Skip to main content

Sign-in and accounts

The first administrator, sign-in and sign-out, your own account, people and invitations.

OperationMethod and path
Create the first administrator oncePOST /api/v1/auth/bootstrap
Whether a fresh install still needs its first administratorGET /api/v1/setup
Create a cookie sessionPOST /api/v1/auth/login
Revoke the current sessionPOST /api/v1/auth/logout
Change the caller's own passwordPOST /api/v1/auth/password
Read current account metadataGET /api/v1/auth/me
List accountsGET /api/v1/users
Change an account's role or disable itPATCH /api/v1/users/{id}
List invitationsGET /api/v1/invitations
Invite an email addressPOST /api/v1/invitations
Revoke an invitationDELETE /api/v1/invitations/{id}
Show whom an invitation is forPOST /api/v1/invitations/lookup
Accept an invitationPOST /api/v1/invitations/accept

Create the first administrator once​

POST /api/v1/auth/bootstrap

Creates the first administrator once and signs them in: the response sets the same session cookie as login.

Sign-in: No sign-in.

Parameters

NameInRequiredTypeDescription
OriginheaderstringMust equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted.
Sec-Fetch-Siteheader"same-origin"

Request body

application/json: Bootstrap

Responses

StatusMeaningBody
201Successful operationUser
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Whether a fresh install still needs its first administrator​

GET /api/v1/setup

Unauthenticated. Returns only whether no account exists yet, so the web can send a fresh install to setup.

Sign-in: No sign-in.

Responses

StatusMeaningBody
200Successful operationSetup
503Database unavailableError

Create a cookie session​

POST /api/v1/auth/login

Ten attempts per minute per transport address, successful or not; further attempts in that minute, including one with the right password, return 429 busy. Forwarded-address headers are not trusted.

Sign-in: No sign-in.

Parameters

NameInRequiredTypeDescription
OriginheaderstringMust equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted.
Sec-Fetch-Siteheader"same-origin"

Request body

application/json: Login

Responses

StatusMeaningBody
200Successful operationUser
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Revoke the current session​

POST /api/v1/auth/logout

Sign-in: A signed-in session or an API token.

Parameters

NameInRequiredTypeDescription
OriginheaderstringMust equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted.
Sec-Fetch-Siteheader"same-origin"

Responses

StatusMeaningBody
204Successful operation
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Change the caller's own password​

POST /api/v1/auth/password

Session only: a personal API token is 403 session_required. The current password must verify (else 400, details field current_password, reason password_incorrect); the new one follows the first administrator's rules (at least 12 characters, not the email, not a common password: reason password_weak) and differs from the current one (reason password_unchanged). On success the caller's session is kept and every other session of the account ends; personal API tokens are not revoked. Audited (area account, item password, action replace) without a value. Attempts share login's limit of ten per minute per transport address, counted before the current password is checked; further attempts are 429.

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Parameters

NameInRequiredTypeDescription
OriginheaderstringMust equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted.
Sec-Fetch-Siteheader"same-origin"

Request body

application/json: PasswordChange

Responses

StatusMeaningBody
204Successful operation
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Read current account metadata​

GET /api/v1/auth/me

Sign-in: A signed-in session or an API token.

Responses

StatusMeaningBody
200Successful operationUser
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

List accounts​

GET /api/v1/users

Every account in creation order, never a password hash. Administrators only; needs a signed-in session (a personal token gets 403 session_required).

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Responses

StatusMeaningBody
200Successful operationAccounts
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Change an account's role or disable it​

PATCH /api/v1/users/{id}

At least one of role and disabled. Disabling deletes the account's sessions and revokes its tokens at once; the account and its tasks stay. The last enabled administrator can be neither demoted nor disabled (409 last_admin). Administrators only; needs a signed-in session (a personal token gets 403 session_required).

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Request body

application/json: ChangeAccount

Responses

StatusMeaningBody
200Successful operationAccount
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409last_adminError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

List invitations​

GET /api/v1/invitations

Newest first, with status pending, accepted, expired or revoked; never a token. Administrators only; needs a signed-in session (a personal token gets 403 session_required).

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Responses

StatusMeaningBody
200Successful operationInvitations
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Invite an email address​

POST /api/v1/invitations

A single-use invitation bound to the email, valid for limits.invitation_hours (default 168). The token is returned once; the join page is /join/{token}. An email that already has an account is 409 email_taken. Administrators only; needs a signed-in session (a personal token gets 403 session_required).

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Request body

application/json: NewInvitation

Responses

StatusMeaningBody
201Successful operationCreatedInvitation
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409email_takenError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Revoke an invitation​

DELETE /api/v1/invitations/{id}

Revokes an invitation that was not accepted; an accepted or revoked one is 409 invitation_closed. Administrators only; needs a signed-in session (a personal token gets 403 session_required).

Sign-in: A signed-in browser session only; an API token is refused with 403 session_required.

Responses

StatusMeaningBody
204Successful operation
400Invalid request or unsupported protocolError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409invitation_closedError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Show whom an invitation is for​

POST /api/v1/invitations/lookup

Public, shares the login limiter (10 per minute per address). Any unknown, used, expired or revoked token is the same 400 invitation_invalid.

Sign-in: No sign-in.

Request body

application/json: InvitationToken

Responses

StatusMeaningBody
200Successful operationInvitee
400invitation_invalid or invalid requestError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError

Accept an invitation​

POST /api/v1/invitations/accept

Public, shares the login limiter. Creates the invited account with the chosen password (the password policy applies) and sets the same session cookie as login. Works once; any unusable token is 400 invitation_invalid.

Sign-in: No sign-in.

Request body

application/json: AcceptInvitation

Responses

StatusMeaningBody
201Successful operationUser
400invitation_invalid, weak password or invalid requestError
401Authentication requiredError
403Origin, ownership or role deniedError
404Record not foundError
409Bootstrap closed, idempotency route conflict or deleted conversationError
413Request body limit exceededError
429Rate or capacity limit reachedError
503Database unavailable or gateway restartingError
504I/O deadline exceededError