Search the docs
Menu
Updated Edit on GitHub

Console: account

Copy as Markdown

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

You: the account and permissions the token acts with.

GET /api/auth/verify

Check that the token works and show the account it signs in as.

The console uses the times for its idle warning.

neodesk account verify calls it.

200: Done (application/json)

Field Type Required What it is
success true yes
user object The account the session or token signs in as
user.id integer
user.username string
user.role string
user.preferred_language string or null
session object yes
session.createdAt string or null (date-time) The sign-in
session.lastActivityAt string or null (date-time)
session.loginIp string or null The address of the sign-in
session.idleTimeoutMs integer
session.maxAgeMs integer
session.warnBeforeMs integer
session.idleExpiresAt string or null (date-time) When the session ends without a request
session.absoluteExpiresAt string or null (date-time) When the session ends at the latest
session.serverNow string (date-time) The server's clock
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/panel/access/effective

Show the console sections and client features the account may use.

neodesk account access calls it.

200: Done (application/json)

Field Type Required
success true yes
data PanelAccessPolicy yes
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/me/profile

Show the account's own profile: name, email, phone.

neodesk account profile calls it.

200: Done (application/json)

Field Type Required What it is
success true yes
profile object yes Fields without a value are ""
profile.id integer
profile.username string
profile.role string
profile.first_name string
profile.last_name string
profile.email string
profile.phone string
profile.role_display string A job title shown with the name
profile.avatar_url string
profile.time_zone string "" for none
profile.formats string "auto", or a Formats locale with a region (BCP 47, such as en-GB or de-CH; the list is GET /api/console/bootstrap formats_locales): date order, month names, digits and separators
profile.clock string, one of auto, 12h, 24h "auto" (the Formats locale's own), 12-hour or 24-hour
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
404 There is no such item, or the account does not see it

PUT /api/users/me/profile

Change the account's own profile: name, email, phone, picture, time zone, Formats and Clock.

Give only what changes; a field left out keeps its value, and a body with none of them changes nothing. Text fields are cut to 200 characters, null saves "". A new email address needs the account's password (or its sign-in code) and waits for a confirmation mail; when that is refused, the other fields are saved anyway and the answer is the refusal with saved naming them. Only the console calls it, in a signed-in session: an API token can't change its account's profile.

Request body, application/json:

Field Type What it is
first_name string or null First name; "" or null takes it away
last_name string or null Last name; "" or null takes it away
email string or null Email address, at most 200 characters; another address asks for password and a confirmation
phone string or null Phone number
role_display string or null A job title shown with the name
avatar_url string or null An http(s) address of a picture; the server fetches and stores it when it changed
time_zone string or null An IANA time zone such as Europe/Berlin, "" or null for none; others are refused with time_zone_invalid
formats string "auto", or a Formats locale with a region (BCP 47, such as en-GB or de-CH; the list is GET /api/console/bootstrap formats_locales); others are refused with formats_invalid
clock string, one of auto, 12h, 24h "auto" (the Formats locale's own), 12-hour or 24-hour; others are refused with clock_invalid
password string The account's password, for a new email address
code string The account's sign-in code, for a new email address of an account without a password

200: Saved (application/json)

Field Type Required What it is
success true yes
avatar string yes What happened to the picture: "unchanged", or what fetching the new address did ("stored", "cleared", "skipped" or "failed")
avatar_error string Why fetching the picture failed, such as invalid_url
Error When
400 Refused: email_too_long, time_zone_invalid, formats_invalid, clock_invalid, or the new email address (such as password_required), with the other fields saved when saved is there
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/me/security-events

List your account's recent sign-ins and security events.

Sign-ins, password and two-factor changes, and each time an admin viewed NeoDesk as you, with who and why. Newest first; --limit up to 200.

neodesk account security-events calls it.

Parameter In Type What it is
limit query integer How many events; more than 200 gives 200; default 50, at least 1, at most 200

200: Done (application/json)

Field Type Required
success true yes
data AccountSecurityEvents yes
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

Type to search pages, sections, commands and settings.