Protocol guide
Direct messages and group DMs
Where a DM lives, how its ID is computed, how first contact becomes a message request, and how security, membership and calls follow the participants.
Specification: 12 Direct messages and group DMs
A DM is a conversation between two accounts; a group DM is one among three or more. Neither belongs to a community. A DM is a context like a channel: it has a context reference, a timeline with seq numbers, and it carries messages through the normal messaging endpoints. What is specific to DMs is where the context lives, how strangers reach each other without exposing anything, and how the security mode follows the people in it.
This page follows the order a client meets those questions. The full rules are in document 12.
How a DM works
A DM lives on exactly one hosting server, which sequences and stores it like any other context (12 §3). Each participant's client connects to that server directly to read and post, using a remote session when it isn't the participant's home server (Federation). Each participant's home server keeps a DM index entry pointing at the DM, so all of that person's devices find it.
The first message (or call) in a new DM makes the hosting server send a dm.request to each other participant's home server. That home either accepts it automatically, because the sender is already known to the recipient, or files it as a message request; until the user accepts, their client talks only to their own home server (12 §3). From then on everyone posts through the hosting server, and the security mode follows the participants.
Which server hosts a DM
The hosting rule picks the server deterministically, so every party can check it (12 §4). The creator's client evaluates it to know where to send POST /v1/dms, the hosting server evaluates it to check it is the right server, and recipient homes check that a dm.request comes from a plausible host.
Inputs
- Canonical addresses of all participants. Canonicalize first; evaluating the rule on an alias or non-canonical form is non-conforming (12 §4.1, Addresses).
- The
secureflag of each participant's home server, from its ServerMetadata (Discovery). Use metadata no older than 1 h. Once you have seensecure: truefor a domain, never usefalsefor it again, because the flag only ever goes fromfalsetotrueand afalsecan only be stale (12 §4.1). - For group DMs only: each participant's
secclaim from a verified IdentityState (Secure accounts), and the group's computed security.
1:1 DMs
host_1to1(A, B):
if A == B: fail dm.invalid_participants (reason "self")
(P1, P2) := (A, B) if UTF8(A) < UTF8(B) else (B, A) ; byte-wise order
H1 := domain(P1); H2 := domain(P2)
if secure(H1) and not secure(H2): return H2
if secure(H2) and not secure(H1): return H1
return H1Sort the two addresses as unsigned UTF-8 byte strings, where a proper prefix sorts first. Host on the home of the lower-sorting address, unless exactly one of the two homes is a secure server; then host on the home that isn't secure, so that a DM that might be insecure never lands on a secure server. When both homes are secure servers the rule returns H1, because every account homed there is secure or upgrade_required (12 §4.2). The result depends only on the two addresses and the two flags, never on who starts the DM.
Selected test vectors from 12 §4.6:
| # | Participants | Secure servers | Host | Why |
|---|---|---|---|---|
| H-1 | alice@a.com, dan@d.com |
none | a.com |
alice@a.com sorts first |
| H-3 | alice@a.com, dan@d.com |
a.com |
d.com |
Exactly one home is secure: the other one |
| H-5 | alice@a.com, dan@d.com |
both | a.com |
Both secure: H1 |
| H-6 | alice@z.com, alice2@a.com |
none | a.com |
2 (0x32) sorts before @ (0x40) |
| H-7 | bob@b.com, bob@b.co |
none | b.co |
bob@b.co is a proper prefix |
Group DMs
host_group(C, Ps, security): ; C = creator, Ps = the other initial participants
if security == secure: return domain(C)
if not secure(domain(C)): return domain(C)
L := (Ps ∪ {C}) in byte-wise order
for p in L: if sec(p) == insecure and not secure(domain(p)): return domain(p)
for p in L: if not secure(domain(p)): return domain(p)
fail dm.encryption_pending ; every home is a secure serverA group DM is hosted on the creator's home server, except when the group is insecure and the creator's home is a secure server. Then it goes to the first insecure participant on a non-secure server, or failing that the first participant on a non-secure server, taking all participants, creator included, in byte-wise order (12 §4.3). If every home is a secure server and the group would be insecure, creation fails with dm.encryption_pending until the insecure people turn on encryption (test vector G-5).
A group DM's host never changes after creation: not when the creator leaves, not when the group becomes secure, and not when the creator's home upgrades. A group DM its host can no longer hold is closed and replaced by a successor (12 §4.3).
Current host and rule host
The rule picks a host only when a DM is created, including when a successor is created. After that, the DM stays where it is (12 §4.5). Server upgrades can make the rule host differ from the current host, and that is expected: moving a secure DM whenever a server upgrades would force a new MLS group and gain nothing.
Warning
To send to an existing DM, use the host recorded in your DM index entry, never a freshly computed rule host. Compute the rule only when you have no non-closed index entry for that context, or the entry you have is closed (12 §4.5).
dm.wrong_host
The hosting server evaluates the rule itself before creating anything. If the result isn't its own domain, it answers 409 dm.wrong_host with data.host set to the domain it computed; it first refetches any other server's metadata older than 60 s, so an old copy doesn't keep it refusing (12 §4.4). An existing 1:1 DM is returned without evaluating the rule, because its current host may legitimately differ.
On dm.wrong_host your client:
- refetches every input ServerMetadata document and recomputes;
- if its result now matches
data.host, retries there; - otherwise retries the original server once after 5 s;
- then reports
core.unavailableto the user as "Couldn't start this conversation right now" and keeps the draft in the outbox.
DM IDs
DM context references come in two forms (12 §5.1):
dm-ctx = dm-ref / gdm-ref
dm-ref = %s"dm:" b64u-128 ; 16 bytes, unpadded base64url; last character
; one of "AQgw" (the 4 unused bits are zero)
gdm-ref = %s"gdm:" uuid7 ; lowercase hyphenated UUIDv7The dm: computation
A 1:1 reference is computed by anyone from the two canonical addresses, with P1 < P2 in byte-wise order (12 §5.2):
digest = SHA-256( UTF8("sv1 dm") || 0x00 || UTF8(P1) || 0x0A || UTF8(P2) )
dm_ctx = "dm:" || base64url( digest[0..16] ) ; first 16 bytes, no padding0x0A (line feed) can't occur in a canonical address, so no length prefixes are needed. The result is dm: followed by 22 base64url characters.
A dm: reference names a pair of addresses, not a server. The same pair has the same reference on every server, which is how a 1:1 DM keeps its ID when it continues on another host after a server upgrade. It also means the reference returns if an address is deleted and later registered by someone else; the incarnation checks under Deleted accounts and reused addresses, below, keep that new account out of the old conversation.
Worked example, test vector V-1 (12 §5.5), alice@a.com and dan@d.com in either order:
P1 = alice@a.com 616c69636540612e636f6d
P2 = dan@d.com 64616e40642e636f6d
input = 73763120646d00 616c69636540612e636f6d 0a 64616e40642e636f6d
SHA-256 = 2815df6a03e82e54322aedd03a22df839f3e796e2c4e2c5a05ea5c4f627247a6
first 16 = 2815df6a03e82e54322aedd03a22df83
ctx = dm:KBXfagPoLlQyKu3QOiLfgwA TypeScript version, for illustration:
async function dmRef(a: string, b: string): Promise<string> {
// a and b must already be canonical (document 01).
const enc = new TextEncoder();
const [ba, bb] = [enc.encode(a), enc.encode(b)];
const cmp = (x: Uint8Array, y: Uint8Array) => {
for (let i = 0; i < Math.min(x.length, y.length); i++) {
if (x[i] !== y[i]) return x[i] - y[i];
}
return x.length - y.length; // a proper prefix sorts first
};
if (cmp(ba, bb) === 0) throw new Error("dm.invalid_participants: self");
const [p1, p2] = cmp(ba, bb) < 0 ? [ba, bb] : [bb, ba];
const input = new Uint8Array([...enc.encode("sv1 dm"), 0x00, ...p1, 0x0a, ...p2]);
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", input));
const b64 = btoa(String.fromCharCode(...digest.slice(0, 16)));
return "dm:" + b64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
}Compare encoded bytes, not JavaScript strings: < on strings compares UTF-16 code units, which differs from byte order for characters outside the Basic Multilingual Plane.
Test the implementation against all of 12 §5.5:
| # | Inputs | Reference |
|---|---|---|
| V-1 | alice@a.com, dan@d.com |
dm:KBXfagPoLlQyKu3QOiLfgw |
| V-2 | alice@z.com, alice2@a.com |
dm:ujW4SDpcLckJChTUrvs1xQ |
| V-3 | bob@b.com, bob@b.co |
dm:Cmp_TnIg-oLZo3br5bqMfw |
| V-4 | zoë@b.example, zoe@b.example |
dm:aZblB5RgcGeRjr6b0T8u8A |
| V-5 | saxonjones@sloppyvoice.com, helperbot@guild.sloppyvoice.com |
dm:HW05sBsjyedT-esQ_cA-KA |
| V-6 | Alice@A.com, dan@d.com |
Canonicalize to alice@a.com first, then V-1. Hashing the original form is non-conforming. |
| V-7 | dm:KBXfagPoLlQyKu3QOiLfgx |
Reject: the last character has non-zero unused bits. |
Validation
Receivers reject a dm: reference that doesn't match dm-ref with 400 core.invalid_request: wrong length, padding, a character outside the base64url alphabet, non-zero unused bits, or a prefix in another case such as DM: (12 §5.1). In URL paths the colon MAY be percent-encoded.
The hosting server recomputes the reference from the participant addresses on POST /v1/dms and on every dm.request it sends, and the recipient home recomputes it on every dm.request it receives. A mismatch is a hard failure: dm.invalid_participants for clients, dm.host_mismatch between servers (12 §5.2).
Group references
A group reference is gdm: followed by a lowercase UUIDv7 that the hosting server generates at creation. Group references are never reused, including for successors (12 §5.4). Because the client can't know the gdm: reference before the server assigns it, group creation registers the DM in the index after creation instead of before.
Creating a DM
Client procedure
To start a 1:1 DM with peer, or a group DM with participants Ps, the creator's client does this (12 §7.1):
- Canonicalize every address. Refuse an address that names a channel, with "That's a channel, not a person".
- Look up security. Fetch each other participant's IdentityState from their home server (GET /v1/users/{local}/identity) and verify it. A 404 means there is no such account. Compute the DM's security as described under Security, below. For a secure DM, pin each person not yet pinned (first contact, silent).
- Register (1:1). Compute the rule host and the
dm:reference and register them at your own home with POST /v1/me/dms. A group DM registers at step 6 instead, because its reference comes from the hosting server. - Session. If the hosting server isn't your home, obtain a remote session there, with a DeviceProof if the device is enrolled (Federation).
- Secure 1:1 only: build the MLS group first. Claim KeyPackages through your home server (POST /v1/keypackages/claim) for every enrolled device of the peer and your own other enrolled devices. Create the group with
group_idsv1:<host>:<ctx>:1, thesv_participantsextension listing both people with their identity-key thumbprints, and the hosting server as external sender. Build the GroupBootstrap and a first CommitSubmission that adds every claimed KeyPackage, with its Welcome. A person for whom no KeyPackage could be claimed is still listed; their devices join later. - Create with
POST {host}/v1/dms, carryingbootstrapandcommitfor a secure 1:1 DM. For a group DM, now register{host, ctx}at your home. Secure group only: your device holds the bootstrap grant for 60 s; build the group exactly as in step 5 with every participant listed andgroup_idsv1:<host>:<ctx>:1, and upload the bootstrap with the first commit in one POST /v1/contexts/{ctx}/mls/bootstrap request. - First message. Post through POST /v1/contexts/{ctx}/messages, plaintext
contentor a SealedMessage. The hosting server sendsdm.requestwhen it sequences it.
Registering at your home before creating means the hosting server never creates an index entry on your behalf, and the 1:1 DM appears on your other devices immediately (12 §7.1).
Note
If POST /v1/dms fails with an error whose retryable is false (for example dm.recipient_not_found, federation.blocked or dm.invalid_participants), or the outbox gives up on it, delete the step 3 registration with DELETE /v1/me/dms/{id} and tell the user the conversation couldn't be started. dm.encryption_pending is retryable: keep the registration, because the DM can start once the named people turn on encryption (12 §7.1).
An unenrolled device of a secure account can create an insecure DM but not a secure one, because steps 5 and 6 need the identity key; the server answers 403 security.device_not_enrolled.
"Add people" in a 1:1 DM starts a new group DM with both participants plus the new people. The 1:1 DM is unchanged and its history isn't copied (12 §7.1).
POST /v1/dms
POST /v1/dms goes to the hosting server with a home or remote session token (12 §7.2). The request body (CreateDmRequest):
| Member | Required | Meaning |
|---|---|---|
kind |
Yes | direct or group. |
peer |
For direct |
The other participant's canonical address. |
participants |
For group |
The other initial participants: at least 2, at most maxGroupDmParticipants − 1, distinct, not including you. |
expectSecurity |
Yes | insecure or secure: the security your client computed. |
name |
No | Group DMs only. 1 to 100 Unicode scalar values, at most 400 bytes, NFC, no control characters, no leading or trailing white space. |
communityHints |
No | Up to 10 canonical domains of communities on your community list in which you saw the recipients. They only order the recipient home's auto-accept checks; they never decide the outcome. |
replaces |
No | { "host", "ctx" } of a closed predecessor, when creating a successor. |
bootstrap |
For direct with expectSecurity secure |
A GroupBootstrap for generation 1. MUST be absent for group, because the client can't build the group_id before the hosting server assigns ctx, and for insecure DMs. |
commit |
With bootstrap, when any KeyPackage was claimed |
The first CommitSubmission (epoch 0 → 1) with its Welcome. |
The hosting server checks, in this order, and the first failure decides the error (12 §7.2): body validation (address.non_canonical, dm.invalid_participants, dm.too_many_participants, and 400 core.invalid_request for a bootstrap where it is forbidden); federation blocks; for a 1:1 DM that already exists and isn't closed, an early 200 with the existing Dm (the caller becomes active; any bootstrap is ignored); participant lookup (dm.recipient_not_found); the hosting rule (dm.wrong_host); security against expectSecurity (409 dm.security_mismatch, whose data lists each participant's sec so you can refetch exactly the IdentityStates you disagree about); device enrolment for a secure DM; an insecure DM on a secure server (dm.encryption_pending); and the bootstrap (a missing one is 400 core.invalid_request). It then creates the DM, sequences dm.created at seq 1 and returns 201.
If the 1:1 DM exists but is closed, the server runs the same checks and reopens it instead of creating it, ignoring bootstrap and commit, and returns 200 (12 §13.4). A DM closed with reason banned doesn't reopen this way; it fails with 409 dm.closed until the ban ends.
A 1:1 POST /v1/dms is idempotent on ctx. For a group DM, send an Idempotency-Key so a retry returns the group the first request created (12 §7.2).
Example: an insecure 1:1 DM
Bob (bob@b.com, insecure) writes to Alice (alice@a.com, secure); neither home is a secure server. The rule host is a.com, because alice@a.com sorts before bob@b.com. Bob's client registers the DM at b.com, opens a remote session at a.com and sends (12 §7.3):
POST https://chat.a.com/server/v1/dms
Authorization: Bearer rs_8fK2…
{ "kind": "direct", "peer": "alice@a.com", "expectSecurity": "insecure" }HTTP/1.1 201 Created
Content-Type: application/json
{
"ctx": "dm:ZlXkbx0pnzfHlpphMcdMEA",
"kind": "direct",
"host": "a.com",
"security": "insecure",
"state": "active",
"closedReason": null,
"participants": [
{ "addr": "alice@a.com", "name": "Alice", "kind": "user", "inc": "sLGys7S1tre4ubq7vL2-vw", "state": "active", "role": "member",
"security": "secure", "ikf": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs",
"addedBy": "bob@b.com", "addedAt": "2026-12-04T18:30:00.120Z", "joinedSeq": 1, "reason": null },
{ "addr": "bob@b.com", "name": "Bob", "kind": "user", "inc": "MDEyMzQ1Njc4OTo7PD0-Pw", "state": "active", "role": "member",
"security": "insecure", "ikf": null,
"addedBy": "bob@b.com", "addedAt": "2026-12-04T18:30:00.120Z", "joinedSeq": 1, "reason": null }
],
"owner": null,
"name": null,
"createdBy": "bob@b.com",
"createdAt": "2026-12-04T18:30:00.120Z",
"groupGeneration": 0,
"securitySinceSeq": 1,
"lastSeq": 1,
"replaces": null
}Alice's true state is pending, but Bob sees active. In a 1:1 DM the peer's pending or declined state is always reported as active, because telling a sender that the recipient declined or blocked them invites harassment (12 §6.5). Only Alice sees her own true state.
The DM is insecure although Alice is secure, because a 1:1 DM is secure only when both people are. See Dm and DmParticipant for every member.
Example: secure DMs
A secure group DM, created by Alice on her home server (12 §7.4):
POST https://chat.a.com/server/v1/dms
Authorization: Bearer hs_Qm1…
Idempotency-Key: 6f1c2a9e-weekend
{ "kind": "group",
"participants": ["carol@c.com", "dan@d.com"],
"expectSecurity": "secure",
"name": "Weekend trip",
"communityHints": ["sloppyvoice.com"] }The response is a Dm with ctx gdm:01938f41-5a6b-7c8d-9e0f-a1b2c3d4e5f6, security secure, owner alice@a.com and groupGeneration 0. Alice's device now holds the bootstrap grant. It claims KeyPackages, creates group sv1:a.com:gdm:01938f41-5a6b-7c8d-9e0f-a1b2c3d4e5f6:1, uploads the bootstrap with its first commit in one request (after which groupGeneration is 1), and posts the first SealedMessage. Until the bootstrap, a SealedMessage fails with 404 mls.group_not_found.
A secure 1:1 DM builds the group before the request and sends it in the same call:
POST https://chat.a.com/server/v1/dms
Authorization: Bearer hs_Qm1…
{ "kind": "direct", "peer": "dan@d.com", "expectSecurity": "secure",
"bootstrap": { "generation": 1, "groupInfo": "AAEABAABAAE0c3YxOmEuY29tOmRtOktCWGZh…", "ekid": "Xc0mY2n4QbE" },
"commit": { "epoch": 0, "commit": "AAEAAQ…", "groupInfo": "AAEABAABAAE0c3Yx…",
"ekid": "q83vEjRWeJA", "welcome": "AAEAAwABAAEAQ…" } }The MLS details (KeyPackages, Welcome, commits) are on MLS and sealed messages.
Simultaneous starts
When Alice and Dan start a DM with each other at the same moment, both clients compute the same host and the same dm: reference, so both requests reach the same server for the same context. The first gets 201, the second 200 with the existing DM and its caller set to active. Both registered in their own index first, so neither sees a message request (12 §5.3).
In a secure DM both requests carry a bootstrap, but only the creating request's is applied. The other client discards its own group, fetches its Welcome (GET /v1/contexts/{ctx}/mls/welcome), joins by external commit only on mls.welcome_not_found, and re-encrypts any queued message under the winner's group. Queued messages keep their client-generated mid, so nothing is duplicated.
Reading and renaming
GET /v1/dms/{ctx} returns the Dm, filtered for the caller as in the example above. Anyone who isn't a participant gets 404 core.not_found, not 403, so probing reveals nothing. Participants who left or were removed can still fetch the Dm, so their client can show why they lost access, but nothing in the timeline (12 §6.5).
PATCH /v1/dms/{ctx} with { "name": … } sets or clears (null) a group's name and returns the Dm. Any active participant may do it. A 1:1 DM answers 409 dm.not_group, a caller who isn't active gets 403 dm.not_participant, and a DM that isn't active answers with its state's error (dm.closed, dm.upgrade_in_progress or dm.encryption_pending). On success the hosting server emits dm.settings_changed (12 §7.5).
Message requests
When a request is sent
The hosting server sends dm.request to each pending participant's home server (12 §8.1):
- at creation, when the first content event is sequenced: a
message.created, or a dm.call_logged withphase: "started". A DM in which nothing is ever posted produces no request; - at a later add to a group DM, as soon as the participant becomes
pending; - in further batches while the participant stays
pending, coalesced to at most one batch per 5 s, until the cumulative size reachesmaxDmRequestBytes(64 KiB by default, also the floor). The last batch carriestruncated: true, and nothing more is forwarded.
Batch 1 starts at the event that created the invitation: dm.created for the initial participants, the participant's own dm.participant_added for a later add, and, for a new invitation after a 1:1 decline, the content event that started it. Earlier events aren't forwarded; the recipient fetches them after Accept, as far as the history rules allow.
A declined 1:1 participant gets no request for 30 days; after that, the next content event starts a new invitation with a new invitationId. A participant still pending 90 days after their latest invitation's addedAt gets no more batches: in a group DM the hosting server removes them with reason invitation_expired, and in a 1:1 DM they stay pending until the next content event starts a new invitation (12 §8.1).
Requests go to the recipient's home server because the recipient already trusts it and is connected to it. The hosting server never sends push notifications (notify.event) or call rings for a pending participant; the recipient's home creates the notification itself.
A dm.request carries everything the recipient's client needs to render the request without contacting anyone else: the inviter, the participants, the security mode, IdentityStates for secure participants, the Welcome for secure DMs, and the DM's durable events. An excerpt of the example from 12 §8.8:
{
"id": "01938f41-8d9e-7fa0-8132-d4e5f6071829",
"t": "dm.request",
"ts": "2026-12-04T18:40:03.400Z",
"orderKey": "dm:KBXfagPoLlQyKu3QOiLfgw",
"d": {
"invitationId": "01938f41-6b7c-7d8e-af10-b2c3d4e5f607",
"batch": 1,
"truncated": false,
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"kind": "direct",
"host": "a.com",
"recipient": "dan@d.com",
"recipientInc": "8PHy8_T19vf4-fr7_P3-_w",
"inviter": { "addr": "alice@a.com", "name": "Alice", "kind": "user", "inc": "sLGys7S1tre4ubq7vL2-vw" },
"createdBy": "alice@a.com",
"participants": [
{ "addr": "alice@a.com", "name": "Alice", "kind": "user", "inc": "sLGys7S1tre4ubq7vL2-vw", "state": "active", "security": "secure" },
{ "addr": "dan@d.com", "name": "Dan", "kind": "user", "inc": "8PHy8_T19vf4-fr7_P3-_w", "state": "pending", "security": "secure" }
],
"security": "secure",
"state": "active",
"name": null,
"replaces": null,
"communityHints": [],
"identityStates": ["eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWlkc3RhdGUrand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3MiOiJhLmNvbSIs…"],
"welcome": "AAEAAwABAAEAQ…",
"events": [
{ "v": 1, "t": "dm.created", "id": "01938f41-7a10-7b20-8c30-d40e50f60718",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw", "seq": 1, "ts": "2026-12-04T18:40:02.004Z",
"d": { "kind": "direct", "createdBy": "alice@a.com", "security": "secure",
"participants": ["alice@a.com", "dan@d.com"], "name": null, "replaces": null } }
]
}
}The spec's example also carries Alice's first sealed message.created at seq 4. It leaves out seq 2 and 3 (the MLS handshake events of the group's creation) for brevity; a real batch carries every durable event in order.
The size limit is the smaller of the hosting server's maxDmRequestBytes and the one the recipient home advertises, counted over the d of every batch of the invitation. Batch 1 is always sent, even with no events, so that the request exists. In a secure DM the Welcome has priority over events: if the Welcome and the first event don't both fit, batch 1 carries the Welcome alone. If the Welcome alone doesn't fit, batch 1 carries welcome: null and truncated: true, and the recipient gets the Welcome from the hosting server after Accept (12 §8.3).
Note
When the recipient's home is a secure server and the DM is insecure, the hosting server sends each message.created event without content and with "contentWithheld": true in that event's d. A secure server never stores plaintext of any DM; the request shows who is writing, and the messages appear after Accept (12 §8.2).
What the recipient's home does
The recipient home verifies the S2S request, checks that the recipient exists with the incarnation the request names, and checks that the host is legitimate: for a 1:1 DM, that ctx matches the recomputed dm: reference and host is one of the two people's domains; for a group, that host is the creator's or a listed participant's domain (12 §8.4). It then drops the request silently if the inviter is blocked, if the user declined this DM less than 30 days ago, or if a rate limit is exceeded. Finally, on batch 1, it applies the auto-accept rule:
- Accepted automatically: the index entry becomes
activeand the user gets a normal message notification. - Otherwise: it files a DmRequest in state
pending, sets the entry torequested, and creates adm_requestnotification if the user'srequestNotificationssetting allows. Adm_requestnotification never carries a content preview, only who is asking.
Your client learns of both outcomes from dm.index_updated and, for requests, dm.request_received on the me stream at your home server.
The auto-accept rule
When batch 1 arrives and the inviter isn't blocked, the recipient home accepts it if any of these holds, checked in order (12 §10.2). S is the inviter, matched on address and incarnation, so an earlier account at the same address never counts. R is the recipient.
| # | Condition | Allowed by setting |
|---|---|---|
| (a) | R's autoAccept setting is everyone. |
everyone |
| (b) | R registered the same DM as outgoing (R started it too). |
all |
| (c) | replaces names a DM R had accepted and its host closed, and S was in it. |
all |
| (d) | S is a current participant, according to the entry's latest participants, of a DM (1:1 or group) for which R has an active entry. |
all |
| (e) | S is an active member of a community on R's community list with at most 200 members. |
contacts_and_communities, everyone |
For a group request, rules (c), (d) and (e) apply only when S is homed at the hosting server, that is, when the hosting server vouches for its own user. Otherwise, unless R's setting is everyone, it becomes a message request and the card says "via host". This stops a server from inventing a group in which a contact of yours on another server appears as the inviter.
The home checks rule (e) against at most 10 candidate communities: its own community first, if R is a member, then the communities on R's list, those named in communityHints first and the rest in list order. It skips a community whose memberCount exceeds 200, gives each remote check a 5 s timeout, and counts a timeout or error as "not shared". It never consults a community that isn't on R's list, so hints can't widen the rule.
Note
The 200-member cap in rule (e) is marked "Proposed decision" in 12 §10.2. It exists because every account on a large public server is a member of its community, so without a cap any of its users could message every other user without a request.
Before Accept
Before the user accepts, the recipient's client MUST NOT contact the hosting server, the inviter's home server or any other server the sender chose; it talks only to its own home server, so a stranger can't learn the recipient's IP address or that they read the message (12 §10.4). In particular it MUST NOT:
- open a session or WebSocket at the hosting server, or post anything there, including read state, typing, epoch acknowledgements and history shares;
- download attachments, thumbnails or avatars, or fetch link previews;
- fetch IdentityStates, profiles or ServerMetadata of the participants' servers;
- accept or join a call.
These actions would also accept the DM implicitly: if a pending or declined participant posts, joins a call, subscribes to the context or reads the timeline, the hosting server sets them active (12 §8.7).
Render the request entirely from the DmRequest (12 §10.4): the inviter's display name with the full address, domain included, and a bot badge for kind: "bot"; for a group, its name, its participant list and, when the inviter isn't homed at the hosting server, "via host"; initials instead of avatars; attachments as "Accept to see this file" and withheld content as "Accept to see this message"; a call start as a missed call; and, when truncated is true, a final line saying there are more messages after Accept. For an insecure DM, show the open lock if the user is secure, plus W7 (1:1) or W3 (group). For a secure DM, verify the carried identityStates with the serverKeys your home relays, for display only, and create no pins; if a key you need to process the welcome is missing, defer it until after Accept rather than rejecting it. Offer Accept, Decline, Block, and Report and block; the report goes to the user's own home server, never to the hosting server.
Show requests in a separate "Message requests" tab, never interleaved with accepted conversations, and group requests from the same inviter.
Request endpoints
All at your home server, with a home session (12 §10.3):
| Endpoint | Effect |
|---|---|
| GET /v1/me/dm-requests | List requests (default state=pending), newest first. List items carry preview (the first event) instead of events and welcome. |
| GET /v1/me/dm-requests/{id} | The full DmRequest. |
| POST /v1/me/dm-requests/{id}/accept | Request accepted, entry active; the home sends dm.response accept. Returns the DmIndexEntry. |
| POST /v1/me/dm-requests/{id}/decline | Request and entry declined, declinedAt set; the home sends dm.response decline. 204. |
| POST /v1/me/dm-requests/{id}/block | Decline and block inviter.addr. 204. |
Acting on a request that isn't pending fails with 409 dm.request_not_pending. Every change emits dm.request_resolved and dm.index_updated, so your other devices update.
A decline is quiet: the sender isn't told. In a 1:1 DM the declined participant stays in the DM, and in its MLS group, but the hosting server sends them no requests for 30 days. In a group DM a decline removes the participant, and the others see them as left (12 §8.5).
After Accept
After accepting, the client (12 §10.5):
- obtains a remote session at the hosting server, subscribes to the context, and resumes from the highest
seqit holds from the request (Event WebSocket); - refreshes the participants' IdentityStates from their home servers and pins silently anyone it has no pin for; a key that differs from an existing pin goes through the key-change warning (W2);
- if the request was truncated, had no Welcome, or the Welcome was deferred, fetches the Welcome and the missing events, including any withheld content;
- in a secure DM, appends the history keys it learned to the key archive, so the user's other devices can read the conversation.
The user's other devices learn of the acceptance from dm.index_updated, fetch their own Welcome, and join by external commit only on mls.welcome_not_found.
Limits
The hosting server allows each account 20 new invitations per 24 h to people who never replied, and 5 per 24 h (newAccount.maxNewDmsPerDay) for local accounts younger than 24 h; excess gets 429 core.rate_limited. The recipient's home accepts at most 20 invitations per 24 h per sender and 200 per 24 h per origin server, keeps at most 200 pending requests per recipient (expiring the oldest first) and 20 per hosting server, and expires a request after 90 days without sending a response. Requests over a limit are dropped silently and MUST look delivered to the sender. These are defaults; the full table is in 12 §10.6.
The DM index
Your home server keeps one DmIndexEntry per DM you take part in, on any hosting server (12 §9.1). The index is your client's source of truth for which DMs exist and where they live. The key is (host, ctx): a 1:1 DM and its successor share ctx but differ in host.
An entry exists only because you registered it or because a request passed your own filter. A hosting server can never plant conversations in someone's DM list (12 §9.3).
Entry states
| State | Meaning |
|---|---|
requested |
A message request is waiting. |
active |
You take part: accepted, created or auto-accepted. |
declined |
You declined. Kept 30 days after declinedAt to suppress repeat requests, then deleted. |
blocked |
You blocked the inviter of this 1:1 DM. |
left |
You left or were removed from a group DM, or the invitation was withdrawn. |
closed |
The hosting server closed a DM you had accepted. |
The home server updates state from your actions and from the hosting server's dm.entry_updated events (12 §9.2). Treat an unknown state as left.
Index endpoints
At your home server, with a home session or a bot token (12 §9.3):
| Endpoint | Purpose |
|---|---|
| GET /v1/me/dms | List entries. Query: state (comma-separated; default active,requested), kind, includeHidden (default false), cursor, limit (1–100, default 50). Ordered by lastActivityAt descending. |
| GET /v1/me/dms/{id} | One entry, with pendingEvents from an auto-accepted request that your devices haven't fetched yet. |
| POST /v1/me/dms | Register an outgoing DM: { "host", "ctx", "kind" }. Idempotent; 201 or 200. If a request for that DM is waiting, this accepts it. |
| PATCH /v1/me/dms/{id} | { "hidden": boolean }. A hidden entry reappears when new activity arrives. |
| DELETE /v1/me/dms/{id} | Delete a declined, left or closed entry, or an outgoing entry whose lastSeq is 0. Others fail with 409 dm.entry_active: hide or block instead. |
POST /v1/me/dms checks only syntax and doesn't contact the hosting server. Every change to an entry emits dm.index_updated on your me stream, and a deletion emits dm.index_removed. A client keeps its DM list current from these two events.
An incoming request, as an entry:
{
"id": "01938f42-0c1d-7e2f-8a3b-4c5d6e7f8091",
"host": "a.com",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"kind": "direct",
"state": "requested",
"origin": "incoming",
"participants": [
{ "addr": "alice@a.com", "name": "Alice", "kind": "user", "inc": "sLGys7S1tre4ubq7vL2-vw", "state": "active", "security": "secure" },
{ "addr": "dan@d.com", "name": "Dan", "kind": "user", "inc": "8PHy8_T19vf4-fr7_P3-_w", "state": "pending", "security": "secure" }
],
"security": "secure",
"dmState": "active",
"closedReason": null,
"name": null,
"inviter": "alice@a.com",
"requestId": "01938f42-1d2e-7f30-9b4c-5d6e7f809102",
"autoAccept": null,
"hidden": false,
"declinedAt": null,
"successor": null,
"replaces": null,
"lastSeq": 4,
"lastActivityAt": "2026-12-04T18:40:03.310Z",
"createdAt": "2026-12-04T18:40:04.002Z",
"updatedAt": "2026-12-04T18:40:04.002Z"
}How the index stays current
The hosting server sends dm.entry_updated to each participant's home on every change to the DM, and, for active participants only, as an activity hint after content events, at most once per 60 s per DM per participant (12 §8.6). A home applies it only to an entry that already exists. The recipient's home answers requests with dm.response (accept, decline, block or unblock, 12 §8.5). Clients never see these server-to-server events; they see the resulting dm.index_updated (12 §16.3).
Settings and blocks
DmSettings
GET /v1/me/dms/settings returns and PUT /v1/me/dms/settings replaces the account's DmSettings (12 §9.4):
| Member | Default | Meaning |
|---|---|---|
autoAccept |
contacts_and_communities |
contacts_and_communities: rules (b)–(e); contacts_only: rules (b)–(d), so shared communities don't count; everyone: accept every request that isn't blocked. Unknown values are treated as the default. |
requestNotifications |
true |
Whether a new message request creates a notification. |
Every change emits dm.settings_updated on the me stream. Show one control for autoAccept, worded as "Who can message you directly: people you know and people in your communities (recommended) / only people you know / anyone".
Blocks
A DmBlock is { "addr", "createdAt" }; an account has at most 10,000 (12 §9.5).
| Endpoint | Purpose |
|---|---|
| GET /v1/me/dms/blocks | List blocks (cursor pagination). |
| PUT /v1/me/dms/blocks/{addr} | Block a canonical address, percent-encoded. Idempotent; 200 with the DmBlock. |
| DELETE /v1/me/dms/blocks/{addr} | Unblock; 204. |
Blocking address X:
- drops every new
dm.requestwith inviterXsilently; - moves every 1:1 entry with
X, and any pending request fromX, toblocked, and sendsdm.responseblockto each hosting server, which then stops call rings and notifications from that DM; - leaves group DMs you share with
Xunchanged at the protocol level. Clients SHOULD collapseX's messages there behind "Message from someone you blocked".
Unblocking sends dm.response unblock for each blocked 1:1 entry and sets it back to declined with declinedAt null, so no quiet period applies. Every block and unblock emits dm.block_updated.
Blocks are personal and apply to DMs only. Community bans are on Roles and moderation; server-wide federation blocks are on Federation.
Security
A DM's security mode is computed from its participants, never chosen (12 §11.1):
computed_security(DM):
if DM.kind == direct:
P := both DM participants, whatever their participation state
return secure if sec(p) == secure for both p in P else insecure
; group
if wasSecure(DM): return secure ; never downgrades
C := current participants (states reserved, pending, active)
return secure if sec(p) == secure for all p in C else insecuresec(p) is the sec claim of the newest IdentityState the evaluator holds. Device enrolment doesn't enter the computation; it decides only what one device can do. In short: a DM is secure when everyone in it is secure. A 1:1 DM follows its participants both ways; a group DM, once secure, never goes back.
A secure DM carries SealedMessages under an MLS group; an insecure DM carries plaintext content. The hosting server refuses the wrong kind.
Clients compute it too
The hosting server computes security to decide what it accepts. Your client computes it as well, from IdentityStates it verified itself, and acts on its own result, because a hosting server could otherwise present a secure DM as insecure and collect plaintext (12 §11.1):
- Never send plaintext into a DM you compute as
secure, whatever the hosting server says. - If you last knew a 1:1 DM as secure, don't send plaintext until you have verified, yourself, an IdentityState of the peer with
sec: insecureand a higherverthan the one you held. - For every group DM you have seen as secure or hold MLS state for, record a secure-state pin for (
host,ctx): asec_pinrecord of kindgroup_dm, in the AccountVault where the device can use it, so all your devices share it, and in device-local storage otherwise, merged into the vault on enrolment. This pin is yourwasSecure, never the value the hosting server reports. Never send plaintext there again. If the hosting server presents a pinned group as insecure, refuse to send and show W9, a hard error with "Leave" offered. - When the hosting server reports a security you disagree with, refetch the IdentityStates concerned (at most once per 30 s per DM) and keep outgoing messages queued meanwhile.
Secure contexts only
For a secure group DM, take the participant set from the group's sv_participants extension, not from the hosting server's list. The hosting server can't add a person to a secure DM, because sv_participants changes only through member commits that clients check (12 §20).
1:1 DMs: both ways, one thread
A 1:1 DM changes mode in the same conversation whenever its participants change (12 §11.2):
| Change | Hosting server | Client shows |
|---|---|---|
| The last insecure participant turns on encryption | active → upgrading → bootstrap → active, security: secure. Emits dm.security_eligible, then dm.security_changed. |
K1 at the switch; W7 disappears. |
| A participant downgrades (an identity reset to insecure) | Sets security: insecure, retires the MLS group, emits dm.security_changed. On a secure server it goes to encryption_pending or closes the DM instead. |
W2 (downgrade variant), then W7, and K2 at the switch. For a verified contact, sending stays blocked until the user chooses "Continue without encryption". |
| A participant resets but stays secure | Removes the old MLS leaves. The DM stays secure. | W2; the peer's client then re-adds the new identity. |
Earlier messages stay readable in both directions: plaintext stays on the hosting server, and SealedMessages stay decryptable with the history keys the client already holds.
Group DMs: up, never down
| Change | Hosting server | Client shows |
|---|---|---|
| Created with every participant secure | Created secure. |
Closed lock. |
| Created with any insecure participant | Created insecure. |
W3 for each secure participant, naming the insecure ones. |
| Every current participant is now secure (an upgrade, or the last insecure one left or was removed) | upgrading → bootstrap → active, security: secure. |
K1; W3 disappears. |
| Someone tries to add an insecure account to a secure group | 409 security.would_downgrade, data.insecure listing them. |
Offer "Start a new group without encryption", with the current participants plus the new person and no history. |
| A participant of a secure group downgrades | Removes them with reason encryption_turned_off. The group stays secure. |
"Bob left because they turned off encryption", and W2 for that contact. |
Source: 12 §11.3.
Becoming secure
When the computed security of an insecure DM becomes secure, the hosting server sets state to upgrading, emits dm.security_eligible with the next group generation, and from then on refuses plaintext posts and call joins with 409 dm.upgrade_in_progress (12 §11.4). Refusing plaintext here means two people who both turned on encryption never keep chatting in plaintext just because nobody created the group yet.
dm.upgrade_in_progress is retryable with userAction none: don't report it as a failure; show the status line "Setting up encryption…" while outgoing messages wait (12 §11.7). An unenrolled device of a secure account shows G2 instead. Any enrolled device of an active participant that sees dm.security_eligible or receives this error MUST, without asking the user:
- verify fresh IdentityStates of all current participants and confirm the computed security itself; if it disagrees, stop and retry later;
- ask for the group with GET /v1/contexts/{ctx}/mls/groupinfo. Exactly one device at a time receives
bootstrapAllowed: true, the bootstrap grant, for 30 s. Without it, wait for the group to exist (mls.welcomeormls.group_created), fetch your Welcome, join by external commit only onmls.welcome_not_found, and stop; - with the grant, pin silently every participant not yet pinned, or handle a changed key through the W2 rules;
- only now claim KeyPackages through your own home server for every enrolled device of every other current participant and your own account's other enrolled devices;
- create the group with
group_idsv1:<host>:<ctx>:<groupGeneration + 1>,sv_participantslisting every current participant (a person with no claimable KeyPackage is still listed) and the hosting server as external sender, and upload the bootstrap with the first commit and its Welcome in onePOST …/mls/bootstraprequest.
One grant holder means only one device claims KeyPackages for everyone, so a large group doesn't burn every participant's one-time KeyPackages in a race. When the bootstrap is accepted, the hosting server sets security to secure, increments groupGeneration, returns to active and emits dm.security_changed (marker K1), whose seq becomes securitySinceSeq:
{
"v": 1,
"t": "dm.security_changed",
"id": "01938f55-1a2b-7c3d-8e4f-506172839405",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"seq": 212,
"ts": "2026-12-05T09:12:44.871Z",
"d": { "security": "secure", "previous": "insecure", "generation": 1,
"lastSeqBefore": 210, "marker": "K1", "cause": "all_secure" }
}A device whose bootstrap still loses gets 409 mls.group_exists; it discards its group, waits for its Welcome and joins by external commit only on mls.welcome_not_found. Messages waiting in the outbox are sent as SealedMessages after the switch, with the same mid.
Plaintext from before the switch stays on the hosting server, readable by the participants who were there at the switch. It is never sealed, archived or shared, and people added afterwards are not served it.
encryption_pending
A 1:1 DM is encryption_pending when its hosting server is a secure server and its computed security is insecure (12 §13.2). This happens only when both homes are secure servers and one participant is insecure, normally an account in the upgrade_required state after its server upgraded. The hosting server refuses content and calls with 409 dm.encryption_pending, data.waitingFor naming the insecure people. The other participant sees W7, a disabled composer and the status line "You can write again once Bob turns on encryption." When Bob turns on encryption, the DM becomes secure through upgrading, in the same thread.
Identity resets in a secure DM
When a participant resets their identity key and stays secure, the hosting server removes their old MLS leaves but keeps them as a participant. Another participant's client re-adds them once it has accepted the new key under the W2 rules: immediately for an unverified contact, after "Accept new key" for a verified one. The person who reset is served nothing from before the re-add, in 1:1 and group DMs alike, so a hijacked login that forces a reset can't fetch the conversation's past (12 §11.5). Until the re-add their messages wait in the outbox and calls are disabled.
Warnings and markers
DMs use a fixed set of warnings and markers, listed with their triggers in 12 §11.6 and worded in Client requirements. The ones specific to DMs are W3 (an insecure group with a secure viewer), W7 (an insecure 1:1 DM with a secure viewer, also shown on encryption_pending) and W9 (a pinned secure group presented as insecure), plus the markers K1 and K2 (security switched), K5 (closed for a server upgrade) and K6 (your own join or re-add point). An insecure participant never sees W3 or W7. In DM headers and participant lists, show the full canonical address of every participant whose domain differs from your own home domain.
Group DM membership
Owner and permissions
| Action | Who may do it |
|---|---|
| Read, post, add people, rename | Every active participant |
| Leave | Every current participant (a pending one declines through their home server instead) |
| Remove someone else | The owner while the group has one; once it has none, every active participant |
| Share earlier messages with one participant | Every active participant of a secure group, except bots |
The owner is the creator, until the creator first stops being a current participant for any reason: leaving, being removed by the hosting server, turning off encryption or deleting the account. From then on the group has no owner for the rest of its life, and the hosting server emits dm.settings_changed with owner: null (12 §12.1). If the creator is added again later, they come back as an ordinary participant, so re-adding the creator's address can never hand removal powers to whoever holds it then. Ownership can't be transferred.
Adding people
POST /v1/dms/{ctx}/participants adds 1 to 10 canonical addresses, with optional communityHints (12 §12.2):
{ "participants": ["erin@e.com"], "communityHints": ["sloppyvoice.com"] }The hosting server checks, in order, that the DM is a group in state active, that the caller is active (a pending caller gets 403 dm.not_accepted), that each address exists and isn't already a current participant, federation blocks and rate limits, the size limit, and, for a secure group, that every new person is secure and the caller's device is enrolled. A person with an active server-scope ban at the hosting server can't be added (403 moderation.banned).
Insecure group: each new person becomes pending at once. The hosting server emits dm.participant_added, sends dm.request and answers 200 with the Dm. Adding a secure person doesn't change the group's mode.
Secure group, in two phases:
- The hosting server sets each new person to
reservedfor the caller, valid 60 s, and answers 202 with the Dm. - Your client pins the new people silently, claims KeyPackages for their enrolled devices through your home server, and submits one commit that adds those devices and lists the new people in
sv_participantswith their identity-key thumbprints, with the Welcome. A new person for whom no KeyPackage could be claimed is still listed, and the add proceeds; their devices join later. - When the hosting server accepts that commit, each reserved person becomes
pending; it emitsdm.participant_addedand sendsdm.requestcarrying the Welcome. - If no commit arrives within 60 s, the reservation lapses silently, and a late commit gets 409 dm.reservation_expired. Start again.
Leaving and removing
DELETE /v1/dms/{ctx}/participants/{addr}, with {addr} percent-encoded, returns 204 (12 §12.3):
{addr}is you: leave. You becomeleft.{addr}is someone else: you must be the owner while the group has one (else 403 dm.not_owner), or anyactiveparticipant once it has none. They becomeremoved. This also withdraws invitations ofpendingorreservedpeople.- A 1:1 DM answers 409
dm.not_group. A 1:1 DM can't be left; hide it or block the peer.
A participant who left can't come back by themselves; another participant must add them again.
Whenever someone stops being a current participant, the hosting server emits dm.participant_removed (with by naming the remover for a removal), stops delivering the DM's events, Welcomes and media to them, revokes their voice leases, and recomputes security, so an insecure group whose remaining participants are all secure starts upgrading (12 §12.4). In a secure group, the committing member MUST remove the person from sv_participants in the same commit that removes their leaves.
What a newcomer can read
| Insecure group DM | Secure group DM | |
|---|---|---|
A new participant's joinedSeq |
1: the whole timeline is served | The seq of their own dm.participant_added |
| Earlier items | Served | Not served, including plaintext from an earlier insecure period |
| Client shows | Nothing special | K6 at the join point |
Source: 12 §12.5. There is no history setting. A participant who left or was removed and is added again gets a new joinedSeq by the same table, so in a secure group their earlier memberships aren't served again; their devices keep what they stored locally. In a 1:1 DM both participants read from seq 1, except after a reopening or an identity reset.
In a secure DM, any active participant other than a bot may deliberately share earlier messages with one specific other participant, through the HistoryShare mechanism on MLS and sealed messages. Offer it only as a deliberate action, never automatically or as a prompt when someone joins. The recipient sees K7; everyone else, the sharer included, sees K8, which is the only record, because DMs have no audit log.
Size limit
maxGroupDmParticipants in ServerMetadata limits is the maximum number of current participants, creator included: default 25, floor 10 (12 §12.7). reserved, pending and active participants count. A secure group is also bounded by maxSecureLeaves, counted in devices.
Closing and successors
When a hosting server becomes secure
A server upgrade is irreversible. When it takes effect, the hosting server applies these rules to every DM it hosts, so no plaintext DM continues on a secure server (12 §13.1):
| DM | Result |
|---|---|
| Secure (1:1 or group) | Unchanged. |
| Insecure group DM | closed, reason host_secure, with marker K5. |
| Insecure 1:1 DM, rule host is not a secure server | closed, reason host_secure, with K5. |
| Insecure 1:1 DM, rule host is a secure server (both homes are now secure) | encryption_pending in place. |
A closed DM stays readable to its participants under its existing history rules.
Successors
When your client wants to send into a DM that is closed with reason host_secure, it creates a successor without asking the user (12 §13.3):
- 1:1: compute the rule host with fresh inputs, register
{ newhost, same ctx }withPOST /v1/me/dms, thenPOST /v1/dmsat the new host withreplacesset to the closed DM, and send. The successor has the samedm:reference. - Group: first check the closed entry's
successor, since another participant may already have created one. Otherwise create a new group at the hosthost_groupselects, with the closed DM's current participants,nameandreplaces. You become the new group's creator and owner.
Recipients auto-accept the successor under rule (c) when they had accepted the closed DM and the inviter was in it; for a group, only when the new creator is homed at the new hosting server. Render a closed DM and its successor as one conversation: the old messages, K5, then the new ones, with K2 after K5 if the successor is insecure.
dm.closed carries data.reason and data.successor (for host_secure, if the hosting server knows it; otherwise null). Only host_secure leads to a successor. A DM closed as banned (a participant has a server-scope ban at the hosting server) reopens in place when the ban ends. A DM closed as peer_deleted reopens only as a new conversation, below.
Deleted accounts and reused addresses
The hosting server records each participant's incarnation (inc). When it learns the account was deleted, or sees a different inc for the same address, the old participant is treated as deleted (12 §6.4):
- Group DM: the participant becomes
removedwith reasonaccount_deleted. - 1:1 DM: the peer becomes
removedand the DMclosedwith reasonpeer_deleted. If either side later starts a DM with that address (after the address quarantine of Addresses), the samedm:reference reopens as a new conversation: neither account is served the earlier messages, the other side becomespendingwith a new invitation, and clients show W2's new-account wording at the reopening point.
The new account at a reused address is a stranger: it can't inherit the old conversation, the old acceptance, or a place in any sv_participants list.
DM calls
Calls exist in DMs and voice channels only. Call control is on Calls; document 12 says which DMs can have calls and how their media travels (12 §14).
Every DM can have calls: 1:1 and group, insecure and secure. In every DM, all call media travels through the hosting server's relay or SFU. Clients MUST NOT send media to each other directly.
- Only
activeDM participants may start or join a call. A DM in stateupgradingaccepts no new joins, and one that isencryption_pendingorclosedhas no calls. - A call has its DM's security mode. A call already running when the DM enters
upgradingcontinues until the switch. When the DM becomes secure, the call ends with reasonsecurity_upgradedand clients rejoin it as a secure call automatically. When a 1:1 DM becomes insecure, the call ends withsecurity_downgradedand clients don't rejoin; the user starts a new call after seeing the warnings. - When a DM is closed (K5), its call ends with reason
context_closedand clients don't rejoin it. - Unenrolled devices can't join calls in secure DMs, and each user has at most one call per hosting server.
Because every call participant connects only to the hosting server and its relay or SFU, a DM call never reveals one participant's IP address to another. The hosting server learns it, as it does for any context (12 §20).
Call entries and ringing
When a call starts or ends, the hosting server sequences dm.call_logged with phase: "started" or "ended". A start is a content event, so a call can open a DM and trigger its dm.request like a first message. Show these as call entries ("Alice called", "Missed call", duration).
Ringing goes only to active participants, never to a pending one and never to a 1:1 participant who blocked the caller. A pending recipient sees the call only as a missed call in the request. The recipient's home also never rings for an entry in state requested, so a stranger can't ring anyone (12 §14.1).
When a server is unreachable
If the hosting server is down, messages wait in the outbox with their mid and are retried, with the status line "Waiting to send — the server for this chat isn't reachable right now." A new 1:1 DM appears at once, because its ctx is known; a group DM appears as a local draft. If your own home server is down, creating a DM on another server and every secure add wait, because both need it ("Waiting for your server…"). A client MUST NOT move a DM to another server because its hosting server is down; the host changes only by closing and a successor (12 §15).
Events
On the DM's context, from the hosting server; all durable, and also forwarded to pending participants inside dm.request batches (12 §16.1):
| Event | Timeline item | Payload |
|---|---|---|
| dm.created | Yes | kind, createdBy, security, participants, name, replaces |
| dm.participant_added | Yes | participant, addedBy |
| dm.participant_removed | Yes | addr, reason (as visible to you), by |
| dm.participant_updated | Line only for "joined" | addr, state, role |
| dm.settings_changed | Yes | Changed name or owner; by |
| dm.call_logged | Yes | callId, phase, by, video, at; durationMs and answered when ended |
| dm.security_eligible | No | generation, participants |
| dm.security_changed | Yes (K1/K2) | security, previous, generation, lastSeqBefore, marker, cause |
| dm.closed | Yes (K5) | reason, marker |
| dm.state_changed | No | state, previous, reason |
On the me stream at your home server; all durable (12 §16.2): dm.index_updated, dm.index_removed, dm.request_received, dm.request_resolved, dm.block_updated and dm.settings_updated.
Ignore unknown payload members and unknown reason and cause values, and treat an unknown marker as none. Decode defensively: an unknown Dm kind is group, an unknown security is secure (so you refuse plaintext), an unknown Dm state is closed, and an unknown participation state is removed.
Errors
Every dm.* code, with its data members, is in the error reference and 12 §17. The ones a client acts on rather than just reports:
- dm.wrong_host: refetch metadata, recompute and retry, as described above.
- dm.security_mismatch: refetch the IdentityStates named in
data.participants, then retry. - dm.upgrade_in_progress: bootstrap or join the new group, then retry.
- dm.encryption_pending: wait for the people in
data.waitingFor; keep the draft. - dm.closed: with
host_secure, continue in a successor; withbanned, wait; withpeer_deleted, only starting again reopens it. - dm.reservation_expired: the secure add took longer than 60 s; start it again.
Where the spec is open
- Large Welcomes. A Welcome for a large secure group can exceed the 64 KiB request size by itself. The current rule leaves the whole Welcome out, so the recipient sees the messages only after Accept. A change is proposed in 12 §21, item 1.
- Bots and message requests. The DM index endpoints accept a bot token, but the message-request endpoints say only "Home session required", so whether a bot can accept, decline or block a request isn't stated (12 §9.3, 12 §10.3). (
POST /v1/dmsacceptsAuthorization: Botonly where the bot's home is the hosting server; elsewhere a bot uses a remote session like a user, 03 §3.1.)