Error Codes
Understand RealtimeX API errors, read the response envelope, and look up common messages by endpoint.
Overview
When a request fails, RealtimeX returns a consistent JSON error envelope so your application can handle failures the same way across every endpoint.
Each error includes an HTTP status code and a clear message describing what went wrong. Use the status code to decide how to recover, and use the message to show useful feedback to users or logs.
Success and error responses share the same top-level shape. Check success first, then read message and error when the request fails.
Error Response Format
Failed requests return a body similar to the example below:
{ "success": false, "message": "Human-readable error message", "data": null, "error": "Optional error detail or null"}Field reference
How to Handle Errors
A simple, reliable approach for client integrations:
- Inspect the HTTP status code to choose the recovery path (retry, re-authenticate, fix input, or show a not-found state).
- Read
messagefor the exact reason returned by the API. - Map common messages to user-friendly copy in your product UI when needed.
- Log the full response (status, message, and error) for support and debugging—without storing sensitive tokens.
Common Error Codes
The table below lists frequently observed error messages across the RealtimeX API, along with the HTTP status and the endpoints where they commonly appear.
Status Categories
Use these categories as a quick guide when deciding how your application should respond.
Bad Request
The request was malformed or missing required fields. Check the payload, headers, and parameter constraints before retrying.
Unauthorized
Authentication failed. Refresh or re-issue the access token, then retry the request with a valid Authorization header.
Forbidden
The caller is authenticated but does not have permission. Confirm the user role, tenant privileges, and endpoint scope.
Not Found
The requested resource does not exist or is no longer available. Verify the ID and that the resource has not been deleted.
Conflict
The request conflicts with the current state of the resource—for example, a duplicate email or a role still assigned to users.
Best Practices
- Always handle both the HTTP status and the JSON
messagefield. - For
401responses, attempt a token refresh before forcing the user to log in again. - Treat
409conflicts as actionable user feedback (for example, “email already in use”). - Do not retry
400or403errors without changing the request. - Prefer showing the API
messagewhen it is already clear; otherwise map it to friendlier product copy.