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
Field
Type
Description
idrequired
string · path
—
Request body7 fields
Field
Type
Description
actionrequired
enumopt_in | opt_out
—
sourcerequired
enumweb_form | hosted_form | keyword | qr | verbal | paper | api_import | api