Skip to content

Roll a scope back to its previous live version

POST
/v1/agents/{agentId}/live/rollback
curl --request POST \
--url https://example.com/v1/agents/example/live/rollback \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "scope": { "kind": "tenant" }, "toVersion": "example", "reason": "example" }'

Back to the scope’s previous live version, or toVersion. Recorded like a promotion. Needs promote on the agent.

agentId
required
string

AgentId — dotted namespace (acme.drafting).

Idempotency-Key
string
>= 1 characters

Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the tenant is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5).

Media typeapplication/json
object
scope
required
One of: discriminator: kind

The agent’s default for the whole tenant.

object
kind
required
string
Allowed values: tenant
toVersion

An earlier version to go back to; omit → the scope’s previous live version.

string
reason
string
<= 2000 characters

Rolled back.

Media typeapplication/json

One change of a scope’s live version, kept for good: what was live before, what is after, who asked and why.

object
id
required
string format: uuid
agentId
required
string
scope
required
One of: discriminator: kind

The agent’s default for the whole tenant.

object
kind
required
string
Allowed values: tenant
action
required
string
Allowed values: promote rollback unpin
fromVersion
required

The scope’s own pin before; null when it had none.

string | null
toVersion
required

The scope’s own pin after; null after an unpin.

string | null
requestedBy
required
object
kind
required
string
Allowed values: user service
id
required
string
reason
string
evalRunId

The comparison the change was judged on.

string
createdAt
required
string format: date-time
status

A promote row’s state: it changes once, from pending-approval to its final state. Absent on rollback and unpin rows, and on promotions made before gates (promoted).

string
Allowed values: promoted pending-approval refused superseded rejected expired
policy
One of:
object
id
required
string
version
required
string
checks
Array<object>

One of a gate’s checks, as the promotion records it.

object
name
required

Stable: comparison.required, comparison.status, comparison.freshness, comparison.suite, sameContents, baselineIsLive, scopeCovered, evidence.<metric>.minCases|minWeight|baselineMinCases|baselineMinWeight, metric.<metric>.k|minCandidate|maxDrop, replay.maxDiverged|maxErrors|maxRefusedWrites|maxStopped, classWeights.restrictedOnly.

string
passed
required
boolean
message
required

A plain sentence: what was found against what the policy asks.

string
value
number | string
threshold
number | string
approvalId

The approval a pending-approval promotion waits on (kept once decided).

string
resolvedAt

When a pending-approval promotion reached its final state.

string format: date-time
Example
{
"scope": {
"kind": "tenant"
},
"action": "promote",
"requestedBy": {
"kind": "user"
},
"status": "promoted"
}

Malformed request body.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

toVersion is not registered, or was unregistered.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

not-pinned: the scope has no pin of its own. nothing-to-roll-back: no earlier version to go back to. gate-policy-descendant-unpinned: the change would also move a narrower scope a gate policy applies to, which has no live version of its own and so follows this scope, without its gate; the message names each one: pin it at its current version first.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Server error (unmapped domain code or framework crash).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}