fishbowlAPI API

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
}
FieldTypeDescription
successbooleanWhether the request succeeded
messagestringHuman-readable status message
dataobject/arrayThe response payload (single object or array of objects)
errorsarray/nullError details when success is false
error_codeinteger/nullHTTP status code on errors
totalinteger/nullTotal count of results (for paginated list endpoints)
cache_hitbooleanWhether the response was served from cache

HTTP Status Codes

StatusMeaningWhen It Happens
200SuccessRequest completed successfully
400Bad RequestValidation error, resource not found, or invalid input
401UnauthorizedMissing/invalid API key, expired key, or insufficient scope
409ConflictResource already exists (duplicate creation)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error
502Bad GatewayExternal 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: 1672617900

Pagination

List endpoints support pagination via limit and offset query parameters:

ParameterDefaultMaxDescription
limit9696Number of results per page
offset0—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=50

Filtering

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:00

Supported filter operators:

Sorting

List endpoints support sorting with the order query parameter:

GET /api/public/guest?order[lastName]=asc

Values: asc (ascending) or desc (descending).

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[]=tag

Each 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.