Skip to main content
POST
Record an opt-in or opt-out for a contact

Authorizations

Authorization
string
header
required

Dashboard JWT token from Clerk

Body

application/json
channels
enum<string>[]
required

Channels this consent applies to (sms, email, whatsapp, voice, rcs, viber, messenger, instagram, line, push, fax).

Minimum array length: 1
Available options:
email,
fax,
instagram,
line,
messenger,
push,
rcs,
sms,
viber,
voice,
whatsapp
opt_in
boolean
required

true records an opt-in grant; false records an opt-out (revocation).

contact_id
string

The contact to record consent for (supply this or identifier).

Required string length: 1 - 64
identifier
string

Freeform contact identifier resolved to a contact — email, E.164 phone, or WhatsApp id (supply this or contact_id).

Required string length: 1 - 320
source
string

Where the consent came from (defaults to consent_api).

Maximum string length: 64

Consent purpose/type (defaults to messaging).

Maximum string length: 80
lawful_basis
enum<string>

GDPR Art 6 lawful basis for processing.

Available options:
consent,
contract,
legal_obligation,
vital_interests,
public_task,
legitimate_interests
purpose
string

What the recipient agreed to — required for a consent-based opt-in (GDPR Art 7(1)).

Maximum string length: 500

Disclosure/policy version the recipient agreed to — required for a consent-based opt-in.

Maximum string length: 80

http(s) link to a specific evidence resource (a bare site root is rejected).

Maximum string length: 500
valid_until
string<date-time>

Absolute ISO-8601 expiry for a time-bounded opt-in (mutually exclusive with expires_in_days).

expires_in_days
integer

Relative validity window in days for a time-bounded opt-in.

Required range: 1 <= x <= 3650
metadata
object

Optional free-form metadata stored on the grant.

Response

Consent recorded — returns { contact_id, consent_record_ids, channels, state, valid_until }.