Skip to Content
Agents

Deploy staging to production

Permissionagents:deployRetriesIdempotency-Key requiredAuthentication
POST
/agents/{id}/deploy

Atomically points production at the current staging snapshot.

Everything is revalidated before activation

The complete stored snapshot and its after-call dependencies are re-checked against the current catalog and baseline budget — including for a semantic no-op, so a version that has since become invalid cannot go live.

If production already references that snapshot, a valid request preserves the aggregate revision.

Pair each new logical intent with a new Idempotency-Key and the latest agent If-Match value.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255
If-Match?string

Optional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.

Response Body

Success

application/json
  1. response
agent_id*string
Formatuuid
production_version_id*string
Formatuuid
updated*boolean

False when production already referenced the staging snapshot.

revision*integer
Formatint64
Range1 <= value
updated_at*string

Aggregate update timestamp corresponding to revision.

Formatdate-time
Example Request
curl -X POST 'https://api.kejue.co/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/deploy' \  -H 'Idempotency-Key: string'
Example Response
{  "agent_id": "11111111-1111-4111-8111-111111111111",  "production_version_id": "33333333-3333-4333-8333-333333333333",  "updated": true,  "revision": 5,  "updated_at": "2026-07-20T09:25:00Z"}