Error Responses
Bridge returns structured error responses for failed requests.
Error Response Structure
When an error occurs, Bridge returns a consistent JSON object:
Response Fields
Field Errors
For validation failures (HTTP 400 or 422), Bridge may include fields:
Field Error Structure
Nested Field Errors
field uses dot notation for nested objects:
HTTP Status Codes
Bridge uses conventional HTTP status codes:
Error Types
The type field is the primary way to classify errors.
invalid_request_error
The request has invalid parameters. Check fields and param when present.
authentication_error
Authentication failed.
permission_error
Authenticated caller lacks permission for this resource.
resource_error
Requested resource could not be found.
conflict_error
Request conflicts with the current resource state.
validation_error
Request failed validation rules.
rate_limit_error
Rate limit was exceeded.
api_error
Generic server-side error.
Handling Errors
Best Practices
- Check HTTP status code first for broad request outcome.
- Use
typefor client branching (primary discriminator). - Use
fieldsfor form validation UX when present. - Log the
requestIdand include it in support requests.
Example Error Handling (TypeScript)
Retryable Errors
Usually retryable:
500Internal Server Error429Too Many Requests
Usually non-retryable without input/auth changes:
400,401,403,404,422
Request IDs
Error responses may include requestId. Successful responses expose request IDs in the X-Request-ID header.
When contacting Bridge support, include the request ID.
You can provide your own request ID header: