Compliance & Consent

List consent events

Append-only consent ledger: the evidence behind an opt-in or an opt-out (Law 09-08 art. 10, CNDP). Every grant and every withdrawal is one event with its source and evidence; the current state of a number is derived from the latest event per purpose (see GET /consents/{phone}).

The platform writes events itself when it observes the person's own act: STOP / START keywords on WhatsApp (whatsapp_keyword), STOP on SMS (sms_keyword), and the first customer-initiated WhatsApp conversation (whatsapp_inbound, purpose service). Everything the platform cannot see — a web form, a signed import — is yours to record via POST.

Add format=csv to download every matching event as a file (capped at 10,000 rows; when the cap bites the last row of the file says so).

get/consents

Request

  • Base URL: https://api.envoisms.ma/v1
  • URL: https://api.envoisms.ma/v1/consents
  • Auth: HTTP bearer

Query parameters

phonestring
Example:+212612345678

E.164 number to filter on

purpose'marketing' | 'transactional' | 'otp' | 'service'
status'granted' | 'withdrawn'
fromstring date-time

Only events recorded at or after this ISO 8601 timestamp

tostring date-time
format'json' | 'csv'

csv returns the full filtered set as a file

limitinteger
offsetinteger

Response

Consent events, newest first

totalinteger
limitinteger
offsetinteger

Example response

{
  "data": [
    {
      "id": "cns_9f2a...",
      "phone": "+212612345678"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.