Read a Campaign
GET /v1/campaigns/{campaign_id}
| Property | Value |
|---|---|
| Operation | get_campaign |
| Group | Campaigns |
| Scope | campaigns:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | Not audited: Configuration, ids and counts; a Campaign holds no Contact content. |
| Released in | 1.65.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers one Campaign and its draft revision as the ETag (1.65.0).
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_..." \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/campaigns/cmp_...`, {
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_...",
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. |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | Campaign | |
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 Campaign.
| Field | Type | Required | Description |
|---|---|---|---|
archived | boolean | yes | True once DELETE archived an ended Campaign. |
arms | array of CampaignArm | yes | |
attestation | CampaignAttestation or null | yes | |
budget | CampaignBudget or null | yes | Required at launch. |
consent | CampaignConsent | yes | |
contact_caps | CampaignContactCaps or null | yes | |
created_at | Timestamp | yes | |
current_revision | integer or null | yes | The frozen revision in force; null before launch. |
ended_at | Timestamp or null | yes | |
environment | Environment | yes | |
error_code | string or null | yes | Why a failed Campaign failed; null otherwise. |
id | CampaignId | yes | |
identity | CampaignIdentity | yes | |
launched_at | Timestamp or null | yes | |
name | string | yes | A label, never PHI (product terms): no patient, condition or appointment. |
numbers | CampaignNumbers | yes | |
object | "campaign" | yes | |
on_exhausted | CampaignOnExhausted or null | yes | |
organization_id | OrganizationId | yes | |
outcome_routing | CampaignOutcomeRouting or null | yes | |
pacing | CampaignPacing | yes | |
paused_reason | CampaignPausedReason or null | yes | Why it is paused; null otherwise. |
project_id | ProjectId or null | yes | |
purpose | CampaignPurpose | yes | |
retry | CampaignRetry | yes | |
revision | integer | yes | The draft's revision, the ETag If-Match names. |
schedule | CampaignSchedule | yes | |
spend_micros | integer | yes | The rated charges of the Campaign's Calls so far. |
status | CampaignStatus | yes | |
supervisor_process_id | ProcessInstanceId or null | yes | The supervisor Process instance; null before launch. |
transport | CampaignTransport | yes | |
updated_at | Timestamp | yes | |
voicemail | CampaignVoicemail | yes | |
windows | CampaignWindow | yes |