VocalDocscontracts 1.65.0

Remove an enrollment

POST /v1/campaigns/{campaign_id}/contacts/{enrollment_id}/remove

PropertyValue
Operationremove_campaign_enrollment
GroupCampaigns
Scopecampaigns:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited campaigns.enrollment.remove (mutation)
Released in1.65.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Removes an enrollment and answers it removed (1.65.0; section 9): its contact instance is cancelled through an enrollment.removed Process event, a live Call finishes, and no later attempt starts; an Audit event. One already removed is answered as it stands; one that ended otherwise is campaign_conflict (enrollment_ended).

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 POST "$VOCAL_API/v1/campaigns/cmp_.../contacts/cen_.../remove" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
campaign_idpathCampaignIdyesThe id of a Campaign: cmp_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
enrollment_idpathCampaignEnrollmentIdyesThe id of the enrollment of one Contact in a Campaign: cen_ 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: CampaignEnrollmentRemoveRequest.

FieldTypeRequiredDescription
reasonstringnoA snake_case code the Audit event records; never free text.

Responses

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

Fields of the 200 answer

The shape is CampaignEnrollment.

FieldTypeRequiredDescription
all_attemptsintegeryesEvery attempt, those that never rang included.
armCampaignArmKeyyes
attemptsintegeryesAttempts that reached ringing.
campaign_idCampaignIdyes
completed_atTimestamp or nullyes
contact_idContactIdyes
created_atTimestampyes
dispositionCampaignDisposition or nullyesThe terminal disposition of a completed enrollment; null otherwise.
idCampaignEnrollmentIdyes
ineligible_codeCampaignIneligibleCode or nullyes
last_call_idCallId or nullyes
last_ended_reasonEndedReason or nullyes
live_call_idCallId or nullyes
next_attempt_atTimestamp or nullyes
object"campaign_enrollment"yes
outcome_idOutcomeId or nullyes
phone_number_idPhoneNumberId or nullyesThe number assigned at the first permit, sticky for the enrollment.
priorityintegeryes
process_idProcessInstanceId or nullyesThe contact instance, started with the first permit; null before it.
statusCampaignEnrollmentStatusyes
variablesobject or nullyesPer-enrollment variables. Content; null unless the read names include=content.