VocalDocscontracts 1.65.0

Archive a Policy

DELETE /v1/policies/{policy_id}

PropertyValue
Operationarchive_policy
GroupPolicies
Scopepolicies:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited policy.archive (mutation)
Released in1.47.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Archives the Policy at the revision If-Match names and answers it with archived_at set. Nothing is deleted: the versions Agent versions pin keep running, and the Policy can still be read. An archived organization-scoped Policy is no longer resolved at dispatch; an archived Policy is refused by a later write with policy_archived. 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 DELETE "$VOCAL_API/v1/policies/pol_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"'

Parameters

NameInTypeRequiredDescription
policy_idpathPolicyIdyesThe id of a Policy: pol_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Responses

StatusContent typeShapeError codes
200application/jsonPolicy
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopepolicy_archived
412application/jsonErrorEnveloperevision_mismatch
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Policy.

FieldTypeRequiredDescription
action_typePolicyActionTypeyesThe one action type the document may output; its legality at hook is checked at save.
active_versioninteger or nullyesThe version Agent version publish pins (agent scope) or dispatch resolves (organization scope), or null when none is active.
analysisPolicyAnalysisyes
archived_atTimestamp or nullyesWhen DELETE archived the Policy, or null. An archived Policy takes no write, publish or activation (409 policy_archived); its pinned versions keep running.
compliance_tagComplianceTag or nullyes
created_atTimestampyes
descriptionstring or nullyesFor reviewers; never sent to the model.
enabledbooleanyesThe kill switch, read at dispatch and effective from the next Call; not part of any version.
hookHookPointyes
idPolicyIdyes
latest_versioninteger or nullyesThe highest published version, or null before the first publish.
logicJdmDocumentyes
namePolicyNameyes
object"policy"yes
organization_idOrganizationIdyes
originPolicyOriginyes
priorityintegeryesLower runs first; ties go to organization scope, then to the id.
revisionintegeryesCounts writes to the draft; returned as the ETag and required in If-Match.
scopePolicyScopeyes
setting_pathSettingPath or nullyesFor a derived Policy, the setting it was compiled from; null when authored.
updated_atTimestampyes