API endpoint reference

Developers · API endpoint reference

API endpoint reference

Base path: /api/v1 unless noted. Auth notation: session = logged-in web session; Bearer = OAuth token (scope in parentheses). All responses use the envelope from the API overview.

Client Ergonomics, Authentication & Device Pairing

Method Path Auth Description
GET /client/bootstrap Bearer (read) Unified startup state in 1 round-trip: returns { user, initial_seq, unread, rooms, timeline, notifications, conversations, mls, ice_servers, server }. Use ?include= to select sections.
GET /client/sync Bearer (any) Offline catch-up: notifications since since_notification_id, conversation summaries, and {latest_seq, since_seq, behind}. Gateway replay itself is /ws resume.
POST /auth/login none Direct client login: accepts {username, password, client_name}. Returns standard OAuth tokens (access_token, refresh_token, client_id, expires_in, scope, user) or {totp_required: true, challenge_token}. Auto-provisions an identifiable client-app row. Protected with brute-force lockout. Disabled when EXTV_API_PASSWORD_LOGIN=off.
POST /auth/login/totp none Complete 2FA login: accepts {challenge_token, code} (TOTP or recovery code). Single-use challenge (TTL ≤300s, max 5 attempts). Returns standard OAuth tokens.
POST /auth/passkey/options none Generate passkey authentication options: accepts {username?}. Returns WebAuthn assertion options and challenge token.
POST /auth/passkey/verify none Verify passkey assertion: accepts {challenge_token, response, client_name}. Verifies assertion, increments signature counter, and issues standard OAuth tokens.
GET /auth/captcha none Stateless captcha: returns {captcha_token, captcha_svg, expires_in} for anti-bot API registration.
POST /auth/register none API registration: accepts {captcha_token, captcha_answer, username, password, display_name?, email?, client_name?}. Validates captcha, provisions account and client app, and returns OAuth tokens.
POST /auth/pair/init Bearer or session (write) Generate a short-lived 5-minute device pairing code (e.g. EXT-A1B2C3D4) + QR pairing URL for zero-typing native login.
POST /auth/pair/claim none Exchange pairing code (code, client_name) for a permanent Personal Access Token (ext_pat_...) and user profile. Single-use.
GET /auth/me Bearer (any) Current account plus credential: {kind, scopes, expires_at, token_id}. kind is oauth, pat, or bot.
GET /instance none Public capabilities: version, api_version, limits, feature flags, gateway URL + protocol version, E2EE engine.

OAuth & OIDC

Method Path Auth Description
POST /apps none Dynamic Client Registration (RFC 7591 / Mastodon-compatible). Body: client_name*, redirect_uris, scopes, website. Returns client_id + client_secret + vapid_key.
POST /oauth/apps session Register an app via web session. Body: name, redirect_uris (string or array), description, website, scopes (space-separated, default read). Returns client_id + client_secret.
GET /oauth/apps session Your registered apps.
GET /oauth/authorize session Consent page. Params: client_id, redirect_uri, response_type=code, scope, state, nonce, code_challenge, code_challenge_method (S256/plain). Browser-only.
POST /oauth/authorize session Approve/deny (approve=yes → redirect with code; else error=access_denied). Browser-only.
POST /oauth/token client Token endpoint. grant_type=authorization_code (needs client_id, code, redirect_uri, code_verifier if PKCE) or grant_type=refresh_token. Public clients (no secret) supported.
POST /oauth/revoke client Revoke a token. Body: token, client_id. Always {ok:true} (no enumeration).
GET /oauth/authorized_apps session Apps you've authorized.
POST /oauth/authorized_apps/:appId/revoke session Revoke one app's access.
GET /oauth/userinfo Bearer (openid) OIDC UserInfo: sub, plus preferred_username/name/picture when profile scope granted.
GET /.well-known/openid-configuration none OIDC discovery document.
GET /.well-known/jwks.json none Signing keys for ID-token verification.

Full flow documentation: OAuth 2.0 & OpenID Connect.

Accounts

Method Path Auth Description
GET /accounts/verify_credentials Bearer (read) Your own account.
PATCH /accounts/update_credentials Bearer (profile) Update display_name (≤100), bio (≤500), theme (light/dark/october/default), html (custom profile markup ≤20k chars, sanitized), and css (custom profile styles ≤10k chars, sanitized).
POST /accounts/avatar Bearer (profile) Multipart avatar (image, ≤10 MB) → resized 200×200 JPEG.
DELETE /accounts/me Bearer (write) Permanently delete your account. Body: password*.
GET /accounts/tokens Bearer (profile) List your personal access tokens (id, name, token_prefix, scopes, created_at, expires_at).
POST /accounts/tokens Bearer (profile) Create a Personal Access Token (name*, scopes, expires_in_days). Returns full token (shown once).
DELETE /accounts/tokens/:id Bearer (profile) Revoke a personal access token.
GET /accounts/sessions Bearer (profile) List your active login sessions.
DELETE /accounts/sessions/:id Bearer (profile) Revoke an active login session.
GET /accounts/relationships?id=1,2,3 Bearer (read) Batch: [{id, following, followed_by}].
GET /accounts/:id Bearer (read) Account (404 if outside your network).
GET /accounts/:id/statuses Bearer (read) Posts, newest first, limit+cursor. Network-gated.
GET /accounts/:id/followers Bearer (read) Follower list.
GET /accounts/:id/following Bearer (read) Following list.
POST /accounts/:id/follow Bearer (follow) Follow (notifies the target).
POST /accounts/:id/unfollow Bearer (follow) Unfollow.

Account shape

{
  "id": "42", "username": "alice", "display_name": "Alice",
  "avatar": "/uploads/avatars/abc.jpg", "bio": "",
  "created_at": 1750000000000,
  "statuses_count": 3, "followers_count": 10, "following_count": 5,
  "is_following": true, "is_self": false
}

Statuses (posts)

Method Path Auth Description
POST /statuses Bearer (write) Create. Multipart (optional media) or JSON. type: text/photo/video/repost; body or status ≤ 5000; repost_of_id for reposts (must be visible, not your own, not already reposted). Supports Idempotency-Key. Broadcasts post_create over gateway.
GET /statuses/:id Bearer (read) One post (404 outside network). Includes content (Markdown) and content_html.
PATCH /statuses/:id Bearer (write) Edit a post (author only). Body: body or status ≤ 5000. Re-renders Markdown and logs revision.
DELETE /statuses/:id Bearer (write) Delete (owner only, cascades). Broadcasts post_delete over gateway.
GET /statuses/:id/history Bearer (read) Revision edit history of a post: [{id, entity_id, body, edited_at}].
POST /statuses/:id/follow_from Bearer (follow) Attribution referral: record that you followed author because of this post.
POST /statuses/:id/favourite Bearer (write) Toggle like.
POST /statuses/:id/unfavourite Bearer (write) Remove like.
POST /statuses/:id/reblog Bearer (write) Repost (not your own; no-op if already reposted).
GET /statuses/:id/context Bearer (read) {ancestors: [], descendants: [comments…]}.
POST /statuses/:id/comment Bearer (write) Comment (body ≤ 1000).
PATCH /statuses/:id/comments/:cid Bearer (write) Edit a comment (author only, body ≤ 1000).
DELETE /statuses/:id/comments/:cid Bearer (write) Delete a comment (author only).
GET /statuses/:id/favourited_by Bearer (read) Who liked it.
GET /statuses/:id/reblogged_by Bearer (read) Who reposted it.

Status shape

{
  "id": "9", "type": "photo", "body": "…", "media_path": "/uploads/…",
  "created_at": 1750000000000,
  "account": { … },
  "likes_count": 2, "shares_count": 1, "comments_count": 0,
  "liked": false, "shared": false, "repost_of_id": null, "is_own": true
}

Engagement counts always target the original content (reposts don't split engagement).

Timelines

Method Path Auth Description
GET /timelines/home Bearer (read) Ranked network feed. limit (≤40), cursor (id-based). Batch-counted engagement.
GET /timelines/public — 403 by design — there is no public timeline.

Notifications

Method Path Auth Description
GET /notifications Bearer (notifications) Newest first, cursor-paginated. Item: id, type, created_at, read, account, post_id.
POST /notifications/clear Bearer (notifications) Mark all read.
GET /notifications/unread_count Bearer (notifications) {data:{count}}.
GET /notifications/stream Bearer (notifications) SSE stream — see Realtime. Emits id: and honors Last-Event-ID.

Media

Method Path Auth Description
POST /media Bearer (media.write) Upload (file field, ≤60 MB, image/video). Returns url, mime_type, file_size, width, height.
GET /media/:id Bearer (read) Metadata, owner only.
Method Path Auth Description
GET /search?q=…&type=…&limit=… Bearer (read) type=accounts / type=statuses / both. Posts limited to your network.

Presence

Method Path Auth Description
GET /calls/presence Bearer (any) Online mutual followers: [{id, username, display_name, in_call}].
GET /calls/presence/:username Bearer (any) {online, in_call} for one user.

Push (native/PWA)

Method Path Auth Description
GET /push/vapid-public Bearer (any) VAPID public key for browser subscriptions (404 if unconfigured).
POST /push/subscribe Bearer (any) Register: {platform, endpoint, p256dh, auth}.
POST /push/unsubscribe Bearer (any) Remove: {endpoint}.

Rooms

Method Path Auth Description
GET /rooms Bearer (read) Your rooms (with member counts).
POST /rooms Bearer (write) Create room. Body: name*, description, is_public.
GET /rooms/:id Bearer (read) Room detail: channels (id/name/type), members, html/css, is_public, is_member.
PATCH /rooms/:id Bearer (write) Update room settings / custom styling (name, description, custom_css/css, custom_html/html, is_public).
DELETE /rooms/:id Bearer (write) Delete room (founder only).
POST /rooms/:id/join Bearer (write) Join public room or submit join request for private room.
POST /rooms/:id/leave Bearer (write) Leave room (founders must transfer first or be last member).
POST /rooms/:id/channels Bearer (write) Create channel (name*, type: text/voice).
PATCH /rooms/:id/channels/:cid Bearer (write) Rename channel (name*).
DELETE /rooms/:id/channels/:cid Bearer (write) Delete channel.
GET /rooms/:id/roles Bearer (read) List roles in room.
POST /rooms/:id/roles Bearer (write) Create role (name*, color, permissions).
PATCH /rooms/:id/roles/:role_id Bearer (write) Update role (name, color, permissions).
DELETE /rooms/:id/roles/:role_id Bearer (write) Delete role.
POST /rooms/:id/members/:uid/roles Bearer (write) Assign role to member (role_id*).
POST /rooms/:id/members/:uid/kick Bearer (write) Kick member from room (MANAGE_MEMBERS).
POST /rooms/:id/transfer Bearer (write) Transfer founder ownership (target_user_id*).
GET /rooms/:id/requests Bearer (read) List pending join requests for private room.
POST /rooms/:id/requests/:reqId/approve Bearer (write) Approve a join request.
POST /rooms/:id/requests/:reqId/reject Bearer (write) Reject a join request.
POST /rooms/:id/invite Bearer (write) Invite user to room (username*).
GET /rooms/:id/channels/:cid/messages Bearer (read) Channel history, newest last, cursor (message id) → next 50.
POST /rooms/:id/channels/:cid/messages Bearer (write) Send. Non-sticker messages must be proto:"mls" with a ciphertext (≤20,000 chars); sticker paths are sent as plaintext bodies. Broadcasts message_create.
DELETE /rooms/:id/channels/:cid/messages/:mid Bearer (write) Delete message (author or MANAGE_MESSAGES). Broadcasts message_delete.
POST /rooms/:id/session Bearer (write:direct) Publish/rotate your Megolm session. Body: keys:[{recipient_id, encrypted_key}], member_ids:[], rotate. Pushes room_session_key to recipients via WebSocket in realtime.
POST /rooms/:id/session/sync Bearer (write:direct) Unified Room Key Sync: Atomically publish new keys (keys: [{recipient_id, encrypted_key}]), cover keyless members (member_ids: []), receive pending keys for yourself, ACK delivered keys (ack_key_ids), and inspect missing_members in 1 round-trip.
GET /rooms/:id/session/keys Bearer (read:direct) Pending encrypted session keys for you (filtered to room).
POST /rooms/:id/session/keys/delivered Bearer (write:direct) Ack delivered keys: {key_ids: []}.
GET /rooms/:id/session/status Bearer (read:direct) {session_id, recipients, empty_keys_for}.
GET /rooms/:id/bundles Bearer (read:direct) Batch Member Bundles: Returns prekey bundles for room members in 1 call. Supports ?missing_for_session=<sessionId> and ?claim=1 (pass claim=1 when establishing sessions to consume one-time keys from the pool). Note: top-level singular fields (identity_key, one_time_key, device_id) represent devices[0]; multi-device clients must iterate devices[] to fan out keys to all devices.
GET /rooms/:id/bundle/:username Bearer (read:direct) Single member's Olm bundle for room key-sharing.

Rooms support 100% REST API parity alongside the web UI under /rooms/*.

The /rooms/:id/session* and /rooms/:id/bundle* rows above are the retired Megolm key-distribution surface, kept for older clients. MLS clients use the /mls/* endpoints (see below) and the channel message endpoint with proto: "mls".

Direct messages

All require mutual followers with the peer.

Method Path Auth Description
GET /conversations Bearer (read:direct) Conversations with last message, unread counts, peer curve key.
GET /conversations/keys Bearer (read:direct) Your public key + encrypted private key.
POST /conversations/keys Bearer (write:direct) Publish public_key (+ optional encrypted_private_key).
POST /conversations/prekeys Bearer (write:direct) Publish Olm identity + one-time keys + backup.
GET /conversations/prekeys/backup Bearer (read:direct) Your stored account backup.
GET /conversations/prekeys/count Bearer (read:direct) Remaining one-time prekeys.
GET /conversations/:username Bearer (read:direct) History, newest first + next cursor; limit ≤100.
POST /conversations/:username/messages Bearer (write:direct) Send. Non-sticker messages must be proto:"mls" with the ciphertext in body (≤65,536 chars) and your encrypted self-copy in sender_ciphertext.
GET /conversations/:username/bundle Bearer (read:direct) Peer's Olm bundle (claims one one-time prekey).
GET /conversations/:username/safety Bearer (read:direct) Both sides' ed25519 + curve25519 keys.
GET /conversations/:username/keys Bearer (read:direct) Peer's legacy public key.
PATCH /messages/:id Bearer (write:direct) Edit (author only, ≤65,536, re-encrypted).
DELETE /messages/:id Bearer (write:direct) Delete (author only).

The /conversations/keys*, /conversations/prekeys*, …/bundle and …/safety rows are the retired Olm key surface, kept for older clients; MLS clients do their key exchange through /mls/*.

Bots

Method Path Auth Description
POST /bots Bearer (write) Create a bot you own; returns its first long-lived token (shown once).
GET /bots Bearer (read) Your bots (admins: all).
DELETE /bots/:id Bearer (write) Delete a bot you own (admins: any). Tokens, webhook and content go with it.
POST /bots/:id/tokens Bearer (write) Issue another token (returned once).
GET /bots/:id/tokens Bearer (read) Token prefixes (never the secrets).
DELETE /bots/:id/tokens/:tokenId Bearer (write) Revoke a token.
POST /bots/webhook Bearer (write) Bot: register a webhook URL; the HMAC signing secret is returned once.
POST /bots/webhook/rotate Bearer (write) Bot: rotate the webhook signing secret.
GET /bot/me Bearer (read) Own identity (bots and humans).
GET /timelines/mentions Bearer (read) Posts that mentioned you — the reply-bot trigger source.

Bot handles are normalized to end in _bot (username: "echo" creates @echo_bot); the suffix is reserved for bots.

MLS (end-to-end encryption)

The device/group endpoints the E2EE client drives (src/routes/mls.js). They are mounted at /api/v1/mls and, for older clients, at /mls. Authentication is the same credential model as the rest of the API: OAuth access tokens, personal access tokens (ext_pat_…), and bot tokens all work, and a session cookie works for the web app.

Method Path Description
POST /mls/device/register Register this device (device_id, device_name, signing_key_pub = base64url Ed25519 public key).
GET /mls/devices List your devices (?user_id= for an authorized peer).
DELETE /mls/devices/:deviceId Remove a device.
POST /mls/keypackages Publish public KeyPackages for a device.
GET /mls/keypackages/status How many KeyPackages remain.
GET /mls/keypackages/:userId Peek the pool and return row ids without consuming. ?claim=1 performs the legacy one-step consume (one per device).
POST /mls/keypackages/consume Consume specific KeyPackages (keypackage_ids).
GET /mls/welcomes Pending Welcomes addressed to your device.
POST /mls/welcomes/claim Lease a Welcome to one device for 5 minutes (welcome_id, device_id).
POST /mls/welcomes/ack Acknowledge a Welcome.
GET /mls/groups Groups you belong to: {group_id, kind, epoch, member_count, room_id, peer_id}.
GET /mls/groups/:groupId/members Members with user, device, leaf index and role.
POST /mls/groups/init Create an MLS group.
GET /mls/groups/:groupId Existence and current epoch.
POST /mls/groups/:groupId/proposals Submit a proposal.
GET /mls/groups/:groupId/proposals Proposals for an epoch.
POST /mls/groups/:groupId/commit Submit a commit (CAS on current_epoch; 409 EpochConflict on drift).
GET /mls/groups/:groupId/commits Ordered commit log (?since=<epoch>).
GET/POST /mls/backup Your password-encrypted client backup. GET returns an ETag; POST accepts If-Match (or ?force=1).

Group ids are server-authored: dm:<lowerUserId>_<higherUserId> and room:<roomId>. Commits that advance the epoch broadcast an mls_epoch gateway_event on the mls topic to that group's members only.

Payload shapes live in the client (public/mls-client.js).

Announcement

Method Path Auth Description
GET /announcement Bearer (read) {body, author_display_name, author_username, updated_at} or data: null.

Stickers

Method Path Auth Description
GET /stickers Bearer (read) List your personal stickers ([{id, file_path, url, created_at}]).
POST /stickers Bearer (write) Upload sticker (multipart file, ≤500 KB, auto-compressed) or save existing (path).
DELETE /stickers/:id Bearer (write) Delete one of your personal stickers.

Administration

All /admin/* routes require a Bearer token carrying the admin scope and belonging to an account with is_admin = 1. A read-only token intentionally cannot perform administrative operations. Every administrative mutation is audited in the server audit log with the acting admin's user ID, target, and IP.

Method Path Auth Description
GET /admin/users Bearer (admin) List all registered users with admin and ban status.
POST /admin/users/:id/ban Bearer (admin) Suspend a user account, destroy all active web sessions and sockets, and revoke all OAuth tokens. Cannot ban another admin.
POST /admin/users/:id/unban Bearer (admin) Restore access to a suspended user account.
DELETE /admin/users/:id Bearer (admin) Permanently delete a user account, associated content, and open sockets. Cannot delete an admin.
POST /admin/users/:id/make_admin Bearer (admin) Promote a user to instance administrator.
POST /admin/users/:id/remove_admin Bearer (admin) Demote an administrator back to regular user. Cannot demote yourself.
GET /admin/reports Bearer (admin) List unresolved moderation reports.
POST /admin/reports/:id/resolve Bearer (admin) Mark a moderation report as resolved.
POST /admin/reports/:id/dismiss Bearer (admin) Dismiss a moderation report.
GET /admin/announcement Bearer (admin) Retrieve current server-wide announcement.
POST /admin/announcement Bearer (admin) Create or update server announcement. Body: {body: "..."}.
DELETE /admin/announcement Bearer (admin) Clear active server announcement.

Transport & Security Configuration

  • Transport Security: Production deployments (NODE_ENV=production) fail closed on unencrypted HTTP requests, requiring HTTPS directly or via an explicit EXTV_TRUST_PROXY behind TLS termination proxies.
  • Uniform Error Responses: Authentication failures return constant-time generic responses (401 Unauthorized: Invalid username or password) regardless of whether the user is unknown, wrong password, or suspended.
  • Brute Force & Lockout: Per-IP limiter (EXTV_LOGIN_RATE_LIMIT_IP, default 15/min) and per-username lockout with exponential backoff (EXTV_LOGIN_LOCKOUT_ATTEMPTS, default 5 failed attempts locks for 1 min up to 15 mins).
  • OAuth-only Mode: Set EXTV_API_PASSWORD_LOGIN=off to disable direct password login on the API surface while preserving OAuth/OIDC and pairing workflows.

Web session routes (not part of the REST API)

The full HTML surface for reference — all require login and CSRF:

Area Routes
Auth GET/POST /login, GET/POST /register, POST /logout, GET/POST /become-admin
Pages GET /, GET /compose, GET /discover
Posts POST /posts, POST /posts/:id/like, /comment, /share, /repost, /follow-from, /edit, GET/POST /posts/:id/delete, GET /posts/:id/history
Profiles GET /u/:username, GET/POST /u/:username/edit, POST /u/:username/avatar, /avatar/remove, POST /u/:username/referral, `GET /u/:username/followers
Social POST /follow/:username, POST /unfollow/:username
Notifications GET /inbox
Chats GET /chats, GET /chats/:username, POST /chats/:username/send, /edit/:mid, GET/POST /chats/pubkey, POST /chats/prekeys, `GET /chats/prekeys/backup
Rooms GET/POST /rooms/create, GET/POST /rooms/:id/settings, `POST /rooms/:id/delete
Settings GET/POST /settings, GET/POST /settings/delete, GET/POST /settings/developers*
Push GET /push/vapid-public, `POST /push/subscribe
Admin GET /admin, `POST /admin/ban
Stickers GET /stickers/manage, `POST /stickers/upload
Docs GET /docs and GET /docs/* (in-app wiki), GET /developers/docs (Swagger UI), GET /developers/openapi.json (OpenAPI 3.1)

By using this Extrovert instance you agree to the Terms of Service.