Create an Agent
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": false,
"is_terminal": false,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": false,
"is_auto_engaged": false,
"is_booking_target": false,
"is_qualified": false,
"requires_all_fields": false,
"pause_bot": false,
"required_field_keys": [
"<string>"
],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": {
"target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"options": [
"<string>"
],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows"
payload = {
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": False,
"is_terminal": False,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": False,
"is_auto_engaged": False,
"is_booking_target": False,
"is_qualified": False,
"requires_all_fields": False,
"pause_bot": False,
"required_field_keys": ["<string>"],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": { "target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"options": ["<string>"],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
statuses: [
{
key: '<string>',
name: '<string>',
label: '<string>',
is_initial: false,
is_terminal: false,
sort_order: 123,
entry_hint: '<string>',
category: '<string>',
color: '<string>',
is_auto_contacted: false,
is_auto_engaged: false,
is_booking_target: false,
is_qualified: false,
requires_all_fields: false,
pause_bot: false,
required_field_keys: ['<string>'],
transition_rules: {},
timeout_config: {timeout: 1, target_status_key: '<string>'},
transfer_config: {target_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
assignment_config: {}
}
],
master_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agent_name: '<string>',
agent_role: '<string>',
company_name: '<string>',
begin_message: '<string>',
timezone: '<string>',
global_prompt: '<string>',
channels: [],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
options: ['<string>'],
extraction_hints: '<string>',
sort_order: 123,
metadata_key: '<string>',
intake_value_map: {}
}
],
description: '<string>'
})
};
fetch('https://api.getnexor.ai/api/public/workflows', 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.getnexor.ai/api/public/workflows",
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([
'name' => '<string>',
'statuses' => [
[
'key' => '<string>',
'name' => '<string>',
'label' => '<string>',
'is_initial' => false,
'is_terminal' => false,
'sort_order' => 123,
'entry_hint' => '<string>',
'category' => '<string>',
'color' => '<string>',
'is_auto_contacted' => false,
'is_auto_engaged' => false,
'is_booking_target' => false,
'is_qualified' => false,
'requires_all_fields' => false,
'pause_bot' => false,
'required_field_keys' => [
'<string>'
],
'transition_rules' => [
],
'timeout_config' => [
'timeout' => 1,
'target_status_key' => '<string>'
],
'transfer_config' => [
'target_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'assignment_config' => [
]
]
],
'master_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_name' => '<string>',
'agent_role' => '<string>',
'company_name' => '<string>',
'begin_message' => '<string>',
'timezone' => '<string>',
'global_prompt' => '<string>',
'channels' => [
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'options' => [
'<string>'
],
'extraction_hints' => '<string>',
'sort_order' => 123,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getnexor.ai/api/public/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getnexor.ai/api/public/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "existed"
}{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"language": "<string>",
"timezone": "<string>",
"region_style": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}Crear un agente
Esta operación permite crear un agente en la cuenta autenticada de Nexor. Esta referencia documenta campos verificados de ruta, consulta y cuerpo JSON de nivel superior, códigos de estado observados y campos de respuesta de nivel superior. Las respuestas del proveedor o con estructuras anidadas profundas pueden permanecer abiertas.
POST
/
workflows
Create an Agent
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": false,
"is_terminal": false,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": false,
"is_auto_engaged": false,
"is_booking_target": false,
"is_qualified": false,
"requires_all_fields": false,
"pause_bot": false,
"required_field_keys": [
"<string>"
],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": {
"target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"options": [
"<string>"
],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows"
payload = {
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": False,
"is_terminal": False,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": False,
"is_auto_engaged": False,
"is_booking_target": False,
"is_qualified": False,
"requires_all_fields": False,
"pause_bot": False,
"required_field_keys": ["<string>"],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": { "target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"options": ["<string>"],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
statuses: [
{
key: '<string>',
name: '<string>',
label: '<string>',
is_initial: false,
is_terminal: false,
sort_order: 123,
entry_hint: '<string>',
category: '<string>',
color: '<string>',
is_auto_contacted: false,
is_auto_engaged: false,
is_booking_target: false,
is_qualified: false,
requires_all_fields: false,
pause_bot: false,
required_field_keys: ['<string>'],
transition_rules: {},
timeout_config: {timeout: 1, target_status_key: '<string>'},
transfer_config: {target_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
assignment_config: {}
}
],
master_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agent_name: '<string>',
agent_role: '<string>',
company_name: '<string>',
begin_message: '<string>',
timezone: '<string>',
global_prompt: '<string>',
channels: [],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
options: ['<string>'],
extraction_hints: '<string>',
sort_order: 123,
metadata_key: '<string>',
intake_value_map: {}
}
],
description: '<string>'
})
};
fetch('https://api.getnexor.ai/api/public/workflows', 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.getnexor.ai/api/public/workflows",
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([
'name' => '<string>',
'statuses' => [
[
'key' => '<string>',
'name' => '<string>',
'label' => '<string>',
'is_initial' => false,
'is_terminal' => false,
'sort_order' => 123,
'entry_hint' => '<string>',
'category' => '<string>',
'color' => '<string>',
'is_auto_contacted' => false,
'is_auto_engaged' => false,
'is_booking_target' => false,
'is_qualified' => false,
'requires_all_fields' => false,
'pause_bot' => false,
'required_field_keys' => [
'<string>'
],
'transition_rules' => [
],
'timeout_config' => [
'timeout' => 1,
'target_status_key' => '<string>'
],
'transfer_config' => [
'target_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'assignment_config' => [
]
]
],
'master_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_name' => '<string>',
'agent_role' => '<string>',
'company_name' => '<string>',
'begin_message' => '<string>',
'timezone' => '<string>',
'global_prompt' => '<string>',
'channels' => [
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'options' => [
'<string>'
],
'extraction_hints' => '<string>',
'sort_order' => 123,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getnexor.ai/api/public/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getnexor.ai/api/public/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "existed"
}{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"language": "<string>",
"timezone": "<string>",
"region_style": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}POST
El goal
Usa Forma de
Otros errores de validación:
Ver Autenticación.
/workflows
Crea un agente nuevo (funnel + statuses) desde cero — completamente vía API. Este es el primer paso del ciclo de vida API-first de un agente:
- Crear el agente (este endpoint). Nace pausado.
- Configurar su prompt — qué dice y cómo se comporta.
- Opcionalmente agregar statuses/campos personalizados o tools personalizadas que pueda llamar.
- Activarlo seteando
is_paused: false.
name en tu cuenta, devuelve el existente (status: "existed") en lugar de crear un duplicado — seguro de reintentar.
Cuerpo de la Solicitud
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
name | string | Sí | Nombre del agente. Se usa para el chequeo de idempotencia |
goal_type | string | Sí | Uno de los valores de la tabla Goals disponibles |
statuses | array | Sí | Array no vacío de statuses del funnel (ver abajo). Si ninguno está marcado is_initial, se usa el primero; si ninguno está marcado is_terminal, se usa el último |
description | string | No | Descripción del agente |
global_prompt | string | No | Prompt base. También se puede configurar después vía PATCH /workflows/:id/prompt |
language | string | No | Por defecto es |
channels | array | No | Canales a habilitar, ej. ["whatsapp", "email"]. Por defecto ["whatsapp"] |
fields | array | No | Campos personalizados a recolectar (ver Actualizar Estructura para la forma exacta) |
Goals disponibles
goal_type | Resultado esperado | Notas |
|---|---|---|
appointment | Agendar una reunión | Habilita las capacidades de calendario. |
payment_link | Enviar un link de pago y cerrar el cobro | La integración que genera o entrega el link debe estar configurada. |
qualification | Calificar al lead según los datos recopilados | Combínalo con campos y etapas que expresen los criterios. |
information | Responder preguntas | Normalmente depende de una base de conocimiento. |
support | Resolver o escalar consultas de soporte | Define reglas claras de escalación. |
document_collection | Solicitar y verificar documentos | El dashboard muestra una sección Documentos para este goal. |
quote | Generar una cotización desde un catálogo | Requiere un catálogo asignado. |
custom | Cumplir un objetivo escrito por el operador | No habilita herramientas de calendario. |
sale | Completar una venta | Valor compatible con la API; no aparece como preset en el selector actual del dashboard. |
El onboarding también muestra Calificar y luego agendar. Esa opción se guarda como
appointment con un pipeline y reglas de calificación; no envíes qualify_then_book a este endpoint público.El goal custom
Usa custom cuando el objetivo del agente no es ninguno de los presets: cobranza, reactivación de clientes, post-venta o encuestas. El agente persigue un objetivo escrito en tus propias palabras, configurado en el Dashboard en Configuración del agente → Objetivo y guardado como config.goal_statement. Admite hasta 600 caracteres y debe describir el resultado, no el procedimiento. Dos cosas a saber:
- Un agente
customno agenda reuniones — las herramientas de calendario no están disponibles para él. Si el objetivo termina en una reunión agendada, usaappointment. - Debes enviar
statusescomo en cualquier otro goal. Este endpoint no infiere el pipeline; para un custom típico puedes usarnew → contacted → engaged → converted → losty adaptar las instrucciones de transición al resultado escrito.
Forma de statuses[]
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
key | string | Sí | Identificador estable del status |
name | string | Sí | Etiqueta visible (label también es aceptado) |
is_initial | boolean | No | Marca el status de entrada del funnel |
is_terminal | boolean | No | Marca un status de cierre del funnel |
sort_order | integer | No | Por defecto, el índice del array |
Respuestas
201 — Agente creado
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "created"
}
200 — Ya existía (respuesta idempotente)
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "existed"
}
400 — Error de validación
{
"error": "Invalid input",
"message": "name is required"
}
"goal_type must be one of: appointment, sale, qualification, information, payment_link, support, custom, quote, document_collection""statuses must be a non-empty array""each status needs a key and a name"
401 — Error de autenticación
Ver Autenticación.
500 — Error interno del servidor
Autorizaciones
API key for authentication. Keys are prefixed with nxr_live_.
Cuerpo
application/json
Minimum string length:
1Opciones disponibles:
appointment, sale, qualification, information, payment_link, support, custom, quote, document_collection Minimum array length:
1- Option 1
- Option 2
Show child attributes
Show child attributes
Opciones disponibles:
es-CL, es-MX, es-PE, es-CO, es-US, en-US, en-AU, ko-KR, pt-BR, fr-FR Maximum string length:
200Maximum string length:
200Maximum string length:
200Maximum string length:
1000Valid IANA time-zone name.
Opciones disponibles:
cl, mx, pe, co, ar, es, latam, us, au, gb, in, nz, kr, br, pt Opciones disponibles:
whatsapp, call, voice, retell, email, sms Show child attributes
Show child attributes
Última modificación el 25 de septiembre de 2026
⌘I