API Reference
Appendix
Shared variables, glossary, pagination shape, and conventions used across the RealtimeX API docs.
Overview
This appendix collects cross-cutting reference material that does not belong to a single endpoint: Postman/collection variables, product glossary, pagination shape, and how Platform admin APIs differ from chat SDK APIs.
Use it when wiring environments, naming things in your integration, or checking whether a call should use a client token or a chat user token.
Collection variables
These reusable variables appear throughout this documentation and the underlying Postman collection. Prefer setting them once per environment instead of hardcoding values in every request.
| Variable | Default / Example | Description |
|---|---|---|
| baseUrl | http://localhost:5000 | Server origin. Production example: https://realtimex.softwareco.com |
| apiVersion | v1 | API version prefix (v1 or v2). Changing this re-points every request path. |
| URL | {{baseUrl}}/api/{{apiVersion}} | Composed base URL used by all requests. Prefer editing baseUrl / apiVersion instead of hardcoding. |
| accessToken | (secret — not shown) | Client (Platform) access token. Set by Auth → Login / Register Client. |
| refreshToken | (secret — not shown) | Client refresh token. Used with Auth → Refresh token to mint a new access token. |
| userAccessToken | (secret — not shown) | Chat user access token. Set by User → Login. Used by Conversation / Messages / Uploads chat SDK calls. |
| clientId | - | Tenant (client) _id. Required with is-tenant: true as x-client-id. |
| clientEmail | clientpro1@yopmail.com | Client credentials used by Auth → Login Client. |
| clientPassword | (secret — not shown) | Client credentials used by Auth → Login Client. |
| conversationId | - | Conversation _id used by conversation and message requests. |
| messageId | - | Message _id used by message and moderation report flows. |
| roleId | - | Custom role _id used by Custom Roles get / update / delete. |
| userId | - | User _id used by user, mute/ban, and Platform user admin requests. |
| reportId | - | Moderation report _id from List Reports, used by Resolve Reports. |
After Auth → Login Client, scripts typically populate accessToken, refreshToken, and clientId. After User → Login, they populate userAccessToken.
Glossary
| Term | Definition |
|---|---|
| Client | A tenant / organization account. Owns users, conversations, settings, and custom roles. Authenticates with a client access token for Platform APIs. |
| Tenant DB | The isolated data space for a single Client, selected via is-tenant: true and x-client-id. |
| User (chat user) | An end participant in a Client's tenant. Authenticates with a user access token for chat SDK endpoints (conversations, messages, uploads). |
| Platform | Admin-facing APIs under /client/... and related modules (dashboard, analytics, settings, moderation) used by the tenant console. |
| Conversation | A DM or group chat thread that contains messages, participants, and optional group permissions. |
| Pinned / Starred message | A message flagged for quick reference (conversation pin) or personal bookmark (star). |
| Pre-signed URL | A time-limited S3 URL that allows direct client-side upload without proxying the file through the API server. |
| Effective settings | Resolved runtime settings (feature gates, limits, timers) without admin document fields or secret tokens such as videoSdkToken. |
| Moderation report | A user-flagged message awaiting Platform review (pending → resolved / dismissed). |
| Audit log | An append-only record of tenant actions (ban, mute, resolve, settings changes) for compliance and debugging. |
Pagination convention
Modern list endpoints return items under data.list plus a data.pagination object. Query parameters such as page and limit are documented per endpoint when supported; some moderation/settings lists use server defaults with no required query string.
{
"list": [],
"pagination": {
"currentPage": 1,
"totalCount": 42,
"hasNextPage": true,
"hasPreviousPage": false,
"pageSize": 10
}
}currentPageis 1-based.- Use
hasNextPage/hasPreviousPageto drive pager UI without recomputing totals locally. pageSizereflects the page that was returned (may differ from your requested limit if capped).
IDs & timestamps
- Resource ids are MongoDB ObjectIds (24 hex characters) exposed as
_idstrings. - Timestamps are ISO-8601 UTC strings (
createdAt,updatedAt,mutedUntil, etc.). - Treat mute as active only while
mutedUntilis in the future. - Nullables such as
resolutionNoteorgroupImagemay benullwhen unset — do not assume empty string.
Platform vs chat SDK
| Aspect | Platform (client) | Chat SDK (user) |
|---|---|---|
| Token | accessToken from Auth Login / Register Client | userAccessToken from User Login |
| Typical paths | /client/..., dashboard, analytics, settings, moderation | /user/..., conversation, messages, uploads |
| Audience | Tenant admins and console tooling | End-user chat applications and SDKs |
| Tenant headers | Usually is-tenant: true + x-client-id | Same tenant headers for tenant-scoped chat data |
Mixing tokens is a common cause of 401/403. If a Platform call fails auth, confirm you are not accidentally sending the chat user token.