Every command in Sloppy Voice is an HTTPS request with a JSON body. Events travel the other way on one WebSocket per client session per server, covered in Event WebSocket. This page covers the rules every HTTPS endpoint follows, whichever document defines it, so read it before you write an HTTP client for the protocol. The endpoint pages assume all of it.

The rules come from document 03, which elaborates 00 §7.3, §7.4 and §7.6 to §7.12. A server conforms only if every endpoint it serves follows them, including endpoints other documents own (03).

Base URLs and paths

You learn a server's base URL through Discovery. It uses https, has no query, fragment or trailing slash, and you append paths to it directly: base https://chat.sloppyvoice.com/server and path /v1/community give https://chat.sloppyvoice.com/server/v1/community (03 §2.1).

Every endpoint is under {base}/v1/, with two exceptions:

  • {base}/meta returns ServerMetadata and is unversioned, so a client of any version can learn which versions the server speaks (GET /meta).
  • https://<fqdn>/.well-known/sloppyv is the discovery fallback, at the domain's origin root rather than under the base URL.

The event WebSocket is at {base}/v1/events, reached with wss instead of https (GET /v1/events). Each path prefix belongs to one document; the ownership table is in 00 §7.3.

Calls add an HTTPS endpoint outside the base URL. All call media goes through the hosting server's relay, and a client opens its relay connection with POST {relayUrl}/connect, where relayUrl comes from the call's join response and can be on a different host from the base URL (15 §6.1, 15 §6.2, Calls).

Path and query rules (03 §2.1, 03 §2.6):

  • No trailing slash. Paths are case-sensitive and every defined segment is lowercase. You MUST NOT add a trailing slash; a server never treats /v1/community/ as a different resource and SHOULD answer it with 404 core.not_found.
  • Context references are one segment, colon included: /v1/contexts/ch:01938a11-2b3c-7d4e-8f90-112233445566/messages. You MAY encode the colon as %3A or %3a; servers accept all three forms as the same resource.
  • Encode once. Servers decode each segment exactly once, so ch%253A… becomes ch%3A…, which isn't a context reference and gets 400 core.invalid_request (03 §17.5). A malformed path parameter gets 400; a well-formed one that names nothing gets 404.
  • me in /v1/me/devices names the caller's own account. It is a path segment, not the me stream.
  • Query parameters are lowerCamelCase with percent-encoded UTF-8 values; form serialization is acceptable, and servers accept both + and %20 for a space. Booleans are true or false, integers have no leading zeros, lists are comma-separated in one parameter, and unknown parameters are ignored. A repeated parameter the owner didn't define as repeatable gets 400. Never put a token or other secret in a query.

A path under /v1/ that the server doesn't implement gets 404 core.not_found with data.reason: "unknown_endpoint", which you treat as "feature absent". An endpoint the server implements but whose optional feature is off gets 501 core.unsupported_feature (03 §2.1). Decide what a server offers from its metadata, not by probing (Versioning and features).

Note

03 §2.1 doesn't say whether the 404 for a trailing-slash path carries unknown_endpoint. A client that reads that reason as "feature absent" could mistake its own trailing-slash bug for a missing feature.

Connections

Check your HTTP library's defaults against these rules, especially for redirects (03 §2.2, 03 §2.3):

  • HTTPS only, TLS 1.2 or later (1.3 RECOMMENDED), certificates validated against the WebPKI for the base URL's host with no "ignore errors" option in the normal user interface. Never send a request, token or WebSocket handshake over plain HTTP or ws:, and don't rely on a server's redirect from HTTP to HTTPS. Any HTTP version is allowed.
  • TLS early data. Servers SHOULD NOT accept 0-RTT; one that does answers any non-GET sent in early data with 425 core.too_early. Retry it once, at once, over the completed handshake without early data.
  • Redirects. You MAY follow a 307 or 308 to the base URL's own origin. Never follow a redirect to another origin while sending Authorization, and never follow 301, 302 or 303 for anything but GET.
  • Caching. Every response to an authenticated request carries Cache-Control: no-store. Public endpoints such as /meta define their own caching. A server MAY send ETag on GET responses and answer If-None-Match with 304.
  • Timeouts. Time a request out after 30 s unless its owner states a longer bound, and treat that as an ambiguous failure: the request may have been processed. Longer operations are modelled as 202 Accepted followed by an event.
  • User-Agent. Clients other than browsers SHOULD send <product>/<version>, for example sloppyvoice-desktop/1.0.3. Servers use it only for logging and diagnostics, never to change behaviour.

Clock offset

Device clocks are often minutes off, so you MUST estimate your offset to each server from its Date headers and envelope ts values and use the corrected time for iat, nbf and exp in every signed object you build for it, such as a DeviceProof. For a signed object addressed to no particular server, use the offset to your home server. You SHOULD also use the corrected time in the UUIDv7s you generate. Never change the device clock (03 §2.3).

Note

Date isn't a CORS-safelisted response header and isn't in the expose list of 03 §4, so a web client can't read it cross-origin. The spec doesn't resolve this; in a browser, envelope ts is the source you can use.

Media types and JSON

Request bodies and successful response bodies are JSON restricted to I-JSON (RFC 7493), UTF-8 without a byte-order mark, with Content-Type: application/json. Errors use application/problem+json. Accept both on every response (03 §2.4). The exceptions are few:

  • attachment upload and download bodies, which are opaque application/octet-stream bytes (Messaging);
  • the browser-navigation endpoints /v1/auth/authorize, /v1/auth/callback and /v1/auth/consent, which MAY return HTML and redirects and use a transaction cookie that authorizes nothing (03 §2.9);
  • POST /v1/auth/par and POST /v1/auth/token, which also accept form bodies and use RFC 6749 member names so standard OAuth libraries work; their errors are still problem objects, with statuses that follow 05 §7.8 (Accounts and login).

Any other Content-Type on a request with a body gets 415 core.unsupported_media_type, as does a charset other than utf-8; other parameters are ignored, and so is Accept. JSON endpoints refuse application/x-www-form-urlencoded, multipart/form-data and text/plain on purpose: application/json forces a CORS preflight on every write, and a later mistake that introduced ambient credentials still couldn't be exploited with a simple form post (03 §2.4, 03 §18.2).

HTTP bodies are never wrapped in the WebSocket envelope. The JSON rules (03 §2.4):

  • The top-level value is always an object; lists come wrapped, as in {"items": [...]}.
  • A body that isn't well-formed I-JSON, or has a duplicate member name in any object, gets 400 core.invalid_request.
  • Ignore unknown members everywhere. A server never rejects a request for one, which is what keeps minor versions additive.
  • An absent optional member and one set to null mean the same thing, unless the owner says otherwise and except in PATCH. Omit optional members rather than send null. A required member is always present and non-null unless its type includes null, as nextCursor does.
  • Integers are at most 2^53 − 1 in magnitude; larger values travel as decimal strings where the owner says so. Booleans are never strings or numbers.
  • Binary values are base64url without padding. Decoders MUST reject padding, white space, characters outside the alphabet and non-zero unused trailing bits, so every value has exactly one spelling and two forms of one device ID can't slip past a ban.
  • Members are lowerCamelCase, enum values lowercase snake_case, timestamps exactly 2026-12-04T10:15:30.123Z (UTC, three fractional digits), and durations integer milliseconds in members ending in Ms (03 §9).

Identifiers have one valid spelling, and a server rejects a non-canonical one (uppercase UUID hex, non-canonical base64url, a leading zero) with 400 instead of converting it. Addresses are canonicalized as Addresses describes, and a non-canonical address where a canonical one is required gets address.non_canonical (03 §8.1).

Methods and status codes

Method Use Idempotent
GET Read a resource or collection. Servers ignore a body. Yes
POST Create a resource, or perform an action the owner names. Only with a client-generated ID or Idempotency-Key
PUT Create or replace the whole resource at a known URL. Yes
PATCH Change some members of a resource. Only with Idempotency-Key, or when the owner says so
DELETE Remove a resource. No body unless the owner defines one. Yes
OPTIONS, HEAD CORS preflight; HEAD MAY be supported for any GET. Yes

An unsupported method gets 405 core.method_not_allowed with an Allow header (03 §2.5).

A PATCH body lists only the members to change. An absent member stays unchanged, null clears an optional member (and is invalid for a required one), and an object or array value replaces the stored value wholesale unless the owner defines finer merging. Owners MAY add control members such as dryRun. The response is the full updated resource (03 §2.5).

A DELETE succeeds with 204. Repeating it may return 204, 404 or 410 core.gone at the owner's choice, so a client retrying a DELETE MUST treat all three as success (03 §2.5).

Success codes are 200 with a body, 201 for a create (with Location where possible), 202 for asynchronous work whose completion an event reports, 204 with no body, and 304 for a conditional GET. The status table in 03 §2.5 lists which codes each error status carries (the core codes are in the table below); an owner uses a status outside that table only by registering an error code for it, as 13 does with 425 mls.commit_busy. Every 4xx and 5xx from a conforming server carries a problem object; proxies may send ones that don't (03 §2.5).

Authorization

Every authenticated request carries exactly one Authorization header; two get 400 core.invalid_request. The scheme is Bearer or Bot, matched case-insensitively, and the credential is an RFC 9110 token68 of at most 4,096 characters. Clients MUST treat tokens as opaque: issuers MAY add a short prefix such as rs_, but your code must not parse or depend on it (03 §3.1, 03 §3.2).

GET /server/v1/contexts/ch:01938a11-2b3c-7d4e-8f90-112233445566/messages?before=4182&limit=2 HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bearer rs_4kJ7yQm2xV0bP9sLwT3e

The credentials a client sends (03 §3.1):

Scheme Credential Accepted at
Bearer Home-session access token (Accounts and login) Client endpoints of the account's home server
Bearer Remote-session access token (Federation) Client endpoints of the remote server that issued it
Bot Bot token Client endpoints of the bot's home server only; elsewhere a bot uses a remote session like a user
Bearer Sign-up token POST /v1/auth/signup only
Bearer Fetch token (Notifications) GET /v1/me/notifications/{id} and POST /v1/me/notifications/read (ids selector) at the home server only
Bearer Event ticket (Notifications) GET /v1/me/notifications/events at the hosting server that issued it only
Bearer Webhook token POST /v1/contexts/{ctx}/webhooks/{id}/messages only
Bearer RelayTicket (sv-relay+jwt, Calls) POST {relayUrl}/connect of the relay it names only, once, within 60 s of issue (15 §5, 15 §6.2)

Servers use Bearer with an sv-s2s+jwt on server-to-server endpoints; clients never send one.

Note

The scheme table in 03 §3.1 doesn't list the RelayTicket; 15 §5 defines it.

Token rules

These apply to every token (03 §3.2):

  1. Never in URLs. No session, bot or S2S token appears in a path, query or fragment, so tokens don't leak through logs, Referer or history (03 §18.1). On the WebSocket the token goes in session.hello, because browsers can't set handshake headers. The one exception is an owner-defined capability URL, such as an attachment download URL, which grants one object, expires within 10 minutes, carries at least 128 bits of randomness and contains no token. Never log capability URLs.
  2. No ambient credentials. No cookie, HTTP authentication cache or client certificate ever authorizes an API request, which is what makes open CORS safe.
  3. Only to the issuer. Send a token only to the base URL of the server that issued it. A home-session token never goes to a remote server, and a remote-session token for b.com never goes to a.com. If discovery later gives a new base URL for that server, don't send the old token there unless your pin accepts the change (02 §10.2); get a new session.
  4. Right kind for the endpoint. A credential the endpoint doesn't accept gets 401 core.unauthenticated, unless its owner defines another answer: 403 core.forbidden for a misused fetch token, notify.ticket_invalid at the event-ticket endpoint, federation.s2s_unauthenticated for a client token on an S2S endpoint.
  5. Stale tokens on public endpoints. Public endpoints such as /meta and GET /v1/users/{local}/identity need no credential, but an invalid one still gets 401, so you learn that your token is stale.
  6. Never logged, and never echoed in a problem object.

Rule 8 of 03 §3.2 lists the owner exceptions to rules 4 and 5 above (rules 4 and 6 there). Apart from the event-ticket endpoint, the one a client meets is POST /v1/auth/logout with scope: current, which answers 204 whatever the state of the token.

Recovering from a 401

A 401 carries WWW-Authenticate naming the accepted schemes, with realm set to the server's canonical domain and, for Bearer, the RFC 6750 error parameter (03 §3.3):

HTTP/1.1 401 Unauthorized
Content-Type: application/problem+json
Cache-Control: no-store
WWW-Authenticate: Bearer realm="sloppyvoice.com", error="invalid_token", error_description="expired", Bot realm="sloppyvoice.com"

{
  "type": "urn:sloppyv:error:core.token_expired",
  "code": "core.token_expired",
  "title": "Session token expired",
  "status": 401,
  "retryable": true,
  "userAction": "none"
}

Recover without bothering the user wherever you can (03 §3.3):

Code Home session Remote session Bot
core.token_expired Refresh silently, retry once. Get a fresh HomeAssertion, create a new remote session silently, retry once. Report to the bot operator.
core.unauthenticated Try one refresh; if it fails, show sign-in. Recreate the remote session silently. Show sign-in only if the home server also answers core.unauthenticated. Stop and report; the token was revoked or rotated.

Remote sessions are cheap to recreate, so a remote server's 401 never shows a sign-in screen by itself. A user sees sign-in only when the home session is really gone. Related rules in other documents:

  • A token of a revoked device gets auth.session_revoked, which the table doesn't cover; refreshing won't help (05 §7.5).
  • Refresh tokens rotate on every use. Presenting a rotated one again revokes the device with auth.refresh_reused; the only exception is a retry within 30 s of the rotation while its successor is still unused (05 §7.6). So run one refresh per session at a time and let requests that hit 401 wait for it.
  • Remote sessions last 1 h and renew with a fresh HomeAssertion (06 §6.4); one that ended reports federation.session_ended, and its retry member says whether to create a new session silently (06 §6.10).
  • After every refresh or renewal, send session.reauth on that server's socket (Event WebSocket).

Note

core.token_expired is registered retryable: true, but retrying with the same expired token can't succeed, so handle it through the table above before generic retry logic sees it. core.unauthenticated carries userAction: sign_in even for a credential of the wrong kind, where signing in isn't the fix (03 §3.2, 03 §10.5).

Errors: problem details

Errors are RFC 9457 problem details with Content-Type: application/problem+json. The same object rides in d of a WebSocket error envelope and in refused subscription results (03 §10.1, ProblemObject).

Member Required Meaning
type Yes urn:sloppyv:error: + code. Key on code, not type.
code Yes The registered error code.
title Yes Short summary, at most 200 characters. Don't parse it.
status Yes The HTTP status; equal to the response status over HTTP.
detail No Human-readable detail, at most 1,000 characters.
instance No urn:uuid:<UUIDv7> for this occurrence in the server's logs.
retryable Yes Whether the same request may succeed later without any change.
retryAfterMs No Minimum delay before retrying. Required for core.rate_limited.
userAction Yes What the user can do (below).
data No Code-specific data defined by the code's owner.

A validation failure (03 §10.5):

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
Cache-Control: no-store
Access-Control-Allow-Origin: *

{
  "type": "urn:sloppyv:error:core.invalid_request",
  "code": "core.invalid_request",
  "title": "Invalid request",
  "status": 400,
  "instance": "urn:uuid:01a2424b-9d88-7111-a222-333344445559",
  "retryable": false,
  "userAction": "none",
  "data": {
    "errors": [
      { "source": "body", "pointer": "/mid", "reason": "format", "detail": "mid must be a lowercase UUIDv7" },
      { "source": "query", "name": "limit", "reason": "range", "detail": "limit must be 1 to 100" }
    ]
  }
}

data.errors holds at most 32 InvalidRequestErrorItem entries: source (body, query, path or header), a JSON Pointer pointer for body errors or a name otherwise, and a reason from missing, type, format, range, length, enum, duplicate, not_allowed and other.

Rules for every problem (03 §10.1, 03 §10.3):

  • If both Retry-After and retryAfterMs are present, use retryAfterMs; Retry-After is the same value in whole seconds, rounded up.
  • Render title and detail only as plain text, and preferably not at all. Never show raw statuses, codes or detail as the main message to a user.
  • Put instance in diagnostics and in the "contact the admin" flow, so an admin can find the log entry.
  • A problem never reveals resources the caller can't see, which is why hidden things are core.not_found, never core.forbidden (03 §18.6).

userAction

userAction lets a client offer the one fix without parsing text. Treat an unknown value as none (03 §10.2).

Value What the client does
none Show a short failure message. No button.
retry Retry automatically where allowed, then offer "Try again".
wait Retry after retryAfterMs; show a waiting state only after 2 s.
sign_in Recover silently first; if that fails, show the home server's sign-in screen, then resume the action.
enable_encryption Show gate card G1, then resume the action.
set_up_device Show gate card G2, then resume the action.
update_app Show "update required" for that server.
contact_admin Say only the operator can fix it, offer the contact details from ServerMetadata, and show instance.

A userAction applies only to the server that sent it, so a hostile remote server can't push the user into another server's screens. Only the home server can cause the sign-in screen; a remote server's sign_in triggers silent recreation of the remote session at most once per 60 s, and if that keeps failing you treat the server as unavailable. update_app and contact_admin affect only that server, and G1 and G2 apply only to the action the user was taking there (03 §10.2). Screen copy is in Client requirements.

The core codes

Each code has one status, one retryable value and one userAction, unless its entry makes one depend on a stated condition, as core.idempotency_conflict does. A code's status, userAction and meaning never change within protocol version 1. Always act on the values in the problem object you received (03 §10.4, 03 §10.5). Owners use a core.* code only where no more specific code would help the client act.

Code HTTP retryable userAction Meaning
core.invalid_request 400 false none Malformed or failed validation; data.errors.
core.unauthenticated 401 false sign_in No credential, or an invalid, revoked or wrong-kind one.
core.token_expired 401 true none The access token expired.
core.forbidden 403 false none Not allowed; data may name permission, ctx, missingRole.
core.not_found 404 false none No such resource or endpoint, or one you may not know exists; data.reason is unknown_endpoint for an endpoint the server doesn't implement.
core.method_not_allowed 405 false none Method unsupported; data.allow.
core.conflict 409 false none Conflicts with current state.
core.idempotency_conflict 409 in_progress: true; mismatch: false none Key or client ID reused (Idempotency).
core.gone 410 false none Permanently gone, or an expired cursor.
core.too_large 413 false none Exceeds an advertised limit; data.limit, data.max.
core.unsupported_media_type 415 false none Content-Type not accepted; data.accept.
core.too_early 425 true retry Non-GET in TLS early data.
core.rate_limited 429 true wait Rate limit exceeded; data.policy.
core.unsupported_version 400 false update_app Version, subprotocol or envelope version unsupported, or client below minClient; data.supported, data.minClient.
core.unsupported_feature 501 false none Endpoint exists, feature absent or off; data.feature.
core.internal 500 true retry Unexpected server error.
core.unavailable 503 true wait Server or a dependency temporarily unavailable.

Most errors you meet come from owners' areas, such as security.account_required; the session.* codes are WebSocket-only (Event WebSocket).

For a code you don't know, use the generic members: userAction decides what the user sees, retryable and retryAfterMs decide retries, and status picks the generic message. A 4xx or 5xx without a problem body comes from a proxy; map 401, 404 and 413 to the matching core code, 425 to core.too_early, 429 to core.rate_limited (with Retry-After, else 5 s), 502 to 504 to retryable core.unavailable, other 5xx to retryable core.internal, and other 4xx to non-retryable core.invalid_request (03 §10.3).

Retrying requests

Retry automatically only when all three hold (03 §2.7):

  1. the failure is a network error, a timeout, or retryable: true (without a problem object: 502, 503 or 504);
  2. the request is idempotent: GET, HEAD, PUT, DELETE, or a POST or PATCH with a client-generated ID or Idempotency-Key;
  3. the user hasn't cancelled.

Before retry n (from 0), wait a uniformly random delay in [0, min(30 000, 500 × 2^n)] ms, never less than retryAfterMs or Retry-After. Stop automatic retries of a user action after 5 attempts, or earlier where the owner says so, and show the problem's userAction. The message outbox and call rejoin have their own longer schedules (Messaging, Calls). Never retry a non-idempotent request automatically after an ambiguous failure, because it may have been processed; you MAY ask the user.

Note

03 §2.5 calls a PATCH idempotent "when the owner says so", but the retry rule lists only a PATCH with a client ID or Idempotency-Key. Send a key on every PATCH you may retry.

HTTP responses and events

A change made over HTTP is usually also reported as an event, as with POST /v1/contexts/{ctx}/messages and message.created. They can arrive in either order, so reconcile by the object's ID (for messages, mid). A seq learned over HTTP never advances your stream position, or you would skip the events in between (03 §2.8).

Pagination

Timelines

Timeline lists, such as GET /v1/contexts/{ctx}/messages, page by seq with before or after (mutually exclusive) and limit from 1 to 100, default 50. With neither, you get the most recent items. Both, or a bad limit, get 400 (03 §13.1).

GET /server/v1/contexts/ch:01938a11-2b3c-7d4e-8f90-112233445566/messages?before=4182&limit=2 HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bearer rs_4kJ7yQm2xV0bP9sLwT3e

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Access-Control-Allow-Origin: *

{
  "items": [
    { "seq": 4178, "mid": "01938f2f-0c1d-7a2b-8c3d-4e5f60718293", "content": { "text": "who's on tonight?" } },
    { "seq": 4181, "mid": "01938f2f-6e7f-7a8b-9c0d-1e2f30415263", "content": { "text": "hi" } }
  ],
  "hasMore": true,
  "headSeq": 4190
}

Reading a TimelinePage (03 §13.1):

  • items are always in ascending seq order, whichever direction you asked for, and their seq values have gaps: non-item events and items you can't see are left out.
  • Page backwards with before = items[0].seq, forwards with after = the last item's seq.
  • hasMore says whether older items you can see exist (with before or neither) or newer ones up to headSeq (with after). An empty page has hasMore: false.
  • headSeq is for the resync procedure only and never advances your position.

11 adds more modes to the messages endpoint, such as around and a changes feed (Messaging).

Collections

Other lists (members, roles, invites, reports, the DM index, devices) page by opaque cursor and limit (1 to 100, default 50; an owner MAY set another default and a maximum of up to 1,000 for an endpoint). The response is a CollectionPage with items in a stable order, nextCursor (null at the end) and an optional total (03 §13.2):

{ "items": [ { "addr": "alice@a.com", "name": "Alice", "state": "active" } ],
  "nextCursor": "c2VxPTUwJnJvbGU9Mw" }
  • Never build, change or parse a cursor; it needs no percent-encoding.
  • A cursor is valid only for the same endpoint, other query parameters and principal, and for at least 1 h. Misuse or a malformed cursor gets 400 core.invalid_request; an expired one gets 410 core.gone, and you restart from the first page.
  • An item that exists unchanged during a whole walk appears exactly once; items added or removed meanwhile may or may not appear.

Idempotency

A create that carries a client-generated ID is idempotent on that ID. Any other write can carry Idempotency-Key. Either makes a request safe to retry after an ambiguous failure (03 §14).

Client-generated IDs

The client generates each message's mid, and a few other IDs owners name, such as a HistoryShare's shareId. A create is idempotent on that ID within the scope its owner defines; for mid the scope is the context (03 §8.2, 03 §14.1):

  • The server records the ID with a fingerprint, by default the SHA-256 of the exact body bytes, so a retry MUST resend exactly the same bytes. An owner MAY compare differently: 11 compares sender, kind and target, so a message re-sealed under a newer epoch with the same mid is still a resend. The account is always part of the fingerprint.
  • A resend with the same fingerprint returns the status the owner defines, by default the original status (201), with the object's stored or current representation, and creates nothing. A different fingerprint gets 409 core.idempotency_conflict with reason: "mismatch", unless the owner defines a more specific code.
  • A duplicate that arrives while the first is still processing gets 409 with reason: "in_progress", retryable: true and retryAfterMs of at least 500.
  • An ID is reserved only when a create with it succeeds, so after a rejection that changed nothing (for example mls.commit_required or a validation error) you may resend the same ID with a different body. A reserved ID stays reserved while the object or its tombstone exists.
  • Servers never reject a client ID for its embedded time, since an outbox may hold one for days.

The Idempotency-Key header

Any POST, PATCH, PUT or DELETE to a client endpoint MAY carry Idempotency-Key, and servers honour it, apart from the exceptions below. It is ignored on GET, HEAD and OPTIONS and on requests without a credential (03 §14.2, IdempotencyKeyHeader):

  • The value is 1 to 64 characters from ALPHA / DIGIT / "-" / "." / "_" / "~", optionally quoted; "abc" and abc are one key, and a value outside the grammar gets 400 core.invalid_request. Send a fresh UUIDv7 per logical operation and the same value on every retry of it.
  • Keys are scoped to the caller's account and kept at least 24 h after first use; a repeat after that is treated as a first use.
  • The fingerprint is the method, the path decoded once per segment (so ch: and ch%3A match), the query parameters as sent and in their original order, and the SHA-256 of the exact body bytes.
  • A repeat with the same fingerprint returns the stored status, Location and body; one still in progress gets 409 in_progress; a different fingerprint gets 409 mismatch.
  • Only responses from requests that reached a state change are stored. A validation 400, 401, 403, 429 or load-shedding 503 isn't, so your retry is evaluated afresh.

Servers ignore the key on a request that carries a client-generated ID, where the ID's rules decide, and on endpoints whose response carries a new credential: POST /v1/federation/assertions, POST /v1/federation/sessions, POST /v1/auth/token, POST /v1/auth/signup, POST /v1/bots, POST /v1/bots/{local}/tokens and POST /v1/bots/{local}/tokens/{did}/rotate. Their owners say how to recover a lost response.

An example from 03 §14.2; the POST /v1/channels body is illustrative, and 09 owns it:

POST /server/v1/channels HTTP/1.1
Host: chat.sloppyvoice.com
Authorization: Bearer hs_Qm9iJ2xV0bP9sLwT3eRk
Content-Type: application/json
Idempotency-Key: "01a2424b-223e-75c3-8123-456789abcdef"

{"name":"Raid night","kind":"voice"}

Warning

Keep the exact bytes of any request you may retry. A retry re-serialized as {"kind":"voice","name":"Raid night"} means the same thing, but its SHA-256 differs, so the server answers 409 core.idempotency_conflict with reason: "mismatch" (03 §17.6).

Rate limits

Servers limit requests per client session, per IP address (per IPv4 address and per IPv6 /64) and per federation peer. The base policy names are session, ip, peer, socket and handshake; owners add policies named <area>.<name>, such as backup.download (03 §15.1). An over-limit request gets 429 core.rate_limited with retryAfterMs, data.policy, Retry-After in seconds, and RateLimit and RateLimit-Policy headers (03 §15.2):

HTTP/1.1 429 Too Many Requests
Content-Type: application/problem+json
Cache-Control: no-store
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Retry-After, RateLimit, RateLimit-Policy, Location, WWW-Authenticate, ETag, Deprecation, Sunset, Link
Retry-After: 3
RateLimit-Policy: "session";q=600;w=60, "ip";q=3000;w=60
RateLimit: "session";r=0;t=3

{
  "type": "urn:sloppyv:error:core.rate_limited",
  "code": "core.rate_limited",
  "title": "Too many requests",
  "status": 429,
  "retryable": true,
  "retryAfterMs": 2400,
  "userAction": "wait",
  "data": { "policy": "session" }
}

Servers MUST allow at least the floor, so a well-behaved client never hits a limit in normal use (03 §15.3):

Policy Floor Recommended default
session 120 requests per 60 s 600 requests per 60 s
ip, unauthenticated 60 requests per 60 s 300 requests per 60 s
ip, all requests — 3,000 requests per 60 s
peer 1,200 requests per 60 s 6,000 requests per 60 s
socket 20 messages per 10 s 60 messages per 10 s
handshake 10 handshakes per 60 s 30 handshakes per 60 s

What a client does (03 §15.4):

  • Never retry before retryAfterMs (or Retry-After) has passed.
  • Spread background work (prefetching, key-archive downloads, HistoryShare verification, KeyPackage uploads) to stay well under session, and use RateLimit headers, when present, to slow down before you are refused.
  • Show a waiting state only for user actions delayed more than 2 s.
  • Back off from 425 mls.commit_busy as from a 429, but retry 425 core.too_early at once (03 §15.2).

Note

The RateLimit header draft has changed syntax between revisions. Open question OQ-03-3 recommends treating those headers as advisory and relying on Retry-After and retryAfterMs (03 §19).

CORS

Web clients talk to many servers from one origin, so the API is open to every origin. That is safe only because nothing accepts ambient credentials: a hostile page without a token can do only what an anonymous caller can (03 §4, 03 §18.2).

  • Every response from /.well-known/sloppyv, {base}/meta and {base}/v1/, errors and S2S endpoints included, carries Access-Control-Allow-Origin: *, and never Access-Control-Allow-Credentials.
  • A preflight gets 204 with the headers below, without authentication or rate-limit headers. It doesn't count toward the session limit, though it MAY count toward the per-IP limit.
  • Responses expose at least Retry-After, RateLimit, RateLimit-Policy, Location, WWW-Authenticate, ETag, Deprecation, Sunset, Link.
  • Servers never authorize on Origin.
  • The relay's POST {relayUrl}/connect answers CORS like a /v1/ endpoint, with Access-Control-Allow-Origin: * and the Authorization and Content-Type request headers allowed, because a web client calls it cross-origin too (15 §6.1).
OPTIONS /server/v1/contexts/ch:01938a11-2b3c-7d4e-8f90-112233445566/messages HTTP/1.1
Host: chat.sloppyvoice.com
Origin: https://web.example.org
Access-Control-Request-Method: POST
Access-Control-Request-Headers: authorization, content-type, idempotency-key

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, HEAD, POST, PUT, PATCH, DELETE
Access-Control-Allow-Headers: Authorization, Content-Type, Idempotency-Key, If-None-Match
Access-Control-Max-Age: 86400

Authorization is listed explicitly because the * wildcard doesn't cover it. A server MAY list more headers, and browsers MAY cap the max age lower. The WebSocket handshake carries no CORS headers (03 §5.1).

Note

The expose list omits Date and Allow, so a web client can read neither. For a 405, data.allow of core.method_not_allowed carries the same list.

Versioning and features

Protocol version 1 is written sv1. Major version N is served at {base}/vN/ with WebSocket subprotocol sloppyv.vN (03 §12.1). Read {base}/meta before your first connection to a server, and again after 3 consecutive WebSocket handshake failures, because that is how a web client learns it must show "update required" (03 §5.1). The members that matter here, from the example in 02 §7.5, which shows only some limits; a real server lists every registered limit:

{
  "versions": ["1.0"],
  "minClient": "1.0",
  "features": ["voice-dc/1", "video-dc/1", "sfu-rtp/1", "webhooks"],
  "limits": {
    "maxRequestBytes": 1048576,
    "maxEventBytes": 1048576,
    "maxMessageBytes": 16384,
    "maxAttachmentBytes": 26214400,
    "maxSecureLeaves": 1000,
    "maxGroupDmParticipants": 25,
    "maxDmRequestBytes": 65536
  }
}
  • versions lists one major.minor per major version served, giving the highest minor implemented. Use the highest major both sides support, and never rely on a minor version above the one listed (03 §12.1). If no listed major is one you implement and every listed version is newer than yours, that is core.unsupported_version and you show "update required"; otherwise the server is too old for you, reported as discovery.version_unsupported (02 §7.4).
  • minClient is the lowest protocol version a client must implement. If you implement only a lower version of that major version, show "update required" for that server and use it for nothing but /meta; other servers keep working. A server MAY also refuse your session.hello with core.unsupported_version and close code 4026 (03 §12.4).
  • features lists every feature the server implements, mandatory ones included. Version 1 registers four: voice-dc/1 and video-dc/1 (mandatory for servers), sfu-rtp/1 (optional, required for SFU-capable servers) and webhooks (optional, insecure contexts only). Full and Web clients MUST support the first three. Secure mode is mandatory and has no flag. A list has at most 64 entries, and unknown names are ignored. The effective feature set is the intersection with the client's session.hello list, and neither side uses anything outside it (03 §12.2).

Decide what exists from features and versions, not by probing. A 404 with unknown_endpoint means no such endpoint; 501 core.unsupported_feature means the endpoint exists but its feature is absent or off; a 404 under /v1/contexts/{ctx}/… without unknown_endpoint means the context or object doesn't exist (03 §12.2).

Minor versions are additive only: new optional members, endpoints, event types, error codes, features, limit names, enum values and higher defaults. You keep working across them by ignoring unknown members, event types, features and limit names, handling unknown codes generically, and following each enum's stated unknown-value rule; where an enum states none, a client ignores the array element or object that contains the unknown value (03 §12.3). A breaking change gets a new major version, and the old one stays served for at least 12 months after the new one is first listed, with Deprecation and, once a date is fixed, Sunset headers. Never block the user while the old version works. After the sunset the old path answers 400 core.unsupported_version with userAction: update_app (03 §12.5).

Size limits

Limits are non-negative integers in ServerMetadata limits, named max<Thing><Unit>. Each has a default and a floor that every server accepts and never advertises below (03 §16.1):

  • Use the advertised value; if a limit is missing or invalid, assume its floor. Ignore unknown limit names (02 §7.3.3).
  • Never send anything larger than the advertised limit, and check before you send, so the user sees "too large for this server" before uploading rather than an error after (02 §7.3.3).
  • Exceeding a limit gets 413 core.too_large with data.limit and data.max, unless the owner defines a more specific code.

The limits indexed in 03 §16.3, with what each bounds from its owner (03 §16.2, 00 §7.12):

Limit Bounds Default Floor Owner
maxRequestBytes One JSON request body, after content decoding 1 MiB 256 KiB 03
maxEventBytes One WebSocket envelope, either direction 1 MiB 256 KiB 03
maxSubscriptions Streams per socket, not counting me 1,000 250 03
maxReplayEvents Events replayed per stream per resume (window at least 24 h) 5,000 1,000 03
maxMessageBytes One content object (content JSON, or SealedMessage plaintext) 16 KiB 8 KiB 11
maxAttachmentBytes One attachment file, before encryption 25 MiB 8 MiB 11
maxSecureLeaves Non-blank leaves in one MLS group 1,000 (at most 65,536) 100 13
maxGroupDmParticipants Group DM size 25 10 12
maxDmRequestBytes All message-request batches of one DM invitation 64 KiB 64 KiB 12
maxMlsUploadBytes MLS commit and bootstrap bodies (≥ 2,048 × maxSecureLeaves + 65,536) 8 MiB 3 MiB 13
maxFederationEventBytes One S2S event 128 KiB 128 KiB 06
maxDevices Active device records per account 30 10 05
maxLinkedProviders Linked sign-in providers per account 10 2 05
maxAvatarBytes One avatar 1 MiB 256 KiB 05
maxBotsPerAccount Bots per account 10 1 05
maxBotTokens Active tokens per bot 10 2 05
maxPushRegistrationsPerDevice Push registrations per device 4 4 19

That index isn't the whole set. Other documents register more limits, and a server lists every registered limit in its metadata (02 §7.3.3). The one for calls is maxCallParticipants, the seats per call, with default 200 and floor 25; in a secure call maxSecureLeaves also bounds it (15 §2.7). Documents 07 to 10 add others, such as limits on enrolled devices, the vault, channels, invites and roles. 21 §12 keeps an informative copy of the full list.

MLS uploads use maxMlsUploadBytes instead of maxRequestBytes, and attachment bytes use their owner's limit. Servers need not accept compressed request bodies and answer an unsupported Content-Encoding with 415 (03 §16.2). A server MAY also reject JSON nested more than 64 levels deep with 400 core.invalid_request (03 §18.7).