Skip to navigation

Suspend agent

Suspends an agent and returns its new state, with the number of campaigns paused. A suspended agent does not answer (callers hear busy), does not call and its web widget does not open; its running campaigns are paused. Calls already in progress end normally. Repeating the request changes nothing: the date and the reason of the first suspension stay. It also works when the plan is no longer active, so an agent can always be stopped. Resume it with POST /agents/{agent_id}/resume. Required scope: agents:operate. With a test key (vx_test_) it is simulated: nothing real happens and nothing is billed. Requires an Idempotency-Key header. Retriable: when the operation itself fails with a 429, a 5xx or a temporary 409, the key is released and a retry with the same key runs the operation again; with no response at all, a retry with the same key returns the first outcome or runs the operation again. A 429 rate_limited from the request limit and 409 request_in_progress come before the operation and leave the key as it is: retry with the same key.

Authentication

AuthorizationBearer
API key created by an Owner or Admin of the organization. Never in the query string.

Path parameters

agent_idstringRequiredformat: "^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$"

Id of an agent of the organization, as returned by GET /agents.

Headers

VoxAI-VersionenumOptional

API version for this request; defaults to the version the key is pinned to.

Allowed values:
Idempotency-KeystringRequiredformat: "^[A-Za-z0-9_-]{16,64}$"

A unique value you generate for each new operation (16 to 64 letters, digits, hyphen or underscore; a UUID works). Repeating the same request with the same key within 24 hours returns the first response and does nothing again, when that response was a success or a 4xx error the same request would always get again (not 429, and not the temporary 409 codes request_in_progress, caller_has_active_call and caller_request_in_progress: for those, and for a 5xx, see the note on retrying in the operation); the same key with a different request is refused with idempotency_key_reused.

Request

This endpoint expects an object.
reasonstringOptional<=200 characters

Why the agent is suspended, for your team (at most 200 characters). It is stored with the agent and never returned. Do not put personal data in it.

Response

Successful response.
object"agent_status"

Always agent_status.

agent_idstring
Id of the agent.
statusenum

The state of the agent after the request. active: it answers, calls and opens its web widget. suspended: it does not answer (callers hear busy), does not call and its web widget does not open.

Allowed values:
suspended_atdatetime or null

When the agent was suspended; null when it is active.

campaigns_changedinteger>=0
Number of campaigns paused by the suspension, or restarted by the resumption. With a test key, the number that would be.
simulatedboolean

true when the request was made with a test key: every check ran but nothing was changed. false with a live key.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error