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
}Update Agent Structure
This operation lets you update agent structure for the authenticated Nexor account. This reference documents verified path, query, and top-level JSON body fields, observed response status codes, and top-level response fields. Provider-owned or deeply nested response shapes may remain open.
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
Also returned as
See Authentication.
/workflows/:id/structure
Add or edit an agent’s funnel statuses and custom lead fields. Rows are upserted by key: an unrecognized key is inserted, an existing key is updated. This endpoint never deletes — removing a status or field stays a deliberate dashboard action, so leads already sitting on a status are never orphaned.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | Agent ID |
Request Body
Providestatuses, fields, or both.
| Field | Type | Required | Description |
|---|---|---|---|
statuses | array | No | Funnel statuses to upsert (see shape below) |
fields | array | No | Custom lead fields to upsert (see shape below) |
statuses[] shape
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Stable identifier. Matches an existing status to update it, otherwise inserts a new one |
label | string | Yes | Display label (name also accepted) |
is_initial | boolean | No | Marks the funnel’s entry status |
is_terminal | boolean | No | Marks a funnel-ending status |
sort_order | integer | No | On insert, defaults to array index appended after the current max. Ignored on update — reordering existing statuses isn’t done here |
fields[] shape
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Stable identifier |
label | string | Yes | Display label |
type | string | No | One of: text, number, date, datetime, boolean, select, multiselect, email, phone, url, currency. Default text |
required | boolean | No | Whether the agent must collect this field before advancing. Default false |
sort_order | integer | No | Same insert/update behavior as statuses |
metadata_key | string | No | Lead metadata key or dot path used to prefill this field, for example company.employee_count. Maximum 100 characters; each segment accepts letters, digits, and underscores. Omit it to preserve the existing mapping |
intake_value_map | object | No | Maps incoming strings to canonical field values, for example { "20+": "enterprise" }. Every key and value must be a string. Omit it to preserve the current map; send {} to remove normalization |
Responses
200 — Updated
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"statuses_upserted": 2,
"fields_upserted": 1
}
statuses_upserted / fields_upserted are only present for the arrays you sent.
400 — Validation error
{
"error": "Invalid input",
"message": "Provide statuses and/or fields arrays"
}
"each status needs a key and a label" or "each field needs a key and a label".
Field validation can also return invalid_field_type, invalid_metadata_key, or invalid_intake_value_map in error, with the rejected property in field.
401 — Authentication error
See Authentication.
404 — Not found
{
"error": "Not found",
"message": "Workflow not found"
}
500 — Internal server error
Authorizations
API key for authentication. Keys are prefixed with nxr_live_.
Path Parameters
Workflow identifier.
Body
application/json
Last modified on September 25, 2026
⌘I