1. Ethora
  2. Docs
  3. REST API overview

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.
bash
curl "https://api.chat.ethora.com/v1/apps/get-config?domainName=app"
# → { "result": { "_id": "...", "appToken": "JWT ...", "xmppHost": "...", ... } }

Tokens and headers

TokenWhat it isHeader
App tokenPer-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 JWTYou sign it with the app secret, data: { type: "server", appId }x-custom-token: <jwt>
Client JWTYou sign it with the app secret, data: { type: "client", appId, userId }x-custom-token: <jwt>, only at POST /v1/users/client
User access tokentoken returned by login or by /v1/users/client; 1-hour lifetimeAuthorization: <token>
Refresh tokenrefreshToken from the same responsesAuthorization: <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

EndpointPurpose
POST /v2/users/sign-up-with-emailRegister a user with email and password (appId in body)
POST /v1/users/login-with-emailLog in with email and password; returns { user, token, refreshToken }
POST /v2/users/login/mfaSecond login step when the account has MFA
POST /v1/users/clientExchange a client JWT for { user, token, refreshToken }
POST /v1/users/login/refreshNew { token, refreshToken }
GET /v1/users/meCurrent user
POST /v1/users/xmpp-tokenFresh XMPP connection token for reconnects

Users (backend)

EndpointPurpose
POST /v1/users/batchCreate users synchronously (server JWT)
POST /v2/apps/{appId}/users/batchCreate users as an async job (202); poll GET …/users/batch/{jobId}
DELETE /v2/apps/{appId}/users/batchArchive users, or purge them with ?mode=hard
POST /v2/apps/{appId}/users/{userId}/suspendSuspend a user (/unsuspend lifts it)

Rooms

EndpointPurpose
POST /v1/chats, POST /v2/apps/{appId}/chatsCreate a group or public room
POST / DELETE /v2/chats/users-accessAdd or remove members
POST /v2/apps/{appId}/chats/privateOpen a 1:1 chat between two users
GET /v1/chats/myRooms of the current user
GET /v2/apps/{appId}/users/{userId}/chatsRooms of any user in the app

Messages

EndpointPurpose
POST /v2/apps/{appId}/chats/{chatId}/messagesSend a message as one of your users (fromUserId, text); server JWT only
GET /v2/apps/{appId}/chats/{chatId}/messagesMessage history from the archive
GET /v2/apps/{appId}/messages/searchSearch archived messages by text
POST /v2/apps/{appId}/users/unread-countsUnread counts per room for up to 200 users, e.g. for digest emails
POST /v2/apps/{appId}/chats/broadcastAnnouncement to selected rooms (async, 202)

Apps

EndpointPurpose
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}/tokensApp tokens; the token is returned once (…/{tokenId}/rotate to rotate)
POST /v2/apps/{appId}/provisionCreate default rooms

Push

EndpointPurpose
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

EndpointPurpose
GET / POST /v2/agents, POST /v2/apps/{appId}/agentsList and create agents
POST /v2/apps/{appId}/agents/{idOrAddress}/invite-to-chatAdd an agent to a room (chatJid or chatId)
POST /v2/agents/{id}/replySynchronous question and answer without a room (server JWT); can take 10–30 s
GET / PUT /v2/apps/{appId}/botAI bot settings for an app

Errors and limits

Errors share one shape:

json
{ "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

Stuck or planning something bigger?

Book 15 minutes with the team, or open an issue on GitHub. Self-hosting and enterprise questions are welcome.