Spec Guides
A compact client and bot API guide for registration, sync, room operations, and command delivery.
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
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.