Sign-in and accounts
The first administrator, sign-in and sign-out, your own account, people and invitations.
| Operation | Method and path |
|---|---|
| Create the first administrator once | POST /api/v1/auth/bootstrap |
| Whether a fresh install still needs its first administrator | GET /api/v1/setup |
| Create a cookie session | POST /api/v1/auth/login |
| Revoke the current session | POST /api/v1/auth/logout |
| Change the caller's own password | POST /api/v1/auth/password |
| Read current account metadata | GET /api/v1/auth/me |
| List accounts | GET /api/v1/users |
| Change an account's role or disable it | PATCH /api/v1/users/{id} |
| List invitations | GET /api/v1/invitations |
| Invite an email address | POST /api/v1/invitations |
| Revoke an invitation | DELETE /api/v1/invitations/{id} |
| Show whom an invitation is for | POST /api/v1/invitations/lookup |
| Accept an invitation | POST /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
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Origin | header | string | Must equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted. | |
Sec-Fetch-Site | header | "same-origin" |
Request body
application/json: Bootstrap
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | User |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Setup |
| 503 | Database unavailable | Error |
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
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Origin | header | string | Must equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted. | |
Sec-Fetch-Site | header | "same-origin" |
Request body
application/json: Login
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | User |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Revoke the current session
POST /api/v1/auth/logout
Sign-in: A signed-in session or an API token.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Origin | header | string | Must equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted. | |
Sec-Fetch-Site | header | "same-origin" |
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Origin | header | string | Must equal public_origin; when absent, Sec-Fetch-Site: same-origin is accepted. | |
Sec-Fetch-Site | header | "same-origin" |
Request body
application/json: PasswordChange
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Read current account metadata
GET /api/v1/auth/me
Sign-in: A signed-in session or an API token.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | User |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Accounts |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Account |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | last_admin | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Invitations |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | CreatedInvitation |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | email_taken | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 204 | Successful operation | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | invitation_closed | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | Invitee |
| 400 | invitation_invalid or invalid request | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
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
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | User |
| 400 | invitation_invalid, weak password or invalid request | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |