Error Response Format

The GetBill API uses conventional HTTP response codes to indicate the success or failure of an API request. All error responses follow a consistent JSON format:
boolean
Always true for error responses
string
A human-readable description of the error
integer
The HTTP status code
object
Additional error details, often including field-specific validation errors

HTTP Status Codes

  • 200 OK: The request was successful
  • 201 Created: A new resource was successfully created
  • 202 Accepted: Asynchronous processing was queued; poll the URL in Location
  • 400 Bad Request: The request was invalid or malformed
  • 401 Unauthorized: Authentication credentials are missing or invalid
  • 403 Forbidden: The authenticated user doesn’t have permission to access the resource
  • 404 Not Found: The requested resource doesn’t exist
  • 409 Conflict: The request conflicts with current resource or idempotency state
  • 413 Content Too Large: The request body exceeds the endpoint limit
  • 422 Unprocessable Entity: The request is valid but contains semantic errors
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: An unexpected error occurred on the server
  • 502 Bad Gateway: The server received an invalid response from an upstream server
  • 503 Service Unavailable: The service is temporarily unavailable
  • 504 Gateway Timeout: The server didn’t receive a response from an upstream server in time

Common Error Scenarios

Authentication Errors

Solution: Ensure you’re including a valid access token in the Authorization header.

Authorization Errors

Solution: Request the appropriate scopes when obtaining your access token.

Validation Errors

Solution: Check the details object for field-specific errors and correct your request data.

Resource Not Found

Solution: Verify the resource ID exists and you have permission to access it.

Rate Limiting

Solution: Implement exponential backoff and respect the retry_after value.

Campaign snapshot errors

Campaign endpoints retain the numeric HTTP status in code and put the stable machine-readable value in details.reason. Validation may also identify a one-based details.row and details.field.
The terminal status API may report safe failure reasons such as client_aborted_upload, stale_snapshot_upload, snapshot_retries_exhausted, or a validation reason. It never returns raw rows, SQL, paths, implementation details, or exception text.
When status is processing_error, inspect core_applied. Do not create a replacement snapshot while the campaign is blocked; contact GetBill support for idempotent operator recovery.

Error Handling Best Practices

1. Implement Proper Error Handling

2. Implement Retry Logic

3. Log Errors for Debugging

4. Handle Specific Error Types

Debugging Tips

1. Check Response Headers

Important headers to examine:
  • X-RateLimit-Remaining: Number of requests remaining in the current window
  • X-RateLimit-Reset: When the rate limit window resets
  • Retry-After: How long to wait before retrying (for 429 responses)

2. Validate Request Format

Common issues:
  • Missing or incorrect Content-Type header
  • Malformed JSON in request body
  • Invalid field values or types
  • Missing required fields

3. Use API Testing Tools

Test your requests using tools like:
  • Postman
  • curl
  • Insomnia
  • HTTPie

4. Enable Debug Logging

Include request/response logging in your application to track API interactions and identify patterns in errors.

Support

If you encounter persistent errors or need help with error handling:
  • Check our Status Page for ongoing incidents
  • Review the specific endpoint documentation
  • Contact support at contact@getbill.io with:
    • The specific error message
    • Your request details (without sensitive data)
    • Steps to reproduce the issue