Read an enrollment
GET /v1/campaigns/{campaign_id}/contacts/{enrollment_id}
| Property | Value |
|---|---|
| Operation | get_campaign_enrollment |
| Group | Campaigns |
| Scope | campaigns:read |
Scopes of include values | content needs campaigns:content |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | An audited content read campaigns.enrollment.read, when the request names an include value |
| Released in | 1.65.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers one enrollment (1.65.0); its variables only when the read names include=content, which needs campaigns:content and is an audited content read.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the campaigns:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/campaigns/cmp_.../contacts/cen_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/campaigns/cmp_.../contacts/cen_...`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/campaigns/cmp_.../contacts/cen_...",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
campaign_id | path | CampaignId | yes | The id of a Campaign: cmp_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log. |
enrollment_id | path | CampaignEnrollmentId | yes | The 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. |
include | query | array of CampaignEnrollmentInclude | no | content adds the variables (campaigns:content). |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | CampaignEnrollment | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
404 | application/json | ErrorEnvelope | not_found |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is CampaignEnrollment.
| Field | Type | Required | Description |
|---|---|---|---|
all_attempts | integer | yes | Every attempt, those that never rang included. |
arm | CampaignArmKey | yes | |
attempts | integer | yes | Attempts that reached ringing. |
campaign_id | CampaignId | yes | |
completed_at | Timestamp or null | yes | |
contact_id | ContactId | yes | |
created_at | Timestamp | yes | |
disposition | CampaignDisposition or null | yes | The terminal disposition of a completed enrollment; null otherwise. |
id | CampaignEnrollmentId | yes | |
ineligible_code | CampaignIneligibleCode or null | yes | |
last_call_id | CallId or null | yes | |
last_ended_reason | EndedReason or null | yes | |
live_call_id | CallId or null | yes | |
next_attempt_at | Timestamp or null | yes | |
object | "campaign_enrollment" | yes | |
outcome_id | OutcomeId or null | yes | |
phone_number_id | PhoneNumberId or null | yes | The number assigned at the first permit, sticky for the enrollment. |
priority | integer | yes | |
process_id | ProcessInstanceId or null | yes | The contact instance, started with the first permit; null before it. |
status | CampaignEnrollmentStatus | yes | |
variables | object or null | yes | Per-enrollment variables. Content; null unless the read names include=content. |