Skip to main content
PATCH
Update Agent Structure
PATCH /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

Request Body

Provide statuses, fields, or both.

statuses[] shape

sort_order is refused for statuses (STATUS_ORDER_REQUIRES_REORDER_ENDPOINT). Use Reorder Statuses to change the order. To rename a status, send only its key and the new label. This also works for the built-in stages (New, Contacted, In conversation and the escalation stage): their key, flags and order stay the same, and only their name changes. When you change an agent’s language, the built-in stages that still have their default name are renamed to the default name in the new language. A name you wrote yourself is kept.

fields[] shape

List fields

A select or multiselect field needs at least one usable option: a string that is not blank, or an object whose value is not blank.
If a list field ends up with no usable option, Nexor saves it as text with no options and lists it in coerced_fields in the response. The request still succeeds. This check runs when you create a field, or change its type or options. A field you send again without changes keeps what is stored. To turn a text field into a list, send it again with type set to select or multiselect and a non-empty options array.

Responses

200 — Updated

statuses_upserted / fields_upserted are only present for the arrays you sent. coerced_fields is present only when a list field was saved as text because it had no usable option:
requested_type is select or multiselect.

400 — Validation error

Also returned as "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. invalid_field_options means a field’s options is not an array, or has an entry that is neither a non-empty string nor an object with a string value. The message names the fields.

401 — Authentication error

See Authentication.

404 — Not found

500 — Internal server error

Authorizations

X-API-Key
string
header
required

API key for authentication. Keys are prefixed with nxr_live_. To work inside a sub-account with a main account key, also send the optional X-Nexor-Sub-Account-Id header.

Path Parameters

id
string<uuid>
required

Workflow identifier.

Body

application/json
statuses
object[]
required
fields
object[]

Response

Successful response.

success
enum<boolean>
required
Available options:
true
workflow_id
string<uuid>
required
statuses_upserted
integer
fields_upserted
integer
coerced_fields
object[]

Fields from this request that were sent as select or multiselect with no usable option and were saved as text. Present only when at least one field was saved this way.

Last modified on November 12, 2026