Record SMS consent

Record SMS consent

POST/api/v1/contacts/{id}/sms-consent

POST /contacts/{id}/sms-consent
curl -X POST 'https://www.unitpost.com/api/v1/contacts/con_123/sms-consent' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
Response · 201
{
  "object": "sms_consent",
  "phone": "string",
  "recorded": {
    "id": "id_123",
    "action": "string",
    "source": "string",
    "occurred_at": "2026-01-01T00:00:00.000Z"
  }
}

Record an SMS opt-in or opt-out that a recipient gave you — typically a checkbox on your own signup form. This is the supported way to bring consent you already hold into Unitpost so marketing SMS is accepted for that contact. source is required: consent without recorded provenance is not consent, and the source is what makes the audit trail defensible. occurred_at may be backdated to when the recipient actually agreed (do not pretend historical consent happened just now); a future timestamp is rejected. Every call appends an immutable event, so the history is never overwritten. Recording an opt-out suppresses SMS for this contact only — it does not touch their email subscription. Requires the contacts:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body7 fields
FieldTypeDescription
actionrequiredenumopt_in | opt_out—
sourcerequiredenumweb_form | hosted_form | keyword | qr | verbal | paper | api_import | api—
purposeenummarketing | transactional—
phonestring—
occurred_atstring—
evidence_urlstring—
disclosure_versionstring—
Response · 201 fields3 fields
FieldTypeDescription
objectrequiredstring—
phonerequiredstring—
recordedrequiredobject—
201401404422

Search docs and guides

Search the docs and product guides.