> For an agent: the map of this documentation is at https://escouade.io/en/mail/docs/llms.txt; every page exists in Markdown, at the same address with `.md` appended.

# `set_webhook`

Declare the space's webhook.

Declares the https address where the server reports, through a signed JSON POST (Standard Webhooks), what happens to the space's messages and threads: departure, bounce, unsubscribe, reply, objection, delivery, refusal, new e-mail, suspended inbox. The same events can be read again with event_feed. The signing secret is returned once only, in this response. An address already declared is replaced, with a new secret. A test event (mail.webhook.test) leaves straight away.

## Access

- **Key**: an Escouade Mail key with `approve`.
- **Space**: a verified space.
- **Changes nothing**: no, it acts.
- **Safe to replay**: use an `idempotency_key` where the tool offers one.

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | The https address that will receive the events. |

## Call it

```sh
curl -s https://api.subagent.fr/v1/set_webhook \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer sak_…' \
  -d '{"url": "…"}'
```

The full page in French, with the response fields and every refusal the tool can return: [/mail/docs/reference/set_webhook](https://escouade.io/mail/docs/reference/set_webhook).
