API referenceCompliance
Record consent
POST
Records an opt-in or opt-out for a channel and purpose (source api). A contact is created when none holds the number. Keep your own evidence; send its reference as evidenceRef.
ApiKeyheader
AuthorizationBearer <token>An API key from Developers → API keys: Authorization: Bearer gauge_live_… (or pulse_k_live_…).
Gauge-Version?stringA dated version. Default 2026-10-21.
Idempotency-Key*stringRequired on every POST. Retries with the same key replay the first response for 24 h.
Length
1 <= length <= 255application/json- body
phone*stringThe person, by phone number. A contact is created when none holds this number.
Match
^\+[1-9]\d{6,14}$channel*stringValue in
"sms""voice"purpose*stringmarketing or utility (transactional).
Value in
"marketing""utility"state*stringValue in
"opted_in""opted_out"evidenceRef?stringYour own reference for the evidence (a form id, an order id). Never the text itself.
Length
1 <= length <= 200The contact's consent history after the change.
application/json- response
contactId*stringFormat
uuidonDncList*array<string>The contact's phone numbers that are on the do-not-contact list.
entries*array<>curl -X POST 'https://app.gauge.chat/backend/v2/consents' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "phone": "string", "channel": "sms", "purpose": "marketing", "state": "opted_in"}'Example Response
{ "contactId": "b5ec5d98-4bee-4da1-ad24-dde86346cb1d", "onDncList": [ "string" ], "entries": [ { "channel": "string", "purpose": "marketing", "state": "opted_in", "source": "string", "at": "string", "current": true } ]}