Skip to content

Error Handling Reference

Error Response Format

All API errors follow a standardized response structure:

json
{
  "error": "Human-readable error message",
  "code": "ERROR_CODE",
  "details": {
    "field": "value",
    "additionalInfo": "..."
  },
  "timestamp": "2024-01-15T10:30:00.000Z",
  "requestId": "req_abc123xyz"
}

Response Fields:

  • error: Human-readable error message describing what went wrong
  • code: Machine-readable error code (see table below)
  • details: Optional object with additional error context (only in development, omitted in production for security)
  • timestamp: ISO 8601 timestamp when the error occurred
  • requestId: Optional request identifier for debugging and support

Common HTTP Status Codes

HTTP StatusError CodeDescriptionCommon Causes
400VALIDATION_FAILEDRequest validation failedMultiple validation errors; see response details array for field-level messages.
400MISSING_REQUIRED_FIELDA required field was not provided.Required parameter was omitted or empty.
400INVALID_FIELD_VALUEInvalid field valueEnum value not in allowed list, wrong data type, or format (e.g. email, category name).
400INVALID_JSONThe request body is not valid JSON.Malformed JSON or syntax error in request body.
400INVALID_PAYLOADThe payload structure is invalid.Web-hook or request payload does not match expected structure.
401UNAUTHORIZEDInvalid or missing auth tokenExpired token, wrong token type
401INVALID_TOKENThe authentication token is invalid.Token expired, malformed, or revoked.
401MISSING_TOKENNo authorization token was provided.No Authorization: Bearer … header in request.
401INVALID_SIGNATUREWeb-hook signature verification failed.Invalid HMAC signature or wrong web-hook secret.
403INSUFFICIENT_PERMISSIONSThe token does not have permission for this operation.Using public key for management operations, or wrong token type.
403SITE_INACTIVEThe site is inactive.Attempting operations on a deactivated site.
404RESOURCE_NOT_FOUNDThe requested resource was not found.Invalid ID, resource deleted, or resource belongs to another publisher.
404PLACEMENT_NOT_FOUNDThe requested placement was not found.Invalid placement ID or placement was deleted.
409RESOURCE_CONFLICTA resource with this value already exists.Duplicate email, name already taken, or unique constraint violation.
429RATE_LIMIT_EXCEEDEDRate limit for this token was exceeded.Too many requests in the time window; use Retry-After before retrying.
500INTERNAL_ERRORAn unexpected internal server error occurred.Unexpected error or database failure; contact support with timestamp and requestId.
500DATABASE_ERRORA database operation failed.Database connection issue or query failure.
500ATOMIC_OPERATION_FAILEDA multi-step operation failed partway.Transaction rollback or partial failure.
500SERVICE_AUTH_NOT_CONFIGUREDService authentication is not configured on the server.Backend misconfiguration; contact support.