1. Introducing Flireo AI
Flireo AI
  • Introducing Flireo AI
    • Introduction
    • Core concepts
    • Getting started
    • API overview
    • Errors
  • Assistants
    • Phone numbers linking
  • Phone numbers
    • Overview
    • Available numbers
    • List phone numbers
    • Order a phone number
    • Phone number orders
  • Verification groups
    • Overview
    • Available numbers
    • Create verification group
    • List verification groups
    • Order number via verification group
  • Server events
    • Assistant types
    • Assistant-request Event
    • Tool-calls Event
    • End-of-call-report Event
    • Status-update Event
    • Control live calls
API ReferenceDocumentatie
API ReferenceDocumentatie
Linkedin
  1. Introducing Flireo AI

Errors

Error Handling#

All API errors follow a consistent format, making it easy to handle them programmatically.

Error Response Format#

{
  "error": {
    "code": "error_code",
    "message": "Human-readable error message",
    "details": {}
  }
}

Error Codes Reference#

Client Errors (4xx)#

CodeHTTP StatusDescription
invalid_parameters400Missing or invalid request parameters
already_linked400Resource is already linked
already_in_use400Resource is being used elsewhere
no_phone_number400No phone number to operate on
invalid_status400Resource is in wrong status for operation
insufficient_credits402Not enough credits for operation
forbidden403You don't have permission
not_found404Resource not found
rate_limit_exceeded429Too many requests

Server Errors (5xx)#

CodeHTTP StatusDescription
database_error500Database operation failed
provider_error500External provider (Telnyx) error
server_error500Unexpected server error

Error JSON Schema#

{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "invalid_parameters",
            "already_linked",
            "already_in_use",
            "no_phone_number",
            "invalid_status",
            "insufficient_credits",
            "forbidden",
            "not_found",
            "rate_limit_exceeded",
            "database_error",
            "provider_error",
            "server_error"
          ],
          "description": "Error code for programmatic handling"
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "details": {
          "type": "object",
          "description": "Additional error details (field-specific validation errors)"
        }
      },
      "required": ["code", "message"]
    }
  }
}

Handling Validation Errors#

When code is invalid_parameters, the details object contains field-specific errors:
{
  "error": {
    "code": "invalid_parameters",
    "message": "Validation failed",
    "details": {
      "phone_number": "Invalid phone number format",
      "city": "City is required"
    }
  }
}

Best Practices#

1.
Always check the code field for programmatic error handling
2.
Display the message field to users for human-readable feedback
3.
Log the full error response for debugging
4.
Implement retry logic for rate_limit_exceeded and transient server_error
5.
Handle insufficient_credits by prompting users to purchase more credits
Modified at 2025-12-08 10:35:46
Previous
API overview
Next
Phone numbers linking
Built with