---
title: "Consent state and history for a number"
method: GET
path: "/consents/{phone}"
tags: ["Compliance & Consent"]
---

# Consent state and history for a number

`GET /consents/{phone}`

## Request

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

The answer to "show me this person's consent": the current state per
purpose (derived from the newest event — `unknown` when no event exists,
never assumed granted), whether the number sits on the opt-out list, and
the full event history, newest first.

## Path parameters

- `phone` string, required

## Response `200`

Derived state and history

- object
  - `phone` string
  - `opted_out` boolean
  - `opted_out_at` string, nullable
  - `state` object
  - `history` 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

---

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