# Send a test alert

Send a sample alert to every channel this account has set up.

POST `/api/v1/notifications/test`

**cURL**

```shell
curl -X POST 'https://www.prufy.dev/api/v1/notifications/test' \
  -b cookies.txt
```

**Node.js**

```javascript
// `cookie` is the session cookie that Create a claim returned.
const response = await fetch("https://www.prufy.dev/api/v1/notifications/test", {
  method: "POST",
  headers: { cookie },
})
const data = await response.json()
```

**Python**

```python
import requests

# `session` is the requests.Session() that created the claim.
response = session.post("https://www.prufy.dev/api/v1/notifications/test")
data = response.json()
```

Response 200 OK

```json
{
  "delivered": 2
}
```

`delivered` counts the confirmed email address and each subscribed browser that took it. Zero means nothing is set up yet, or the address hasn't been confirmed.

## Authentication

Send the session cookie. Without it the answer is `unauthorized`. [How sessions work](https://www.prufy.dev/docs/authentication.md).

## Response

`200 OK`, with every field below present. Times are ISO 8601 strings in UTC.

- `delivered` integer

  How many inboxes and browsers took the alert.

## Errors

| Status | Kind | When |
| --- | --- | --- |
| 401 | `unauthorized` | The request has no session cookie, or one we don't recognise. |
| 429 | `rate_limited` | The account has sent 10 test alerts in the last hour. |

Any route can also answer `500` with `internal_error`. Every error has the same shape, described in [Errors](https://www.prufy.dev/docs/errors.md).

---

Every page of these docs, as a list: https://www.prufy.dev/llms.txt
