Crear un nuevo horario para el agente
curl --request POST \
--url https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"isEnabled": true,
"timezone": "<string>",
"rules": [
{
"isEnabled": true,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"outOfHoursMessage": "<string>",
"metadata": {}
}
'import requests
url = "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules"
payload = {
"isEnabled": True,
"timezone": "<string>",
"rules": [
{
"isEnabled": True,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"outOfHoursMessage": "<string>",
"metadata": {}
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
isEnabled: true,
timezone: '<string>',
rules: [{isEnabled: true, slot: {startTime: '<string>', endTime: '<string>'}}],
outOfHoursMessage: '<string>',
metadata: {}
})
};
fetch('https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isEnabled' => true,
'timezone' => '<string>',
'rules' => [
[
'isEnabled' => true,
'slot' => [
'startTime' => '<string>',
'endTime' => '<string>'
]
]
],
'outOfHoursMessage' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isEnabled": true,
"timezone": "<string>",
"rules": [
{
"isEnabled": true,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"outOfHoursMessage": "<string>",
"metadata": {}
}{
"code": "<string>",
"message": "<string>",
"details": {
"subcode": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"code": "<string>",
"message": "<string>",
"details": {
"subcode": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Agent Schedules
Crear un nuevo horario para el agente
POST
/
v1
/
agents
/
{agentId}
/
schedules
Crear un nuevo horario para el agente
curl --request POST \
--url https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"isEnabled": true,
"timezone": "<string>",
"rules": [
{
"isEnabled": true,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"outOfHoursMessage": "<string>",
"metadata": {}
}
'import requests
url = "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules"
payload = {
"isEnabled": True,
"timezone": "<string>",
"rules": [
{
"isEnabled": True,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"outOfHoursMessage": "<string>",
"metadata": {}
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
isEnabled: true,
timezone: '<string>',
rules: [{isEnabled: true, slot: {startTime: '<string>', endTime: '<string>'}}],
outOfHoursMessage: '<string>',
metadata: {}
})
};
fetch('https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isEnabled' => true,
'timezone' => '<string>',
'rules' => [
[
'isEnabled' => true,
'slot' => [
'startTime' => '<string>',
'endTime' => '<string>'
]
]
],
'outOfHoursMessage' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules")
.header("x-workspace-id", "<x-workspace-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.studio.getsupervisor.ai/v1/agents/{agentId}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isEnabled\": true,\n \"timezone\": \"<string>\",\n \"rules\": [\n {\n \"isEnabled\": true,\n \"slot\": {\n \"startTime\": \"<string>\",\n \"endTime\": \"<string>\"\n }\n }\n ],\n \"outOfHoursMessage\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isEnabled": true,
"timezone": "<string>",
"rules": [
{
"isEnabled": true,
"slot": {
"startTime": "<string>",
"endTime": "<string>"
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"outOfHoursMessage": "<string>",
"metadata": {}
}{
"code": "<string>",
"message": "<string>",
"details": {
"subcode": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"code": "<string>",
"message": "<string>",
"details": {
"subcode": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Identificador del workspace multi-tenant.
Path Parameters
Identificador del agente
Body
application/json
Payload para crear o reemplazar la configuración del horario del agente.
Available options:
offline, limited-service, auto-message Required array length:
7 elementsShow child attributes
Show child attributes
Requerido cuando outOfHoursBehavior es auto-message.
Response
Horario creado
Horario estándar configurado para el agente.
Activa o desactiva el uso del horario sobre el agente.
Identificador IANA del timezone (ej. America/Mexico_City).
Comportamiento del agente fuera de la franja configurada.
Available options:
offline, limited-service, auto-message Arreglo con una regla por cada día de la semana (monday..sunday).
Required array length:
7 elementsShow child attributes
Show child attributes
Mensaje automático enviado cuando outOfHoursBehavior es auto-message.
⌘I
