# Notifications and alerts

Bastide lets you know in three ways: your account's notifications, which you set by kind of event and by channel; events sent to your webhooks, to connect your own tools; and notices the platform sends to your account. This page says what each one covers, how to set it, and what is not in service yet.

## Account notifications

Each person chooses, for each organisation they belong to, how they are told about four kinds of event:

| Kind | What triggers it | Default channels |
| --- | --- | --- |
| Production failure (échec de production) | A deployment to production fails. | Email, web notification, app |
| Incident opened (incident ouvert) | A project enters an anomaly (errors, latency, saturation), once per episode. | Email, web notification, app |
| Go-live (mise en ligne) | A deployment is promoted to production. | Web notification |
| Billing alert (alerte de facturation) | A usage threshold or cap is reached. | Email |

Billing alerts only go to Owners, Administrators and Billing members. The three channels are **email** (courriel), **web notification** (web) and **app** (application: a push notification on a registered phone).

A notification's text carries only the project's short name, the environment and a threshold percentage. No variable value, log excerpt or error message goes into it: the detail is read in the console, after signing in.

> **Attention.** Your choices are saved and can be read back today, but sending these notifications is not in service yet. To be told about a failed deployment now, connect a webhook (see below).

### Set them from the console

1. Open **Compte** (Account), "Notifications" card. It applies to the organisation currently open.
2. Tick or untick a channel for a kind: the choice is saved at once. As long as you have changed nothing, the row shows "Réglage par défaut" (default setting).
3. Under "Appareils déclarés" (registered devices), remove a phone that should no longer receive anything.

A device is registered from the app itself, not from the console; at most twenty devices per account. A device's token is never shown again.

### Set them from the command line or the API

These settings are personal: they have no MCP tool.

```sh
bastide account notification read --organization-id org_01JQ8ZK4M7NP2RSTVWXYZ34567
bastide account notification write --organization-id org_01JQ8ZK4M7NP2RSTVWXYZ34567 \
  --genre mise_en_ligne --channels courriel --channels web
```

The `--channels` option is repeated, once per channel; it also accepts a JSON list (`'["courriel","web"]'`).

```json
{
  "organizationId": "org_01JQ8ZK4M7NP2RSTVWXYZ34567",
  "genre": "echec_de_production",
  "channels": ["courriel"]
}
```

The body above, sent as `PUT /v1/account/notifications`, replaces the list of channels for that kind, for you and that organisation. An empty list turns the kind off. References: [account.notification.read](../reference/operations/account.notification.read.md), [account.notification.write](../reference/operations/account.notification.write.md).

## Webhooks: connect your tools

To feed an on-call tool, a team chat or a dashboard, declare a receiving endpoint in **Webhooks**: the platform sends your projects' events there, signed and replayable. The full list of events, their payload and how to check the signature are on the [Webhooks](webhooks.md) page.

## Spending and quota alerts

- **Spending cap.** An organisation is created with a monthly cap of €500, which the Owner or a Billing member adjusts (see [Billing](billing.md)). Once the cap is reached, no new build or resource starts, with code `plafond_de_depense_atteint`; sites already online keep being served.
- **Spending thresholds.** The `spend.threshold.reached` and `spend.cap.reached` events are declared but not emitted yet: they wait for the usage measurement chain (see [Logs](logs.md), "Usage" section).
- **Outgoing traffic.** The `project.egress.threshold` event is sent when a project uses 80 % of its tier's ten-second burst at one edge, at most once per project and per node every quarter of an hour. Beyond that, the edge paces sending without refusing anything.
- **Image transformations.** The `project.images.threshold` event is sent when a project crosses 80 % of its tier's monthly cap, at most once a month. Beyond the cap, images are served as they are until the following month.

These last two events are emitted today: receive them through a webhook. Each tier's caps are on the [Limits](limits.md) page.

> **Note.** Custom alert rules on your metrics (an error-rate or latency threshold…) are not available yet: no screen or operation sets them.

## Account notices

The platform sometimes writes directly to your account: an inactive personal token about to be disabled, a reminder of a second factor required by an organisation, a password or second-factor link, an invitation. The "Avis reçus" (notices received) card on the **Compte** screen says what became of each one for 30 days: "Remis" (delivered), "En attente" (pending), "Refusé" (rejected by the mail server) or "Abandonné" (given up), with the relay's response. It shows neither the address nor the content.

```sh
bastide account notice list
```

If a notice is rejected or given up, check that your mailbox accepts the platform's emails. Reference: [account.notice.list](../reference/operations/account.notice.list.md).

## Common errors

| Code | What happens | What to do |
| --- | --- | --- |
| `plafond_d_appareils_atteint` | The account already registers twenty devices. | Remove a device in the "Notifications" card, then try again from the app. |
| `plafond_de_depense_atteint` | The organisation's spending cap is reached for the cycle. | Raise the cap in **Facturation** (Billing), or wait for the next cycle. |

See also: [Webhooks](webhooks.md), [Logs](logs.md), [Billing](billing.md), [Limits](limits.md), [Security](security.md).
