---
title: "Create webhook"
method: POST
path: "/webhooks"
tags: ["Delivery Webhooks (DLR)"]
---

# Create webhook

`POST /webhooks`

## Request

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

Message events POST one payload shape regardless of where in the pipeline the state change happened: `{ "id", "to", "channel", "status", "error_code", "error_message" }` — the two error fields are present only on failed/undeliverable events and carry the same values as the stored message (see the Message schema). `id` is the EnvoiSMS message id, the same one the send call returned. `metadata` supplied at send time is included on delivery-report events.

## Request body

- object
  - `url` string, uri, required
  - `events` string[]
  - `secret` string: Optional HMAC secret. Generated and returned when omitted.

## Response `201`

Webhook created

---

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