Response format
All API responses follow a consistent envelope structure.
Success response
{
"success": true,
"data": [],
"meta": {
"count": 25,
"pagination": {
"hasNext": true,
"hasPre": false,
"total": 1250,
"totalPage": 63
}
},
"timestamp": "2023-07-28T07:27:54.123Z",
"message": "Operation completed successfully"
}| Field | Type | When present |
|---|---|---|
success | boolean | Always (true) |
data | object or array | Always |
meta.count | number | List responses |
meta.pagination | object | Paginated responses |
meta.pagination.hasNext, meta.pagination.hasPre | boolean | Paginated responses |
meta.pagination.total, meta.pagination.totalPage | number | Paginated responses, when you send hasCount=true |
timestamp | string (ISO 8601) | Always |
message | string | Optional |
Error response
{
"success": false,
"error": {
"message": "Resource not found",
"code": "NOT_FOUND",
"statusCode": 404,
"details": {}
},
"timestamp": "2023-07-28T07:27:54.123Z"
}| Field | Type | When present |
|---|---|---|
success | boolean | Always (false) |
error.message | string | Always |
error.code | string | Always |
error.statusCode | number | Always |
error.details | object | Optional |
timestamp | string (ISO 8601) | Always |
Plan and rate-limit errors (HTTP 402 and 429) use a flat body instead. See Errors.
Data filtering
API responses only include fields with actual data. Fields with null or undefined values are automatically filtered out to provide cleaner responses for customer-facing applications.