Check what publishing the Agent draft would answer
POST /v1/agents/{agent_id}/publish-check
| Property | Value |
|---|---|
| Operation | check_agent_publish |
| Group | Agents |
| Scope | agents:write |
| Route class | control |
| Idempotency | Idempotency-Key accepted: a retry with the same key replays the first answer |
| Audit | Not audited: A dry run of a publish: it changes no state and reads no Call content, so it writes no Audit event (ADR 0012). |
| Released in | 1.58.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Runs every check of POST /v1/agents/{agent_id}/versions over the current draft, with the acknowledgements of the body, and answers the draft revision, whether the publish would pass, the code and details it would refuse with, and every lint finding of the template and its cross-checks against the Agent (1.58.0), so the publisher sees the warnings to acknowledge before publishing. From 1.63.0 it answers the Agent's publish gate (evaluation_gate) and, for a check with activate, the gate's refusal evaluation_gate_failed with the reason run_required. It writes nothing: no version, Audit event or Webhook event. An Agent of another Organization is not found.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the agents:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X POST "$VOCAL_API/v1/agents/agt_.../publish-check" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/agents/agt_.../publish-check`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import uuid
import requests
response = requests.post(
f"{os.environ['VOCAL_API']}/v1/agents/agt_.../publish-check",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | AgentId | yes | The id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
idempotency-key | header | string | no | A client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response. |
Request body
Content type application/json, required: AgentPublishCheckRequest.
| Field | Type | Required | Description |
|---|---|---|---|
acknowledged_warnings | array of PromptLintCode | no | The warnings the publisher would acknowledge; the check then answers only the unacknowledged ones as refusals. |
activate | boolean | no | Checks the publish as one with activate (1.63.0), which the Agent's publish gate applies to; false when omitted. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | AgentPublishCheck | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
409 | application/json | ErrorEnvelope | idempotency_in_progress, idempotency_key_reused |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is AgentPublishCheck.
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | AgentId | yes | |
draft_revision | integer | yes | The draft revision checked, which a publish names in If-Match. |
evaluation_gate | AgentEvaluationGate or null | no | The Agent's publish gate (1.63.0), null when its owner turned none on; it applies to a publish with activate. Absent from an api before 1.63.0. |
findings | array of PromptLintFinding | yes | Every lint finding of the template and its cross-checks against the Agent, warnings included, each with acknowledge when a publish needs it acknowledged; empty for an Agent with inline instructions. |
issues | array of ErrorDetail | yes | The details of that refusal, as the publish's 422 would list them; empty when publishable. |
object | "agent_publish_check" | yes | |
publishable | boolean | yes | True when a publish of this revision with these acknowledgements would pass. |
refusal | ErrorCode or null | yes | The code the publish would answer, validation_failed or capability_not_available, and from 1.63.0 evaluation_gate_failed for a gated Agent checked with activate; null when publishable. |
warnings | array of ErrorDetail | no | The warnings the publish found and did not refuse (1.59.0): the statechart warnings of StatechartWarningCode (slot_trust_warning, squad_setting_ignored, proposal_reaches_transfer), each with its pointer, computed over the Tools of the root Agent and of each squad Agent. Empty when none; absent from an api before 1.59.0, which a reader treats as none. |