Skip to Content
Agents

Promote the draft to staging

Permissionagents:promoteRetriesIdempotency-Key requiredAuthentication
POST
/agents/{id}/promote-staging

Revalidates the locked mutable draft, its reusable catalog and transfer references, after-call dependencies, and baseline budget; snapshots it as the next immutable version; then points staging at it. A successful new logical intent always advances the aggregate revision; replaying the same Idempotency-Key returns the original response instead of creating another snapshot.

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.

Request Body

application/json
  1. body
name?string

Optional human-readable snapshot label. When present, the trimmed value must contain at least one non-whitespace character; an empty or whitespace-only value returns 422 invalid_body with a field error for name rather than being treated as omitted.

Lengthlength <= 120

Response Body

Success

application/json
  1. response
id*string

ID of the immutable snapshot created from the draft.

Formatuuid
agent_id*string
Formatuuid
staging_version_id*string

New staging pointer; equal to id for this operation.

Formatuuid
version*integer
Range1 <= value
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/promote-staging' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "Initial production candidate"}'
Example Response
{  "id": "33333333-3333-4333-8333-333333333333",  "agent_id": "11111111-1111-4111-8111-111111111111",  "staging_version_id": "33333333-3333-4333-8333-333333333333",  "version": 1,  "revision": 4,  "updated_at": "2026-07-20T09:15:00Z"}