Protocol guide
Sign-in, accounts and bots
How clients sign in through their home server with OAuth and PKCE, how sessions, devices and tokens work, and how accounts, profiles, bots and deletion behave.
Specification: 05 Accounts, login, sessions, devices and bots
Every credential a client holds comes from its home server. This page follows a client from the first sign-in to account deletion. The full rules are in document 05. Identity keys, pairing and the vault are in Secure accounts; sessions on other servers are in Federation.
How sign-in works
Sign-in has two independent OAuth legs (05 §3.1):
- Leg A, between your client and its home server. The home server is the authorization server and your client is a public client with no secret. It uses the authorization code grant with PKCE
S256, following RFC 8252 and RFC 9700, and issues Sloppy Voice tokens. - Leg B, between the home server and a login provider such as Google or GitHub. The home server is a confidential OpenID Connect relying party and keeps the provider's tokens to itself.
Your client only talks to its own home server. There are no passwords: a server MUST NOT offer password login, so people sign in only through the providers the admin configured (05 §4.1). The provider's e-mail address has nothing to do with the Sloppy Voice address, and accounts are never matched by e-mail, because that would let anyone with a provider account using the same e-mail take the account over (05 §4.4).
Before drawing a sign-in screen, read auth and links from ServerMetadata (05 §3.3, Discovery):
{
"auth": {
"providers": [
{ "id": "google", "name": "Google", "type": "google" },
{ "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" }
}- Show one button per entry of
auth.providers, in order.typeonly picks a familiar button style. signup: falsemeans the provider signs in to existing accounts but can't create new ones.auth.registrationisopen,inviteorclosed. Treat an unknown value asclosed.links.terms, when present, means sign-up requires accepting the terms.
The home server's issuer identifier is its base URL exactly, for example https://chat.sloppyvoice.com/server.
Client identity
Any Sloppy Voice app can sign in to any home server, so clients aren't registered (05 §5.1). A client_id is either:
- an HTTPS URL serving a Client ID Metadata Document with
client_id(the URL itself),client_name(1–64 characters, shown on the consent page),redirect_uris(1–10), and optionallyclient_uriandlogo_uri; or urn:sloppyv:client:loopback, which needs no document and may only use loopback redirects. Desktop apps SHOULD use it.
A redirect URI must match a registered one exactly (simple string comparison), except that the port of a loopback URI is ignored, and it must not contain a fragment (05 §5.2):
| Form | Example | Rules |
|---|---|---|
| Loopback (desktop) | http://127.0.0.1:53682/callback |
Literal IP only; localhost is refused. |
| Claimed HTTPS (web, mobile) | https://app.example.org/oauth/callback |
Same origin as the client_id URL. |
| Private-use scheme (mobile, desktop) | org.example.sloppy:/oauth |
Contains a period; not sloppyv, http, https, javascript, data, file or about. |
How each platform runs the flow (05 §6.8):
- Desktop: the loopback client ID. Listen on
127.0.0.1or[::1]on an ephemeral port for the flow only, and open the authorize URL in the default browser. - Mobile: a metadata-document client ID with a claimed HTTPS redirect or a private-use scheme, through
ASWebAuthenticationSessionor Custom Tabs. - Web: a metadata-document client ID on the client's own origin. Keep
stateand the code verifier insessionStoragewhile navigating, and redeem the code with a cross-originfetch. Never use the implicit flow or put tokens in URLs.
Warning
Native apps MUST use the system browser or a platform authentication session, never an embedded web view (05 §5.2), because an embedded view lets the app see what the user types at the provider (RFC 8252 §8.12) and every major provider blocks it (05 §6.8).
The sign-in flow
1. Generate the secrets
Generate a state of at least 128 random bits (1–512 characters) and a code_verifier of 43–128 characters from [A-Za-z0-9-._~], made from at least 256 random bits and never reused. The challenge is BASE64URL(SHA-256(code_verifier)) (05 §6.2). Test vector (05 §21.1): verifier AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8 gives challenge 6oZqdX5MOLq_qBJ8vppAnT4fk6AP8UiP9zX8-Rev_9A.
2. Push the request
POST /v1/auth/par is optional for a login and required for re-authentication, because only a pushed request can carry the session's access token (05 §6.1). The body is form-encoded or JSON with snake_case names:
POST /server/v1/auth/par HTTP/1.1
Host: chat.sloppyvoice.com
Content-Type: application/x-www-form-urlencoded
client_id=urn%3Asloppyv%3Aclient%3Aloopback&response_type=code
&redirect_uri=http%3A%2F%2F127.0.0.1%3A53682%2Fcallback
&code_challenge=6oZqdX5MOLq_qBJ8vppAnT4fk6AP8UiP9zX8-Rev_9A&code_challenge_method=S256
&state=Yv8n2kQe7Tq0pL1sWc9fZg&provider=google{ "request_uri": "urn:ietf:params:oauth:request_uri:mQ3rV0bW1yNc8sK2pT5uXg", "expires_in": 60 }The server answers 201 Created. The request_uri is single-use and valid for 60 s.
3. Open the authorize URL
Open GET /v1/auth/authorize with client_id and request_uri, or with the full set: client_id, response_type=code, redirect_uri, code_challenge, code_challenge_method=S256, state, and optionally provider, prompt=select_account and ui_locales (05 §6.2). Without provider the server shows its own chooser. Unknown parameters such as scope are ignored.
https://chat.sloppyvoice.com/server/v1/auth/authorize?client_id=urn%3Asloppyv%3Aclient%3Aloopback&request_uri=urn%3Aietf%3Aparams%3Aoauth%3Arequest_uri%3AmQ3rV0bW1yNc8sK2pT5uXgThe server checks client_id and redirect_uri first. If either is invalid it shows an error page and never redirects, because it can't trust the redirect URI. Every later error comes back to your redirect URI.
4. The server's side
You don't implement this part, but it explains the errors you can receive:
- The server creates an authorization transaction, sets a path-scoped
__Secure-svtx-…cookie that ties the flow to this browser, and redirects to the provider (05 §6.3, §6.4). The cookie stops login CSRF; it is never an API credential. - At GET /v1/auth/callback it checks the cookie, validates the ID token, and records the time as
authAt(05 §6.5). - If the provider identity is linked to an account, the transaction belongs to that account; otherwise it becomes a pending sign-up.
The transaction expires 10 minutes after it starts. A slow user, or a browser that lost the cookie, sees an auth.transaction_expired page asking them to go back to the app and try again.
The "Continue to …" page. If the visitor is already signed in at the provider, the provider may answer silently, so any website or local app that starts a flow could get tokens without the user doing anything. Before it issues a code, the server therefore shows "Continue to client_name (host) as saxonjones@sloppyvoice.com?" with Continue and Cancel (05 §5.4). For the loopback client, which has no metadata document, the page says "an app on this computer" instead of a name and host. The server may skip the page only for a trusted client with a claimed HTTPS redirect, when the user just entered a credential at the provider, or when the user chose Continue for this client before (never remembered for the loopback client or a private-use scheme). Desktop users should expect to tap Continue whenever the provider answered from an existing session. The page posts to POST /v1/auth/consent; Cancel reaches you as error=access_denied.
5. Check the redirect
On success the server redirects with code, your state, and iss (05 §6.6):
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%2FserverOn failure it sends error, error_description, state, iss and sv_code, the Sloppy Voice error code, for example sv_code=auth.access_denied.
Warning
Check that state equals what you sent and iss equals the base URL you started with, and discard the response otherwise (05 §6.6). The state check stops injected codes; the iss check stops mix-ups between home servers.
The code is single-use and valid for 60 s. Redeeming it twice revokes what the first redemption issued.
6. Redeem the code
POST /v1/auth/token with grant_type=authorization_code. For a login, also send platform (desktop, web, ios or android) and client_software (1–64 printable ASCII characters, shown in the device list and never used for authorization, 05 §5.3); device_name and shared_computer are optional, and shared_computer is allowed only with platform web or desktop (05 §7.3).
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%20laptopA syntax error in the device parameters is core.invalid_request and doesn't consume the code, so you can fix it and retry within the 60 s. A bad code, verifier, client ID or redirect URI is auth.invalid_grant.
For a linked identity the server checks the account isn't suspended, enforces the device limit, creates the device record and its tokens, and returns:
{
"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
}
}The OAuth members keep their RFC 6749 names so libraries such as AppAuth work unchanged; the extensions are lowerCamelCase (05 §7.1, TokenResponse). The server also sends device.added with via: "login" to the account's other devices (New sign-in notice).
7. Route the user
After every sign-in or refresh, Full and Web clients route on the response (05 §11.5):
state: "upgrade_required": show the blocking "Turn on encryption to continue" screen.security: "secure"anddevice.enrolled: false: show "Approve from your other device". The user may choose "Not now"; the device then works in insecure contexts only.- Otherwise, the normal app.
Sign-up
The same "Continue with Google" button signs in or signs up. When the provider identity has no account, the code exchange still succeeds but returns a sign-up token and creates no device (05 §8.2):
{
"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"
}
}If sign-up isn't possible, the exchange fails with auth.registration_closed and data.reason server or provider. The usual cause is a person who picked the wrong provider account, so offer "Use a different sign-in?" and restart the login with prompt=select_account (05 §7.3).
Show "Choose your name", pre-filled with suggestedName, and check availability with GET /v1/addresses/{local}, debounced by 300 ms (05 §8.8). The suggestion isn't reserved, so availability is checked again at sign-up (05 §8.5). Show providerLabel ("Signed in with Google as …") with a link "Already have an account? Use a different sign-in" that restarts the login with prompt=select_account, fill inviteCode from an invite link without asking, and show a terms checkbox only when termsUrl is set. How names become addresses is in Addresses.
Warning
The sign-up token works only at /v1/auth/signup; anywhere else it gets 401 core.unauthenticated. Call public endpoints such as /v1/addresses/{local} without an Authorization header (05 §8.2).
Then call POST /v1/auth/signup with an ordinary JSON body (05 §8.4):
POST /server/v1/auth/signup HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bearer svs_YGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn8
Content-Type: application/json
{ "name": "Saxon Jones", "acceptTerms": true, "platform": "desktop",
"clientSoftware": "sloppyvoice-desktop/1.0.3", "deviceName": "Saxon's laptop" }inviteCode is required when inviteRequired is true (registration invite). The server checks the token, the body, the registration policy and invite (auth.invite_required, auth.invite_invalid), the terms (auth.terms_not_accepted), and the name against document 01 (address.* codes), in that order. It then checks that the provider identity is still unlinked (auth.identity_already_linked if another sign-up won the race). On success it creates the account, the provider link, the device and its tokens, and answers 201 with the same full token response as a login. If account.name differs from the name you sent after 01 §6.3 steps 1 and 2, the display name collided and the prepared local part was used; tell the person in one line that their name is shown in lowercase for now.
Retries. The sign-up token lasts 900 s, allows 5 attempts, and is consumed by success. A retry after a lost 201 gets 409 auth.identity_already_linked. On that code, or on auth.signup_token_invalid, restart the login flow, which signs in to the account that now exists. A device created by a sign-up whose tokens are never used is revoked 15 minutes after creation, so a lost response doesn't leave a device counting against maxDevices. After sign-up, suggest "Add a backup sign-in" once (Linked providers); within 10 minutes of the sign-up it needs no extra provider login, because authAt is still fresh (05 §8.8).
Secure contexts only
On a server whose ServerMetadata secure is true, a new account starts as state: "upgrade_required" with security: "insecure", and the client goes straight into the encryption ceremony. A server MAY delete an account that has stayed in upgrade_required for 30 days without ever registering an identity, with deletion reason unconfirmed (05 §8.6).
Tokens
Every credential is prefix_ followed by 43 base64url characters, 47 in total (05 §7.4):
| Prefix | Kind | Lifetime |
|---|---|---|
sva_ |
Access token | 900 s |
svr_ |
Refresh token | Until the device is revoked or expires |
svs_ |
Sign-up token | 900 s, 5 attempts |
svb_ |
Bot token | Until revoked, or an optional expiry of at most 2 years |
svc_ |
Authorization code | 60 s, single use |
Treat tokens as opaque apart from the prefix. Servers store only SHA-256 of each token and never log them. Responses that issue a token ignore Idempotency-Key and are never replayed, so recover from a lost response by restarting the login, or for bots by listing and revoking unknown tokens.
Access tokens
An access token works only at the issuing home server, for the /v1/ API and the event WebSocket (05 §7.5). Three failures need different handling:
| Error | Meaning | Action |
|---|---|---|
| core.token_expired | The access token expired. | Refresh and retry once. |
| core.unauthenticated | The access token was revoked on its own; the device is still active. | Refresh (HTTP API). |
| auth.session_revoked | The device is revoked; data.reason says why. |
Clean up and sign out. |
For at least 30 days after a device is revoked, the server answers auth.session_revoked for its tokens; after that it may answer core.unauthenticated instead (05 §7.5).
After every refresh, send the new token on an open event WebSocket with session.reauth, or the socket closes 60 s after the old token expires (Event WebSocket).
Refreshing
POST /server/v1/auth/token HTTP/1.1
Host: chat.sloppyvoice.com
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=svr_ICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj8
&client_id=urn%3Asloppyv%3Aclient%3AloopbackThe response has a new access token, a new refresh token and authAt. client_id must be the one the tokens were issued to. Insecure accounts hold no keys, so tokens can't be bound to a key; instead refresh tokens rotate on every use, with reuse detection (05 §7.6):
- A refresh marks the presented token rotated and issues a successor. Store the new token before using the new access token.
- If a rotated token comes back within 30 s and its successor is unused, the server treats it as a retry after a lost response: it invalidates the successor and its access token and issues a new pair.
- Any other use of a rotated or invalidated token is reuse. The server revokes the device and answers auth.refresh_reused; the user signs in again.
A refresh token has no absolute lifetime. The default rate limit is 1 refresh per 10 s per family, with rule 2 retries excepted (05 §20). A refresh on a suspended account fails with account.suspended without revoking the device. The scenarios in 05 §21.6, including a thief inside the retry window, are worth reading before you write refresh code.
Storing tokens
From 05 §7.7:
- Native apps MUST keep refresh tokens in the platform's secure storage (Keychain, Android Keystore, Windows Credential Manager or DPAPI, libsecret) and SHOULD keep access tokens in memory only.
- Web clients MUST NOT put tokens in
localStorageor cookies; they SHOULD use IndexedDB. In shared-computer mode tokens stay in memory only. - Serialize refreshes across every process and tab, one at a time. Web clients MUST use Web Locks or an equivalent, because two tabs refreshing at once can revoke the device.
- Notification extensions and service workers MUST NOT touch session tokens, because they would race the app; they use the push fetch token (Notifications).
OAuth endpoint errors
/v1/auth/par and /v1/auth/token return problem details that also carry the RFC 6749 error member (05 §7.8):
{
"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" }
}Note
At these two endpoints the HTTP status follows RFC 6749, not the error table: 400 for codes mapped to invalid_request, invalid_grant or unsupported_grant_type, 401 for invalid_client, 429 with Retry-After for core.rate_limited, and 500 or 503 for server_error. So auth.too_many_devices and account.suspended also arrive as 400 there. Branch on code, not status.
Fresh authentication
Some operations need proof that the person is present, not just a token holder, so a stolen token can't lock the owner out or destroy the account (05 §9.1):
fresh(session, maxAgeMs) = (now − session.authAt) ≤ maxAgeMsWhen the check fails, the request gets 403 auth.reauth_required with data.maxAgeMs and data.providers.
| Operation | maxAgeMs |
|---|---|
| Link or unlink a provider; revoke another active device (including by uploading a DeviceRevocation); sign out all other devices; delete the account; create or delete a bot, create or rotate a bot token, transfer a bot; identity reset | 600000 |
| KeyBackup download from an unenrolled device | 3600000 |
| Turn on encryption | 86400000 |
Renaming a device, signing out the current device and changing the profile don't need it. Bot tokens never carry fresh authentication, so bots can't call the 05 operations in the table (05 §9.1).
To satisfy it (05 §9.2):
Push a request with
intent=reauthand the session's access token. Setproviderto the linked provider used most recently on this device, or leave it out, in which case the server's chooser shows only the account's linked, enabled providers:POST /server/v1/auth/par HTTP/1.1 Host: chat.sloppyvoice.com Authorization: Bearer sva_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8 Content-Type: application/json { "client_id": "urn:sloppyv:client:loopback", "response_type": "code", "redirect_uri": "http://127.0.0.1:53682/callback", "code_challenge": "6oZqdX5MOLq_qBJ8vppAnT4fk6AP8UiP9zX8-Rev_9A", "code_challenge_method": "S256", "state": "Yv8n2kQe7Tq0pL1sWc9fZg", "provider": "google", "intent": "reauth" }Run the browser leg. The provider is asked for a fresh login (
prompt=login,max_age=0). A provider account not linked to this account fails with auth.reauth_mismatch.Redeem the code. You get a new access token and
authAtand no refresh token; keep the one you have. The device doesn't change.Retry the original request once.
Signing in again as a new device never satisfies the requirement for the old one. GitHub can't be forced to ask for a credential again, so a GitHub re-authentication proves less; it is still accepted so that GitHub-only accounts can remove a stolen device (05 §9.3).
Devices
A home session and a device record are the same thing (05 §12.1). A login or sign-up creates one DeviceRecord with one set of tokens, and signing out revokes it. A revoked did is never reused, so signing out and in again creates a new device; on a secure account that device must be approved again.
The record carries the did (22 characters, chosen by the server), name, platform (desktop, web, ios, android or bot), clientSoftware, state (active or revoked), enrolled (always false for an insecure account) and dkf while enrolled, sharedComputer, the provider and authAt of the session (null for bot devices), createdAt, lastSeenAt (at most 60 s stale), expiresAt (null once revoked), revokedAt and revokedReason once revoked, current for the caller's own device, and tokenHint and tokenRotatedAt for bot devices (05 §12.2). Treat an unknown platform as desktop and an unknown state as revoked.
Expiry, limits and shared computers
A device with no activity for its limit is revoked (05 §12.5):
| Device | Inactivity limit |
|---|---|
desktop, ios, android |
365 days |
web |
90 days |
sharedComputer: true |
12 h |
bot |
None; an optional token expiry instead |
These limits outlast MLS eviction, so a device that comes back after a long break rejoins its groups without being approved again.
An account has at most maxDevices active devices (default 30); bot devices count against the bot's own limit, not the owner's. At the limit the server first revokes devices whose expiry has passed, then may replace the oldest unenrolled device idle for 30 days, but never an enrolled one, because it may hold the only copy of the identity key. Otherwise the login fails with auth.too_many_devices; tell the user to remove a device from another signed-in device (05 §12.7).
Web and desktop sign-in screens offer one unchecked box, "This is a shared or public computer". When ticked, send shared_computer=true (or sharedComputer: true at sign-up); the setting is fixed for the life of the device record, and the server refuses it for ios, android and bot with core.invalid_request. The client then keeps tokens and keys in memory only, never in sessionStorage, because browsers restore it when a closed tab is reopened; it forgets the provider and address at sign-out; and a web client SHOULD send a best-effort logout on pagehide with fetch(…, {keepalive: true}) (05 §12.6).
Device endpoints
- GET /v1/me/devices lists active devices, most recently seen first;
?include=revokedadds those revoked in the last 30 days. With a bot token it lists the bot's own devices. - GET /v1/me/devices/{did} returns one;
{did}may becurrent. - PATCH /v1/me/devices/{did} with
{"name": "…"}renames it and emitsdevice.updated. A revoked device fails with device.already_revoked, an invalid name with device.name_invalid. - POST /v1/me/devices/{did}/revoke revokes it, with an optional body:
reason(removed, the default, orlost_or_stolen) andrevocation, a DeviceRevocation JWS that only an enrolled device can produce (Secure accounts). An invalidrevocationfails the whole request with device.revocation_invalid. It answers200withdeviceandidentityStateVer(nullwhen no IdentityState was published). - DELETE /v1/me/devices/{did} is a body-less alias with reason
removed, answering204.
Revoking your own device (or current) is a sign-out: the reason is signed_out, reason is ignored, and no re-authentication is needed. Revoking another active device needs fresh authentication, and bot tokens get bot.not_allowed. Revoking an already revoked device succeeds again (05 §12.9).
Every revocation runs the same steps (05 §13). Before answering, the server invalidates the device's tokens, deletes its push registrations, closes its event WebSockets with close code 4004 and updates the IdentityState. It then sends device.revoked to every server the account uses, so they end the device's sessions within 60 s, and to the account's other devices. Contacts see nothing.
Secure contexts only
For an enrolled device, the remove confirmation asks "Was it lost or stolen?". A yes sends reason: "lost_or_stolen", which makes the remaining devices rotate the vault key and create a new recovery key (05 §12.10).
New sign-in notice
When a login creates a device, the account's other devices get device.added with via: "login" (05 §12.12):
{
"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",
"provider": "google", "createdAt": "2026-12-04T10:15:30.500Z", "…": "…" },
"via": "login" }
}A Full or Web client raises the W4d notice once per did when the device isn't its own and its createdAt is later than its own device record's createdAt, and records the dids it raised W4d for in device-local storage. It raises W4d even if that device was already revoked by the time the event is processed, because the sign-in happened. Bot clients raise nothing. W4d is a fading notice naming the device, provider and time, with one action, "This wasn't me", that opens the providers and device list. Any other via (signup, bot_token) only updates the device list and MUST NOT look like a warning. Treat an unknown via as login. After session.resync_required on me, raise it from GET /v1/me/devices?include=revoked instead, for each device whose provider isn't null and whose createdAt is later than both your own createdAt and the last me event you processed; the spec doesn't say which timestamp of that event to compare against. The server sends no push for W4d and the client plays no sound. Wording is in Client requirements.
When your device is revoked
On auth.session_revoked or auth.refresh_reused, or a socket closed for revocation, you MUST (05 §14.1):
- stop every session of the account, home and remote;
- for a secure account, unless the reason is
signed_outoraccount_deleted, fetch GET /v1/users/{local}/identity without anAuthorizationheader before discarding local state, and raise W4a if the identity changed without this device; - delete the tokens, keys and cached content;
- show the sign-in screen with one line keyed by the reason.
Step 2 exists because an attacker who controls a linked provider might sign out every device before resetting the identity, leaving nothing signed in to show the warning.
Signing out
POST /v1/auth/logout with an optional body (05 §14):
{"scope": "current"}(the default) revokes this device with reasonsigned_outand answers204. It answers204even for an expired, revoked or unknown token, because you are signed out either way and a 401 would only make the client try to refresh a session it is ending.{"scope": "others"}revokes every other active device with reasonsigned_out_elsewhere, needs fresh authentication, and answers200with{"revoked": ["<did>", …]}. With an expired, revoked or unknown token it gets 401 as usual. Bots can't use it.
Afterwards, delete the tokens, keys and cached content for the account and show the sign-in screen.
Secure contexts only
Signing in again creates a new, unenrolled device. When the current device is the account's last enrolled one, the sign-out confirmation MUST say that encrypted history will then need the recovery key on the next device. If the recovery key hasn't been saved (W8 is active), the confirmation MUST offer "Save recovery key" as its first and default action (05 §14).
Linked providers
A second linked provider is a backup sign-in, which lets the owner recover if one provider account is lost or hijacked, provided they act first (05 §22.2). GET /v1/me/providers lists ProviderLink objects, ordered by linkedAt, with linkId, provider, providerName, an optional label of at most 64 characters (such as the provider e-mail, so the owner recognises it), enabled, linkedAt and lastUsedAt (05 §10.1, §10.2). A link to a provider the admin disabled stays, with enabled: false; when no enabled link would be left, tell the user to add another sign-in (05 §10.5).
Linking needs fresh authentication. POST /v1/me/providers takes the same PKCE values in lowerCamelCase and answers 201 with an authorize URL (05 §10.3):
{ "provider": "github", "clientId": "urn:sloppyv:client:loopback",
"redirectUri": "http://127.0.0.1:53682/callback",
"codeChallenge": "6oZqdX5MOLq_qBJ8vppAnT4fk6AP8UiP9zX8-Rev_9A", "codeChallengeMethod": "S256",
"state": "Yv8n2kQe7Tq0pL1sWc9fZg" }{
"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
}Open authorizeUrl and redeem the code as usual. The response has a new access token, no refresh token, and link, the new ProviderLink. An identity linked to another account fails with auth.provider_in_use, which never says which account. Linking the same identity twice returns the existing link, and an account may link several identities at the same provider. An account already at maxLinkedProviders (default 10) gets auth.too_many_providers.
Unlinking with DELETE /v1/me/providers/{linkId} needs fresh authentication and fails with auth.last_provider if no enabled provider would remain (05 §10.4). It revokes no session; it answers 200 with devicesSignedInWithIt so you can offer "Also sign out those devices", which revokes them one by one without a second re-authentication while authAt is still fresh.
The account
GET /v1/me returns account, the caller's own device, and authAt (absent for bots). Every /v1/me* and /v1/bots* endpoint refuses remote-session tokens with auth.home_session_required (05 §3.2).
addressnever changes.nameis the display name, linked to the local part so only spacing and capitalization can differ.kindisuserorbot. Treat an unknown value asbot, so an unknown kind is never shown as a person.incis the incarnation (below).stateisactive,upgrade_required,suspendedordeleted. Treat an unknown value assuspended.security(insecureorsecure) andigenmirror the account's IdentityState.aboutis 0–190 code points with at most 4 line breaks;avataris an object ornull.profileVersionstarts at 1 and goes up on every change toname,aboutoravatar.owneris set for bots only.
Incarnation
inc is 16 random bytes (22 base64url characters), assigned at creation and never changed. A deleted address registered again later always gets a new inc (05 §11.1). Key whatever you store about another account on (address, inc), and treat a different inc as a different account, not an update.
States
| State | Meaning | Allowed |
|---|---|---|
active |
Normal. | Everything. |
upgrade_required |
On a secure server, encryption not on yet. | Account, device and provider endpoints, and the encryption ceremony; nothing else (security.upgrade_required). |
suspended |
Suspended by the operator, or by a server-scope ban. | GET /v1/me and logout only; everything else is account.suspended. |
deleted |
A tombstone. | Nothing. |
Suspension is reversible: devices stay, and other servers end the account's sessions but keep its memberships (05 §11.2, §11.8). A bot is suspended while its owner is. Changes reach the account's devices as account.updated. Moderation is covered in Roles and moderation.
Profile and avatar
PATCH /v1/me takes name, about, or both (05 §11.6). A name that changes more than spacing and capitalization fails with address.display_name_mismatch, because the address is the identity; a name too close to another one is address.too_similar. An empty name resets it to the prepared local part. An about outside the limits is core.invalid_request. The server answers 200 with the Account; each change bumps profileVersion, sends account.updated to the account's devices and account.profile_changed to other servers.
PUT /v1/me/avatar takes the raw image as the body, with Content-Type image/png, image/jpeg or image/webp, up to maxAvatarBytes (default 1 MiB) and 4096 × 4096 (05 §11.7). The server scales it to fit 1024 × 1024, re-encodes it and strips all metadata, which removes location data and decoder exploits aimed at other clients. PUT answers 200 with the Account. DELETE /v1/me/avatar removes it. Both bump profileVersion. Errors are account.avatar_invalid and core.too_large.
Public profiles
GET /v1/users/{local}/profile needs no authentication; send no Authorization header (05 §17.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 PublicProfile leaves out security state, dates, devices, providers and a bot's owner. It carries ETag: "<profileVersion>" and Cache-Control: public, max-age=300, and If-None-Match gives 304. Malformed input is 400 address.invalid_local_part; a missing or suspended account is 404 core.not_found; a deleted one is 410 account.deleted during the quarantine. The avatar URL is cached immutable while v matches the current version.
Note
profileVersion restarts at 1 for a new account at a re-registered address, so the ETag and avatar URL alone can match an old cached copy. Compare inc too before reusing a cached profile, and discard one whose inc differs (05 §11.1, §17.4).
Bots
A bot is an account with kind: "bot" and an address like any user's (05 §15.1). It never uses the OAuth flow. It authenticates with bot tokens, and each bot token is one device record with platform: "bot", so each bot process has its own device and one leaked token can be revoked without stopping the others.
Only an active local kind: user account holding manage_bots in its home server's community can create a bot, and it becomes the bot's owner. Permissions split like this (05 §15.1):
- The owner, while it holds
manage_bots, edits the bot, creates and rotates its tokens, and can transfer it to another local user holdingmanage_bots. - The owner (with or without
manage_bots) and any other local holder ofmanage_botscan view the bot, revoke its tokens or delete it. - Another holder of
manage_botscan transfer the bot to themselves, but only when the owner no longer holdsmanage_bots. - The bot itself can edit its own name, about and avatar through
/v1/meand/v1/me/avatar, and revoke its own current token by signing out.
If the owner's account is deleted, its bots go with it.
Creating a bot
POST /v1/bots needs a home-session access token, fresh authentication and fewer than maxBotsPerAccount owned bots (default 10) (05 §15.2). A caller without manage_bots gets 403 core.forbidden with data.permission: "manage_bots"; a caller that isn't an active local kind: user account gets bot.permission_required; at the limit it is bot.limit_reached. The body takes name (checked like a sign-up name), and optionally about, deviceName (default "Bot token 1") and expiresAt for the first token:
{ "name": "Weather Bot", "about": "Posts the forecast at 7am." }{
"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",
"state": "active", "expiresAt": null, "tokenHint": "dXl8", "…": "…" } ]
},
"token": "svb_QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl8"
}The server answers 201 Created, and the token appears in this response only. The bot starts active on an insecure server and upgrade_required on a secure one, with a new inc. Its first device is announced on the bot's own me stream with device.added via: "bot_token", and bot.created goes to the owner's devices. As at sign-up, if only the display name collides, bot.account.name comes back as the prepared local part. A new bot joins no community until a member with manage_bots adds it (05 §8.7, Communities).
Using a bot token
Send it with the Bot scheme, and as the token of session.hello on the event WebSocket (05 §15.4):
GET /server/v1/me HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bot svb_QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl8A svb_ token sent as Bearer is refused with core.unauthenticated. The token works only at the bot's home server; elsewhere the bot uses remote sessions as users do. It has no refresh token and doesn't expire unless the owner set expiresAt (at most 2 years ahead). Bots get bot.not_allowed for /v1/auth/par, provider endpoints, account deletion, revoking other devices, logout with scope: others, /v1/bots* and pairing (05 §15.5). Bots have their own rate limits, applied per bot account across all its tokens on top of the per-session limits, and exceeding one gives core.rate_limited (05 §15.7):
- 50 authenticated requests per second, burst 100;
- 5 messages per second per context, and 30 per second in total;
- 120 HomeAssertions per hour;
- 1 event WebSocket per device at a time.
Managing tokens
From 05 §15.4:
- POST /v1/bots/{local}/tokens (owner, fresh authentication) takes optional
deviceNameandexpiresAt, creates another token and device, and answers201withtokenanddevice. A bot has at mostmaxBotTokensactive tokens (default 10); beyond that it is bot.token_limit_reached. - GET /v1/bots/{local}/tokens lists them as DeviceRecords.
- POST /v1/bots/{local}/tokens/{did}/rotate (owner, fresh authentication) with
{"graceMs": 3600000}issues a new token for the same device and answers200withtoken,deviceandoldTokenValidUntil. The old token keeps working forgraceMs(an integer from 0 to 86,400,000, default 0). The device keeps itsexpiresAtunless the body sets a new one (nullremoves it). Thedid, the device key and its certificate stay the same, and nothing is sent to other servers. - DELETE /v1/bots/{local}/tokens/{did} revokes one, with reason
bot_token_revoked.
From 05 §15.3:
- GET /v1/bots lists the bots you own;
?all=truelists every bot on the server and needsmanage_bots. GET /v1/bots/{local} returns one Bot, which is{"account": Account, "devices": [DeviceRecord…]}with the active devices. - PATCH /v1/bots/{local} edits
name,aboutorowner. Changingownerneeds fresh authentication, because it hands over the power to create tokens, and a new owner that isn't a local user holdingmanage_botsis bot.invalid_owner. - PUT /v1/bots/{local}/avatar and DELETE /v1/bots/{local}/avatar work as for your own avatar.
- DELETE /v1/bots/{local} needs fresh authentication and deletes the bot account with reason
owner.
A caller without the right for an action gets bot.not_owner; one who can't see the bot at all gets core.not_found.
Warning
If a token may have leaked, revoke it and create a new one; don't rotate it, because a rotation grace period leaves the leaked token working for up to 24 h (05 §15.4). After a lost response to a token-issuing call, list the tokens, revoke the one you don't recognise and create a new one.
Secure contexts only
A secure bot generates its own identity key, an IdentityCertificate with kind: "bot" and one device key per process, and registers them with its bot token. On a secure server the bot stays upgrade_required until its identity is registered. Bots don't pair; the operator copies the identity key to each process. Adding a bot to a secure context shows W6, and the bot gets nothing from before it joined (05 §15.6). An insecure bot can't enter secure contexts.
Deleting an account
DELETE /v1/me with confirm set to the account's canonical address and no body, because intermediaries may drop a body on DELETE (05 §16.1):
DELETE /server/v1/me?confirm=saxonjones%40sloppyvoice.com HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bearer sva_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8It needs fresh authentication and a kind: user account (bots get bot.not_allowed; their owners use DELETE /v1/bots/{local}), and answers 204. A wrong confirm is account.confirmation_mismatch. Deletion is immediate and final, with no grace period and nothing to undo, so never offer to undo or schedule it.
The server deletes the provider links, sends account.deleted to the account's devices before closing their sockets, revokes every device with reason account_deleted, deletes the account's bots (each with its own account.deleted, reason owner) and data, and tells other servers (05 §16.2):
{
"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" }
}reason is user, owner, admin or unconfirmed; treat unknown values as admin. Messages already sent stay where they were sent. The address is quarantined for 365 days, so nobody can register it at once and inherit the old account's trust; the public profile answers 410 during the quarantine and 404 after it. A new account at that address later gets a new inc and every server treats it as a stranger (05 §22.8).
Events and limits
Events on the me stream (05 §18): account.updated, account.deleted, auth.provider_linked, auth.provider_unlinked, device.added, device.updated, device.revoked, and, on the owner's devices, bot.created, bot.updated and bot.deleted.
ServerMetadata limits (05 §20):
| Limit | Default | Floor |
|---|---|---|
maxDevices |
30 | 10 |
maxLinkedProviders |
10 | 2 |
maxAvatarBytes |
1 MiB | 256 KiB |
maxBotsPerAccount |
10 | 1 |
maxBotTokens |
10 | 2 |
Every error code, with its status and userAction, is in 05 §19.