VocalDocscontracts 1.65.0

Delete or archive a Campaign

DELETE /v1/campaigns/{campaign_id}

PropertyValue
Operationdelete_campaign
GroupCampaigns
Scopecampaigns:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited campaigns.campaign.delete (mutation)
Released in1.65.0
Phase 0 hostServed (the hosted api pins 1.65.0)

At the revision If-Match names (1.65.0): removes a draft with its enrollments, or archives a Campaign that ended, keeping its records. A Campaign that has not ended is 409 campaign_conflict (not_ended); cancel it first.

Request

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

curl -X DELETE "$VOCAL_API/v1/campaigns/cmp_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"'

Parameters

NameInTypeRequiredDescription
campaign_idpathCampaignIdyesThe id of a Campaign: cmp_ 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/jsonCampaignDeletion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopecampaign_conflict
412application/jsonErrorEnveloperevision_mismatch
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is CampaignDeletion.

FieldTypeRequiredDescription
archivedbooleanyesTrue when an ended Campaign was archived.
idCampaignIdyes
object"campaign_deletion"yes
removedbooleanyesTrue when a draft was removed.