Skip to navigation

Archive an agent

Starts the agent’s 14-day archive window, as the Archive action in the product does. The agent stops taking calls at once, its phone numbers are released (they keep their history and can be assigned to another agent), it leaves listAgents unless state=archived is asked for, and draft edits, publication and rollback are refused with agent_archived. Deletion is permanent: from archive_deadline (archived_at plus exactly 14 days) the agent and its configuration are deleted, and call evidence is retained hidden; after that the agent reads as not_found. unarchiveAgent restores it until then. Archive is refused with 409 archive_blocked while the agent has work in progress; details.reason says which (open vocabulary, listed in x-archive-blocked-reasons): active_calls (a call of the agent is live), active_campaigns (a campaign of the agent is planned, admitted, dialing, paused or stalled), active_jobs (other running work of the agent), account_calls (an inbound number of the agent is on a carrier account with a live call). Wait for the work to end, or cancel the campaign, and retry with a new Idempotency-Key. An agent that is already archived is refused with agent_archived. The archive is recorded against this API key. Any member or key of the workspace can unarchive it.

Authentication

AuthorizationBearer

Create and manage workspace-owned keys through the existing app session routes, outside this public API. Creator and manager identities are audit actors only. Key validity follows workspace policy, expiry and explicit revocation, independently of creator membership. Do not include a workspace-selection header.

Path parameters

agent_idstringRequired1-128 characters
Resource identity within the authenticated workspace.

Headers

Idempotency-KeystringRequired1-255 characters

Stable key per logical intent, 1–255 printable characters. Persist it before sending. Retry the same key/body after an uncertain result for 24 hours. A changed body conflicts. Beyond retention, reconcile the resource before retrying; this is not permanent deduplication. Current authorization is rechecked on replay. Evaluation order: authenticate and check current authorization; look up intent; replay its stored receipt before checking the current revision; only a new intent evaluates If-Match and executes. Fingerprint includes method, path, body and original If-Match. A changed request returns idempotency_key_reused. The server stores only a keyed (HMAC) fingerprint, and no error or response ever returns a fingerprint or hash of a request. In-flight intent returns 409 idempotency_in_progress with Retry-After; retry the same intent after reconciliation. Receipts describe that attempt, not current resource state. A replay returns the original status code and body, with the response header Idempotent-Replayed: true.

Response headers

X-Request-IdstringOptional
Safe server request correlation ID.
ETagstringOptional

Strong agent-identity revision, as getAgent returns. Archive and unarchive do not change it; use it for a later updateAgent.

RateLimit-LimitintegerOptional
Requests allowed in the current window for the tightest applicable limit.
RateLimit-RemainingintegerOptional
Requests left in the current window.
RateLimit-ResetintegerOptional
Seconds until the current window resets.
Idempotent-ReplayedstringOptional

true when this response replays a stored Idempotency-Key result. The status and body equal the original.

Response

Archive an agent.
idstring<=128 characters
Opaque agent identifier. Do not parse its contents.
namestring<=120 characters
descriptionstring or null<=2000 characters
statestring

draft: never published. live: admits calls. paused: refuses new calls but keeps configuration and history. archived: the 14-day archive window (archiveAgent); hidden from listAgents by default, readable by ID, and draft edits, publication, rollback and call start are refused. unarchiveAgent returns the agent to its state before archive until archive_deadline; after it the agent is permanently deleted and reads as not_found. Open response vocabulary. Preserve unknown values; never assume they mean success.

live_version_idstring or null<=128 characters
created_atdatetime
updated_atdatetime
archived_atdatetime or null
When the agent was archived. Null unless state is archived.
archive_deadlinedatetime or null

Exactly 14 days after archived_at. From this time the agent is permanently deleted unless unarchiveAgent restores it first; a running call, campaign or legal hold can delay the deletion, never bring it forward. Null unless state is archived.

resource_keystring or nullformat: "^[A-Za-z0-9][A-Za-z0-9._:~-]{0,127}$"1-128 characters

Optional caller-chosen resource key: an opaque external identifier that matches your own record (for example a CRM ID, a configuration-file ID or a UUID) to this resource. Rasen still generates the canonical id; use id in paths and references. Case-sensitive, compared exactly, never normalized or parsed. 1-128 characters from A-Z a-z 0-9 . _ : ~ - and starting with a letter or digit; UUIDs and ULIDs are valid. Unique per resource type within one workspace; separate environment workspaces can reuse the same key. Set only at creation and immutable afterwards. A create with a key that already exists returns 409 resource_key_conflict with details.existing_id; it never updates or returns the existing resource. Not an Idempotency-Key: that header identifies one request intent for 24 hours, and a same-intent replay returns its original receipt before the resource-key check runs. Uniqueness includes archived resources. A key becomes free again only after its resource is permanently deleted or erased (a deleted secret or a deleted knowledge source); archive never frees it.

Errors

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