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

# `close_space`

Close the space.

Closes the space: inboxes, threads, messages, domains, access and block list are erased, the direct debit stops, the invoices stay. In three steps. Without a code: says what will be erased and sends a 6-digit code to the space's human (15 minutes). With confirmation_code: the closure is confirmed, and the space is erased 48 hours later; until then everything works. With cancel = true: the closure is cancelled. The human gives you this code: do not look for it yourself, and do not guess it.

## Access

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

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `confirmation_code` | string | no | The 6-digit code the space's human received by e-mail and gives you. Absent: the code is sent, nothing is confirmed. |
| `cancel` | boolean | no | true: cancels the confirmed closure, and any pending code. |

## Call it

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

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