What is the base URL?
{appId} with your CometChat App ID and {region} with your deployment region.
How do I authenticate?
Include these headers on every request:Your CometChat App ID. Uniquely identifies your CometChat app.
Your CometChat API Key. Authorizes the request.
What does the error response look like?
All errors follow a consistent structure:Machine-readable error code in
SCREAMING_SNAKE_CASE.A user-facing error message safe to display in UI.
A developer-facing message with additional debugging detail.
Optional field-level validation errors. Keys are field names, values are error descriptions.
What are the common error codes?
| Code | HTTP Status | Description |
|---|---|---|
ERR_BAD_REQUEST | 400 | Invalid request body or parameters |
ERR_UNAUTHORIZED | 401 | Missing or invalid credentials |
ERR_NOT_FOUND | 404 | Resource not found |
ERR_TEMPLATE_NOT_APPROVED | 400 | Template is not in approved status |
ERR_INVALID_VARIABLES | 400 | Missing or invalid template variables |
ERR_TARGET_LIMIT_EXCEEDED | 400 | Too many targets for the mode |
ERR_INVALID_MODE | 400 | Invalid delivery mode |
How does pagination work?
List endpoints return paginated results. Use query parameters to control pagination:Page number (1-indexed).
Number of items per page.
All timestamps in the API use ISO 8601 format (e.g.,
2024-01-15T09:30:00.000Z).