Record an opt-in or opt-out for a contact
Record a consent opt-in or opt-out for a contact across one or more channels. The write fans out to the canonical consent ledger, the contact’s channel-preferences mirror, and — on opt-out — the suppression list and STOP-fence cache, so every send-time gate sees the same state. Identify the contact by contact_id or a freeform identifier (email / E.164 phone / WhatsApp id); a consent-based opt-in requires purpose and consent_text_version for GDPR Art 7(1) proof, and you may attach a validity window (valid_until or expires_in_days) for re-permission jurisdictions. 404s when the contact does not exist.
Authorizations
Dashboard JWT token from Clerk
Body
Channels this consent applies to (sms, email, whatsapp, voice, rcs, viber, messenger, instagram, line, push, fax).
1email, fax, instagram, line, messenger, push, rcs, sms, viber, voice, whatsapp true records an opt-in grant; false records an opt-out (revocation).
The contact to record consent for (supply this or identifier).
1 - 64Freeform contact identifier resolved to a contact — email, E.164 phone, or WhatsApp id (supply this or contact_id).
1 - 320Where the consent came from (defaults to consent_api).
64Consent purpose/type (defaults to messaging).
80GDPR Art 6 lawful basis for processing.
consent, contract, legal_obligation, vital_interests, public_task, legitimate_interests What the recipient agreed to — required for a consent-based opt-in (GDPR Art 7(1)).
500Disclosure/policy version the recipient agreed to — required for a consent-based opt-in.
80http(s) link to a specific evidence resource (a bare site root is rejected).
500Absolute ISO-8601 expiry for a time-bounded opt-in (mutually exclusive with expires_in_days).
Relative validity window in days for a time-bounded opt-in.
1 <= x <= 3650Optional free-form metadata stored on the grant.
Response
Consent recorded — returns { contact_id, consent_record_ids, channels, state, valid_until }.