REST API overview
The Ethora chat SDKs and the admin panel are clients of one REST API. Your backend can call it directly to manage users, rooms, messages, push, webhooks and AI agents. This page maps the API; the full reference is in Swagger UI.
Base URL and reference
- Ethora Cloud:
https://api.chat.ethora.com. The version is part of the path (/v1/..., /v2/...).
- Interactive reference (Swagger UI): https://api.chat.ethora.com/api-docs/
- OpenAPI 3.0 spec: https://ethora.com/openapi.json
- Self-hosted Ethora servers expose the same API under their own host. Quick check:
GET <api>/v1/apps/get-config?domainName=app must return JSON with xmppHost.
curl "https://api.chat.ethora.com/v1/apps/get-config?domainName=app"
# → { "result": { "_id": "...", "appToken": "JWT ...", "xmppHost": "...", ... } }
Tokens and headers
| Token | What it is | Header |
| App token | Per-app JWT eyJ… from the admin panel or GET /v1/apps. Public-ish: it ships in your frontend. | Authorization: JWT eyJ…, sent as-is, not wrapped in Bearer |
| Server JWT | You sign it with the app secret, data: { type: "server", appId } | x-custom-token: <jwt> |
| Client JWT | You sign it with the app secret, data: { type: "client", appId, userId } | x-custom-token: <jwt>, only at POST /v1/users/client |
| User access token | token returned by login or by /v1/users/client; 1-hour lifetime | Authorization: <token> |
| Refresh token | refreshToken from the same responses | Authorization: <refreshToken>, only at POST /v1/users/login/refresh |
The app secret itself is never sent; it stays on your server. How to sign server and client JWTs: Connect your users.
The API checks the token type at runtime. A token of the wrong type gets code: "INVALID_TOKEN_TYPE".
v1 and v2
- The spec calls
/v2 the canonical surface for new integrations.
/v2/apps/{appId}/... endpoints name the target app in the path. Use them when your backend manages a specific app; most accept a user token or a server JWT.
- Some operations exist only under
/v1. Deprecated /v1 operations name their replacement, for example /v1/chats → /v2/chats.
- The client-JWT sign-in uses
POST /v1/users/batch and POST /v1/users/client. Both are marked deprecated in the spec but are what the chat SDK flow uses today (verified Oct 2026).
Endpoints by area
Sign-in and session
| Endpoint | Purpose |
POST /v2/users/sign-up-with-email | Register a user with email and password (appId in body) |
POST /v1/users/login-with-email | Log in with email and password; returns { user, token, refreshToken } |
POST /v2/users/login/mfa | Second login step when the account has MFA |
POST /v1/users/client | Exchange a client JWT for { user, token, refreshToken } |
POST /v1/users/login/refresh | New { token, refreshToken } |
GET /v1/users/me | Current user |
POST /v1/users/xmpp-token | Fresh XMPP connection token for reconnects |
Users (backend)
| Endpoint | Purpose |
POST /v1/users/batch | Create users synchronously (server JWT) |
POST /v2/apps/{appId}/users/batch | Create users as an async job (202); poll GET …/users/batch/{jobId} |
DELETE /v2/apps/{appId}/users/batch | Archive users, or purge them with ?mode=hard |
POST /v2/apps/{appId}/users/{userId}/suspend | Suspend a user (/unsuspend lifts it) |
Rooms
| Endpoint | Purpose |
POST /v1/chats, POST /v2/apps/{appId}/chats | Create a group or public room |
POST / DELETE /v2/chats/users-access | Add or remove members |
POST /v2/apps/{appId}/chats/private | Open a 1:1 chat between two users |
GET /v1/chats/my | Rooms of the current user |
GET /v2/apps/{appId}/users/{userId}/chats | Rooms of any user in the app |
Messages
| Endpoint | Purpose |
POST /v2/apps/{appId}/chats/{chatId}/messages | Send a message as one of your users (fromUserId, text); server JWT only |
GET /v2/apps/{appId}/chats/{chatId}/messages | Message history from the archive |
GET /v2/apps/{appId}/messages/search | Search archived messages by text |
POST /v2/apps/{appId}/users/unread-counts | Unread counts per room for up to 200 users, e.g. for digest emails |
POST /v2/apps/{appId}/chats/broadcast | Announcement to selected rooms (async, 202) |
Apps
| Endpoint | Purpose |
GET /v1/apps/get-config?domainName= | Public app config, no auth |
GET / POST /v2/apps, GET / PATCH /v2/apps/{appId} | List, create, read, update apps |
GET / POST /v2/apps/{appId}/tokens | App tokens; the token is returned once (…/{tokenId}/rotate to rotate) |
POST /v2/apps/{appId}/provision | Create default rooms |
Push
| Endpoint | Purpose |
POST /v1/push/subscription/{appId} | Register a device token for the current user (the SDK does this) |
POST /v1/push/apns/{appId}, POST /v1/push/firebase-service-account/{appId} | Upload APNs key or Firebase service account |
POST /v1/push/user/{appId}, POST /v1/push/project/{appId} | Push to one user, or to the whole app |
Webhooks
GET / POST /v2/apps/{appId}/webhooks, PATCH / DELETE …/webhooks/{id}, POST …/webhooks/{id}/test. Body: { url, events, description?, enabled? }; up to 10 per app; the secret is returned once. Events: message.created, message.updated, message.deleted, message.unread, user.created, user.login, user.logout, user.deleted, user.online, user.offline, chat.created, chat.deleted, conversation.completed. Each delivery carries X-Ethora-Signature: sha256=HMAC_SHA256(secret, "<timestamp>.<raw body>") and X-Ethora-Timestamp. Delivery is at least once and can be out of order: drop duplicates by event id.
AI agents
| Endpoint | Purpose |
GET / POST /v2/agents, POST /v2/apps/{appId}/agents | List and create agents |
POST /v2/apps/{appId}/agents/{idOrAddress}/invite-to-chat | Add an agent to a room (chatJid or chatId) |
POST /v2/agents/{id}/reply | Synchronous question and answer without a room (server JWT); can take 10–30 s |
GET / PUT /v2/apps/{appId}/bot | AI bot settings for an app |
Errors and limits
Errors share one shape:
{ "success": false, "error": "Validation Failed", "code": "VALIDATION_ERROR", "details": { "field": "Reason" }, "requestId": "..." }
503 with code SERVER_RESTARTING or SERVER_UNAVAILABLE carries Retry-After (seconds). A write that got either code was not applied and can be retried.
- No global rate limit is documented. Some endpoints set their own and answer
429 with code: "RATE_LIMITED", for example POST /v2/widget/sessions (30 requests per minute per IP by default).
Next steps