Skip to content
</> SCOPED API V1

Developer API v1: scoped keys and messaging

Server-to-server REST with keys issued by Super Admin only. Each key has explicit room permissions and limited scopes. Visitors cannot self-issue keys.

Current capabilities only — admin-issued scoped API keys; first-party WebSocket only

1. Issue an API key

Keys are limited to 25 permitted public rooms and can be revoked immediately. Private or hidden rooms are deliberately excluded in v1.

  1. Sign in as Super Admin on Chat Live.
  2. Open /ar/developers/console (admin-only console).
  3. Choose a label, room allowlist and scopes such as rooms:read or messages:write.
  4. Set expiry between 1 and 365 days.
  5. Copy the bearer key once and store it in your server secret manager, never in frontend JavaScript.

2. Endpoints and scopes

Keys cannot access rooms outside their allowlist. Automated messages show Integration plus the integration label, never impersonating a human user.

  • GET /api/developer/v1/rooms — rooms:read.
  • GET /api/developer/v1/rooms/{slug}/messages?limit=20 — messages:read (up to 50 messages).
  • POST /api/developer/v1/rooms/{slug}/messages — messages:write; up to 2,000 characters and mandatory Idempotency-Key.
  • GET/POST /api/developer/v1/webhooks and DELETE /api/developer/v1/webhooks/{id} — webhooks:manage; the signing secret appears only at creation.

3. Read rooms and messages

Send Authorization: Bearer with every request. Tokens expire and can be revoked. Browser CORS is not enabled for third-party clients; call from your backend.

Shell
# Supply the token securely from a server-side environment variable.
curl -sS 'https://chat.egytag.com/api/developer/v1/rooms' \
  -H "Authorization: Bearer $CHAT_LIVE_API_KEY"

curl -sS 'https://chat.egytag.com/api/developer/v1/rooms/general/messages?limit=20' \
  -H "Authorization: Bearer $CHAT_LIVE_API_KEY"

4. Send a message

Every write needs a unique Idempotency-Key. Retrying the same operation returns the prior message ID. Reusing the key with different text responds with 409. The default write limit is 10 requests per minute per key.

Shell
# Requires messages:write and explicit permission for this room.
# Never put this secret in browser JavaScript.
curl -X POST 'https://chat.egytag.com/api/developer/v1/rooms/general/messages' \
  -H "Authorization: Bearer $CHAT_LIVE_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: event-20261114-001' \
  -d '{"text":"Automated deployment notification"}'

5. Node.js sample

Keep the secret out of browser bundles and Git. Reads are limited to 120 requests per minute per key. Handle 401, 403, 404 and 429 responses.

JavaScript
// Node.js 24+; env CHAT_LIVE_API_KEY is server-side only.
const key = process.env.CHAT_LIVE_API_KEY;
if (!key) throw Error('CHAT_LIVE_API_KEY is missing');
const response = await fetch('https://chat.egytag.com/api/developer/v1/rooms', {
  headers: { Authorization: 'Bearer ' + key },
  signal: AbortSignal.timeout(8000)
});
if (!response.ok) throw Error('Chat Live HTTP ' + response.status);
const { rooms } = await response.json();
console.log(rooms);