# Sign out

End this device's session on the server and clear its cookie.

DELETE `/api/v1/session`

**cURL**

```shell
curl -X DELETE '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", {
  method: "DELETE",
  headers: { cookie },
})
const data = await response.json()
```

**Python**

```python
import requests

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

Response 200 OK

```json
{
  "signedOut": true
}
```

Only the session that makes the request is ended. The account, its claims and its other devices are untouched, and the domains keep being checked.

With no session, or one we don't know, `signedOut` is false and the answer is still a 200, so repeating it is safe.

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

- `signedOut` boolean

  True when a session was ended. False when there wasn't one, so repeating is safe.

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