VocalDocscontracts 1.65.0

Activate a Policy version

POST /v1/policies/{policy_id}/versions/{version}/activate

PropertyValue
Operationactivate_policy_version
GroupPolicies
Scopepolicies:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited policy.version.activate (mutation)
Released in1.47.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Makes the version the active one and answers it. An agent-scoped change reaches Calls only through the next Agent version publish, which pins it; an organization-scoped one reaches the next Call. A Call never changes Policy versions mid-Call. It emits the Webhook event policy.version.activated. A write to an organization-scoped Policy, or one that disables a compliance-tagged Policy, also needs policies:admin and is otherwise refused with forbidden and the detail policies_admin_required.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the policies:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/policies/pol_.../versions/1/activate" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

NameInTypeRequiredDescription
policy_idpathPolicyIdyesThe id of a Policy: pol_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
versionpathintegeryesA version number, from 1.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
200application/jsonPolicyVersion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopepolicy_archived, idempotency_in_progress, idempotency_key_reused
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PolicyVersion.

FieldTypeRequiredDescription
action_typePolicyActionTypeyes
activebooleanyesTrue for the active version: the one Agent version publish pins, or, for an organization-scoped Policy, the one dispatch resolves.
analysisPolicyAnalysisyes
compliance_tagComplianceTag or nullyes
engine_versionstringyesThe Zen engine version the version was published under; a worker refuses one it does not run with rules_engine_version_mismatch.
hookHookPointyes
logicJdmDocumentyes
logic_sha256stringyesThe SHA-256 of the canonical document, in lowercase hex.
notesstring or nullyes
object"policy_version"yes
policy_idPolicyIdyes
priorityintegeryes
profile_versionintegeryesThe Vocal JDM profile version the document was linted under.
published_atTimestampyes
published_byActorRefyes
source_revisionintegeryesThe draft revision this version was published from.
statusPolicyVersionStatusyes
versionintegeryesThe snapshot number, from 1.