On this page
drafts.discard
Discard the draft (revision compare-and-set)
Request
DELETE /api/v1/agents/{agent_id}/draft
- MCP:
drafts_discard - SDK:
client.drafts.discard(SDK path arguments usepath; MCP usesparams). - Minimum API key role: member.
- Idempotency: natural.
Use the request schema below. Read IDs from earlier operation results.
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_.:-]*$"
}
},
{
"name": "draft_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "expected_revision",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"exclusiveMinimum": true,
"minimum": 0,
"maximum": 2147483647
}
}
],
"requestBody": null
}
Responses
json
{
"200": {
"description": "Discard the draft (revision compare-and-set)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DraftsDiscardResponse200"
}
}
}
},
"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": {
"DraftsDiscardResponse200": {
"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
},
"draft_id": {
"type": "string",
"format": "uuid"
},
"discarded": {
"type": "boolean",
"enum": [
true
]
}
},
"required": [
"agent",
"draft_id",
"discarded"
],
"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 4e03055aMarkdown source