On this page
publications.promote
Move head to an existing version (manual promote or rollback), rebasing the named open draft in the same transaction
Request
POST /api/v1/agents/{agent_id}/head
- MCP:
publications_promote - SDK:
client.publications.promote(SDK path arguments usepath; MCP usesparams). - Minimum API key role: member.
- Idempotency: natural.
Body {version, expected_head_version}: expected_head_version is the current head version (agents_get head.version), or null when the agent has never been live.
Input schema
json
{
"parameters": [
{
"name": "agent_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicationsPromoteRequest"
}
}
}
}
}
Responses
json
{
"200": {
"description": "Move head to an existing version (manual promote or rollback), rebasing the named open draft in the same transaction",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PublicationsPromoteResponse200"
}
}
}
},
"4XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"5XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
Referenced schemas
json
{
"components": {
"schemas": {
"PublicationsPromoteRequest": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"expected_head_version": {
"allOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 2147483647
}
],
"nullable": true
},
"draft_id": {
"allOf": [
{
"type": "string",
"format": "uuid"
}
],
"nullable": true
}
},
"required": [
"version",
"expected_head_version"
],
"additionalProperties": false
},
"PublicationsPromoteResponse200": {
"type": "object",
"properties": {
"agent": {
"type": "object",
"properties": {
"tenant_id": {
"type": "string",
"format": "uuid"
},
"kind": {
"type": "string",
"enum": [
"agent"
]
},
"id": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
}
},
"required": [
"tenant_id",
"kind",
"id"
],
"additionalProperties": false
},
"from_version": {
"allOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 2147483647
}
],
"nullable": true
},
"to_version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"digest": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$"
},
"moved": {
"type": "boolean"
}
},
"required": [
"agent",
"from_version",
"to_version",
"digest",
"moved"
],
"additionalProperties": false
},
"ApiError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"unauthenticated",
"forbidden",
"not_found",
"conflict",
"invalid_request",
"idempotency_conflict",
"policy_denied",
"capability_unavailable",
"provider_unavailable",
"knowledge_unavailable",
"publication_invalid",
"run_not_active",
"rate_limited",
"outcome_unknown",
"internal"
]
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"outcome": {
"type": "string",
"enum": [
"none",
"unknown"
]
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"code",
"message",
"retryable",
"outcome"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
}
}
}
Errors and recovery
See API error handling and Troubleshooting.
Related guides
Content version 9c77dab4Markdown source