Error Codes

Error handling reference for the TBit API

Error Response Format

All errors follow a consistent JSON structure:

Error Codes

  • 400 VALIDATION_ERROR: Invalid request body or query parameters
  • 401 UNAUTHORIZED: Missing or invalid API key
  • 404 NOT_FOUND: Resource not found or does not belong to your agent
  • 405 METHOD_NOT_ALLOWED: HTTP method not supported for this endpoint
  • 409 CONFLICT: Resource already exists (e.g., contact with this channel)
  • 422 SEND_FAILED: Template send failed (e.g., no messaging window)
  • 429 RATE_LIMITED: Rate limit exceeded (100 requests/minute)
  • 500 INTERNAL_ERROR: Unexpected server error

Error Handling

Best practices for handling API errors:

  • Always check the HTTP status code before parsing the response body
  • Implement exponential backoff for 429 (rate limit) errors
  • Log error codes and messages for debugging
  • Do not retry 400 or 401 errors — fix the request first