Skip to main content
PATCH
JavaScript
Works for voice and chat agents. To learn how tags route calls, see environment tags. Tags you leave out stay as they are, and so do the fields you leave out of a tag. For example, {"tags": {"prod": {"version": 3}}} moves prod to version 3 and keeps its dynamic variables and every other tag. Set a tag to null to delete it. Deleting a tag also removes it from every phone number that uses it. To avoid overwriting a change made after you read the agent, send the ETag from your last response in the If-Match header. If the agent changed since then, the request returns 412 and changes nothing.

Authorizations

Authorization
string
header
required

Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"

Headers

If-Match
string

ETag from an earlier get-agent-root or update-agent-root response. If the agent changed since then, the update returns 412 and changes nothing.

Pattern: ^("[0-9]+"|[0-9]+)$
Example:

"\"1744761835123\""

Path Parameters

agent_id
string
required

Unique id of the agent.

Minimum string length: 1
Example:

"agent_xxx"

Body

application/json
tags
object

Environment tags to add, change, or delete, keyed by tag name. Set a tag to an object to add or change it, or to null to delete it. Tags you leave out stay as they are. The prod and staging tags cannot be deleted. An agent can have up to 10 tags. Tag names must be 1-20 characters, start with a lowercase letter, use only lowercase letters, digits, underscores, or hyphens, and cannot be "latest", "latest_published", or "v" followed only by digits, such as "v2".

Example:

Response

Agent settings updated successfully.

agent_id
string
required

Unique id of the agent.

Example:

"agent_xxx"

is_suspended
boolean
required

Whether the agent is currently suspended.

Example:

false

tags
object
required

Environment tags for this agent, keyed by tag name. Every agent has prod and staging tags.

Example:
user_modified_timestamp
integer<int64>
required

User modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.

Example:

1746105600000