# Console: sessions

Source: https://docs.neode.sk/development/api-reference/console-sessions/
Last updated: 2026-12-03

> 4 operations. Console sign-ins: the browsers and devices an account is signed in on.

These routes are on the console, port 3375. They take an API token as `Authorization: Bearer ndt_...`; see [API tokens](https://docs.neode.sk/command-line/api-tokens.md).

Console sign-ins: the browsers and devices an account is signed in on.

## GET /api/users/me/sessions

List the browsers and devices your account is signed in on.

Each entry shows the browser and system, the address, when it signed in and when it was last used. An API token has no browser session of its own, so no entry is marked current.

`neodesk sessions list` calls it.

**200**: Done (`application/json`)

[SignedInSessions](https://docs.neode.sk/development/api-reference/schemas.md#signedinsessions).

| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |

## GET /api/users/{id}/sessions

List the browsers and devices an account is signed in on.

Needs `user.edit`. `neodesk sessions list-for` calls it.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | integer | yes | The account ID (see users list); at least 1 |

**200**: Done (`application/json`)

[SignedInSessions](https://docs.neode.sk/development/api-reference/schemas.md#signedinsessions).

| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |

## POST /api/users/{id}/sessions/end-all

Sign an account out on every browser and device.

Only an account whose role you could give, or your own. On your own account the session that asks stays; an API token has none, so every session ends.

Needs `user.edit`. `neodesk sessions end-all` calls it. It cannot be undone.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | integer | yes | The account ID (see users list); at least 1 |

**200**: Done (`application/json`)

| Field | Type | Required | What it is |
|---|---|---|---|
| `success` | `true` | yes |  |
| `ended` | integer | yes | How many sessions ended |

| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |

## DELETE /api/users/{id}/sessions/{sessionId}

Sign an account out on one browser or device.

That browser goes to the sign-in page at its next request and is told an administrator signed it out. Only an account whose role you could give, or your own; your own current session is refused.

Needs `user.edit`. `neodesk sessions end` calls it. It cannot be undone.

| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
| `id` | path | integer | yes | The account ID (see users list); at least 1 |
| `sessionId` | path | string | yes | The session's id from GET /api/users/{id}/sessions |

**200**: Done (`application/json`)

[ConsoleSuccess](https://docs.neode.sk/development/api-reference/schemas.md#consolesuccess).

| Error | When |
|---|---|
| 400 | The request is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such item, or the account does not see it |
