Update Agent Structure
curl --request PATCH \
--url https://api.getnexor.ai/api/public/workflows/{id}/structure \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"statuses": [
{
"key": "<string>",
"label": "<string>",
"name": "<string>",
"is_initial": true,
"is_terminal": true
}
],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"metadata_key": "<string>",
"intake_value_map": {}
}
]
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows/{id}/structure"
payload = {
"statuses": [
{
"key": "<string>",
"label": "<string>",
"name": "<string>",
"is_initial": True,
"is_terminal": True
}
],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"metadata_key": "<string>",
"intake_value_map": {}
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
statuses: [
{
key: '<string>',
label: '<string>',
name: '<string>',
is_initial: true,
is_terminal: true
}
],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
metadata_key: '<string>',
intake_value_map: {}
}
]
})
};
fetch('https://api.getnexor.ai/api/public/workflows/{id}/structure', 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/{id}/structure",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'statuses' => [
[
'key' => '<string>',
'label' => '<string>',
'name' => '<string>',
'is_initial' => true,
'is_terminal' => true
]
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
]
]),
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/{id}/structure"
payload := strings.NewReader("{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getnexor.ai/api/public/workflows/{id}/structure")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows/{id}/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statuses_upserted": 123,
"fields_upserted": 123
}Actualizar la estructura de un agente
Esta operación permite actualizar la estructura de 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.
PATCH
/
workflows
/
{id}
/
structure
Update Agent Structure
curl --request PATCH \
--url https://api.getnexor.ai/api/public/workflows/{id}/structure \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"statuses": [
{
"key": "<string>",
"label": "<string>",
"name": "<string>",
"is_initial": true,
"is_terminal": true
}
],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"metadata_key": "<string>",
"intake_value_map": {}
}
]
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows/{id}/structure"
payload = {
"statuses": [
{
"key": "<string>",
"label": "<string>",
"name": "<string>",
"is_initial": True,
"is_terminal": True
}
],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"metadata_key": "<string>",
"intake_value_map": {}
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
statuses: [
{
key: '<string>',
label: '<string>',
name: '<string>',
is_initial: true,
is_terminal: true
}
],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
metadata_key: '<string>',
intake_value_map: {}
}
]
})
};
fetch('https://api.getnexor.ai/api/public/workflows/{id}/structure', 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/{id}/structure",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'statuses' => [
[
'key' => '<string>',
'label' => '<string>',
'name' => '<string>',
'is_initial' => true,
'is_terminal' => true
]
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
]
]),
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/{id}/structure"
payload := strings.NewReader("{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getnexor.ai/api/public/workflows/{id}/structure")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows/{id}/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"is_initial\": true,\n \"is_terminal\": true\n }\n ],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"statuses_upserted": 123,
"fields_upserted": 123
}PATCH
Forma de
Forma de
También se devuelve como
Ver Autenticación.
/workflows/:id/structure
Agrega o edita los statuses del funnel y los campos personalizados de un agente. Las filas se upsertean por key: una key desconocida se inserta, una key existente se actualiza. Este endpoint nunca elimina — quitar un status o campo sigue siendo una acción deliberada del dashboard, así ningún lead que esté sentado en un status queda huérfano.
Parámetros de Ruta
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
id | string (uuid) | Sí | ID del agente |
Cuerpo de la Solicitud
Proveestatuses, fields, o ambos.
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
statuses | array | No | Statuses del funnel a upsertear (ver forma abajo) |
fields | array | No | Campos personalizados a upsertear (ver forma abajo) |
Forma de statuses[]
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
key | string | Sí | Identificador estable. Si coincide con un status existente lo actualiza, si no inserta uno nuevo |
label | string | Sí | Etiqueta visible (name 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 | Al insertar, por defecto es el índice del array agregado después del máximo actual. Se ignora al actualizar — reordenar statuses existentes no se hace aquí |
Forma de fields[]
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
key | string | Sí | Identificador estable |
label | string | Sí | Etiqueta visible |
type | string | No | Uno de: text, number, date, datetime, boolean, select, multiselect, email, phone, url, currency. Por defecto text |
required | boolean | No | Si el agente debe recolectar este campo antes de avanzar. Por defecto false |
sort_order | integer | No | Mismo comportamiento de inserción/actualización que statuses |
metadata_key | string | No | Clave o ruta por puntos dentro de la metadata que prellena este campo, por ejemplo company.employee_count. Máximo 100 caracteres; cada segmento acepta letras, números y guion bajo. Si se omite, conserva el mapeo existente |
intake_value_map | object | No | Mapea strings entrantes a valores canónicos del campo, por ejemplo { "20+": "enterprise" }. Cada clave y valor debe ser un string. Si se omite, conserva el mapa actual; envía {} para quitar la normalización |
Respuestas
200 — Actualizado
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"statuses_upserted": 2,
"fields_upserted": 1
}
statuses_upserted / fields_upserted solo aparecen para los arrays que enviaste.
400 — Error de validación
{
"error": "Invalid input",
"message": "Provide statuses and/or fields arrays"
}
"each status needs a key and a label" o "each field needs a key and a label".
La validación de campos también puede devolver invalid_field_type, invalid_metadata_key o invalid_intake_value_map en error, con la propiedad rechazada en field.
401 — Error de autenticación
Ver Autenticación.
404 — No encontrado
{
"error": "Not found",
"message": "Workflow not found"
}
500 — Error interno del servidor
Autorizaciones
API key for authentication. Keys are prefixed with nxr_live_.
Parámetros de ruta
Workflow identifier.
Cuerpo
application/json
Última modificación el 25 de septiembre de 2026
⌘I