Set consent state from your own system (CRM sync)
Opting in a number that opted out needs proof with collected_at at or after the opt-out (a STOP cancels earlier consent); otherwise 409 invalid_request with param proof or proof.collected_at, and nothing changes.
Path Parameters
- phonestringrequired
Body Parameters
- statusopted_out, opted_inrequired
- notestring
At most 200 characters.
- campaign_idstring
Only with opted_in: the registration the person opted in to. A marketing send from a number linked to that registration looks for this record. Proof is required when its use case is marketing or mixed (400 otherwise). An opt-out is always account-wide. Example:
reg_a1B2c3D4e5F6. - proofOptInProof
Opt-in evidence (Messaging Policy 1.4). Accepted only with status opted_in.
Responses
- 200Consent
Updated consent state
- 401Error
Missing, malformed, or revoked API key
- 402Error
Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged
- 409Error
The number opted out, and the opt-in carries no proof collected at or after the opt-out
- 429Error
Rate limit or quota exceeded
Response Fields
- objectconsent
- phonestring
Example:
+14155550132. - statusopted_out, opted_in, no_record
- updated_atstring (date-time)
- viastring
Example:
sms_phrase. - methodkeyword, phrase, ai, api, import, hosted_page
- detectedstring
The keyword or phrase that triggered detection
- confidencenumber
Intent-tier detections only, 0 to 1
- campaign_idstring
On the response to an opt-in recorded for one registration
- proofOptInProof
Opt-in evidence (Messaging Policy 1.4). Accepted only with status opted_in.
Errors
Every error has the same JSON shape, and request_id matches the X-Request-Id response header. Errors lists every code and what to do about it.
- 401
Missing, malformed, or revoked API key
- 402
Billable live calls only: the prepaid credit balance cannot cover the call (insufficient_credits); nothing was done or charged
- 409
The number opted out, and the opt-in carries no proof collected at or after the opt-out
- 429
Rate limit or quota exceeded