Status Draft. Protocol version 1 (sv1) of the Sloppy Voice v2 product
Date 2026-12-04
Depends on 00 (overview and conventions), 01 (addresses), 02 (discovery and ServerMetadata), 03 (transport, envelope, errors), 04 (crypto conventions)
Refers to 06 (federation), 07 (identity), 08 (device setup and vault), 09 (communities), 10 (permissions), 12 (DMs), 13 (MLS), 19 (push), 20 (client UX), 21 (deployment)
Decisions used D-002, D-004, D-005, D-007, D-016, D-017, D-018, D-019, D-020, D-021, D-026, D-031, D-032, D-033, D-035, D-054, D-055, D-058, D-059, D-060, D-061, D-062, D-065, D-066, D-068, D-071, D-079, D-084, D-085, D-086, D-091
Decisions proposed here P-05-1 to P-05-15 (listed under "Proposed decisions" below), for the lead to log
Owns /v1/auth/*; /v1/me, /v1/me/avatar, /v1/me/devices*, /v1/me/providers*; /v1/bots*; GET /v1/users/{local}/profile and its avatar; the access-token, refresh-token, sign-up-token and bot-token rules; the DeviceRecord, Account, ProviderLink and Bot objects; the account incarnation (inc) and its assignment; the trigger of W4d, the new-sign-in notice; account states; the device-revocation orchestration; the fresh-authentication rule and its error code, for every document; the account.deleted, account.suspended and account.profile_changed S2S payloads; every event type and error code in the auth, account, device and bot areas

Conformance preamble

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals, as shown here.

This document follows the cross-cutting conventions of 00 §7 (I-JSON bodies, lowerCamelCase members, RFC 9457 problem details with userAction, base64url without padding, RFC 3339 timestamps with milliseconds, UUIDv7 object IDs). The deliberate exceptions are the OAuth wire format of /v1/auth/par, /v1/auth/authorize and /v1/auth/token, which keeps the RFC 6749, RFC 7636 and RFC 9126 parameter names and accepts form-encoded bodies so that standard OAuth libraries work unchanged (§7.1, P-05-4); the form post of the server's own "Continue to …" page to /v1/auth/consent (§5.4); and the transaction cookie of the browser-facing /v1/auth/ pages (§6.4, P-05-3). 00 §7.2, §7.3 and 03 §2.9, §3.2 rule 2 record these exceptions.

Rationale notes start with "Rationale:" and are informative. Examples are informative unless the text says otherwise. Where an example and the normative text disagree, the normative text wins.

Requirements in this document apply to these conformance classes (00 §1.5):

Class Must implement from this document
Server Everything, in the home-server role. The hosting-server role implements the receiving side of §11.8 (account.suspended), §16.4 (account.deleted) and §17.4 (account.profile_changed), and §17 (profile lookup as a client of other servers).
Full client, Web client §5 to §14 and §17 as a client: the OAuth flow, sign-up, re-authentication, providers, account and device screens, sign-out.
Bot client §15 (bot tokens), §11 (/v1/me with a bot token), §12 as it applies to bot devices.
Push gateway Nothing.

Proposed decisions (summary)

The numbered sections below contain these "Proposed decision:" blocks (00 §1.7 rule 5). They are listed here so the lead can log them.

ID Proposed decision Section
P-05-1 An external identity is keyed by (provider ID, issuer, subject). E-mail addresses are never used to find or match accounts. §4.4
P-05-2 Clients identify themselves with a Client ID Metadata Document URL, or with the reserved loopback client ID for native apps. No pre-registration. §5.1
P-05-3 The home server binds each authorization transaction to the browser with a short-lived, path-scoped transaction cookie. It is never used for API authentication. Adopted in the revised D-026. §6.4
P-05-4 The OAuth endpoints use the RFC 6749 wire format (form or JSON requests, snake_case members), with problem details that also carry the OAuth error member. Adopted as D-079. §7.1
P-05-5 An unknown external identity always gets a successful code exchange that returns a sign-up token; the account is created by POST /v1/auth/signup. §8
P-05-6 One home session is one device record. Signing out revokes the device. §12.1
P-05-7 Refresh tokens rotate on every use. Reuse of a rotated token outside a 30 s retry window revokes the device, and a successor invalidated by a retry counts as rotated. §7.6
P-05-8 Sensitive operations, in every document, need a pass through the provider leg no older than a stated limit (10 minutes unless the owning document states another), and fail with the one code auth.reauth_required. §9
P-05-9 Each bot token is exactly one device record of the bot. Only a local account holding manage_bots can create a bot, and that account owns it. §15
P-05-10 Accounts have a fourth state, suspended, set by the server operator or by a server-scope ban of the account (10 §9.3). §11.2
P-05-11 Community membership by default (D-068) applies to kind: user accounts only; bots join communities when added. §8.7
P-05-12 A one-tap "Continue to …" page is shown before a code is issued, unless the client's identity is assured (a trusted client with a claimed HTTPS redirect) or the user just interacted with the provider. Loopback and private-use-scheme clients can never skip it silently (RFC 8252 §8.6). §5.4
P-05-13 Device records expire after 365 days of inactivity (90 days for web, 12 h for shared computers). These limits are longer than MLS eviction (D-059), so evicted devices still rejoin silently. §12.5
P-05-14 Home servers send an account.profile_changed S2S event to the account's audiences when a public profile changes. §17.4
P-05-15 Suspending an account sends an account.suspended S2S event, so remote servers end its sessions within 60 s; bots are suspended with their owner. §11.8

1. Scope

This document specifies how people and bots get and keep access to their home server:

  • the home server as an OpenID Connect relying party to the providers its admin configures (D-016);
  • the home server's own OAuth 2.0 authorization server for Sloppy Voice clients: /v1/auth/par, /v1/auth/authorize, /v1/auth/callback, /v1/auth/consent, /v1/auth/token, /v1/auth/signup, /v1/auth/logout;
  • sign-up, including the address choice (M2) and the registration policy;
  • linking and unlinking login providers;
  • access, refresh and sign-up tokens;
  • device records, shared-computer mode, device limits and the new-sign-in notice W4d (§12.12, D-084);
  • the orchestration of device revocation (D-017);
  • the Account object, including the account incarnation (D-086), account states, and where the account security state is shown;
  • bot accounts and bot tokens (D-061);
  • account deletion, which is immediate with no grace period (D-091), and the account.deleted S2S event;
  • /v1/me and the public profile GET /v1/users/{local}/profile.

It does not cover: identity keys, certificates, IdentityState or DeviceRevocation (07); the encryption upgrade ceremony, pairing, KeyBackup or the AccountVault (08); remote sessions, HomeAssertions and S2S delivery (06); community membership (09); permissions (10); push registrations (19); or the exact wording of screens (20). Where this document triggers one of those mechanisms, it names the owner and the trigger only.

2. Terminology

This document uses the terms of 00 §2 exactly. It adds these:

Term Definition
Provider One login provider configured by the home server's admin: an OIDC issuer, or a provider with protocol: github (§4.1). Identified by a provider ID. A provider is an "OIDC provider" in the sense of 00 §2.2.
External identity One user at one provider, keyed by (provider ID, issuer, subject) (§4.4).
ProviderLink The home server's record that an external identity may sign in to one account (§10).
Client In this document, a Sloppy Voice application acting as an OAuth 2.0 public client of the home server (RFC 6749 §2.1).
Authorization transaction The home server's server-side state for one pass through /v1/auth/authorize (§6.2).
Session A home session (00 §2.3). Under P-05-6 it is identified with exactly one device record.
Token family All access and refresh tokens issued to one session. Revoking the device revokes the family.
Access token Opaque bearer token for the home server's API, valid 15 minutes (§7.5).
Refresh token Opaque, rotating token that obtains new access tokens for one session (§7.6).
Sign-up token Opaque bearer token, valid 15 minutes, that only allows sign-up (§8.2).
Bot token Opaque long-lived credential of one bot device, sent as Authorization: Bot <token> (§15.4).
Fresh authentication A pass through the provider leg, bound to the current session, that is no older than the operation's limit: 10 minutes unless the owning document states another (§9).
authAt The time at which the provider leg (§6.5) that created the session, or the latest re-authentication of it, completed.
Incarnation (inc) An account's immutable random value, assigned when the account is created and never reused (§11.1, D-086). Other servers key their records about the account on (address, inc).
New sign-in The creation of a device record by a login (§7.3, intent login). It raises W4d on the account's other devices (§12.12, D-084). Sign-up, bot-token creation, re-authentication and provider linking aren't new sign-ins.
Trusted client A client ID the home server's admin lists as trusted, plus the server's own web client (§5.4).
Audience As in 06 §11.1: the servers that received a HomeAssertion for an account in the last 30 days, plus the hosting servers in its DM index, plus the servers on its community list (09).

3. Architecture of sign-in

3.1 Two OAuth legs

Sign-in has two independent OAuth legs:

 +---------+  (A) OAuth 2.0 code + PKCE   +--------------+  (B) OIDC code + PKCE    +-----------+
 | Client  |----------------------------->| Home server  |-------------------------->| Provider  |
 | (public |   /v1/auth/par, /authorize,  | AS for its   |   state, nonce, iss check | (Google,  |
 |  client)|<-----------------------------| clients; RP  |<--------------------------| GitHub…)  |
 +---------+   code -> /v1/auth/token     | to providers |   code -> provider token  +-----------+
                                          +--------------+
  • Leg A is between the client and the home server. The home server is the authorization server. Clients are public clients (they hold no secret). Leg A uses the authorization code grant with PKCE S256 (RFC 7636), follows RFC 8252 for native apps and RFC 9700 throughout, and issues Sloppy Voice tokens.
  • Leg B is between the home server and the provider. The home server is a confidential OIDC relying party (OpenID Connect Core 1.0). It uses the authorization code flow with PKCE, state and nonce, and never issues the provider's tokens to the client.

The client never sees the provider's tokens, and the provider never sees Sloppy Voice tokens. The provider's e-mail address and the Sloppy Voice address are unrelated (D-016).

Rationale: two legs let one client implementation work with any provider the admin configures, keep provider client secrets on the server, and keep the provider list a server-side choice. The client only ever speaks to its own home server.

3.2 Endpoint summary

All paths are relative to the home server's base URL (02). CORS is open on every /v1/ endpoint (00 §7.3); the HTML pages are top-level navigations and don't use CORS.

Method and path Auth Purpose Section
POST /v1/auth/par None, or Bearer for intent=reauth Pushed authorization request (RFC 9126) §6.1
GET /v1/auth/authorize None (browser) Start leg A; redirect to the provider §6.2
GET /v1/auth/callback Transaction cookie (browser) Provider redirect target for leg B §6.5
POST /v1/auth/consent Transaction cookie and consent token tx (browser form) Answer the "Continue to …" page §5.4
POST /v1/auth/token None (public client) Code and refresh-token exchange §7
POST /v1/auth/signup Bearer sign-up token Create the account §8
POST /v1/auth/logout Bearer or Bot Sign out (revoke this device, or all others) §14
GET, PATCH /v1/me; DELETE /v1/me?confirm=… Bearer or Bot Own account; deletion §11, §16
PUT, DELETE /v1/me/avatar Bearer or Bot Own avatar §11.7
GET /v1/me/devices, GET, PATCH, DELETE /v1/me/devices/{did}, POST /v1/me/devices/{did}/revoke Bearer or Bot Device records §12
GET, POST /v1/me/providers, DELETE /v1/me/providers/{linkId} Bearer Linked providers §10
/v1/bots… Bearer Bot accounts and bot tokens §15
GET /v1/users/{local}/profile, GET /v1/users/{local}/profile/avatar None Public profile §17

Every /v1/me* and /v1/bots* endpoint in this document accepts only home-session access tokens and bot tokens of accounts homed on this server. A remote-session token (06) is refused with 403 auth.home_session_required.

3.3 What the client learns from ServerMetadata

The client reads the provider list and registration policy from the auth member of ServerMetadata, and the terms link from its links member. 02 owns both members and their syntax (02 §7.3.2, §7.3.4); this document gives their semantics. It relies on these members:

Member Type Meaning here
auth.providers array The enabled providers, in the order the admin chose. Each entry has id (provider ID, §4.1), name (button label, for example "Google"), type and optionally icon. type is cosmetic: 02's values google, github, microsoft, apple or oidc, used only to style a familiar button; it says nothing about the protocol the home server uses with the provider (§4.1).
auth.providers[].signup boolean, optional Whether this provider may create new accounts (§8.3). Absent means true.
auth.registration string open, invite or closed (§8.3). Clients treat an unknown value as closed.
links.terms string, optional HTTPS URL of terms of service. When it is present, sign-up requires accepting them (§8.4).
{
  "auth": {
    "providers": [
      { "id": "google", "name": "Google", "type": "google" },
      { "id": "github", "name": "GitHub", "type": "github" },
      { "id": "corp_sso", "name": "Example Corp", "type": "oidc", "signup": false,
        "icon": "https://chat.sloppyvoice.com/server/static/corp.png" }
    ],
    "registration": "open"
  },
  "links": { "terms": "https://sloppyvoice.com/terms" }
}

The server's answer at sign-up (auth.registration_closed with data.reason: "provider", §7.3) is authoritative.

The issuer identifier of the home server's authorization server (leg A) is its base URL exactly, for example https://chat.sloppyvoice.com/server.

4. Login providers (leg B)

4.1 Provider configuration

People sign in to their home server only through the providers its admin configures (D-016). A server MUST NOT offer password login and MUST NOT store passwords or password hashes for accounts. Bots use bot tokens (§15).

The admin configures each provider. Configuration is local to the server; only the members listed in §3.3 (id, name, type, icon, signup) are published. Each provider has:

Setting Required Meaning
id Yes Provider ID, unique on the server and never reused for a different issuer. ABNF provider-id below (02's syntax).
protocol Yes Private, never published. oidc (any OpenID Connect issuer, including Google and Microsoft) or github (GitHub's OAuth 2.0 profile, §4.6). It selects how the server runs leg B.
type Yes Published, cosmetic button style: google, github, microsoft, apple or oidc (02). Independent of protocol.
icon No Published button icon (02).
name Yes Button label, 1–64 code points (02).
issuer For oidc The issuer identifier. The server uses OIDC Discovery ({issuer}/.well-known/openid-configuration).
issuerTemplate No For multi-tenant issuers only, for example https://login.microsoftonline.com/{tenantid}/v2.0. See §4.3.
clientId, client credential Yes The home server's registration at the provider. The credential is a client secret or a private_key_jwt key.
redirectUri Fixed Always {base}/v1/auth/callback. The admin registers this exact URL at the provider.
scopes No Default openid profile. email MAY be added only to build a ProviderLink label (§10.1).
signup No Default true. If false, this provider can sign in to existing accounts and be linked, but can't create accounts.
enabled No Default true. A disabled provider is not published and can't be used to sign in. Its links are kept.
provider-id = 1*32( %x61-7A / DIGIT / "-" / "_" )   ; lowercase a-z, digits, hyphen, underscore (02)

An admin SHOULD NOT disable a provider while some account has no link to any other enabled provider. A server MUST show the admin how many accounts would be left unable to sign in before disabling one.

4.2 The upstream request

When the home server sends the browser to a provider (§6.3), it MUST:

  1. use response_type=code only (never implicit or hybrid flows) and the default query response mode;
  2. generate a fresh upstream state (32 random bytes, base64url-encoded, 43 characters), a fresh nonce of at least 128 random bits, and a fresh PKCE verifier with method S256, and send state, nonce and code_challenge to the provider even when the provider doesn't require PKCE;
  3. send redirect_uri={base}/v1/auth/callback exactly;
  4. map the transaction's intent to the provider's prompt (§6.3);
  5. never send the user's Sloppy Voice address or any client parameter to the provider.

4.3 Validating the provider's response (protocol oidc)

On the callback (§6.5) the home server MUST:

  1. find the authorization transaction by the upstream state and check the transaction cookie (§6.4);
  2. if the provider's metadata sets authorization_response_iss_parameter_supported, require the iss query parameter to equal the expected issuer (RFC 9207);
  3. redeem the code at the provider's token endpoint with the PKCE verifier and the client credential;
  4. validate the ID token as OpenID Connect Core §3.1.3.7 requires: signature with a key from the provider's jwks_uri (refetched at most once per 5 minutes when an unknown kid appears); alg from the allow-list RS256, PS256, ES256, EdDSA (never none or an HMAC algorithm); iss; aud contains clientId; azp equals clientId when present; exp and iat with ±60 s skew; and nonce equal to the transaction's nonce;
  5. for a multi-tenant provider with issuerTemplate, require iss to equal the template with {tenantid} replaced by the token's tid claim, and use that exact iss in the external identity key;
  6. discard the provider's access and refresh tokens once the ID token is validated, unless a claim fetch from the UserInfo endpoint is configured, in which case the server discards them right after that fetch.

4.4 External identity

Proposed decision (P-05-1): an external identity is keyed by the triple (provider ID, iss, sub). E-mail addresses, names and usernames are never used to find, match or merge accounts. Rationale: sub is the only claim OIDC guarantees stable and unique per issuer; matching on e-mail lets anyone who controls a provider account with that e-mail take over the account.

  • The server MUST store the key exactly as received (case-sensitive, at most 255 bytes for sub).
  • One external identity belongs to at most one account.
  • If an admin changes a provider's clientId, some providers (for example Microsoft, whose sub is pairwise per application) issue different subjects. The admin documentation SHOULD warn that this orphans existing links.

4.5 Claims used

The server uses provider claims for exactly two things, never for authorization:

Use Claims, in order of preference
Pre-filling the sign-up name (§8.5) name; then given_name alone; then preferred_username (or GitHub login).
ProviderLink label (§10.1) email (if the email scope was configured); else preferred_username; else name.

The server MUST NOT derive an address suggestion from an e-mail address (D-016).

4.6 Provider protocol github

GitHub OAuth apps don't issue ID tokens. For protocol: github:

  • the authorization endpoint is https://github.com/login/oauth/authorize and the token endpoint https://github.com/login/oauth/access_token; the server sends state and PKCE as in §4.2 (it omits nonce, which GitHub doesn't support);
  • after redeeming the code, the server calls GET https://api.github.com/user with the access token;
  • the external identity key is (provider ID, https://github.com, the decimal string of the user's numeric id); the login is a label only, because GitHub lets users rename;
  • prompt=login isn't available, so a re-authentication through GitHub may be answered from GitHub's own session (§9.3).

5. Clients of the home server (leg A)

5.1 Client identification

Any Sloppy Voice application can sign in to any home server, so clients can't be pre-registered.

Proposed decision (P-05-2): a client's client_id is either an HTTPS URL that serves a Client ID Metadata Document, or the reserved value urn:sloppyv:client:loopback. Rationale: a URL client ID gives every server the redirect URIs and display name it needs to validate a client without any registration step, which is what a federated system requires.

client-id       = metadata-url / loopback-client
metadata-url    = "https://" authority path-abempty   ; RFC 3986; no query, no fragment, no userinfo
loopback-client = "urn:sloppyv:client:loopback"

Client ID Metadata Document. GET <client_id> with Accept: application/json returns a JSON object:

Member Type Required Meaning
client_id string Yes MUST equal the URL it was fetched from, exactly.
client_name string Yes 1–64 characters, shown on the "Continue to …" page (§5.4).
redirect_uris array of strings Yes 1–10 redirect URIs (§5.2).
client_uri string No HTTPS home page of the application.
logo_uri string No HTTPS logo; servers MAY ignore it.

When it fetches a metadata document, the home server MUST: use HTTPS with certificate validation; refuse redirects; refuse a URL whose host resolves to a loopback, link-local, private-use or otherwise non-public address (SSRF defence); time out after 5 s; refuse a body over 16 KiB; and cache the document for the HTTP cache lifetime, clamped to between 5 minutes and 24 hours. A fetch failure fails the request with auth.invalid_client.

Loopback client. urn:sloppyv:client:loopback needs no document. It may only use loopback redirect URIs (§5.2). Desktop applications SHOULD use it.

5.2 Redirect URIs

A redirect URI is accepted only if it matches an entry of the client's redirect_uris exactly (simple string comparison), with one exception: for loopback redirect URIs the port is ignored (RFC 8252 §7.3). Allowed forms:

Form Example Who uses it Rules
Loopback http://127.0.0.1:53682/callback, http://[::1]:53682/callback Desktop apps Literal IP only; localhost MUST NOT be accepted (RFC 8252 §8.3). Any port.
Claimed HTTPS https://app.example.org/oauth/callback Web clients; mobile apps with universal links or app links MUST have the same origin as the client_id URL.
Private-use scheme org.example.sloppy:/oauth Mobile and desktop apps The scheme MUST contain a period (reverse domain name, RFC 8252 §7.1) and MUST NOT be sloppyv (01), http, https, javascript, data, file or about.

Redirect URIs MUST NOT contain a fragment. Native apps MUST use the system browser or a platform authentication session (ASWebAuthenticationSession, Android Custom Tabs), never an embedded web view (RFC 8252 §8.12).

5.3 Client software string

Clients send a client software string (client_software at the token endpoint, §7.3) such as sloppyvoice-desktop/1.0.3. It is 1–64 printable ASCII characters, matches token "/" token loosely, is shown in the device list, and is never used for authorization.

5.4 Trusted clients and the "Continue to …" page

A website can send a visitor's browser to /v1/auth/authorize with its own client ID. If the visitor is already signed in at the provider and has consented before, the provider may answer without showing anything, and the website would receive tokens for the visitor's account without the visitor doing anything. The same holds for a malicious app on the user's phone or computer: a loopback redirect or a private-use URI scheme doesn't prove which app receives the code, because any app can listen on 127.0.0.1 or claim a scheme (RFC 8252 §8.6), and PKCE doesn't help when the attacker started the flow.

Proposed decision (P-05-12): before the home server issues a code, it shows one page, "Continue to client_name (host) as saxonjones@sloppyvoice.com?", with Continue and Cancel, unless one of the skip conditions below holds. Rationale: the page closes silent token theft by arbitrary websites and local apps at the cost of one tap. RFC 8252 §8.6 says an authorization server shouldn't process a request automatically when it can't be sure of the client's identity.

The server MAY skip the page only when:

  1. the client is trusted (a client ID in the admin's trusted list, or the web client the server itself serves) and the redirect URI is a claimed HTTPS URI with the same origin as the client_id URL, so the operating system or the browser's origin rules guarantee which app receives the code; or
  2. the provider leg of this transaction was interactive: the ID token's auth_time is no earlier than the transaction start minus 60 s, so the user has just entered a credential at the provider for this transaction; or
  3. the account has a remembered Continue for this client ID (below).

In every other case the server MUST show the page. In particular, the loopback client (urn:sloppyv:client:loopback) and every client using a private-use-scheme redirect see it whenever the provider answered from an existing single-sign-on session.

  • Host shown. The page names the redirect URI's host. When the redirect URI has no host (a private-use scheme), it names the client_id URL's host. For the loopback client, which has no metadata document, it says "an app on this computer" instead of a client name and host.
  • Remembering. The server MAY remember a Continue per (account, client ID) for at most 90 days, and only for metadata-document clients whose redirect URI was a claimed HTTPS URI. It MUST NOT remember a Continue for the loopback client ID or for any private-use-scheme redirect. It MUST forget remembered choices when the account is deleted.
  • Sign-up. For an unknown external identity the page names no address; it says "Continue to client_name (host) to create an account?".
  • Moment. The page is part of moment M1 (00 §4.12.4); it is not a security warning. The server renders it in the user's language (from ui_locales or Accept-Language). Document 20 owns the intent of the copy (20 §9.2, M1.continue).

The consent form. The page is shown after the provider leg (so the account is known) and before the code is issued. When it renders the page, the server generates a consent token tx: 32 random bytes, base64url without padding (43 characters). It stores SHA-256(tx) in the transaction and embeds tx only in this page's form. The form is:

POST {base}/v1/auth/consent
Content-Type: application/x-www-form-urlencoded

tx=<43 characters>&decision=continue        (or decision=cancel)

The server MUST:

  1. reject the request if an Origin header is present and isn't the server's own origin (scheme, host and port of the base URL), or if a Sec-Fetch-Site header is present with a value other than same-origin;
  2. find the transaction by the transaction cookie (§6.4), require it to be in state consent, and require SHA-256(tx) to equal the stored hash;
  3. treat tx as single use: the first request with it, valid or not for the decision, ends its usability;
  4. on any failure of 1 to 3, show the auth.transaction_expired page (§6.5 step 1) and end the transaction, without redirecting;
  5. on decision=continue, issue the code and answer 302 to the redirect URI as in §6.6;
  6. on decision=cancel, answer 302 to the redirect URI with error=access_denied and sv_code=auth.access_denied (§6.6).

Rationale: SameSite=Lax alone doesn't stop a cross-origin POST from a page on the same site, such as another server on the same host (00 §3.4: /server and /server2) or a sibling subdomain. The unguessable, single-use tx and the Origin check do.

6. The authorization flow

6.1 Pushed authorization request: POST /v1/auth/par

Clients MAY push their authorization parameters first (RFC 9126). They MUST do so for intent=reauth, because only a pushed request can carry the session's access token. Linking uses POST /v1/me/providers (§10.3), which creates a pushed request internally.

Request: Content-Type: application/x-www-form-urlencoded or application/json, with the parameters of §6.2 (except request_uri) plus:

Parameter Required Meaning
intent No login (default) or reauth. reauth requires Authorization: Bearer <access token>; the request is then bound to that session's device.

Response 201 Created, Cache-Control: no-store:

{ "request_uri": "urn:ietf:params:oauth:request_uri:mQ3rV0bW1yNc8sK2pT5uXg", "expires_in": 60 }

The request_uri is single-use and valid for 60 s. Errors are problem details (§7.8).

6.2 GET /v1/auth/authorize

The client opens this URL in the system browser (native) or by top-level navigation (web). It carries either client_id and request_uri only, or the full parameter set:

Parameter Required Meaning
client_id Yes §5.1.
request_uri Alternative From §6.1. When present, the server uses only the pushed parameters and ignores every other parameter except client_id, which MUST equal the pushed client_id (RFC 9126 §4). OAuth libraries often repeat response_type or scope here; that is harmless.
response_type Yes code.
redirect_uri Yes §5.2.
code_challenge Yes BASE64URL(SHA-256(code_verifier)), 43 characters (RFC 7636 §4.2).
code_challenge_method Yes S256. plain MUST be refused.
state Yes Opaque to the server, 1–512 characters. Clients MUST generate at least 128 random bits for it and check it on return.
provider No A provider ID from auth.providers. If absent, the server shows its own provider chooser page.
prompt No select_account only (for "Use a different account"). Any other value fails with invalid_request.
ui_locales No BCP 47 language tags for the server's pages.

intent=reauth can't appear in a plain (non-pushed) request; such a request is treated as login. Unrecognized parameters (for example scope or nonce, which some libraries add) are ignored at /v1/auth/authorize, /v1/auth/par and /v1/auth/token (RFC 6749 §3.1).

The code verifier is 43–128 characters from [A-Za-z0-9-._~] (RFC 7636 §4.1). Clients MUST generate it from at least 256 random bits and MUST NOT reuse it.

Validation order. The server validates client_id and redirect_uri first. If either is invalid, it MUST NOT redirect; it shows an error page (auth.invalid_client or auth.invalid_redirect_uri) instead. Every later error is returned to the redirect URI (§6.6).

If valid, the server creates an authorization transaction and continues at §6.3.

6.3 The transaction and the redirect to the provider

The authorization transaction holds: the client parameters; the intent; for reauth and link, the bound account and device ID; the provider; the upstream state, nonce and PKCE verifier; the transaction cookie's binding secret (as a SHA-256 hash); the start time; and the state of §6.7.

The server then sets the transaction cookie (§6.4) and redirects (302) to the provider with the upstream parameters of §4.2 and this prompt mapping:

Intent Upstream prompt and max_age
login The client's prompt=select_account if given; nothing otherwise.
reauth prompt=login, max_age=0.
link prompt=select_account.

6.4 The transaction cookie

Proposed decision (P-05-3, adopted in the revised D-026): the home server binds each authorization transaction to the browser that started it with a cookie. Rationale: without it, an attacker could start a transaction for their own web client, send the victim the provider URL, and receive a code for the victim's account (login CSRF and session fixation, RFC 9700 §4.7). The cookie is the standard defence, and it lives only on the browser-facing /v1/auth/ pages; API authentication stays bearer-only (00 §7.3).

The transaction cookie is a browser-binding value, not an API credential. It authorizes no API request and identifies no account; it only ties the provider's redirect, and the consent form, to the browser that started the transaction. 00 §7.3 and 03 §3.2 rule 2 carry this exception.

tx-cookie-name  = "__Secure-svtx-" 12b64u-char   ; first 12 characters of the upstream state
tx-cookie-value = 43b64u-char                    ; 32 random bytes
b64u-char       = ALPHA / DIGIT / "-" / "_"

Attributes: Secure, HttpOnly, SameSite=Lax, Path={base path}/v1/auth/ (for example /server/v1/auth/), Max-Age=600, no Domain. The server stores only the SHA-256 of the value. It deletes the cookie (Max-Age=0) when the transaction ends.

SameSite=Lax sends the cookie on the provider's top-level GET redirect to /v1/auth/callback and blocks it on cross-site POSTs to /v1/auth/consent. It doesn't block same-site POSTs; the consent token tx and the Origin check of §5.4 cover those. Each transaction has its own cookie name, so concurrent sign-ins in one browser don't collide, and several servers on one host (00 §3.4) don't collide because each has its own path.

The cookie is read only at /v1/auth/callback and /v1/auth/consent. Every other endpoint MUST ignore it, and no endpoint accepts it as authorization for an API request.

6.5 GET /v1/auth/callback

The provider redirects here with code and state (or error). The server:

  1. finds the transaction by upstream state; if none, or if it has expired (10 minutes after start), it shows an error page (auth.transaction_expired) that tells the user to go back to the app and try again. It MUST NOT redirect to any redirect URI, because without a transaction it can't know a validated one;
  2. requires the transaction cookie to be present and to hash to the stored value; otherwise it shows the same error page and ends the transaction (it MUST NOT redirect a code);
  3. if the provider returned error=access_denied, ends the transaction with auth.access_denied; any other provider error ends it with auth.provider_error;
  4. validates the provider's response (§4.3 or §4.6), obtains the external identity, and records the current time as the transaction's authAt (the completion of the provider leg);
  5. resolves the intent:
    • login: if the external identity has a ProviderLink, the transaction's account is that link's account. Otherwise the transaction is marked sign-up pending (§8);
    • reauth: the external identity MUST be linked to the bound account, else the transaction ends with auth.reauth_mismatch. If the ID token has auth_time, it MUST be no earlier than the transaction start minus 60 s, else auth.reauth_required;
    • link: nothing is linked yet; the link is created at code redemption (§7.3), so that only the client holding the PKCE verifier completes it;
  6. shows the "Continue to …" page if §5.4 requires it;
  7. issues the authorization code and redirects (§6.6).

All HTML pages under /v1/auth/ MUST be served with Cache-Control: no-store, Referrer-Policy: no-referrer, X-Content-Type-Options: nosniff and Content-Security-Policy: frame-ancestors 'none'.

6.6 Returning to the client

Success: 302 to redirect_uri with code, the client's state, and iss (the home server's base URL, RFC 9207):

HTTP/1.1 302 Found
Location: http://127.0.0.1:53682/callback?code=svc_mQ3rV0bW1yNc8sK2pT5uXgk9Lr4Xh2Vd6aZcEoPwT1Q&state=Yv8n2kQe7Tq0pL1sWc9fZg&iss=https%3A%2F%2Fchat.sloppyvoice.com%2Fserver

Failure: 302 to redirect_uri with error (an RFC 6749 §4.1.2.1 code), error_description, the client's state, iss, and sv_code (this document's error code):

Location: org.example.sloppy:/oauth?error=access_denied&error_description=Cancelled&state=Yv8n2kQe7Tq0pL1sWc9fZg&iss=https%3A%2F%2Fchat.sloppyvoice.com%2Fserver&sv_code=auth.access_denied

The client MUST check that state equals the value it sent and that iss equals the base URL it started with, and MUST discard the response otherwise.

The authorization code:

  • has the form svc_ followed by 43 base64url characters (§7.4);
  • is single-use and valid for 60 s;
  • is bound to the client ID, redirect URI, code challenge, intent, external identity, and for reauth and link the bound device.

If a code is presented twice, the server MUST refuse the second attempt with auth.invalid_grant and revoke everything issued from the first redemption (RFC 6749 §4.1.2):

Intent of the code What is revoked
login, linked identity The device created by the first redemption (§13, reason code_reuse).
login, sign-up pending The sign-up token. If an account was already created from it, the device created by that sign-up (§13, reason code_reuse); the account itself stays.
reauth The access token issued by the first redemption. The session's authAt goes back to its value before that redemption.
link The access token issued by the first redemption, and the ProviderLink it created, if any (with auth.provider_unlinked).

6.7 Transaction state machine

State Event Action Next state
— Valid GET /authorize Create transaction, set cookie, redirect to provider at_provider
at_provider Valid callback Validate, resolve intent consent if §5.4 applies, else code_issued
at_provider Provider error, cookie mismatch, validation failure Error page or error redirect ended
consent decision=continue Issue code code_issued
consent decision=cancel Error redirect access_denied ended
consent Invalid tx, Origin or Sec-Fetch-Site (§5.4) Error page ended
code_issued Valid redemption at /token within 60 s Issue tokens (§7.3) redeemed
code_issued 60 s pass Discard code ended
redeemed Second redemption Refuse; revoke what was issued (§6.6) ended
any 10 minutes since start Discard ended

The server MUST keep at most 20 open transactions per bound account and at most 200 per client IP address (an IPv4 address, or an IPv6 /64). A new transaction over either cap is refused with core.rate_limited (shown as a page, since nothing is validated enough to redirect). The server MUST NOT end an existing transaction to make room, so one person behind a shared address can't cancel everyone else's sign-ins.

6.8 Platform notes

Client How it runs the flow
Desktop app client_id urn:sloppyv:client:loopback. Listens on 127.0.0.1 (or [::1]) on an ephemeral port, only for the duration of the flow, and opens /v1/auth/authorize in the user's default browser. When the provider answers from an existing session, the user taps Continue on the server's page (§5.4). After receiving the redirect it shows a page "You can close this tab and return to Sloppy Voice".
Mobile app A metadata-document client_id with a claimed HTTPS redirect (universal link or app link), or a private-use scheme. Uses ASWebAuthenticationSession (iOS) or Custom Tabs (Android). The session MAY be ephemeral; the transaction cookie only needs to last for one flow.
Web client A metadata-document client_id on the web client's origin, with an HTTPS redirect URI on that origin. Before navigating to /v1/auth/authorize (top-level navigation, or a popup), it stores state and the code verifier in sessionStorage; on return it checks state and iss, removes both values, and redeems the code with a cross-origin fetch to /v1/auth/token (open CORS, 00 §7.3). It MUST NOT use the implicit flow or put tokens in URLs.
Bot Doesn't use this flow (§15).

Rationale: these are the RFC 8252 and RFC 9700 patterns that work with every major provider, which block embedded web views.

7. Tokens and the token endpoint

7.1 Wire format of the OAuth endpoints

Proposed decision (P-05-4, adopted as D-079): POST /v1/auth/par and POST /v1/auth/token accept application/x-www-form-urlencoded (RFC 6749) and application/json request bodies with the same snake_case parameter names. Their success responses use the RFC 6749 member names (access_token, token_type, expires_in, refresh_token); extension members use lowerCamelCase (00 §7.5). Errors are RFC 9457 problem details (00 §7.9) that also carry the RFC 6749 error and error_description members. Rationale: standard OAuth libraries (for example AppAuth) then work unchanged, while Sloppy Voice clients still get one error renderer.

Every response from these endpoints carries Cache-Control: no-store.

7.2 Grants

POST /v1/auth/token supports exactly two grant types: authorization_code and refresh_token. Any other grant_type fails with auth.unsupported_grant_type. Clients are public: they send client_id and no client secret.

7.3 Authorization code grant

Request parameters:

Parameter Required Meaning
grant_type Yes authorization_code
code Yes From §6.6.
redirect_uri Yes Exactly the value used at /authorize.
client_id Yes Exactly the value used at /authorize.
code_verifier Yes PKCE verifier (RFC 7636 §4.5).
platform For a login that creates a device desktop, web, ios or android (§12.2). bot is refused with core.invalid_request.
client_software For a login that creates a device §5.3.
device_name No Suggested device name, 1–64 characters, for example "Chrome · Windows".
shared_computer No Default false. In a form body, the literal true or false; in a JSON body, a JSON boolean. Allowed only with platform web or desktop (§12.6).
POST /server/v1/auth/token HTTP/1.1
Host: chat.sloppyvoice.com
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&code=svc_mQ3rV0bW1yNc8sK2pT5uXgk9Lr4Xh2Vd6aZcEoPwT1Q
&redirect_uri=http%3A%2F%2F127.0.0.1%3A53682%2Fcallback&client_id=urn%3Asloppyv%3Aclient%3Aloopback
&code_verifier=AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8&platform=desktop
&client_software=sloppyvoice-desktop%2F1.0.3&device_name=Saxon%27s%20laptop

The server first validates the syntax of platform, client_software, device_name and shared_computer (presence where required, allowed values, lengths). A failure there is core.invalid_request and does not consume the code, so a client can correct the request and retry within the code's 60 s. The server then checks the code (unexpired, unused, issued to this client_id and redirect_uri) and that BASE64URL(SHA-256(code_verifier)) equals the stored challenge. Any failure is auth.invalid_grant. A code that passes these checks is consumed. The server then acts on the transaction's intent:

login, external identity linked.

  1. If the account is suspended (§11.2), or its owner is suspended for a bot, fail with account.suspended.
  2. Enforce the device limit (§12.7).
  3. In one transaction: create the device record (§12); create the token family, issued to this client_id; set the session's authAt to the transaction's authAt (the callback time, §6.5 step 4); set the link's lastUsedAt.
  4. In the same transaction as step 3, sequence device.added with via: "login" on the account's me stream (§18), so that it reaches the account's other devices even if the server stops right after the commit; their clients raise W4d (§12.12, D-084).
  5. Return the full token response:
{
  "access_token": "sva_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8",
  "token_type": "Bearer",
  "expires_in": 900,
  "refresh_token": "svr_ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj8",
  "authAt": "2026-12-04T10:15:30.123Z",
  "account": {
    "address": "saxonjones@sloppyvoice.com",
    "name": "Saxon Jones",
    "kind": "user",
    "inc": "4OHi4-Tl5ufo6err7O3u7w",
    "state": "active",
    "security": "secure",
    "igen": 1,
    "about": "",
    "avatar": null,
    "profileVersion": 4,
    "createdAt": "2026-11-02T09:01:12.000Z"
  },
  "device": {
    "did": "oKGio6SlpqeoqaqrrK2urw",
    "name": "Saxon's laptop",
    "platform": "desktop",
    "clientSoftware": "sloppyvoice-desktop/1.0.3",
    "state": "active",
    "enrolled": false,
    "sharedComputer": false,
    "provider": "google",
    "authAt": "2026-12-04T10:15:30.123Z",
    "createdAt": "2026-12-04T10:15:30.500Z",
    "lastSeenAt": "2026-12-04T10:15:30.500Z",
    "expiresAt": "2027-12-04T10:15:30.500Z",
    "current": true
  }
}

login, sign-up pending. If auth.registration is closed, or the provider has signup: false, fail with auth.registration_closed, with data.reason (server or provider), data.provider and, when available, data.providerLabel (§10.1). The usual cause is a person who picked the wrong provider account, so the client shows "No account uses this provider account (label). Use a different sign-in?" with a button that restarts the login with prompt=select_account (copy in 20). Otherwise return a sign-up token (§8.2). No device is created.

reauth. Check that the bound device is still active and its account isn't suspended or deleted. Set the session's authAt to the transaction's authAt. Return a new access token without a refresh token; the session's current refresh token stays valid:

{ "access_token": "sva_…", "token_type": "Bearer", "expires_in": 900, "authAt": "2026-12-04T11:02:07.004Z" }

link. Check the bound device as for reauth. If the external identity is linked to a different account, fail with auth.provider_in_use. If it is already linked to this account, return the existing link. Otherwise create the ProviderLink (§10) and emit auth.provider_linked. Return a new access token without a refresh token, plus link (the ProviderLink object).

Rationale: reauth and link responses don't rotate the refresh token. A client that refreshed in parallel would otherwise present a rotated token and trip reuse detection (§7.6).

7.4 Token formats

Every Sloppy Voice credential issued by this document has this form:

sv-token     = token-prefix "_" 43b64u-char   ; 32 random bytes, base64url, no padding
token-prefix = "sva"   ; access token
             / "svr"   ; refresh token
             / "svs"   ; sign-up token
             / "svb"   ; bot token
             / "svc"   ; authorization code
  • The 32 bytes MUST come from a cryptographically secure generator (00 §7.15).
  • Clients MUST treat tokens as opaque apart from the prefix, which tells a client and the event WebSocket's session.hello (03) which kind of token it holds.
  • The server MUST store only SHA-256(token) (over the ASCII bytes of the whole string, prefix included) and look tokens up by that hash. It MUST NOT log tokens.
  • The fixed prefixes let secret scanners find leaked tokens. A server operator MAY register them with scanning services.
  • A response that carries a newly issued token is never stored for replay. POST /v1/auth/token, POST /v1/auth/signup, POST /v1/bots, POST /v1/bots/{local}/tokens and POST /v1/bots/{local}/tokens/{did}/rotate ignore Idempotency-Key (03 §14.2 item 8). After a lost response, the client recovers as §8.4 says (restart the login) or as §15.4 says (list the bot's tokens, revoke the unknown device, create a new token).

Rationale: 256 random bits make guessing impossible, so a plain SHA-256 is enough for storage; no password hashing is needed.

7.5 Access tokens

  • Lifetime 900 s (15 minutes) from issue. expires_in is 900.
  • Valid only at the issuing home server, for the /v1/ API and the event WebSocket. Remote servers never accept them; they use remote sessions (06).
  • Bound to exactly one device record. The server derives the account, did and session from the token, never from request parameters.
  • On every request the server checks that the token exists, hasn't expired, and that its device is active. An expired token fails with core.token_expired (03); the client refreshes and retries once. A token of a revoked device fails with auth.session_revoked, with data.reason set to the revocation reason (§12.3). An access token revoked on its own, while its device stays active (§7.6 rule 2a, §6.6), fails with core.unauthenticated, and the client refreshes as 03 §3.3 says.
  • Retention. The server keeps the token-hash → did mapping of every access, refresh and bot token of a revoked device for at least 30 days after the revocation (the window of ?include=revoked, §12.9), and answers auth.session_revoked for those tokens during that time. After it, the server MAY forget them and answer core.unauthenticated.
  • Revocation is effective immediately on the server node that handled the revocation, and on every node of the server within 5 s.

7.6 Refresh tokens

Request:

Parameter Required Meaning
grant_type Yes refresh_token
refresh_token Yes The current refresh token.
client_id Yes Must equal the client ID the family was issued to, else auth.invalid_grant.

Response: a new access token and a new refresh token, plus authAt:

{ "access_token": "sva_…", "token_type": "Bearer", "expires_in": 900, "refresh_token": "svr_…", "authAt": "2026-12-04T10:15:30.123Z" }

Proposed decision (P-05-7): refresh tokens rotate on every use, with reuse detection (RFC 9700 §4.14.2). The rules are:

  1. A successful refresh marks the presented token rotated and issues its successor. At most one valid (neither rotated nor invalidated) refresh token exists per family. A token's current successor is the most recent refresh token issued in exchange for it.
  2. Retry window. If a rotated token is presented again within 30 s of its rotation, and its current successor hasn't been used yet, the server treats this as a client retry after a lost response: it invalidates the current successor and issues a new pair, which becomes the current successor.
    • 2a. An invalidated refresh token counts as rotated from then on. Any later presentation of it is reuse under rule 3. The access token issued together with an invalidated refresh token is revoked at the same moment.
  3. Reuse. Any other presentation of a rotated token is reuse. The server MUST revoke the device (§13, reason token_reuse) and fail with auth.refresh_reused. The client signs in again.
  4. A refresh token stops working when its device is revoked or expires by inactivity (§12.5). There is no other absolute lifetime: the session lives as long as the device record.
  5. A refresh on a suspended account fails with account.suspended; the device isn't revoked.
  6. Each successful refresh counts as device activity (§12.5).

Rationale: insecure accounts hold no keys (D-021), so refresh tokens can't be sender-constrained with DPoP or mTLS without giving every account a key. Rotation with reuse detection is the RFC 9700 alternative for public clients. The 30 s window absorbs the common race of a lost response. Rule 2a stops it from being a way to steal the family silently: if a thief presents a copied token inside the window, the legitimate client's successor is invalidated, its access token stops working, and its next refresh is reuse, which revokes the device and ends both copies. A genuine client that lost the response never holds the invalidated token, so it never trips rule 2a. Rule 2 may apply several times within the window (for example two lost responses in a row); the window itself bounds it.

7.7 Token storage in clients

  • Native and mobile clients MUST keep refresh tokens in the platform's secure storage (Keychain, Android Keystore-backed storage, Windows Credential Manager or DPAPI, libsecret) and SHOULD keep access tokens in memory only.
  • Web clients MUST NOT put tokens in localStorage or cookies. They SHOULD keep the refresh token in IndexedDB, under the same non-extractable wrapping key they use for other secrets where the account is secure (08). In shared-computer mode, tokens MUST be kept in memory only (for example inside the dedicated Worker of 08), because browsers restore sessionStorage when a closed tab is reopened (§12.6).
  • Clients MUST serialize refresh requests per session across every process and tab that uses the session (one in flight at a time), so that rule 2 of §7.6 is rarely needed. Web clients with several tabs MUST coordinate through the Web Locks API, a shared Worker or an equivalent cross-tab lock; a race between two tabs can otherwise revoke the device (§7.6 rule 2a).
  • Notification extensions (iOS Notification Service Extension, Android background handlers) and web service workers MUST NOT hold, use or refresh session tokens. They read notification records with the fetch token of 19 §9.3, which belongs to the device's push registration and is deleted with it at revocation (§13 step 1). Rationale: an extension that refreshed the app's token would race the app and trip reuse detection.

7.8 Errors at the OAuth endpoints

Problem details at /v1/auth/par and /v1/auth/token carry the RFC 6749 §5.2 error member. Errors redirected from /v1/auth/authorize, /v1/auth/callback or /v1/auth/consent carry the RFC 6749 §4.1.2.1 error in the redirect and add sv_code (§6.6). The two columns differ because RFC 6749 defines different codes for the two places.

Code (this document or 03) error at /par and /token error in a redirect
core.invalid_request invalid_request invalid_request
auth.invalid_client invalid_client Never redirected (§6.2)
auth.invalid_redirect_uri invalid_request Never redirected (§6.2)
auth.invalid_grant, auth.refresh_reused, auth.session_revoked invalid_grant —
auth.unsupported_grant_type unsupported_grant_type —
auth.registration_closed, account.suspended, auth.provider_in_use, auth.too_many_devices invalid_grant access_denied
auth.access_denied, auth.reauth_mismatch, auth.reauth_required — access_denied
auth.provider_unknown invalid_request invalid_request
auth.provider_error — temporarily_unavailable
core.rate_limited invalid_request temporarily_unavailable
core.internal, core.unavailable server_error server_error

HTTP status at /par and /token. RFC 6749 §5.2 answers token-endpoint errors with 400. At these two endpoints the HTTP status, and the problem's status member, is therefore 400 for every code mapped to invalid_request, invalid_grant or unsupported_grant_type, and 401 for invalid_client, whatever §19 lists. The exceptions are core.rate_limited (429, with Retry-After) and server_error (500 or 503). The status in §19 applies wherever else the code is returned, for example auth.session_revoked (401) on an API request with an access token. A 400 at these endpoints carries no WWW-Authenticate header; clients decide what to do from code (for auth.refresh_reused and auth.session_revoked, sign in again).

Example, a reused refresh token at /v1/auth/token:

{
  "type": "urn:sloppyv:error:auth.refresh_reused",
  "code": "auth.refresh_reused",
  "title": "You were signed out for your security",
  "status": 400,
  "detail": "This sign-in was used from two places, so it was ended. Sign in again.",
  "retryable": false,
  "retryAfterMs": null,
  "userAction": "sign_in",
  "error": "invalid_grant",
  "error_description": "refresh token reuse detected",
  "data": { "did": "oKGio6SlpqeoqaqrrK2urw" }
}

8. Sign-up

8.1 When sign-up happens

Sign-up happens when a login (§6.5) returns an external identity that has no ProviderLink. The client learns this from the code exchange and shows "Choose your name" (M2). There is no separate "Create account" path in the protocol: the same "Continue with Google" button signs in or signs up.

Proposed decision (P-05-5): for an unknown external identity, the code exchange succeeds and returns a sign-up token; the account is created by POST /v1/auth/signup. Rationale: every code exchange then looks like a normal OAuth success to libraries, and no account is created until the user has chosen a name.

8.2 The sign-up token

Returned by the code exchange (§7.3):

{
  "access_token": "svs_YGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn8",
  "token_type": "Bearer",
  "expires_in": 900,
  "signupRequired": true,
  "signup": {
    "provider": "google",
    "providerLabel": "sam.example@mail.example",
    "suggestedName": "Saxon Jones",
    "suggestedLocal": "saxonjones",
    "registration": "open",
    "inviteRequired": false,
    "termsUrl": "https://sloppyvoice.com/terms"
  }
}
Member of signup Type Required Meaning
provider string Yes Provider ID used.
providerLabel string No The label of §10.1, so the client can say "You signed in with Google as …".
suggestedName string No Display-name suggestion (§8.5), absent if none.
suggestedLocal string No The canonical local part of suggestedName.
registration string Yes open or invite (a closed server never issues sign-up tokens).
inviteRequired boolean Yes true when registration is invite.
termsUrl string No ServerMetadata links.terms (§3.3), copied here when present. Its presence means sign-up requires acceptTerms.

Rules for the sign-up token:

  • Valid 900 s. Usable only for POST /v1/auth/signup. Every other endpoint answers it with 401 core.unauthenticated (03 §3.2 rule 4). Clients MUST NOT send it to any other endpoint, including public ones such as /v1/addresses/{local}, which they call without an Authorization header (03 §3.2 rule 6).
  • It is bound to the transaction's client_id, external identity, provider and authAt. The token family that sign-up creates is issued to that client_id, so later refreshes need the same client_id (§7.6).
  • At most 5 sign-up attempts per token; the sixth fails with auth.signup_token_invalid.
  • It is consumed by a successful sign-up. The server keeps the hash of a consumed sign-up token until the token's original expiry, so that a retry can be told apart from an invalid token (§8.4).

8.3 Registration policy

auth.registration Who may sign up
open Anyone who signs in with a provider that has signup: true.
invite As open, but POST /v1/auth/signup MUST carry a valid inviteCode. A valid code is one that 09 §8.7 accepts for sign-up (an active invite of this server's community with allowSignUp: true). Any other code fails with auth.invite_invalid and counts as a failed invite-code attempt under 09 §8.5. A successful sign-up consumes one use of it, in the sign-up transaction.
closed Nobody. The code exchange fails with auth.registration_closed. Existing accounts sign in normally.

The registration policy never limits bot creation (§15.2), which needs a local account with manage_bots.

A server MAY add a human-verification step (for example a CAPTCHA page) inside the authorization flow before the provider redirect. It MUST NOT add one to POST /v1/auth/signup, which is called by the client app, not the browser.

8.4 POST /v1/auth/signup

Authorization: Bearer <sign-up token>. JSON body:

Member Type Required Meaning
name string Yes The display name the user chose, for example "Saxon Jones". The local part is derived from it by 01's rule (remove white space, then PRECIS preparation).
inviteCode string When inviteRequired §8.3.
acceptTerms boolean When termsUrl is set MUST be true, else auth.terms_not_accepted.
platform string Yes As in §7.3; bot is refused with core.invalid_request.
clientSoftware string Yes As in §5.3.
deviceName string No As in §7.3.
sharedComputer boolean No As in §12.6. Default false.
setupToken string No The one-time first-admin setup token of 21 §11.1 item 7.
POST /server/v1/auth/signup
Authorization: Bearer svs_YGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn8

{ "name": "Saxon Jones", "acceptTerms": true, "platform": "desktop",
  "clientSoftware": "sloppyvoice-desktop/1.0.3", "deviceName": "Saxon's laptop" }

The server processes it in this order and stops at the first failure:

  1. If the token was consumed by a successful sign-up, fail with 409 auth.identity_already_linked. Otherwise, if it is unknown, expired or out of attempts, fail with auth.signup_token_invalid.
  2. Body syntax: platform, clientSoftware, deviceName and sharedComputer as in §7.3 (core.invalid_request).
  3. Registration still allows sign-up (auth.registration_closed), and the invite is valid if needed (auth.invite_required, auth.invite_invalid).
  4. Terms accepted if required (auth.terms_not_accepted).
  5. The name is a valid display name whose local part passes every check of 01: grammar, the UTS #39 Highly Restrictive script rule (D-031, D-092), reserved names, the shared user-and-channel namespace (D-020), the confusable-skeleton collision check (D-031) and the deleted-address quarantine. Failures use 01's address.* codes. The display name is processed by 01 §6.3. If only the display name collides (01 §5.3, data.field: "name") and the local part is free, sign-up doesn't fail: the account is created with the prepared local part as its display name (01 §5.3, §6.3). Exception (21 §11.1 item 7): a local part configured for a first admin is accepted only when the sign-up token's external identity (§4.4) is the one bound to it, or when setupToken is the bound token; anyone else gets address.reserved.
  6. The external identity is still unlinked; if another sign-up or a link won the race, fail with auth.identity_already_linked.
  7. In one transaction: create the Account (kind: user, security: insecure, state per §8.6, and a new inc, §11.1); create the ProviderLink; create the device record and the token family, issued to the sign-up token's client_id, with the sign-up token's authAt; emit device.added with via: "signup" (§18); consume the invite use; apply the D-068 hook (§8.7), which creates the community membership in this same transaction as 09 §4.4 requires; consume the sign-up token.

Response 201 Created: the full token response of §7.3 (RFC 6749 member names, plus authAt, account and device), so clients handle one shape. When step 5 stored the prepared local part instead of the chosen display name, account.name differs from the name sent after 01 §6.3 steps 1 and 2. That difference is the only signal; the client then tells the person in one line that their name is shown in lowercase for now (01 §5.3, 20 §9.3).

Retries: the sign-up token is single-use and tokens are stored only as hashes, so a lost 201 can't be replayed. A client that retries after a lost response gets auth.identity_already_linked (step 1). On both auth.identity_already_linked and auth.signup_token_invalid, the client restarts the login flow (§6), which signs in to the existing account and usually completes without a visible provider screen. A device record created by a sign-up whose tokens have never been used is revoked 15 minutes after creation (§13, reason inactive), so a lost response doesn't leave a phantom device counting against maxDevices.

8.5 Name suggestion

The server computes suggestedName from provider claims (§4.5) as follows. The steps refer to 01's local-part validation as valid(x): remove white space from x, prepare it with 01's profile, and check every 01 rule except availability.

  1. Take the first available claim of name, given_name, preferred_username (for GitHub, name, then login). Apply NFC.
  2. Replace every code point that isn't a letter (L*), a combining mark (M*), a decimal digit (Nd) or white space with U+0020 SPACE. Collapse runs of white space to one SPACE and trim.
  3. If valid fails, try the longest prefix of whole words for which valid succeeds. If none succeeds, go back to step 1 with the next claim. If no claim works, return no suggestion.
  4. If the local part is longer than 01 allows, drop whole words from the end until it fits.
  5. Availability: if the local part is taken (by a user or a channel) or quarantined, try appending " 2", " 3", … " 9" to the display name, and suggest the first available. If all are taken, suggest the step-4 result anyway; the live check will say it is taken.

suggestedLocal is the canonical local part of suggestedName. The server MUST NOT reserve the suggestion; availability is checked again at sign-up.

8.6 Sign-up on a secure server

On a server whose ServerMetadata secure is true, every account is secure (SM-1, SM-3). A server can't create keys for the user, so:

  • the account is created with state: upgrade_required and security: insecure;
  • the client continues straight into the encryption ceremony (M4, 08), using the endpoints of 07 and 08;
  • when 07 records the first IdentityCertificate, the account moves to active with security: secure (§11.3).

A server MAY delete an account that has stayed in upgrade_required since sign-up for 30 days without ever registering an identity (deletion reason unconfirmed, §16).

8.7 Community membership hook (D-068)

When it creates a kind: user account (§8.4 step 7), the home server applies 09's default-membership rule in the same transaction: if the community's setting for default membership of local accounts is on (09 §4.4 owns the setting and the Membership object), it creates the membership as 09 specifies and adds the community to the user's community list (09). If 09's join gate requires accepting community rules, 09 decides whether and when the new member is asked.

Proposed decision (P-05-11): default membership (D-068) applies to kind: user accounts only. A bot becomes a member of any community, including its home community, only when a member with manage_bots adds it (09, 10). Rationale: a bot appearing in every channel of its home community the moment it is created would surprise members and, for secure contexts, raise W6 unasked.

8.8 User experience

  • The client shows the providers from auth.providers as buttons, with the last provider used on this device first (M1).
  • "Choose your name" (M2) is pre-filled with suggestedName. As the user types, the client checks availability with GET /v1/addresses/{local} (01), debounced by 300 ms, and shows the resulting address, for example "saxonjones@sloppyvoice.com".
  • The screen shows providerLabel ("Signed in with Google as sam.example@…") and a link "Already have an account? Use a different sign-in", which restarts the login with prompt=select_account. This catches people who picked the wrong provider account.
  • If the user came from an invite link, the client fills inviteCode from the link (01) and doesn't ask.
  • A terms checkbox appears only when termsUrl is set.
  • After sign-up, the client SHOULD suggest once, and only once, "Add a backup sign-in" (§10.3). authAt is the time the provider leg completed (§6.5 step 4), so within 10 minutes of it no extra provider login is needed; after that, the link flow first runs §9.2.

9. Fresh authentication

9.1 Rule

Proposed decision (P-05-8): some operations require fresh authentication. The one normative predicate, used by every document, is:

fresh(session, maxAgeMs) = (now − session.authAt) ≤ maxAgeMs

where authAt is the time the provider leg that created the session, or the latest intent=reauth pass for it, completed (§6.5 step 4). When fresh is false, the server MUST fail the request with 403 auth.reauth_required, with data.maxAgeMs set to the operation's limit and data.providers listing the account's linked, enabled provider IDs. Every document that needs fresh authentication MUST use this code, this status and these data members (05 registers the code; other documents use it as they use core.* codes), and MUST NOT define its own code or session field for it. Clients satisfy it only with the procedure of §9.2, which keeps the device record and its did; signing in again as a new device never satisfies it for the old one. Rationale: a stolen access or refresh token must not be enough to take over the account permanently, lock the owner out, or destroy it. Only someone who can also pass a linked provider's login can do these things. One code and one procedure let clients handle the requirement the same way everywhere.

Operation Endpoint maxAgeMs Owner
Link a provider POST /v1/me/providers 600000 05
Unlink a provider DELETE /v1/me/providers/{linkId} 600000 05
Revoke an active device other than the caller's own POST /v1/me/devices/{did}/revoke, DELETE /v1/me/devices/{did} 600000 05
Revoke an active device other than the caller's own by uploading a DeviceRevocation POST /v1/me/identity/revocations (07 §11.7 step 4) 600000 07 applies this rule
Sign out all other devices POST /v1/auth/logout with scope: others 600000 05
Delete the account DELETE /v1/me 600000 05
Create or delete a bot, create or rotate a bot token, or transfer bot ownership POST /v1/bots, DELETE /v1/bots/{local}, POST /v1/bots/{local}/tokens, POST /v1/bots/{local}/tokens/{did}/rotate, PATCH /v1/bots/{local} with owner 600000 05
Identity reset and downgrade POST /v1/me/identity/reset 600000 07 applies this rule
KeyBackup download from an unenrolled device GET /v1/me/backup 3600000 08 §5.7 applies this rule
Turn on encryption (first upgrade, or re-upgrade after a downgrade) PUT /v1/me/identity 86400000 07 §11.4 applies this rule (D-085)

Uploading a DeviceRevocation for a device that is already revoked, or for the caller's own device, needs no fresh authentication (07 §11.7 step 4). Proof of the identity key isn't a substitute for fresh authentication when revoking another active device: every enrolled device holds the identity key, including a stolen one.

Renaming a device, revoking the current device and changing the profile don't need fresh authentication. Turning on encryption accepts a much older sign-in than the other operations, 24 hours (D-085). People usually turn it on soon after signing in, and every sign-up on a secure server goes straight into it (§8.6), so for almost everyone it stays one tap (00 §1.1 rule 2, HP-12); a client whose sign-in is older shows one provider sign-in first (08 §3.2, 20 §9.5). Rationale: the first identity key of an account is pinned silently by every DM contact (07 §16.2), so a stolen access or refresh token mustn't be enough to attach the thief's key. The residual risk is stated in §22.3.

Bot tokens never carry fresh authentication. Bots can't call the operations of this document listed above (bot.not_allowed, §15.5). For 07's upgrade and reset and 08's download, a bot's own token stands in for fresh authentication (§15.5, 07, 08).

9.2 Procedure

  1. The client receives auth.reauth_required.
  2. It pushes an authorization request (§6.1) with intent=reauth, Authorization: Bearer <access token>, and provider set to the linked provider used most recently on this device (or omitted, in which case the server's chooser shows only the account's linked, enabled providers).
  3. The browser leg runs with prompt=login and max_age=0 at the provider (§6.3).
  4. The code exchange returns a new access token and the new authAt (§7.3). The device record, its did and its refresh token are unchanged.
  5. The client retries the original request once, with the new access token.

9.3 Provider limits

How strong a re-authentication is depends on the provider. OIDC providers that honour prompt=login ask for the password or passkey again. GitHub can't be forced and may answer at once from its own session, so a GitHub re-authentication proves control of the GitHub session in that browser rather than a fresh credential. Every linked, enabled provider is accepted for re-authentication, GitHub included: refusing one would leave an account linked only to it unable to remove a stolen device, sign out other devices or link a stronger provider, and a fresh sign-in through it creates a session that counts as fresh anyway. Admin documentation SHOULD say that GitHub re-authentication is weaker.

9.4 User experience

The client shows one sentence, for example "To keep your account safe, confirm it's you", and opens the provider. This prompt is part of moment M1 (00 §4.12.4), not a security warning (D-055); 20 owns its copy. The user never has to choose a provider when only one is linked.

10. Linked providers

10.1 The ProviderLink object

Member Type Required Meaning
linkId string Yes UUIDv7, server-generated.
provider string Yes Provider ID.
providerName string Yes The provider's name at the time of the response.
label string No A hint so the user recognises which provider account this is, built from the claims of §4.5 at link time and refreshed at each login: at most 64 characters. Shown only to the account holder.
enabled boolean Yes Whether the provider is currently enabled.
linkedAt string Yes Timestamp.
lastUsedAt string No Last login, reauth or sign-up through this link.

The server also stores the external identity key (§4.4), which is never returned.

10.2 GET /v1/me/providers

Returns {"items": [ProviderLink…], "nextCursor": null} (00 §7.10), ordered by linkedAt. Bots get bot.not_allowed.

{
  "items": [
    { "linkId": "01938a02-11aa-7c3d-9e4f-0a1b2c3d4e5f", "provider": "google", "providerName": "Google",
      "label": "sam.example@mail.example", "enabled": true,
      "linkedAt": "2026-11-02T09:01:12.000Z", "lastUsedAt": "2026-12-04T10:15:30.123Z" },
    { "linkId": "01938f41-0c0d-7e0f-8a1b-2c3d4e5f6a7b", "provider": "github", "providerName": "GitHub",
      "label": "saxonj", "enabled": true,
      "linkedAt": "2026-12-04T10:20:02.871Z", "lastUsedAt": null }
  ],
  "nextCursor": null
}

10.3 Linking: POST /v1/me/providers

Requires fresh authentication (§9). JSON body:

Member Type Required Meaning
provider string Yes An enabled provider ID. The provider's signup flag doesn't matter.
clientId string Yes As client_id (§5.1).
redirectUri string Yes As redirect_uri (§5.2).
codeChallenge string Yes As code_challenge.
codeChallengeMethod string Yes S256.
state string Yes As state.
uiLocales string No As ui_locales.

The server checks the account has fewer than maxLinkedProviders links (§20; auth.too_many_providers otherwise), creates a pushed authorization request with intent link bound to the current session, and answers 201:

{
  "requestUri": "urn:ietf:params:oauth:request_uri:Qx0r2T9bW1yNc8sK2pT5uA",
  "authorizeUrl": "https://chat.sloppyvoice.com/server/v1/auth/authorize?client_id=urn%3Asloppyv%3Aclient%3Aloopback&request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3AQx0r2T9bW1yNc8sK2pT5uA",
  "expiresInMs": 60000
}

The client opens authorizeUrl, receives the code at its redirect URI, and redeems it at /v1/auth/token (§7.3, intent link). The response's link member is the new ProviderLink, and auth.provider_linked goes to the account's devices.

Rules:

  • An external identity linked to another account can't be linked (auth.provider_in_use). The client explains: "That Google account is already used by another Sloppy Voice account." It never reveals which account.
  • Linking the same external identity twice is idempotent.
  • One account MAY link several identities at the same provider (for example two Google accounts).

10.4 Unlinking: DELETE /v1/me/providers/{linkId}

Requires fresh authentication. The server MUST refuse with auth.last_provider if, after the unlink, the account would have no link to an enabled provider. Otherwise it deletes the link, emits auth.provider_unlinked, and answers 200 with the devices whose sessions were created through this link and are still active:

{ "unlinked": "01938a02-11aa-7c3d-9e4f-0a1b2c3d4e5f", "devicesSignedInWithIt": ["oKGio6SlpqeoqaqrrK2urw"] }

Unlinking doesn't revoke any session. The client SHOULD offer "Also sign out those devices", which revokes them one by one (§12.9) without a second re-authentication, since authAt is still fresh. Unlinking the provider used for the current session is allowed.

10.5 Admin-side changes

Admins can't link or unlink identities for users through this protocol. If an admin disables a provider (§4.1), links to it stay but can't be used; the link's enabled becomes false. Users with an active session whose only enabled-provider links would be lost SHOULD be told by their client, from GET /v1/me/providers, to add another sign-in.

11. Accounts

11.1 The Account object

Member Type Required Meaning and constraints
address string Yes Canonical address (01). Never changes.
name string Yes Display name. Never empty: it is linked to the local part (01 §6.1) and meets 01 §6.2 (D-005, D-031). An account whose holder hasn't chosen another capitalization or spacing, or whose chosen name collided at registration (01 §5.3), has the prepared local part (01 §6.3). Receivers apply 01 §6.4 and show the local part if the check fails (01 §6.5).
kind string Yes user or bot. Never changes. Receivers treat an unknown value as bot, so an unknown kind is never shown as a person.
inc string Yes The account's incarnation (D-086): 16 bytes from a cryptographically secure generator, base64url without padding (22 characters; the grammar of did, §12.4). Assigned when the account is created (§8.4, §15.2) and never changed. A local part registered again after a deletion (01 §5.7) always gets a new value: the server MUST check that it differs from every inc the local part has had (kept with the tombstone, §16.2 step 8). Other servers key their records about the account on (address, inc) and treat a different inc as a different account (06 §11.6).
state string Yes active, upgrade_required, suspended or deleted (§11.2). Receivers treat an unknown value as suspended.
security string Yes insecure or secure. Always equal to the sec claim of the account's latest IdentityState (07), which is authoritative.
igen integer Yes The identity generation from the latest IdentityState (07); 0 for an account that has never been secure.
about string Yes Plain text, 0–190 Unicode code points, at most 4 line breaks; empty string when unset.
avatar Avatar or null Yes §11.7.
profileVersion integer Yes Starts at 1; increases by 1 on every change to name, about or avatar.
createdAt string Yes Timestamp.
owner string Bots only Canonical address of the local account that owns the bot (§15.1).

The Avatar object:

Member Type Required Meaning
url string Yes {base}/v1/users/{local}/profile/avatar?v={profileVersion}.
sha256 string Yes base64url SHA-256 of the served image bytes.
contentType string Yes image/png, image/jpeg or image/webp.
width, height integer Yes Pixels, 1–1024 each.

11.2 Account states

State Meaning Can sign in HomeAssertions (06)
active Normal. Yes Yes
upgrade_required Homed on a secure server, encryption not on yet (SM-3, A10). Yes Refused, security.upgrade_required
suspended Suspended by the server operator, or for the lifetime of a server-scope ban of the local account (10 §9.3). No Refused, account.suspended
deleted Deleted (§16). A tombstone (§16.2 step 8). No Refused

Proposed decision (P-05-10): accounts have a suspended state, set and cleared by the server operator through implementation-specific administration (21), and also set for the lifetime of a server-scope ban of the local account (10 §9.3). The server records each active cause (operator, or ban with the ban ID); the account leaves suspended only when no cause remains. Rationale: community bans (10) can't stop a local spammer from using the home-server role (assertions, DMs to other servers); operators need a reversible switch short of deletion.

Transitions:

From Event To Effects
— Sign-up or bot creation on an insecure server active §8.4, §15.2
— Sign-up or bot creation on a secure server upgrade_required §8.6
active (insecure) The server becomes secure (09) upgrade_required account.updated; next sign-in shows the blocking "Turn on encryption to continue" (A10)
upgrade_required 07 records the first IdentityCertificate active security: secure; account.updated
active, upgrade_required Operator suspends, or a server-scope ban of the account starts (10 §9.3) suspended Every API request except GET /v1/me and POST /v1/auth/logout fails with account.suspended; refresh fails with account.suspended (§7.6); no assertions. Device records stay. The home server sends account.suspended (§11.8) to the account's audiences, which end its remote sessions within 60 s. Bots the account owns are treated as suspended for as long as their owner is (§11.8). account.updated.
suspended Operator restores, or the ban expires or is lifted, and no other cause of suspension remains upgrade_required if the server is secure and the account is insecure; otherwise active account.updated. Nothing is sent to other servers: new HomeAssertions simply work again.
any but deleted Deletion (§16) deleted §16

A deleted account never changes state again.

11.3 The security flag and its entry points

The account security state is shown in security, but this document doesn't change it. The entry points are:

Change How the client starts it Specified in What this document does
Insecure → secure (turn on encryption) "Turn on encryption" in settings, a G1 card, or the A10 screen 08 (ceremony), 07 (PUT /v1/me/identity) Requires fresh authentication within 24 h (§9.1, D-085), enforced by 07 §11.4. Sets security, igen, and state (upgrade_required → active) in the same transaction in which 07 publishes the IdentityState; marks the ceremony device enrolled and the others unenrolled; emits account.updated and device.updated.
Secure → secure with a new key (reset) "Start fresh" (M10) 07 (/v1/me/identity/reset), 08 (client side) Requires fresh authentication (§9); updates igen; marks every device except the resetting one unenrolled; emits the same events. Takes effect at once (D-071).
Secure → insecure (downgrade) "Turn off encryption" 07 (counts as a reset, D-019) As for a reset; security: insecure. On a secure server the downgrade is refused by 07, because every account there must be secure (SM-3).

Device records are never revoked by any of these changes. After a reset or downgrade the other devices stay signed in, unenrolled (D-058), and show W4a (07).

11.4 What each state allows

Operation active upgrade_required suspended
GET /v1/me, /v1/auth/logout, event WebSocket for me events Yes Yes GET /v1/me and logout only
PATCH /v1/me, avatar, devices, providers, DELETE /v1/me Yes Yes No
Identity registration (07), KeyBackup upload and pairing (08) Yes Yes No
HomeAssertions (06), communities, messages, DMs, calls, bots Yes No: security.upgrade_required No

11.5 GET /v1/me

Returns the caller's account, its own device record and authAt (absent for bot tokens):

{
  "account": {
    "address": "saxonjones@sloppyvoice.com", "name": "Saxon Jones", "kind": "user", "inc": "4OHi4-Tl5ufo6err7O3u7w", "state": "active",
    "security": "insecure", "igen": 0, "about": "Mostly here for the board-game nights.",
    "avatar": { "url": "https://chat.sloppyvoice.com/server/v1/users/saxonjones/profile/avatar?v=4",
                "sha256": "n4bQgYhMfWWaL-qgxVrQFaO_TxsrC4Is0V1sFbDwCgg", "contentType": "image/webp",
                "width": 512, "height": 512 },
    "profileVersion": 4, "createdAt": "2026-11-02T09:01:12.000Z"
  },
  "device": { "did": "oKGio6SlpqeoqaqrrK2urw", "name": "Saxon's laptop", "platform": "desktop",
              "clientSoftware": "sloppyvoice-desktop/1.0.3", "state": "active", "enrolled": false,
              "sharedComputer": false, "provider": "google", "authAt": "2026-12-04T10:15:30.123Z",
              "createdAt": "2026-12-04T10:15:30.500Z",
              "lastSeenAt": "2026-12-04T10:40:02.000Z", "expiresAt": "2027-12-04T10:40:02.000Z", "current": true },
  "authAt": "2026-12-04T10:15:30.123Z"
}

The top-level authAt equals device.authAt; it is kept so that clients can read the session's freshness in one place.

Client logic after sign-in or refresh (normative for Full and Web clients):

  1. state: upgrade_required → the blocking "Turn on encryption to continue" screen (A10), which starts M4 (08).
  2. security: secure and device.enrolled: false → "Approve from your other device" (08). The user MAY skip it ("Not now"); the device then works in insecure contexts only (D-058) and shows G2 at secure doors.
  3. Otherwise, the normal app.

11.6 PATCH /v1/me

JSON body with any of:

Member Type Meaning
name string New display name. Processed exactly as 01 §6.3 says, including the collision check of 01 §5.3 even when only spacing or capitalization changes. Failures are 400 address.display_name_mismatch (data.reason not_linked or too_long) or 409 address.too_similar (data.field: "name"). An empty string, or one of white space only, resets the display name to the prepared local part (01 §6.3); that can't collide. Only spacing and capitalization can change; the address itself can never change.
about string §11.1 limits, else core.invalid_request.

Response 200 with the Account. If anything changed, profileVersion increases by 1, account.updated goes to the account's devices, and account.profile_changed goes to its audiences (§17.4).

Rationale: the address is the identity (M2); a new address means a new account. People who want a different address create one and tell their contacts.

11.7 Avatar: PUT /v1/me/avatar, DELETE /v1/me/avatar

PUT takes the raw image as the body, with Content-Type image/png, image/jpeg or image/webp (anything else fails with account.avatar_invalid) and at most maxAvatarBytes (§20; core.too_large otherwise). The server MUST decode it, refuse images larger than 4096 × 4096 or that fail to decode (account.avatar_invalid), scale it to fit 1024 × 1024, re-encode it, and strip all metadata (EXIF, XMP, ICC beyond sRGB). It answers 200 with the Account. DELETE removes the avatar. Both bump profileVersion.

Rationale: re-encoding removes location metadata that non-technical users don't know their photos carry, and removes decoder exploits aimed at other users' clients.

11.8 The account.suspended S2S event

Proposed decision (P-05-15): when an account becomes suspended (by the operator, or by a server-scope ban, 10 §9.3), the home server sends the S2S event account.suspended to the account's audiences (06 §11.1). A bot is suspended together with its owner: while the owner is suspended, the bot's state reads suspended, its own requests fail with account.suspended, it gets no HomeAssertions, and the home server sends account.suspended for the bot too. Restoring the owner restores the bot, unless the bot has a cause of suspension of its own. Rationale: suspension is meant to stop a local abuser at once; without an event, remote sessions would keep working until their renewal fails, up to 1 h later, and the abuser's bots would keep running.

Member of d Type Required Meaning
addr string Yes Canonical address of the suspended account.
inc string Yes The suspended account's incarnation (§11.1). A receiver applies the event only to this incarnation (06 §11.4).
kind string Yes user or bot.
suspendedAt string Yes Timestamp.

Registration for 06's catalogue (06 §10.1):

Origin → destination Lane orderKey Subject binding expiresAt Give-up hook Unknown account
Home server → each audience of the account (06 §11.1) high The account's canonical address The domain of d.addr equals iss None None: a remote session still ends at its next renewal, at most 1 h later ignored

A receiver MUST, within 60 s, end every remote session of (d.addr, d.inc) (06, reason admin) and revoke its voice leases (15). It MUST NOT remove the account's MLS leaves, end its memberships or delete anything: suspension is reversible, and the account returns by obtaining new HomeAssertions. Restoration sends no event. A receiver that doesn't know the type answers ignored (06), and the account's remote sessions then end at their next renewal.

12. Devices

12.1 Sessions are devices

Proposed decision (P-05-6): a home session and a device record are the same thing. A device record is created by a login (§7.3) or sign-up (§8.4), or by bot token creation (§15.4), and holds exactly one token family. Signing out revokes it. A revoked device ID is never used again. Rationale: one object to list, name and revoke is what users can understand ("signed in on 3 devices"), and it makes the revocation of D-017 complete: there is no session that outlives its device.

Consequence: after signing out, signing in again on the same installation creates a new device record with a new did. For a secure account, that device is unenrolled and must be approved again (08).

12.2 The DeviceRecord object

Member Type Required Meaning and constraints
did string Yes Device ID, §12.4.
name string Yes 1–64 code points, no control characters. Default: the device_name sent at login, else "Platform device". The user can rename it.
platform string Yes desktop, web, ios, android or bot. The same values as the DeviceCertificate plat claim (07). Receivers treat an unknown value as desktop for logic and show a generic icon.
clientSoftware string Yes §5.3.
state string Yes active or revoked. Receivers treat an unknown value as revoked.
enrolled boolean Yes §12.8. Always false for an insecure account.
dkf string No The DSK fingerprint from the IdentityState, present while enrolled is true.
sharedComputer boolean Yes §12.6.
provider string or null Yes Provider ID used to create the session; null for bot devices.
authAt string or null Yes The session's authAt: when its most recent pass through the provider leg (sign-in, sign-up or re-authentication) completed (§9.1). null for bot devices. 08's DeviceSummary authAt (08 §6.2) is this value.
createdAt string Yes Timestamp.
lastSeenAt string Yes Last activity (§12.5), at most 60 s stale.
expiresAt string or null Yes When the device will be revoked if nothing changes (§12.5): for user devices lastSeenAt plus the inactivity limit; for a bot device with a token expiry, that expiry. null for a bot device without an expiry and for every revoked device.
revokedAt string When revoked Timestamp.
revokedReason string When revoked §12.3.
current boolean Yes true only for the device the request was made from.
tokenHint string Bot devices only The last 4 characters of the bot token.
tokenRotatedAt string Bot devices only When the bot token was last issued or rotated.

12.3 Revocation reasons

revokedReason Cause
signed_out The device signed itself out (§14).
removed The user removed it from another device (§12.9), including by uploading a DeviceRevocation for it (07 §11.7).
lost_or_stolen The user removed it and said it was lost or stolen (§12.9, §12.10). 08 then makes a new recovery key after rotating the vault (08 §10.8).
signed_out_elsewhere Sign out of all other devices (§14).
shared_expired Shared-computer device idle for 12 h (§12.6).
inactive Inactivity expiry (§12.5), replaced at the device limit (§12.7), or a sign-up device whose tokens were never used (§8.4).
token_reuse Refresh-token reuse (§7.6).
code_reuse Authorization code redeemed twice (§6.6).
bot_token_revoked The bot's owner or a manage_bots holder revoked the bot token (§15.4).
bot_token_expired The bot token reached the expiry its owner set (§15.4).
account_deleted The account was deleted (§16).
admin The server operator revoked it.
other Anything else. Receivers treat unknown values as other.

12.4 Device IDs

The home server assigns the did when it creates the device record:

did = 21b64u-char did-last   ; 16 random bytes, base64url without padding (22 characters)
did-last = "A" / "Q" / "g" / "w"   ; the last character carries 2 bits and 4 zero bits
  • The 16 bytes MUST come from a cryptographically secure generator.
  • A did is unique among all device records the server has ever created, including revoked ones and devices of deleted accounts. The server MUST check for a collision and draw again if one occurs.
  • The server MUST keep at least the did, account and revokedAt of every revoked device for as long as the account exists, so the IdentityState revoked list (07) stays meaningful and IDs are never reused.

The client never chooses its did; it learns it from the token response.

12.5 Activity and expiry

Activity is any request authenticated with the device's access or refresh token, or bot token. The server updates lastSeenAt at most once per 60 s.

Proposed decision (P-05-13): a device record that has had no activity for its inactivity limit is revoked (§13):

Device Inactivity limit Reason
desktop, ios, android 365 days inactive
web 90 days inactive
Any device with sharedComputer: true 12 h shared_expired
bot None. A bot device whose owner set a token expiry is revoked at that time (§15.4). bot_token_expired

Rationale: MLS evicts devices from groups after 90 days (30 for web) and expects them to rejoin silently by external commit when they return (D-059, HP-3). The device record must therefore outlive MLS eviction; otherwise a returning enrolled device would have to be approved again.

For user devices expiresAt is lastSeenAt plus the limit (§12.2). The server MUST run expiry at least every 10 minutes, so a shared-computer device is revoked no later than 12 h 10 min after its last activity.

12.6 Shared-computer mode

The sign-in screen of web clients, and of desktop clients, offers one unchecked checkbox, "This is a shared or public computer" (00 HP-10: never asked by default). If checked, the client sends shared_computer=true at the code exchange or sharedComputer: true at sign-up. The setting is fixed for the life of the device record.

Party Behaviour in shared-computer mode
Home server Revokes the device 12 h after its last activity (§12.5). Refuses shared_computer for ios, android and bot with core.invalid_request.
Client Keeps tokens in memory only (§7.7), never in sessionStorage, which browsers restore when a closed tab is reopened; keeps keys in memory only (08); doesn't remember the last provider or the account address after sign-out. On sign-out it discards everything. On pagehide (tab close, navigation or reload) a web client SHOULD send a best-effort POST /v1/auth/logout with fetch(…, {keepalive: true}); a reload therefore needs a new sign-in. If that request is lost, the server's 12 h expiry still applies.
Secure accounts The device is a normal unenrolled device. It MAY be paired or restored (08); its keys then vanish when the tab or app closes, and the device record expires 12 h later.

12.7 Device limit

An account has at most maxDevices active device records (§20). When a login would exceed it, the server first revokes devices whose expiry has passed. It MAY then revoke the unenrolled active device with the oldest lastSeenAt if that device has been idle for at least 30 days (reason inactive). It MUST NOT revoke an enrolled device under this rule: an idle enrolled device (for example a home computer left off for a month) may hold the account's only copy of the identity key, and losing it without the user's agreement could force a reset. If the limit would still be exceeded, the login fails with 409 auth.too_many_devices, with data.maxDevices; the client tells the user to remove a device they no longer use from the device list of another signed-in device. Bot devices count against the bot's own limit (§15.4), not the owner's.

12.8 Enrolment and D-058

A device is enrolled exactly when the account is secure and the device's did is listed in devices of the account's latest IdentityState (07). The home server computes enrolled from that state and nothing else; it changes when 07 lists or delists the device, and the server emits device.updated each time.

Unenrolled devices of secure accounts can use insecure contexts only (D-058). The home server enforces this at three points:

  1. HomeAssertions. When it issues a HomeAssertion (06), the home server sets enr to the device's enrolled value at that moment, and MUST NOT set enr: true (or the igen, ikf and dkf claims) for a device that isn't listed active in the current IdentityState. Remote servers enforce SM-4 from enr (06). An account in upgrade_required gets no assertion at all (security.upgrade_required).
  2. Its own contexts. Where the home server is also the hosting server (its own community and the DMs it hosts), it applies SM-4 to home sessions using enrolled exactly as a remote server uses enr: security.device_not_enrolled for an unenrolled device of a secure account, security.account_required for an insecure account.
  3. Home-only secure operations. The owners of KeyPackage publication (13), AccountVault writes (08) and other operations that need the identity key or vault keys refuse unenrolled devices. They MUST use this enrolled flag as their only test.

Unenrolled devices of secure accounts can always: use insecure contexts; pair (08); register their own DeviceCertificate (07); and reset the identity (07, D-071; with fresh authentication, §9.1). They can download the KeyBackup subject to 08 §5.7 (fresh authentication within 1 hour, §9.1).

12.9 Device endpoints

GET /v1/me/devices. Returns {"items": [DeviceRecord…], "nextCursor": null} with active devices ordered by lastSeenAt, newest first. With ?include=revoked, devices revoked in the last 30 days follow. With a bot token, it returns the bot's own devices.

GET /v1/me/devices/{did}. One record. {did} MAY be the literal current.

PATCH /v1/me/devices/{did}. Body {"name": "…"}. Answers 200 with the record and emits device.updated. A revoked device fails with device.already_revoked; an invalid name with device.name_invalid.

POST /v1/me/devices/{did}/revoke. Revokes a device (§13). JSON body, every member optional:

Member Type Required Meaning
reason string No removed (default) or lost_or_stolen (§12.3). Any other value fails with core.invalid_request.
revocation string No A DeviceRevocation JWS (sv-devrevoke+jwt, 07) for this did, signed by the account's identity key. Only an enrolled device can produce one. Checked as 07 §11.8 specifies; an invalid one fails the whole request with device.revocation_invalid and revokes nothing.
  • If {did} is the current device (or current), this is a sign-out (§14): the reason is signed_out, reason is ignored, and no fresh authentication is needed.
  • Otherwise fresh authentication is required (§9). Bot tokens get bot.not_allowed (bot owners use §15.4).
  • Revoking an already revoked device answers 200 with the record (idempotent).

DELETE /v1/me/devices/{did}. A body-less alias of POST …/revoke with reason: removed and no revocation, for clients and intermediaries that handle a request body on DELETE badly (RFC 9110 §9.3.5). It answers 204 (03 §2.5), and 204 again for an already revoked device. Requests that need a reason or a DeviceRevocation use POST …/revoke.

Response 200 to POST …/revoke:

{
  "device": { "did": "Yx3kP0aL9qR2sT5uV8wZ1A", "name": "Saxon's phone", "platform": "ios", "state": "revoked",
              "enrolled": false, "sharedComputer": false, "provider": "google", "authAt": "2026-11-02T09:05:40.311Z",
              "clientSoftware": "sloppyvoice-ios/1.0.3", "createdAt": "2026-11-02T09:05:44.000Z",
              "lastSeenAt": "2026-12-03T22:10:00.000Z", "expiresAt": null,
              "revokedAt": "2026-12-04T10:41:12.207Z", "revokedReason": "removed", "current": false },
  "identityStateVer": 18
}

identityStateVer is the ver of the IdentityState published by step 3 of §13, or null when none was needed.

12.10 User experience

  • The device list shows, per device: name, platform icon, "This device" for the current one, "Active now" or the last-seen time, and "Encryption set up" for enrolled devices. One action per device: "Remove".
  • Removing a device asks one confirmation ("Remove Saxon's phone? It will be signed out."), then, if needed, the fresh-authentication step.
  • For an enrolled device of a secure account, the confirmation adds one question, "Was it lost or stolen?" (default no; copy in 20). A yes sends reason: lost_or_stolen, and the client then follows 08 §10.8 (new recovery key, with the M4 save step).
  • If the device being removed is the account's last enrolled device and the user hasn't saved the recovery key (W8 is active), the confirmation adds one sentence that the recovery key is now the only way to read encrypted history on a new device (copy in 20). This sentence is context for W8 and M4 (00 §4.12), shown inside the confirmation; it is not a new warning (D-055).

12.11 Device activity log

The home server keeps, per account, a server-side device activity log of security-relevant device events for at least 90 days: device created (with provider and platform), re-authentication, provider linked or unlinked, device revoked (with reason), and the KeyBackup downloads that 08 §5.7 requires it to record. In v1 the log has no client API; it is available to the server operator (21) and for the account holder's data-access requests. What the user sees of it is the device list itself (provider, authAt, lastSeenAt, and with ?include=revoked, recent revocations).

12.12 The new-sign-in notice (W4d)

Trigger (D-084). A new sign-in is the creation of a device record by a login: the code exchange of §7.3 with intent login for a linked external identity. Sign-up (§8.4), bot-token creation (§15.4), re-authentication (§9.2) and provider linking (§10.3) aren't new sign-ins. The home server announces each new sign-in with device.added carrying via: "login" (§18) on the account's me stream, in the same transaction that creates the device record (§7.3 step 3).

Who sees it. A Full client or Web client raises W4d (00 §4.12.1) when it processes a device.added event with via: "login" whose device.did isn't its own and whose device.createdAt is later than its own device record's createdAt. So every device of the account that was signed in when the sign-in happened sees it once, whether the account is secure or not and whether the device is enrolled or not; the new device itself never does. A client that gets session.resync_required for its me stream (03) raises W4d in the same way for each device in GET /v1/me/devices?include=revoked whose createdAt is later than both its own createdAt and the last me event it processed, and whose provider isn't null. Bot clients have no user interface and raise nothing.

Frequency. Once per new device record (did) on each receiving device. The client records the dids it raised W4d for in device-local storage, with its other W4 alerts (07 §18.4); this state isn't shared through the vault. A sign-in whose device record was revoked before the client processed the event still raises W4d, because the sign-in happened.

Presentation. W4d never blocks and needs no tap: it is a fading notice (20 §3.4.4). It names the new device (name, or its platform), the provider (provider, by its display name in ServerMetadata auth.providers) and the time (createdAt). Its one action, "This wasn't me", opens the linked providers and the device list (20 §12.9 steps 1 and 2), where the user can remove the device (§12.9, with fresh authentication) and the provider (§10.4). The home server creates no notification record and no push for W4d (19 §5.3 reserves account_alert for W4a), and the client plays no sound.

Pairing. A device doesn't show W4d for a device that is being paired with it. When the M5 approver prompt (08 §6.9.2 step 1) appears for a pairing session whose new device is the did of a pending or visible W4d, the prompt replaces the W4d. While a device shows its own direction-B code (08 §6.9.3), it holds W4d for new sign-ins until the code screen closes, and drops it for a did that joined that session. In both cases the prompt or the joined-device line already names the device, the provider and the time. If W4c is raised for a did while that did's W4d is still on screen, W4c replaces it (20 §3.4.3). A replaced or dropped W4d is still listed in the device's security activity (20 §12.9).

Rationale: a new sign-in is the earliest sign of a hijacked provider login (D-071), and for an insecure account the only one. A notice on the user's other devices costs nothing when the user signed in themselves, and the device list already shows every sign-in with its provider (§12.10). It can't stop a takeover: an attacker who signs the victim's devices out before they process the event suppresses it there, and those devices then show the signed-out line with "This wasn't me" (§14.1).

13. Device revocation orchestration (D-017)

Every revocation, whatever its cause (§12.3), runs these steps. Steps 1 to 3 MUST complete before the request that caused the revocation gets its response (for revocations without a request, such as expiry, before the next expiry run). Steps 1 and 3 run in one database transaction (07 §11.8 updates the IdentityState "in the same transaction as 05's revocation"), and the S2S events of step 4 are enqueued in that same transaction (06's outbox rule). Later steps MUST start within 1 s and are retried until they succeed. A revocation is never rolled back.

Step Action Owner of the mechanism
1 Set the device record to revoked with revokedAt and revokedReason, and expiresAt to null; invalidate every access and refresh token of its family (or its bot token), keeping their hashes as §7.5 says; delete its push registrations (and with them 19's fetch tokens); delete the KeyPackages it published; cancel any pairing session it takes part in. 05; push registrations 19; KeyPackages 13; pairing 08
2 Close the device's event WebSockets at the home server with 03's session.closing (session_ended) carrying the problem auth.session_revoked with data.reason, and close code 4004 (03 §5.10). 03
3 Same transaction as step 1: update the IdentityState as 07 §11.8 steps 1 and 2 specify. A listed device moves from devices to revoked. An unlisted device of a secure account gets a revoked entry only when a DeviceRevocation was supplied. A supplied DeviceRevocation (§12.9, §14) is first checked as 07 §11.8 says, and becomes the entry's rev. If the device was listed, also apply 08 §10.4 in this transaction: mark the vault rotationPending, record pendingAt and the delisting ver, delete the device's box key and grants, and set phraseChangePending when revokedReason is lost_or_stolen. 07 §11.8; vault marking 08 §10.4
4 Send device.revoked to the account's audiences (06 §11.1), including every server on the account's community list (09), for every account regardless of security state, because remote sessions are bound to the did. Target: all audiences reached within 10 s. Audiences end the device's sessions within 60 s, revoke its voice leases and start removing its MLS leaves. The home server processes the event for its own hosted contexts in the same way. Payload 07; delivery and audiences 06; leaf removal 13; leases 15
5 Send device.revoked (payload 07) on me to the account's other active devices. 07
6 If step 3 marked the vault, send vault.rotation_needed (08 §14.3, with the revocation reason) to the remaining enrolled devices, so that one of them rotates the vault key (D-054) and, for lost_or_stolen, makes a new recovery key (08 §10.8). 08
7 A DeviceRevocation MAY also be uploaded later by any enrolled device (07 §11.7) for a device that is already revoked; the home server then publishes a new IdentityState including it and sends device.revoked again with rev (07). Using 07 §11.7 to revoke a device that is still active is a revocation like any other (reason removed) and needs fresh authentication unless it is the caller's own device (§9.1). 07

Steps 4 and 5 are the "after commit" sending of 07 §11.8 step 3, not an addition to it: each revocation produces exactly one device.revoked per audience and per own device, plus the repeat of step 7 when a DeviceRevocation is attached later.

The identity is kept: igen, the IdentityCertificate and every other device are unaffected. Contacts and channel members see nothing (00 §4.12.5: other users' removed devices never prompt). The user's own devices show no warning; their device list updates.

Rationale: steps 1 to 3 make the device useless at its home server, and invisible to verifiers that fetch a fresh IdentityState, before the user is told "Removed". Step 3 also removes the revoked device's access to the vault, step 4 covers remote sessions and MLS leaves, and step 6 gets the vault key rotated so the device can't read anything new in it. A DeviceRevocation (step 7) adds protection against a home server that later tries to relist the device (07).

14. Sign-out: POST /v1/auth/logout

Authorization: Bearer <access token> or Bot <token>. Optional JSON body:

Member Type Required Meaning
scope string No current (default): revoke this device, reason signed_out. others: revoke every other active device of the account, reason signed_out_elsewhere; requires fresh authentication. Bot tokens may use current only.
revocation string No With scope: current, a DeviceRevocation for this device (as in §12.9).

Responses: 204 for current; 200 with {"revoked": ["<did>", …]} for others. Each revocation runs §13. A scope: current logout with an expired, revoked or unknown token also answers 204. This is the exception of 03 §3.2 rule 8(b), which 03 §3.3 also records: the client is signed out either way, a 401 would only make it try to refresh a session it is ending, and the answer reveals nothing because no state changes. A scope: others request with such a token gets 401 as usual.

The client then deletes its tokens, its keys for this account (08) and its cached content, and shows the sign-in screen.

Signing out the last enrolled device. Signing out revokes the device (P-05-6), and signing in again creates a new, unenrolled device. When the current device is the account's last enrolled device, the sign-out confirmation MUST say that encrypted history will then need the recovery key on the next device (the §12.10 sentence, copy in 20). If W8 is also active, the client MUST offer "Save recovery key" (M4) before signing out, as the first and default action of that confirmation.

Rationale: sign-out of all other devices is the user's main tool after a suspected takeover. It needs fresh authentication so that a thief holding only a stolen token can't use it to lock the owner out. Signing out and in again is a common way people try to fix problems; for the last enrolled device without a saved recovery key, it would otherwise force a reset that every DM contact sees as W2.

14.1 When the client learns that its own device was revoked

A client that receives auth.session_revoked, or auth.refresh_reused, on any request or at session.hello, or whose socket is closed because its device was revoked (03), MUST:

  1. stop every session of this account (home and remote) and stop sending;
  2. if the account is secure, and the reason is neither signed_out nor account_deleted, fetch the public IdentityState once (GET /v1/users/{local}/identity, 07, no Authorization header) before discarding its local identity state, and apply 07 §18.1: if igen changed without this device causing it, it raises W4a on the sign-in screen (W4a's "This wasn't me" then leads, after signing in, to the device list and linked providers);
  3. delete its tokens, its keys for this account (identity key, DSK, vault keys; 08) and its cached content, as after a sign-out;
  4. show the sign-in screen, saying in one line that the device was signed out (copy in 20, keyed by the reason). For signed_out_elsewhere, removed and lost_or_stolen it names the time of the revocation, and, when W4a didn't fire, offers "This wasn't me", which after sign-in opens the device list and linked providers.

Rationale: an attacker who controls a linked provider might sign out every device of the victim before resetting the identity, so that no signed-in device is left to show W4a (§22.2). The public IdentityState check in step 2 keeps W4a visible in exactly that case. Step 3 makes sure a lost device that an honest client is still running erases its key material once the owner revokes it.

15. Bots (D-061)

15.1 Model

A bot is an account with kind: "bot", homed on one server, with an address in the server's shared namespace like any user or channel (D-020). It has a display name linked to its local part (D-005) and a public profile. It has no ProviderLinks and never uses the OAuth flow. It authenticates with bot tokens, and each bot token is exactly one device record of the bot (P-05-9), with platform: "bot".

Proposed decision (P-05-9): only a local account of kind: user that holds manage_bots in its home server's community (10) can create a bot there, and it becomes the bot's owner. Each bot token is one device record. Rationale: tying bot creation to a local, permissioned person keeps bot accounts accountable to someone the server knows; one token per device lets each bot process have its own DSK (HP-10) and lets one leaked token be revoked without stopping the others.

Who can do what:

Action Owner (while holding manage_bots) Owner without manage_bots Other local holders of manage_bots The bot itself (bot token)
View the bot and its devices Yes Yes Yes Its own (/v1/me, /v1/me/devices)
Edit name, about, avatar Yes No No Yes (/v1/me, /v1/me/avatar)
Create or rotate tokens Yes No No No
Revoke a token Yes Yes Yes Its own current token (§14)
Transfer ownership (fresh authentication, §9.1) Yes, to a local user holding manage_bots No Yes, to themselves, only when the owner no longer holds manage_bots No
Delete the bot Yes Yes Yes No

If the owner account is deleted, its bots are deleted with it (§16.2).

15.2 POST /v1/bots

Requires a home-session access token of an active local kind: user account holding manage_bots (else 403 core.forbidden with data.permission: "manage_bots", 10 §6.3; a caller that isn't an active local kind: user account gets bot.permission_required), fresh authentication (§9), and fewer than maxBotsPerAccount owned bots (bot.limit_reached). JSON body:

Member Type Required Meaning
name string Yes The bot's display name; its local part is derived and checked exactly as at sign-up (§8.4 step 5), including the shared namespace and confusable checks. The display name is processed by 01 §6.3: if only the display name collides (01 §5.3, data.field: "name") and the local part is free, creation doesn't fail; the bot is created with the prepared local part as its display name, and bot.account.name in the 201 body then differs from the name sent (01 §5.3).
about string No §11.1 limits.
deviceName string No Name of the first token's device; default "Bot token 1".
expiresAt string No Optional expiry of the first token, at most 2 years ahead (§15.4).

Response 201 Created. The token appears in this response only; the server can't show it again:

{
  "bot": {
    "account": { "address": "weatherbot@sloppyvoice.com", "name": "Weather Bot", "kind": "bot", "inc": "UFFSU1RVVldYWVpbXF1eXw", "state": "active",
                 "security": "insecure", "igen": 0, "about": "Posts the forecast at 7am.", "avatar": null,
                 "profileVersion": 1, "createdAt": "2026-12-04T11:00:00.000Z", "owner": "saxonjones@sloppyvoice.com" },
    "devices": [ { "did": "k9Qy0bW1yNc8sK2pT5uXgA", "name": "Bot token 1", "platform": "bot",
                   "clientSoftware": "unknown", "state": "active", "enrolled": false, "sharedComputer": false,
                   "provider": null, "authAt": null, "createdAt": "2026-12-04T11:00:00.000Z", "lastSeenAt": "2026-12-04T11:00:00.000Z",
                   "expiresAt": null, "current": false, "tokenHint": "dXl8", "tokenRotatedAt": "2026-12-04T11:00:00.000Z" } ]
  },
  "token": "svb_QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl8"
}

The bot starts active and insecure on an insecure server, and upgrade_required on a secure server (§15.6), with a new inc (§11.1). Its first device record is announced on the bot's own me stream with device.added via: "bot_token". bot.created goes to the owner's devices. Bot creation doesn't depend on auth.registration.

15.3 Managing bots

Method and path Who Purpose
GET /v1/bots Any local user Bots the caller owns, as {"items": [Bot…], "nextCursor": …}. With ?all=true (requires manage_bots), every bot on the server.
GET /v1/bots/{local} Owner, manage_bots holders One Bot.
PATCH /v1/bots/{local} §15.1 Body with any of name (same rule as §11.6), about, owner (canonical address; bot.invalid_owner if it isn't a local kind: user account holding manage_bots). A change of owner requires fresh authentication (§9.1), because it hands over the power to create tokens. Emits bot.updated (to the old and the new owner's devices when the owner changes), and account.profile_changed if the profile changed.
PUT, DELETE /v1/bots/{local}/avatar Owner As §11.7, for the bot.
DELETE /v1/bots/{local} §15.1; fresh authentication Deletes the bot account (§16, reason owner).

The Bot object is {"account": Account, "devices": [DeviceRecord…]}; devices lists the bot's active devices.

A non-owner without the right for an action gets bot.not_owner; a caller who can't see the bot at all gets core.not_found.

15.4 Bot tokens

bot-authorization = "Bot" 1*SP sv-token   ; with token-prefix "svb" (§7.4)
  • Bot tokens are sent as Authorization: Bot <token> (00 §7.3), and as the token of session.hello on the event WebSocket (03), where the svb_ prefix tells the server it is a bot token. A svb_ token sent with the Bearer scheme MUST be refused with core.unauthenticated.
  • A bot token is valid only at the bot's home server. At other servers the bot gets HomeAssertions (06) with its bot token and uses remote sessions, exactly as users do.
  • A bot token has no refresh token and doesn't expire, unless its owner set expiresAt (at most 2 years ahead) when creating or rotating it. The device record's expiresAt is that time (§12.2); when it passes, the device is revoked with reason bot_token_expired (§13). Bot devices have no inactivity expiry (§12.5).
Method and path Who Purpose
POST /v1/bots/{local}/tokens Owner; fresh authentication Body {"deviceName"?, "expiresAt"?}. Creates a device record and its token; 201 with {"token", "device"}. At most maxBotTokens active tokens per bot (bot.token_limit_reached).
GET /v1/bots/{local}/tokens Owner, manage_bots holders {"items": [DeviceRecord…], "nextCursor": null}.
POST /v1/bots/{local}/tokens/{did}/rotate Owner; fresh authentication Body {"graceMs"?, "expiresAt"?}. graceMs is an integer 0–86,400,000, default 0. Issues a new token for the same device record; the old token keeps working for graceMs, then stops. The device keeps its expiresAt unless the body sets a new one (at most 2 years ahead; null removes it). 200 with {"token", "device", "oldTokenValidUntil"}.
DELETE /v1/bots/{local}/tokens/{did} §15.1 Revokes that device (§13, reason bot_token_revoked).

Rotation isn't a revocation: the did, the device's DSK and its DeviceCertificate stay the same, and nothing is sent to other servers. Rationale: operators rotate tokens routinely, for example when staff change; a zero-downtime grace window and an unchanged device identity keep that invisible to everyone else.

Retries: a bot token is shown only in the response that issues it, and that response is never replayed (§7.4). After a lost response to POST /v1/bots, POST …/tokens or POST …/rotate, the owner tool lists the bot's tokens (GET /v1/bots/{local}/tokens), revokes the device it doesn't know (DELETE), and creates a new token.

If a token may have leaked, revoke it (DELETE) and create a new one instead of rotating it: a rotation with a grace period leaves the leaked token working for up to 24 h. Owner tools SHOULD offer "Revoke and replace" as the action for a suspected leak, and show the grace period only for routine rotation.

15.5 What bots can't do

A bot token is refused with bot.not_allowed for: /v1/auth/par, /v1/me/providers*, DELETE /v1/me, POST /v1/me/devices/{did}/revoke and DELETE /v1/me/devices/{did} for a device other than its own, POST /v1/auth/logout with scope: others, /v1/bots*, and pairing (08). A bot may call 07's identity endpoints with its bot token, including reset: for bots, the bot token itself stands in for fresh authentication, because the owner issued it and bot processes run unattended. A bot's identity is reset only by the bot itself, with its token (07 §15.6); this document has no endpoint through which an owner resets a bot's identity, because only the bot's process can create the new identity key. An owner who suspects a bot's key or token is compromised revokes the affected tokens (§15.4) or deletes the bot.

15.6 Insecure and secure bots

  • Insecure bots hold no keys (D-021) and can't enter secure contexts (Matrix F, security.account_required).
  • Secure bots. The bot SDK generates the identity key, an IdentityCertificate with kind: "bot", and one DSK per bot process, and registers them with 07's endpoints using the bot token: the identity once, then one DeviceCertificate per device (did of each bot token). The home server MUST refuse an IdentityCertificate whose kind differs from the account's kind (07 performs the check). Bots don't pair: the operator copies the identity key to each process through its own secret store. A KeyBackup is optional (08). A lost identity key means a reset, and DM contacts see a bot-worded W2 (07, 20).
  • On a secure server a new bot is upgrade_required until its identity is registered (§11.2).
  • Adding a bot to a secure context shows W6. Like every newcomer, a bot is served nothing from before its join (D-007, D-061 as amended; 09 §7.4, 14). There is no botsGetHistory setting.

15.7 Rate limits for bots

Bots get their own limits, applied per bot account across all its tokens, in addition to the per-session limits of 03. Defaults:

What Default limit
All authenticated requests 50 per second, burst 100
Messages posted (any context, 11) 5 per second per context; 30 per second in total
New DMs and group DMs As 12 §10.6 and 10 §12.1 set for every account, enforced by the hosting server (no bot-specific limit here)
HomeAssertions requested (06) 120 per hour
Event WebSocket connections 1 per device at a time

Exceeding a limit fails with core.rate_limited (03). Servers MAY grant individual bots higher limits.

16. Account deletion

16.1 DELETE /v1/me?confirm=…

Requires a home-session access token of a kind: user account (bots get bot.not_allowed; their owners use DELETE /v1/bots/{local}), fresh authentication (§9), and one query parameter. There is no request body, because intermediaries and HTTP libraries may drop a body on DELETE (RFC 9110 §9.3.5).

Query parameter Required Meaning
confirm Yes The account's canonical address, exactly, percent-encoded as 03 §2.6 says. Otherwise account.confirmation_mismatch. It is not a secret.

The client fills confirm after its own confirmation step (20); the parameter exists so that no stray or replayed request can delete an account.

Response 204 (03 §2.5). The deletion time is in the account.deleted event (§16.3). Deletion is immediate and final, with no grace period (D-091): there is no pending-deletion state, signing in again can't undo it, and the server MUST NOT delay any step of §16.2 beyond what §16.2 itself allows. Rationale: consistent with D-071's preference for immediate effect; a grace period would leave a half-deleted account whose address and data linger and would need a fifth account state.

16.2 What deletion does

In this order:

  1. Account. State becomes deleted. Every ProviderLink is deleted, so those external identities can sign up again. Remembered "Continue" choices (§5.4) are forgotten.
  2. Client notice. account.deleted (§16.3) goes on me to the account's devices, before step 3 closes their sockets, so the devices learn why they are signed out.
  3. Devices. Every device is revoked with reason account_deleted (§13), including the device.revoked events of §13 steps 4 and 5 (07 §11.8 has no exception for deletion).
  4. Bots. Every bot the account owns is deleted the same way, each with its own account.deleted (reason owner).
  5. Data at the home server. Deleted: profile, avatar; KeyBackup and AccountVault (08); KeyPackages (13); push registrations and notification records (19); DM index and message requests (12); community list (09); pairing sessions (08). Membership in the home community ends as 09 specifies for a deleted account. Deleted data MUST be unrecoverable from the live system at once and SHOULD be purged from backups within 30 days.
  6. Identity. The home server stops issuing HomeAssertions and publishes for the account what 07 specifies for a deleted account.
  7. S2S notice. account.deleted goes as an S2S event (§16.3) to the account's audiences (06 §11.1), including every server on the account's community list (09). The events are enqueued in the same transaction as step 1 (06's outbox rule), so the destination list is read before step 5 deletes the community list.
  8. Tombstone. The server keeps the address, kind, inc, deletedAt and last igen for the deleted-address quarantine of 01, during which the local part can't be registered again. Independently of the quarantine, for as long as the local part can ever be registered again, the server keeps the canonical address's last IdentityState ver, last igen, identity-key history and every inc it has had (07 §7.3, §11.9; §11.1); step 5 never deletes them. The public profile answers 410 account.deleted during the quarantine, then 404.

Content the account posted stays under each hosting server's retention rules (11), including on the home server in its role as a hosting server. Deletion doesn't erase messages elsewhere; clients show the author as a deleted account (20).

Rationale: the quarantine stops someone registering the same address at once to inherit the trust of the old one. After it ends, a new owner of the address is a new account with a new inc (§11.1, D-086): every server treats it as a stranger, even one that missed account.deleted (06 §11.6), and DM contacts see W2's new-account wording (07 §16.8).

16.3 The account.deleted payload

The event travels in the S2S event envelope of 06 and the client envelope of 03. This document owns its payload d:

Member Type Required Meaning
addr string Yes Canonical address of the deleted account.
kind string Yes user or bot.
inc string Yes The deleted account's incarnation (§11.1). Receivers apply the event only to what they hold for this incarnation (§16.4).
deletedAt string Yes Timestamp.
igen integer Yes The last identity generation; 0 if the account was never secure.
reason string Yes user (deleted by its owner), owner (a bot deleted by its owner or a manage_bots holder, or because its owner was deleted), admin (the server operator), unconfirmed (never-upgraded account on a secure server, §8.6). Receivers treat an unknown value as admin.

Client form (00 §7.4 envelope on the me stream of the account's own devices):

{
  "v": 1,
  "t": "account.deleted",
  "id": "01938fa0-4c2b-7e1d-8f3a-9b8c7d6e5f40",
  "ctx": "me",
  "seq": 112,
  "ts": "2026-12-04T12:00:00.250Z",
  "d": {
    "addr": "saxonjones@sloppyvoice.com",
    "kind": "user",
    "inc": "4OHi4-Tl5ufo6err7O3u7w",
    "deletedAt": "2026-12-04T12:00:00.000Z",
    "igen": 2,
    "reason": "user"
  }
}

S2S form (one event in the body of POST {base}/v1/federation/events, 06 §9.2 and §9.3):

{
  "events": [
    {
      "id": "01938fa0-4c2b-7e1d-8f3a-9b8c7d6e5f41",
      "t": "account.deleted",
      "ts": "2026-12-04T12:00:00.250Z",
      "orderKey": "saxonjones@sloppyvoice.com",
      "d": {
        "addr": "saxonjones@sloppyvoice.com",
        "kind": "user",
        "inc": "4OHi4-Tl5ufo6err7O3u7w",
        "deletedAt": "2026-12-04T12:00:00.000Z",
        "igen": 2,
        "reason": "user"
      }
    }
  ]
}

Registration for 06's catalogue (06 §10.1): origin is the home server; destinations are the account's audiences (06 §11.1), including every server on its community list (§16.2 step 7); lane high; orderKey the account's canonical address; subject binding: the domain of d.addr equals iss; no expiresAt; no give-up hook; a receiver that doesn't know the account answers ignored. 06 is asked to name the community-list servers in its catalogue row.

16.4 Receiving account.deleted

A server receiving the S2S event MUST:

  1. accept it only if the S2S request token's iss (06) equals the domain of addr, so only an account's home server can announce its deletion, and apply it only to records of the incarnation d.inc: if the server knows addr only under another inc (a later account at that address), it records the deleted mark for (addr, d.inc) (06 §11.4) and does nothing else;
  2. process it idempotently (06 deduplicates by event ID);
  3. within 60 s, end every remote session of addr (06) and revoke its voice leases (15);
  4. end the account's memberships as 09 specifies, keeping bans and audit records keyed by the address (10);
  5. remove the account's leaves from every secure group it hosts (13);
  6. apply 12's rules to DMs and group DMs it hosts that include the account;
  7. mark any cached profile of addr deleted.

16.5 User experience

Deletion is in account settings, behind one screen that says in plain words what happens: the address can't be used again for a while, messages already sent stay where they were sent, and this can't be undone. The client then runs fresh authentication if needed and sends the request. There is no waiting period and nothing to cancel (D-091): the client never offers to undo or schedule a deletion (20 §12.10).

17. Public profile

17.1 GET /v1/users/{local}/profile

Public: no authentication, open CORS, rate-limited (§17.3). As 03 §3.2 rule 6 requires, a request that carries an invalid Authorization header gets 401, except an S2S token (03 §3.2 rule 8(a)). Clients call this endpoint without one; a server MAY attach an S2S token to obtain per-peer limits (06 §8.1), which never causes a 401. {local} is the local part, percent-encoded UTF-8. The server processes it exactly as 01 §9.2 "Path parameter processing" steps 1 to 5 say: it percent-decodes once, looks up minimalPrepare of the result, and runs the full profile only to explain a miss, so grandfathered names keep working (01 §5.8, AD-14). It answers for the entry it finds, with the canonical address in the body, and never redirects.

Response 200 with ETag: "<profileVersion>" and Cache-Control: public, max-age=300. If-None-Match gives 304.

Member Type Required Meaning
address string Yes Canonical address.
name string Yes Display name; never empty (the prepared local part unless the account's holder chose another capitalization or spacing, 01 §6.3). Receivers MUST apply 01's display-name check and fall back to the local part on a mismatch.
kind string Yes user or bot; unknown treated as bot.
inc string Yes The account's incarnation (§11.1, D-086), so that other servers and clients can tell a later account at the same address from an earlier one.
about string Yes As in §11.1.
avatar Avatar or null Yes §11.1.
profileVersion integer Yes As in §11.1.
{
  "address": "saxonjones@sloppyvoice.com",
  "name": "Saxon Jones",
  "kind": "user",
  "inc": "4OHi4-Tl5ufo6err7O3u7w",
  "about": "Mostly here for the board-game nights.",
  "avatar": { "url": "https://chat.sloppyvoice.com/server/v1/users/saxonjones/profile/avatar?v=4",
              "sha256": "n4bQgYhMfWWaL-qgxVrQFaO_TxsrC4Is0V1sFbDwCgg", "contentType": "image/webp",
              "width": 512, "height": 512 },
  "profileVersion": 4
}

The profile deliberately omits the security state (the IdentityState at /v1/users/{local}/identity, 07, is the only source for it), the creation date, the bot's owner, devices and providers. inc is random, so it reveals no date.

Errors: 400 address.invalid_local_part (01 §9.2) for malformed input; 404 core.not_found when no account has this local part (including when it names a channel, and for suspended accounts); 410 account.deleted during the deleted-address quarantine.

17.2 GET /v1/users/{local}/profile/avatar

{local} is processed as in §17.1. Returns the image bytes with their Content-Type, X-Content-Type-Options: nosniff and Content-Security-Policy: default-src 'none'; sandbox. When the v query parameter equals the current profileVersion, the response carries Cache-Control: public, max-age=31536000, immutable; otherwise the current image is served with max-age=300. No avatar: 404 core.not_found. Same rate limits as the profile.

17.3 Rate limits and caching

Default: 120 profile or avatar requests per minute per client IP address (an IPv4 address, or an IPv6 /64). Federation peers fetch profiles for many users from a few addresses, so a server SHOULD exempt the source addresses of peers it currently federates with (servers whose S2S requests it has accepted in the last 24 h) from that limit, or give them a higher one (default 1,200 per minute). Servers that fetch profiles for their users SHOULD cache them for at least 300 s and revalidate with If-None-Match, and SHOULD refetch early when they receive account.profile_changed.

17.4 account.profile_changed

Proposed decision (P-05-14): after a change to an account's public profile, the home server sends the S2S event account.profile_changed to the account's audiences (06), coalesced over 60 s. Rationale: member lists on other servers then show a new display name or avatar within about a minute instead of after their cache expires, at the cost of one tiny event.

Member of d Type Required Meaning
addr string Yes Canonical address.
inc string Yes The account's incarnation (§11.1). A receiver whose cached profile has another inc discards it and refetches.
profileVersion integer Yes The new version.

Registration for 06's catalogue (06 §10.1):

Origin → destination Lane orderKey Subject binding expiresAt Give-up hook Unknown account
Home server → each audience of the account (06 §11.1, including community-list servers) normal The account's canonical address (d.addr) The domain of d.addr equals iss None None: losing the event is harmless ignored

A receiver SHOULD refetch the profile if its cached profileVersion is lower than d.profileVersion, and ignores the event otherwise.

18. Events

All client events here are durable events on the account's me stream (00 §7.4), delivered to the account's active devices; bot.* events go to the owner's devices.

Type Payload d Sent when
account.updated {"account": Account} Any change to the Account object, including state, security and profile.
account.deleted §16.3 The account is deleted (§16.2 step 2, before sockets close).
auth.provider_linked {"link": ProviderLink} §10.3.
auth.provider_unlinked {"linkId": "…"} §10.4.
device.added {"device": DeviceRecord, "via": "login" | "signup" | "bot_token"} A device record was created: by a login (login, §7.3), sign-up (signup, §8.4) or bot token creation (bot_token, §15.2, §15.4).
device.updated {"device": DeviceRecord} Rename, enrolment change, bot token rotation.
device.revoked Owned by 07 §13 step 5.
bot.created {"bot": Bot} §15.2.
bot.updated {"bot": Bot} Any change to the bot or its tokens. On an ownership transfer, sent to the old and the new owner's devices.
bot.deleted {"addr": "…"} The bot was deleted. addr is its canonical address, named as in every event payload of this document.

S2S events in this document's areas: account.deleted (§16.3), account.suspended (§11.8), account.profile_changed (§17.4), and device.revoked (payload 07, triggered by §13).

device.added with via: "login" raises W4d on the account's other devices (§12.12, D-084). With any other via it isn't a warning and clients MUST NOT present it as one (00 §4.12, D-055); it updates the device list. Receivers treat an unknown via value as login.

{
  "v": 1,
  "t": "device.added",
  "id": "01938f2e-9a1b-7c2d-8e3f-405162738495",
  "ctx": "me",
  "seq": 78,
  "ts": "2026-12-04T10:15:30.512Z",
  "d": {
    "device": { "did": "oKGio6SlpqeoqaqrrK2urw", "name": "Saxon's laptop", "platform": "desktop",
                "clientSoftware": "sloppyvoice-desktop/1.0.3", "state": "active", "enrolled": false,
                "sharedComputer": false, "provider": "google", "authAt": "2026-12-04T10:15:30.123Z",
                "createdAt": "2026-12-04T10:15:30.500Z",
                "lastSeenAt": "2026-12-04T10:15:30.500Z", "expiresAt": "2027-12-04T10:15:30.500Z", "current": false },
    "via": "login"
  }
}

19. Error codes

This document registers these codes in its areas (00 §7.5). It also uses core.* (03), address.* (01) and security.* (00 §4.11). At /v1/auth/par and /v1/auth/token the HTTP status follows §7.8 (400 for OAuth errors), not the column below.

Code HTTP Retryable userAction Meaning data
auth.invalid_client 400 No none Unknown or unusable client_id, or its metadata document can't be fetched or is invalid. —
auth.invalid_redirect_uri 400 No none The redirect URI isn't registered for the client. Never redirected. —
auth.unsupported_grant_type 400 No none Grant type other than the two of §7.2. —
auth.invalid_grant 400 No sign_in Code or refresh token invalid, expired or used; PKCE mismatch; client mismatch. —
auth.refresh_reused 401 No sign_in Refresh-token reuse; the device was revoked (§7.6). did
auth.session_revoked 401 No sign_in The token belongs to a revoked device. reason (§12.3)
auth.home_session_required 403 No none A remote-session token was used on a home-only endpoint. —
auth.provider_unknown 400 No none Provider ID not configured or disabled. provider
auth.provider_error 502 Yes retry The provider failed or returned an error other than a cancel. provider
auth.access_denied 403 No none The user cancelled at the provider or on the "Continue to …" page. —
auth.transaction_expired 400 No retry The sign-in took longer than 10 minutes, the browser lost the transaction cookie, or the consent form was invalid (§5.4). Shown as a page. —
auth.reauth_required 403 No sign_in The operation needs fresh authentication (§9). The only code for this, in every document (§9.1). maxAgeMs, providers
auth.reauth_mismatch 403 No sign_in The provider account used to confirm isn't linked to this account. —
auth.registration_closed 403 No none No account is linked to this provider account and sign-up isn't possible. Usually the person picked the wrong provider account; the client offers "Use a different sign-in?" (§7.3). reason: server or provider; provider; providerLabel (optional)
auth.invite_required 403 No none Sign-up needs an invite code. —
auth.invite_invalid 400 No none The invite code is unknown, expired, used up or not valid for sign-up (09 §8.7). —
auth.terms_not_accepted 400 No none acceptTerms missing or false. termsUrl
auth.signup_token_invalid 401 No sign_in Sign-up token unknown, expired or out of attempts. The client restarts the login flow. —
auth.identity_already_linked 409 No sign_in This provider account already has an account (another sign-up won, or a retried sign-up already succeeded); the client restarts the login flow. —
auth.provider_in_use 409 No none The provider account is linked to a different Sloppy Voice account. —
auth.last_provider 409 No none Unlinking would leave no usable sign-in. —
auth.too_many_providers 409 No none maxLinkedProviders reached. max
auth.too_many_devices 409 No none maxDevices reached (§12.7). maxDevices
account.suspended 403 No contact_admin The account is suspended. —
account.deleted 410 No none The account was deleted. —
account.confirmation_mismatch 400 No none confirm isn't the account's canonical address. —
account.avatar_invalid 400 No none Unsupported type, undecodable, or larger than 4096 × 4096. —
device.already_revoked 409 No none The device is revoked. —
device.name_invalid 400 No none Name empty, too long or with control characters. —
device.revocation_invalid 400 No none The supplied DeviceRevocation failed the checks of 07 §11.8. —
bot.not_allowed 403 No none The operation isn't available to bot tokens. —
bot.permission_required 403 No contact_admin Creating bots needs an active local user account. —
bot.not_owner 403 No none Only the owner may do this. —
bot.invalid_owner 400 No none The new owner isn't a local user holding manage_bots. —
bot.limit_reached 409 No none maxBotsPerAccount reached. max
bot.token_limit_reached 409 No none maxBotTokens reached. max

20. Limits and timers

ServerMetadata limits owned by this document (00 §7.12; advertised in limits, 02):

Limit Default Floor
maxDevices (active device records per account) 30 10
maxLinkedProviders 10 2
maxAvatarBytes 1 MiB 256 KiB
maxBotsPerAccount (bots one account owns) 10 1
maxBotTokens (active tokens per bot) 10 2

Timers:

Timer Value
Pushed request (request_uri) 60 s, single use
Authorization transaction and its cookie 600 s
Authorization code 60 s, single use
Access token 900 s
Sign-up token 900 s, 5 attempts
Refresh-token retry window 30 s
Fresh authentication 600 s (05, 07); 3,600 s for 08's KeyBackup download; 86,400 s for turning on encryption (07 §11.4, D-085) (§9.1)
Consumed sign-up token hash kept Until the token's original expiry (at most 900 s)
Unused sign-up device revoked 15 minutes after creation
Hashes of a revoked device's tokens kept At least 30 days
Open authorization transactions 20 per bound account; 200 per IP address (IPv4, or IPv6 /64)
Device inactivity 365 days (desktop, ios, android); 90 days (web); 12 h (shared computer); none (bot)
Bot token expiry (optional) At most 2 years ahead
Device activity log retention At least 90 days
Expiry run interval At most 600 s
lastSeenAt update granularity 60 s
Revocation effective on all server nodes 5 s
device.revoked fan-out target 10 s (06)
Audiences end sessions after device.revoked, account.deleted or account.suspended 60 s
Client metadata cache 300 s to 24 h
Remembered "Continue" At most 90 days
Bot token rotation grace 0 to 86,400 s
Never-upgraded account deletion (optional) 30 days
Revoked devices shown in ?include=revoked 30 days

Default rate limits (servers MAY change them; exceeding gives core.rate_limited):

Endpoint Default
/v1/auth/par, /v1/auth/authorize 30 per minute per IP
/v1/auth/token 60 per minute per IP; 1 refresh per 10 s per family (retries of §7.6 rule 2 excepted). The server checks for reuse (§7.6 rules 2a and 3) before it applies the per-family limit, so a rate limit never hides reuse.
/v1/auth/signup 30 per hour per IPv4 address or IPv6 /64; 5 attempts per sign-up token (§8.2); 5 sign-up tokens issued per hour per external identity. Servers SHOULD rely on the per-identity limits and the optional human-verification step (§8.3) rather than tighter per-IP limits, because schools, offices, events and carrier-grade NAT put many people behind one address.
/v1/me/providers (POST, DELETE), POST /v1/me/devices/{did}/revoke, DELETE /v1/me/devices/{did}, DELETE /v1/me 10 per hour per account
/v1/users/{local}/profile and avatar 120 per minute per IP; federation peers exempt or 1,200 per minute (§17.3)
Bots §15.7

21. Test vectors

Encodings follow 04's test-vector conventions: bytes in hexadecimal, strings as UTF-8.

21.1 PKCE S256

Item Value
Verifier bytes 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
code_verifier (base64url of the bytes) AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8
code_challenge = base64url(SHA-256(ASCII verifier)) 6oZqdX5MOLq_qBJ8vppAnT4fk6AP8UiP9zX8-Rev_9A

21.2 Token format and storage hash

The stored value is SHA-256 over the ASCII bytes of the whole token string.

Kind Random bytes Token Stored SHA-256 (hex) Hint
Access 00 … 1f sva_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8 35ece1ac7251d4b4e2c7967feabe80302b7626563354a0dd3ddd7aa52ea091c8 dHh8
Refresh 20 … 3f svr_ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj8 e7080d7e83e8b78d87ff7327c65e5d8b35e82d3d75aa8dc1c249ffa9cef54e27 9Pj8
Bot 40 … 5f svb_QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl8 3b07d2bb2b34ab4a531db711c352059bbcd02acf80ee63bf1bd8a690ba290d33 dXl8
Sign-up 60 … 7f svs_YGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn8 07a12e4e6c3c77d203633c06ee289552036abca47ddbd17afcd64ec138959dde 9fn8

Every token above is 47 characters long. Negative cases: sva_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8= (padding) and SVA_AAEC… (uppercase prefix) MUST be rejected as malformed.

21.3 Device ID

Item Value
16 random bytes a0a1a2a3a4a5a6a7a8a9aaabacadaeaf
did oKGio6SlpqeoqaqrrK2urw (22 characters; last character w)
Rejected oKGio6SlpqeoqaqrrK2urx (non-zero trailing bits), oKGio6SlpqeoqaqrrK2urw== (padding)

21.4 Redirect URI matching

Client registered redirect_uris: ["http://127.0.0.1/callback", "https://app.example.org/oauth/callback", "org.example.sloppy:/oauth"], client_id https://app.example.org/sloppy-client.json.

Presented redirect_uri Result Why
http://127.0.0.1:53682/callback Accept Loopback; port ignored
http://localhost:53682/callback Reject localhost not accepted
http://127.0.0.1:53682/callback/ Reject Path differs
https://app.example.org/oauth/callback Accept Exact match, same origin as client_id
https://app.example.org/oauth/callback?x=1 Reject Not an exact match
https://evil.example/oauth/callback Reject Not registered
org.example.sloppy:/oauth Accept Exact match
sloppyv:/oauth Reject Reserved scheme (would be refused at registration too)

21.5 Name suggestion

These vectors assume 01 accepts Latin letters with diacritics, Han characters and the lengths shown, and that every local part is free unless stated. Reviewers MUST re-check the outputs against 01's final rules.

Claims suggestedName suggestedLocal
name = Saxon Jones Saxon Jones saxonjones
name = Zoë O'Brien Zoë O Brien zoëobrien (7a 6f c3 ab 6f 62 72 69 65 6e)
name = Ann-Marie Smith-Jones Ann Marie Smith Jones annmariesmithjones
name = Ivan Иванов (mixed scripts) Ivan ivan
name = 🎮 Gamer Gamer gamer
name = 李小龍 李小龍 李小龍
no name or given_name; preferred_username = saxon_j saxon j saxonj
name = Saxon Jones; saxonjones taken Saxon Jones 2 saxonjones2

21.6 Refresh rotation scenarios

Family F, token R1 issued at t = 0.

Step Request Result
1 t = 100 s: refresh with R1 OK: R2 issued; R1 rotated at 100 s
2 t = 110 s: refresh with R1 (response to step 1 was lost; R2 unused) Retry window: R2 invalidated; R3 issued
3 t = 120 s: refresh with R3 OK: R4 issued
4 t = 125 s: refresh with R1 Reuse (R1's current successor is R3, which has been used): device revoked, auth.refresh_reused
5 t = 126 s: refresh with R4 auth.session_revoked, data.reason token_reuse

Second scenario: R1 rotated to R2 at t = 100 s; R2 used at t = 105 s; R1 presented at t = 108 s → reuse, because the current successor has been used, even though the 30 s window hasn't passed.

Third scenario (a thief inside the retry window, rule 2a):

Step Request Result
1 t = 100 s: the client refreshes with R1 OK: R2 and access token A2 issued to the client; R1 rotated
2 t = 110 s: a thief who copied R1 refreshes with it (R2 unused) Retry window: R2 and A2 invalidated; R3 and A3 issued to the thief
3 t = 115 s: the client calls the API with A2 core.unauthenticated; the client refreshes (03 §3.3)
4 t = 115 s: the client refreshes with R2 Reuse (R2 was invalidated, so it counts as rotated): device revoked, auth.refresh_reused
5 t = 130 s: the thief refreshes with R3 auth.session_revoked, data.reason token_reuse

21.7 Account incarnation

Item Value
16 random bytes e0e1e2e3e4e5e6e7e8e9eaebecedeeef
inc 4OHi4-Tl5ufo6err7O3u7w (22 characters; last character w)
Rejected 4OHi4-Tl5ufo6err7O3u7x (non-zero trailing bits), 4OHi4-Tl5ufo6err7O3u7w== (padding)

The examples of this document use this value for saxonjones@sloppyvoice.com and UFFSU1RVVldYWVpbXF1eXw (bytes 50 … 5f) for weatherbot@sloppyvoice.com.

22. Security considerations

22.1 What protects an account

An insecure account has no keys (D-021). Its security is exactly: TLS to the home server, the provider logins linked to it, and the tokens this document issues. Its home server can impersonate it anywhere (00 §5.2). A secure account adds an identity key that neither the provider nor the home server holds, but every access to the home server, including starting a reset, still rests on a provider login (D-071).

22.2 Takeover of a linked provider account (D-071)

Someone who controls one of the victim's linked provider accounts (for example a hijacked Google account) can:

  • sign in and get a new device record, which reaches every insecure context the victim can reach;
  • for a secure account, use that unenrolled device only in insecure contexts (D-058); it can't pair without the victim approving on an enrolled device (08), and can't decrypt the KeyBackup without the recovery key (08);
  • pass fresh authentication (§9), because they control the provider, so they can link their own provider, unlink the victim's others (keeping at least one), sign out the victim's devices, delete the account, turn on encryption for an insecure account with a key of their own (§22.3, D-085 doesn't stop someone who controls the provider), and reset the identity, which takes effect at once with no hold (owner decision D-071).

A reset is silent in channels (D-035). The mitigations are the ones the owner accepted:

  • W4a on each of the victim's own devices, at once, when the identity changes without that device causing it (07). Signing out the victim's devices first doesn't suppress W4a: a client of a secure account that finds its own device revoked MUST check the public IdentityState before it discards its identity state, and raises W4a on the sign-in screen if the identity changed (§14.1).
  • W2 for every DM and group DM contact who pinned the old identity key (07), which blocks sending to a verified contact until they accept the new key.

This document adds:

  • Backup sign-ins. An account with two linked providers survives the loss of one only if the victim acts first: the victim signs in with the other, signs out every other device (scope: others), and unlinks the hijacked provider. An attacker who acts first can do the same to the victim, because fresh authentication through the hijacked provider lets them link their own provider and unlink the victim's (at least one link must remain, and it can be the attacker's). Every link and unlink emits auth.provider_linked or auth.provider_unlinked to all the account's devices, so a victim with a signed-in device sees it happen in the provider list. Clients suggest "Add a backup sign-in" once after sign-up (§8.8). A seniority rule (newer links can't remove older ones) was considered and not adopted: it would leave an owner unable to remove an old provider account that was lost or compromised.
  • Visibility. Every new device record emits device.added and appears in the device list with the provider used, and every new sign-in shows W4d, "New sign-in on device (provider)", on the account's other signed-in devices (§12.12, D-084). It is the earliest sign of a takeover and the only one for an insecure account. It gives no time to act before a reset (D-071), and an attacker who signs the victim's devices out before they process the event suppresses it there; those devices then show the signed-out line with "This wasn't me" (§14.1).
  • No e-mail matching (P-05-1): taking over an e-mail address, or registering a provider account with the victim's e-mail, gives nothing.

Residual risk: an attacker with the victim's only linked provider can permanently take the account (and, for a secure account, replace its identity in channels without other members noticing). This is the accepted risk of D-071; 22 records it.

22.3 Refresh-token theft

A stolen refresh token gives the thief the victim's session until one of them refreshes after the other has. Then reuse detection (§7.6) revokes the device, which ends both copies. This includes a thief who presents a copied token inside the 30 s retry window: the victim's successor token is invalidated and counts as rotated (rule 2a), so the victim's next refresh revokes the device (§21.6, third scenario). The thief keeps an access token for at most 15 minutes. Tokens can't be sender-constrained without account keys, which D-021 forbids for insecure accounts; for that reason this document relies on rotation, the 15-minute access-token lifetime, secure storage on the client (§7.7) and the device list. A thief who uses a stolen refresh token and then keeps refreshing before the victim's client does will lock the victim's device out (it gets auth.refresh_reused, and that revokes the thief too). The victim signs in again.

Almost nothing persistent can be gained, because linking and unlinking providers, revoking other devices, deleting the account, managing bots, resetting the identity and turning on encryption need fresh authentication (§9). Turning on encryption accepts a provider sign-in up to 24 h old (D-085), so a token stolen from a session that signed in within the last day can still attach the thief's key to an insecure account: the victim's devices then become unenrolled and show "Approve this device", which none of them can approve, and DM contacts who start a secure DM meanwhile pin the thief's key without a warning (an upgrade raises none). A token of an older session can't do this. The victim recovers by removing the thief's device (with fresh authentication) and resetting or turning encryption off, which shows W2 to any contact who pinned the thief's key. 22 records the residual risk (RR-10).

22.4 Authorization flow attacks

Attack Defence
Code interception by another app on the device PKCE S256 on leg A (§6.2); loopback redirects; claimed HTTPS redirects preferred on mobile.
A local app starting its own flow with the loopback client ID or a private-use scheme, riding the provider's single sign-on The "Continue to …" page, which such clients can never skip silently and can't have remembered (§5.4, RFC 8252 §8.6).
Code injection, login CSRF, session fixation Client state; PKCE; the transaction cookie binds the provider leg to the starting browser (§6.4); codes bound to client, redirect URI and challenge.
Mix-up between providers or between home servers RFC 9207 iss on both legs (§4.3, §6.6); one fixed callback URL; transaction found by upstream state.
Silent token theft by a website, through provider single sign-on The "Continue to …" page, skipped only for trusted clients with a claimed HTTPS redirect or after an interactive provider login (§5.4).
Forged consent from another page on the same site or host Single-use consent token tx, Origin and Sec-Fetch-Site checks (§5.4).
Clickjacking of server pages frame-ancestors 'none' (§6.5).
Open redirect Exact redirect-URI matching; errors before validation are never redirected (§6.2).
SSRF through client metadata URLs Public-address-only fetches, no redirects, size and time limits (§5.1).
Forged or substituted ID tokens Full ID-token validation, algorithm allow-list, nonce, azp (§4.3).
Code or token leakage through logs and Referer Referrer-Policy: no-referrer, no-store, tokens never logged, hashes stored (§7.4).
Replay of a code Single use; a second redemption revokes what the first one issued (§6.6).

A user can still be phished by a malicious app they chose to install or a look-alike website. The "Continue to …" page names the app and its host; the protocol can't do more.

22.5 Enumeration and privacy

  • Address availability is public by design (01, M2). Whether a given provider account has a Sloppy Voice account is revealed only to whoever controls that provider account. auth.provider_in_use never says which account.
  • The home server stores only the external identity key and a label shown to the account holder. It never uses e-mail addresses for anything else and SHOULD NOT request the email scope unless the admin wants labels.
  • The public profile shows only what the user chose to publish; it omits security state, devices, providers and dates (§17.1). Its inc is a random value that shows only whether an address still belongs to the same account (D-086). Avatars are re-encoded and stripped of metadata (§11.7).
  • lastSeenAt is visible only to the account holder. Device records store no IP addresses in this protocol.

22.6 Bots

Bot tokens are long-lived bearer credentials. They are stored only as hashes, carry a scannable prefix, can be rotated without downtime and revoked one by one, and are valid only at the bot's home server. A leaked token of a secure bot also lets its holder reset the bot's identity (07 §15.6), which DM contacts see as a bot-worded W2 and channels don't see at all; this is why a leaked token is revoked, not rotated (§15.4). A secure bot is a full member of the contexts it joins: whoever runs it can read everything it can read, which is why W6 is shown (D-061). A bot's reach is limited by the roles it is given in each community (10), not by this document.

22.7 Shared computers

Shared-computer mode limits what a later user of the same browser can find: tokens and keys in memory only (not in sessionStorage, which "Reopen closed tab" restores), a best-effort sign-out when the page goes away, and server-side revocation 12 h after last use. It can't protect against a computer that is already compromised (for example a keylogger); 20 tells users not to turn on encryption on a computer they don't trust.

22.8 Deletion and re-registration

Deletion is immediate and final (D-091): there is no grace period, nothing can restore a deleted account, and a later account at the same address is always a new one. The deleted-address quarantine (01) keeps the address unused for 365 days. After it, the new account has a new incarnation (§11.1, D-086), so servers carry nothing of the old account over to it, even servers that missed account.deleted (06 §11.6), and DM contacts see W2's new-account wording rather than a key change (07 §16.8). Bans and audit records stay keyed by address (10 §9.2), so a re-registered address doesn't escape an old ban.

23. Open questions

OQ-05-1 (a new-sign-in notice) and OQ-05-2 (a deletion grace period) were answered by the owner on 2026-12-04: D-084 adds W4d (§12.12), and D-091 keeps deletion immediate with no grace period (§16.1).

OQ-05-3 (owner): Is a provider login acceptable to remove a lost device? Removing a device other than the current one needs fresh authentication (§9), so someone who lost their phone signs in at their provider again (password or passkey) before "Remove" works. Without it, a thief holding only a stolen token could sign the owner out everywhere. Recommendation: keep the requirement; it costs one provider login in a rare, already stressful moment, and it is the only thing stopping a token thief from locking the owner out.

24. References

24.1 Normative

  • RFC 2119, RFC 8174 — requirement key words
  • RFC 3339 — timestamps; RFC 3986 — URI syntax; RFC 4648 — base64url; RFC 5234 — ABNF
  • RFC 5646 (BCP 47) — language tags (ui_locales)
  • RFC 6265 — HTTP cookies; draft-ietf-httpbis-rfc6265bis — SameSite and cookie prefixes
  • RFC 6749 — OAuth 2.0; RFC 6750 — bearer token usage
  • RFC 7636 — PKCE
  • RFC 8252 — OAuth 2.0 for native apps
  • RFC 9126 — OAuth 2.0 pushed authorization requests
  • RFC 9207 — OAuth 2.0 authorization server issuer identification
  • RFC 9700 — OAuth 2.0 security best current practice
  • OpenID Connect Core 1.0; OpenID Connect Discovery 1.0
  • RFC 7515 — JWS; RFC 7517 — JWK; RFC 7519 — JWT; RFC 7518 — JWA (ID-token algorithms)
  • RFC 8259 — JSON; RFC 7493 — I-JSON; RFC 9457 — problem details; RFC 9562 — UUIDv7
  • FIPS 180-4 — SHA-256
  • RFC 9110 — HTTP semantics (conditional requests, status codes, DELETE content)
  • RFC 6454 — the web origin concept and the Origin header; W3C Fetch Metadata Request Headers — Sec-Fetch-Site (§5.4)
  • Sloppy Voice documents 00, 01, 02, 03, 04 (dependencies); 06, 07, 08, 09, 10, 12, 13, 15, 19, 20 (owners of mechanisms this document triggers)

24.2 Informative

  • draft-ietf-oauth-client-id-metadata-document — OAuth Client ID Metadata Document (the model for §5.1)
  • RFC 9449 — DPoP (considered and not used, §22.3)
  • W3C Web Locks API — cross-tab refresh serialization (§7.7)
  • RFC 7009 — token revocation (replaced here by /v1/auth/logout and device revocation)
  • RFC 8414 — authorization server metadata (not used; the client knows the endpoints from the base URL)
  • RFC 8265 — PRECIS usernames; Unicode UTS #39 — confusables (through 01)
  • draft-ietf-httpapi-ratelimit-headers — rate-limit headers (through 03)
  • GitHub documentation, "Authorizing OAuth apps" — the protocol: github provider profile
  • spec/DECISIONS.md — decision log