Search the docs
Menu
Updated Edit on GitHub

Console: sessions

Copy as Markdown

These routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.

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.

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.

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.

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

Type to search pages, sections, commands and settings.