# Retrieve alert settings

Where alerts go for this session, and which channels this server can use.

GET `/api/v1/notifications`

**cURL**

```shell
curl 'https://www.prufy.dev/api/v1/notifications' \
  -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", {
  headers: { cookie },
})
const data = await response.json()
```

**Python**

```python
import requests

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

Response 200 OK

```json
{
  "email": {
    "address": "owner@yourcompany.com",
    "verified": true
  },
  "pushDevices": 1,
  "capabilities": {
    "email": true,
    "pushPublicKey": "BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U"
  }
}
```

Works with no session too, so a client knows which channels to offer before anyone has claimed a domain. `capabilities.email` is false when the server has no email set up, and `capabilities.pushPublicKey` is null when push is off.

Alerts are sent for six moments only: verified, at risk, recovered, lapsed, expired and transferred. Routine checks never send anything.

## Authentication

Works with or without the session cookie. Without it there's less to return. [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.

- `email` object | null

  The alert address. Null when none is set.

  - `address` string

    Where alert emails go.
  - `verified` boolean

    False until the confirmation link has been used.
- `pushDevices` integer

  How many browsers are subscribed to push.
- `capabilities` object

  Which channels this server can use.

  - `email` boolean

    Whether this server can send email at all.
  - `pushPublicKey` string | null

    The key a browser subscribes with. Null when push is off.

## Errors

Nothing specific to this route.

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
