Channels#
GET /api/channels lists joined channels; /api/channels/public lists discoverable public channels. POST /api/channels accepts name, description, kind (public/private/dm/group) and members. Public/private names must be unique per workspace. Direct conversations require exactly two people. POST /api/channels/{id}/join joins a public channel. Membership queries and invitations use /api/channels/{id}/members. Authorization still applies to every operation.
Message envelope#
{"clientId":"UUID","parentId":null,"ciphertext":"BASE64","nonce":"BASE64_12_BYTES","mac":"BASE64_16_BYTES","algorithm":"AES-256-GCM-v1","attachmentIds":[]}POST /api/channels/{id}/messages is idempotent for channel/user/clientId. Parent replies must reference a top-level message in that channel. Attachment IDs must belong to valid pending uploads owned by the sender. Active custody policies require matching signed auditCopies as well. GET /api/channels/{id}/messages returns up to 100 entries with timestamp/ID cursors (before, beforeId). For a local day, pass inclusive from and exclusive before with empty beforeId, using UTC milliseconds of local midnight and the following midnight; keep from on older pages. after/afterId return the next 100 in ascending order; do not combine forward/backward cursors. GET /api/me/conversations/{id}/first-unread returns authorized first unread id, parent_id, created_at, or an empty object, enforcing active membership/workspace/history boundaries. Preserve authenticated sender, channel, client and parent identifiers when decrypting. Plaintext server search and editing are not available. Message reactions are persisted metadata (emoji, author and message ID), with idempotent PUT /api/channels/{channel}/messages/{message}/reactions using {emoji, enabled}. Only current members within their history scope may react. Summaries are batched with each message page; deleted messages hide reactions. Use Reagir à mensagem, then tap a count to add/remove your own reaction. DELETE /api/channels/{id}/messages/{messageId} logically deletes an owned message; POST to the same path plus /restore restores it. GET by message ID returns its current authorized state, hiding deleted content. Visibility versions prevent stale responses/events from overriding newer deletions or restorations.
Catalog, context and read receipts#
GET /api/me/messages/catalog?workspaceId=&cursor= returns {items,nextCursor}, up to 100 authorized encrypted messages per page including threads. Without workspaceId it spans authorized workspaces on this installation. It requires a local session bound to a trusted device and rejects delegated federation sessions. No plaintext search term is accepted. GET /api/me/messages/{channel}/{message}/context returns up to 101 authorized messages around a target. GET /api/me/conversations/unread?workspaceId=&cursor= returns up to 50 conversation summaries. POST /api/me/conversations/{channel}/read accepts {"messageId":"UUID"} and advances the receipt monotonically through that authorized target. Cursors are bound to account and scope. See Discovery.
People search#
Authenticated GET /api/people/search uses the workspace scope. Empty query returns up to 20 contacts from recent direct/group conversations, or an empty list. Queries of 2–100 characters search names/emails and return {items: [{id, name, email}], nextCursor}. Send the opaque cursor as cursor for the next page of up to 20 people. One character does not enumerate the directory. Percent and underscore are literal search characters. includeSelf=true includes the requesting person for administrative selectors; default is false. channel restricts results to an authorized conversation's members; excludeChannel removes its existing members. Both require access to that conversation. Delegated federation sessions remain restricted to their approved channel. GET /api/people?ids=id1,id2 fetches up to 100 authorized profile/presence records by ID. The legacy route without IDs is capped at 100 records.
Public-channel discovery#
Authenticated GET /api/channels/discover uses workspace scope and returns {items, nextCursor} with up to 20 entries containing id, name, description, last_activity and member_count. Empty query lists relevant candidates; 2–100 characters search names. Exact/prefix matches rank first, followed by recent activity, member count and name/ID ties. Send the opaque cursor with the same query/workspace. It carries an activity reference time; membership/visibility can change between pages and clients deduplicate IDs. Private/joined channels are excluded; federation remains restricted to the approved channel. No ciphertext or keys are disclosed. The old /channels/public route is retained for compatibility; the UI uses the paginated route.