---
title: "List consent events"
method: GET
path: "/consents"
tags: ["Compliance & Consent"]
---

# List consent events

`GET /consents`

## Request

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

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).

## Query parameters

- `phone` string
- `purpose` 'marketing' | 'transactional' | 'otp' | 'service'
- `status` 'granted' | 'withdrawn'
- `from` string, date-time
- `to` string, date-time
- `format` 'json' | 'csv'
- `limit` integer
- `offset` integer

## Response `200`

Consent events, newest first

- object
  - `data` ConsentEvent[]
    - `id` string
    - `phone` string
    - `channel` 'whatsapp' | 'sms' | 'any'
    - `purpose` 'marketing' | 'transactional' | 'otp' | 'service'
    - `status` 'granted' | 'withdrawn'
    - `source` 'api' | 'form' | 'import' | 'dashboard' | 'whatsapp_keyword' | 'sms_keyword' | 'whatsapp_inbound' | 'ctwa'
    - `evidence` object, nullable
    - `recorded_at` string, date-time
    - `created_at` string, date-time
  - `total` integer
  - `limit` integer
  - `offset` integer

---

[API](https://skmtc.dev/envoisms/apis/envoisms-ma-api.md) · [All operations](https://skmtc.dev/envoisms/apis/envoisms-ma-api/llms.txt) · [OpenAPI document](https://skmtc.dev/envoisms/apis/envoisms-ma-api/revisions/662db074bd86?raw)
