API referenceCompliance

Record consent

POST
/v2/consents

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.

Authorization

ApiKey
headerAuthorizationBearer <token>

An API key from Developers → API keys: Authorization: Bearer gauge_live_… (or pulse_k_live_…).

Header Parameters

Gauge-Version?string

A dated version. Default 2026-10-21.

Idempotency-Key*string

Required on every POST. Retries with the same key replay the first response for 24 h.

Length1 <= length <= 255

Request Body

application/json
  1. body
phone*string

The person, by phone number. A contact is created when none holds this number.

Match^\+[1-9]\d{6,14}$
channel*string
Value in"sms""voice"
purpose*string

marketing or utility (transactional).

Value in"marketing""utility"
state*string
Value in"opted_in""opted_out"
evidenceRef?string

Your own reference for the evidence (a form id, an order id). Never the text itself.

Length1 <= length <= 200

Response Body

The contact's consent history after the change.

application/json
  1. response
contactId*string
Formatuuid
onDncList*array<string>

The contact's phone numbers that are on the do-not-contact list.

entries*array<>
Example Request
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    }  ]}