VocalDocscontracts 1.65.0

Check what publishing the Agent draft would answer

POST /v1/agents/{agent_id}/publish-check

PropertyValue
Operationcheck_agent_publish
GroupAgents
Scopeagents:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditNot 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 in1.58.0
Phase 0 hostServed (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 '{}'

Parameters

NameInTypeRequiredDescription
agent_idpathAgentIdyesThe id of an Agent: agt_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA 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.

FieldTypeRequiredDescription
acknowledged_warningsarray of PromptLintCodenoThe warnings the publisher would acknowledge; the check then answers only the unacknowledged ones as refusals.
activatebooleannoChecks the publish as one with activate (1.63.0), which the Agent's publish gate applies to; false when omitted.

Responses

StatusContent typeShapeError codes
200application/jsonAgentPublishCheck
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is AgentPublishCheck.

FieldTypeRequiredDescription
agent_idAgentIdyes
draft_revisionintegeryesThe draft revision checked, which a publish names in If-Match.
evaluation_gateAgentEvaluationGate or nullnoThe 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.
findingsarray of PromptLintFindingyesEvery 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.
issuesarray of ErrorDetailyesThe details of that refusal, as the publish's 422 would list them; empty when publishable.
object"agent_publish_check"yes
publishablebooleanyesTrue when a publish of this revision with these acknowledgements would pass.
refusalErrorCode or nullyesThe 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.
warningsarray of ErrorDetailnoThe 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.