# Retrieve this session

Whether this device is signed in, and how many devices share the account.

GET `/api/v1/session`

**cURL**

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

Response 200 OK

```json
{
  "signedIn": true,
  "devices": 2,
  "email": "owner@yourcompany.com"
}
```

`email` is the confirmed alert address: the one that can sign another device in. When it's null, this device is the only way into the account.

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

- `signedIn` boolean

  Whether this device has a session.
- `devices` integer

  How many devices are signed in to this account, this one included.
- `email` string | null

  The confirmed alert address, which is what signs another device in. Null when there isn't one.

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