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

# `save_campaign`

Prepare a campaign.

Creates or updates a draft: one inbox, one audience and a sequence of 1 to 4 steps, with 1 to 3 variants per step. Fields such as {{prenom}} and {{societe}} come from the contacts. An empty field blocks the send. Only {{unsubscribe_url}} is filled in when the message leaves.

## Access

- **Key**: an Escouade Mail key with `send`.
- **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 |
|---|---|---|---|
| `campaign_id` | string | no | Draft to update, optional. |
| `name` | string | yes | Name. |
| `inbox_id` | string | yes | Sending inbox. |
| `from_address` | string | no | This inbox's main address or an alias. |
| `audience_id` | string | no | Audience. |
| `reply_to` | string | no | Optional reply-to address. |
| `steps` | list of object | yes | The sequence: 1 to 4 steps, each with its delay and 1 to 3 variants (subject, text, optional HTML). |

## Call it

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

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