Error Handling & Responses
Standard Response Format
Every API response follows a consistent JSON structure:
{
"success": true,
"message": "Success",
"data": { ... },
"errors": null,
"error_code": null,
"total": 25,
"cache_hit": false
}| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request succeeded |
message | string | Human-readable status message |
data | object/array | The response payload (single object or array of objects) |
errors | array/null | Error details when success is false |
error_code | integer/null | HTTP status code on errors |
total | integer/null | Total count of results (for paginated list endpoints) |
cache_hit | boolean | Whether the response was served from cache |
HTTP Status Codes
| Status | Meaning | When It Happens |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Validation error, resource not found, or invalid input |
| 401 | Unauthorized | Missing/invalid API key, expired key, or insufficient scope |
| 409 | Conflict | Resource already exists (duplicate creation) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected server error |
| 502 | Bad Gateway | External service failure (e.g., email send failed) |
Error Response Examples
Validation Error (400)
{
"success": false,
"message": "Validation failed",
"data": [],
"errors": ["firstName is required", "email must be a valid email address"],
"error_code": 400,
"total": null,
"cache_hit": false
}Not Found (400)
When a resource is not found, the API returns a 400 (not 404):
{
"success": false,
"message": "No results found",
"data": [],
"errors": null,
"error_code": 400,
"total": null,
"cache_hit": false
}Unauthorized (401)
{
"success": false,
"message": "You do not have access to this resource",
"data": [],
"errors": null,
"error_code": 401,
"total": null,
"cache_hit": false
}Rate Limited (429)
{
"success": false,
"message": "Too Many Requests",
"data": [],
"errors": null,
"error_code": 429,
"total": null,
"cache_hit": false
}Headers included:
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1672617900
Retry-After: 1672617900Pagination
List endpoints support pagination via limit and offset query parameters:
| Parameter | Default | Max | Description |
|---|---|---|---|
limit | 96 | 96 | Number of results per page |
offset | 0 | — | Number of results to skip |
The total field in the response indicates the total count of matching results (not just the current page).
# Page 1
GET /api/public/guest?limit=50&offset=0
# Page 2
GET /api/public/guest?limit=50&offset=50Filtering
Most list endpoints support filtering with the filter query parameter:
GET /api/public/guest?filter[customerEmailAddress]=jane@example.com
GET /api/public/member/email?filter[updatedDate][gt]=2024-01-01 00:00:00Supported filter operators:
filter[field]orfilter[field][eq]— equalsfilter[field][gt]— greater thanfilter[field][lt]— less than
Sorting
List endpoints support sorting with the order query parameter:
GET /api/public/guest?order[lastName]=asc
Values: asc (ascending) or desc (descending).
Including Related Data
Many endpoints support the include[] query parameter to embed related resources in the response, reducing the number of API calls needed:
GET /api/public/brand?include[]=stores&include[]=restaurantSegment
GET /api/public/member/email?include[]=subscription&include[]=tagEach endpoint documents its supported includes in the API Reference.
Caching
Many GET endpoints use server-side caching. When a response is served from cache, cache_hit will be true. Cached responses do not consume additional server resources but still count toward your rate limit.
Write operations (POST, PUT, PATCH, DELETE) automatically invalidate relevant caches.