HTTP API

The HTTP API covers accounts, sessions, public keys, access grants, and operational statistics. Send account requests over HTTPS with Content-Type: application/json and Content-Length; /auth/ bodies are limited to 16 KiB, and account responses use Cache-Control: no-store. The Erlang agent has dedicated routes and limits, listed separately below.

Send a session as Authorization: Bearer TOKEN. The public routes below do not take a session. Do not retry a login, a reset, a key update, or any other call that consumes an authenticator code. A used code cannot be reused until the next time step.

API reference pages

Status codes

StatusWhat it means for your program
200Success. Signup is the exception and returns 201
400The JSON or a field was rejected (bad_request)
401The credential was missing or rejected (unauthorized)
403The caller is signed in and is not an administrator (unauthorized from the admin handlers)
404Unknown route, user, or resource (not_found)
405Method not allowed
409The username is taken (user_exists on signup, exists on admin creates)
429The account is locked, or the node rate limit fired (too_many_attempts, or history_busy on statistics)
503The account service or a history query is unavailable

Error bodies are {"error":"..."}. They do not echo passwords, codes, or tokens.

Authentication

How a person moves from signup to a session is in Enrollment. The calls are in Authentication.

Method and pathSession
POST /auth/signupNo
POST /auth/signup/confirmNo
POST /auth/loginNo
POST /auth/logoutYes, empty body
POST /auth/refreshYes, empty body
POST /auth/password/resetNo
POST /auth/password/changeYes
POST /auth/otp/rotateYes
POST /auth/otp/confirmYes
POST /auth/recovery/enrollNo

Account

Use these after you have a session, except the public key lookup, which other programs use to encrypt to an active user. Details are in Account.

Method and pathSession
GET /auth/keysYes
PUT /auth/keysYes
GET /auth/sessionsYes
DELETE /auth/sessions/IDYes, body {"otp":"123456"}
GET /auth/historyYes
GET /user/<name>/keysNo. Public keys for an active account

OAuth

The browser and native flows are in OAuth.

Method and pathSession
GET /auth/oauth/providersNo
GET or POST /auth/oauth/PROVIDER/startNo
GET /auth/oauth/PROVIDER/callbackBrowser cookies
GET /auth/oauth/pendingBrowser cookies
POST /auth/oauth/completeNo. Body carries oauth_token and otp
POST /auth/oauth/registerNo
GET or POST /auth/oauth/PROVIDER/challengeNo
POST /auth/oauth/PROVIDER/tokenCookies from the challenge
POST /auth/oauth/PROVIDER/linkYes
GET /auth/oauth/accountsYes
DELETE /auth/oauth/accounts/PROVIDERYes, plus OTP

Administration

You need an administrator session for all of these. What each action does is in Administration.

Method and path
GET /auth/admin/me
GET /auth/admin/users?after=USERNAME
GET /auth/admin/audit
POST /auth/admin/create
POST /auth/admin/disable
POST /auth/admin/enable
POST /auth/admin/revoke
POST /auth/admin/unlock
POST /auth/admin/recover
POST /auth/admin/remove

Grants, samples, statistics

Method and pathPage
GET /auth/admin/grantsGrants
POST /auth/admin/permissionGrants
POST /auth/admin/permission/deleteGrants
POST /auth/admin/roleGrants
POST /auth/admin/role/deleteGrants
POST /auth/admin/assignGrants
POST /auth/admin/issueGrants
POST /auth/admin/grant/batchGrants
GET /auth/admin/samplesGrants
GET /auth/admin/samples/IDGrants
POST /auth/admin/samples/examineGrants
POST /auth/admin/samples/patternGrants
POST /auth/admin/samples/suggestGrants
GET /auth/admin/statistics/chartsStatistics
GET /auth/admin/statistics/charts/CHART?from=&to=Statistics

Erlang agent

These routes ask the agent application to check, run, or bind Erlang. They are not account routes. Shapes, limits, and status codes are in Erlang agent.

Method and pathCredential
POST /agents/erlangLogin session, or a grant token that covers the path
POST /agents/erlang/bindingsGrant token
POST /agents/erlang/stdinA credential mesgd accepts for that path
POST /agents/erlang/stdoutSame
POST /agents/erlang/stderrSame
GET /agent-ui and GET /agent-ui/...No session. Served only when agent_ui_enabled is true
GET and POST /auth/agent-state/...Login session. Same config flag. Handled before other /auth/ routes

Browser UI

GET /account and GET /account/app.js serve the account UI. A path that leaves that directory is 404.