VocalDocscontracts 1.65.0

Check whether an address may be contacted

POST /v1/consent/check

PropertyValue
Operationcheck_consent
GroupConsent
Scopecontacts:read
Route classread
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditNot audited: A read of a consent state that changes nothing and answers no content (ADR 0012).
Released in1.61.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Answers the consent check admission and the send path run (1.61.0) for an address in the body: allowed unless an Organization-scope opt-out or an opt-out of the sender named applies. Writes nothing; the purpose marketing is capability_not_available.

Request

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

curl -X POST "$VOCAL_API/v1/consent/check" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "channel": "voice", "address": "<address>" }'

Parameters

NameInTypeRequiredDescription
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: ConsentCheckRequest.

FieldTypeRequiredDescription
addressConsentAddressyes
channelone of "voice", "sms", "whatsapp", "email", "app_push"yesAn address channel.
purposeConsentPurposenoall when omitted, which an opt-out of any purpose refuses.
senderConsentSenderInputnoThe sender to check as well: the caller ID number of a Call, or the Connection of a message. Organization scope only when omitted.

Responses

StatusContent typeShapeError codes
200application/jsonConsentCheck
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
422application/jsonErrorEnvelopecapability_not_available
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is ConsentCheck.

FieldTypeRequiredDescription
allowedbooleanyes
channelConsentChannelyes
object"consent_check"yes
purposeConsentPurposeyes
reasonConsentCheckReasonyes
record_idConsentRecordId or nullyesThe record behind that state; null for no_record.
scopeone of "organization", "sender" or nullyesThe scope of the state that decided; null for no_record.
stateConsentSummaryValueyes