ECCP

Layered Docs

Reference material for protocol builders, operators, and client teams.

ECCP separates messaging basics, server operations, protocol concepts, and implementation guides so each layer stays understandable.

Static export ready

Static MDX guides, Shiki code fences, sidebar navigation, and bilingual routing for English and Traditional Chinese readers.

Spec Guides

A compact client and bot API guide for registration, sync, room operations, and command delivery.

Updated 2026-04-08/docs/api-reference

API Reference

ECCP keeps the wire contract explicit. Clients talk to their homeserver over authenticated APIs, while federation traffic stays on the server-to-server plane.

Client Surface

| Method | Endpoint | Purpose | | --- | --- | --- | | POST | /_eccp/client/v1/register | Create an account and initial device | | POST | /_eccp/client/v1/login | Exchange credentials for a scoped token | | POST | /_eccp/client/v1/rooms | Create direct, group, or Shadow Rooms | | PUT | /_eccp/client/v1/rooms/{roomId}/send/{eventType} | Send an event into a room | | GET | /_eccp/client/v1/sync | Incrementally sync account data and timelines |

Bot Surface

| Method | Endpoint | Purpose | | --- | --- | --- | | POST | /_eccp/bot/v1/commands | Deliver a slash command | | POST | /_eccp/bot/v1/webhooks/{webhookId} | Inject an approved bot event |

Example Command Request

TypeScript snippet

TypeScript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
interface CommandRequest {
  command: "/translate" | "/todo" | "/remind";
  roomId: string;
  arguments: string[];
}

export async function sendCommand(
  baseUrl: string,
  accessToken: string,
  payload: CommandRequest
): Promise<Response> {
  return fetch(`${baseUrl}/_eccp/bot/v1/commands`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${accessToken}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify(payload)
  });
}

Error Semantics

ECCP responses should expose a stable machine-readable errcode and a human-readable error field. Clients should branch on errcode, not on display text.