Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Webhooks
  • API Reference
    • Agents
      • List all agents
      • Create a new agent
      • Get an agent
      • Update an agent
      • Delete an agent
    • Tool Templates
      • List all tool templates
      • Create a new tool template
      • Get a tool template
      • Update a tool template
      • Delete a tool template
    • Numbers
      • List all phone numbers
      • Register a phone number
      • Get a phone number
      • Update a phone number
      • Delete a phone number
    • Calls
      • List calls
      • Get call by ID
      • Initiate outbound call
    • Call Control
      • Send control command to active call
    • Usage
      • Get usage logs
    • SIP Trunks
      • List SIP trunks
      • Create a SIP trunk
      • Get a SIP trunk
      • Delete a SIP trunk
    • Voices
      • List available voices
    • BYOK
      • Get BYOK configurations
      • Add BYOK configuration
      • Delete BYOK configuration
      • Get BYOK provider configurations
    • Domains
      • Get your domain
      • Add a domain
      • Delete your domain
      • List available Resend domains
      • Select and sync a Resend domain
      • Verify domain DNS records
      • Refresh domain status
    • Webhooks
      • Dynamic assistant configuration webhook
      • Tool/Function Call
      • Call Status Update
      • End of Call Report
    • Analysis Templates
      • List analysis templates
      • Create analysis template
      • Get analysis template
      • Update analysis template
      • Delete analysis template
    • Organization
      • Get organization information
    • Campaigns
      • List all campaigns
      • Create a campaign
      • Get a campaign
      • Update a campaign
      • Delete a campaign
      • List campaign leads
      • Add a lead
      • Remove a lead
  • Documentation
    • Get started
      • Quickstart
      • Introduction
      • Authentication
    • Core concepts
      • Agents
      • Phone numbers
      • Calls
      • Webhooks
    • Api's
      • Organization
      • Agents
      • Phone numbers
      • Sip trunks
      • Calls
      • Call control
      • Usage
      • Voices
      • BYOK
      • Domains
      • Analysis templates
      • Tool templates
    • Webhooks
      • Overview
      • Assistant request
      • Tool calls
      • Status update
      • End of call report
      • Security
    • Guides
      • BYOK Setup
      • Call analysis
      • Custom Tools
      • Call Transfers
      • xAI Realtime Integration
      • Analysis templates
      • Billing
      • Error codes
      • Rate limits
      • Sip Trunks
      • Tool templates
      • Troubleshooting
WebsiteLinkedin
WebsiteLinkedin
  1. Webhooks

Tool calls

Called when the AI agent needs to execute a custom tool/function during the conversation.

When It's Called#

1.
Agent has tools defined in llm_config.tools[]
2.
During conversation, LLM decides to call a tool
3.
Flireo sends POST request with tool call details
4.
Your endpoint returns the result
5.
LLM continues conversation with the result

Timeout#

Sync tools: Must respond within 10 seconds
Async tools: Respond immediately with 200 OK (fire-and-forget)

Request Payload#

{
  "message": {
    "type": "tool-calls",
    "timestamp": "2025-12-13T12:00:00.000Z",
    "call": {
      "id": "5c4d030f-43e3-4e65-899e-8148521e660f",
      "type": "inboundPhoneCall",
      "status": "in-progress"
    },
    "phoneNumber": {
      "number": "+31850835037",
      "name": "Flireo Demo"
    },
    "customer": {
      "number": "+31612345678"
    },
    "toolCallList": [
      {
        "id": "tool_abc123def456",
        "type": "function",
        "function": {
          "name": "lookup_contact",
          "arguments": {
            "query": "Jan de Vries"
          }
        }
      }
    ]
  }
}

Response Formats#

Multiple response formats are supported:

Object Format (Recommended)#

{
  "results": [
    {
      "toolCallId": "tool_abc123def456",
      "result": {
        "name": "Jan de Vries",
        "email": "jan@example.com",
        "phone": "+31612345678"
      }
    }
  ]
}

Simple Format#

{
  "result": {
    "name": "Jan de Vries",
    "email": "jan@example.com"
  }
}

Direct Format#

Your data directly (no wrapper):
{
  "name": "Jan de Vries",
  "email": "jan@example.com"
}

Error Format#

{
  "error": "Contact niet gevonden"
}

Defining Tools#

Define tools in your agent's llm_config.tools[]:
{
  "llm_config": {
    "tools": [
      {
        "name": "lookup_contact",
        "description": "Look up contact information by name or phone number",
        "url": "https://api.example.com/tools/lookup",
        "async": false,
        "parameters": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "description": "Name or phone number to search"
            }
          },
          "required": ["query"]
        }
      }
    ]
  }
}

Tool Definition Fields#

FieldTypeRequiredDescription
namestringYesUnique tool name
descriptionstringYesWhat the tool does (for LLM)
urlstringNoPer-tool URL (overrides agent webhook_url)
asyncbooleanNoFire-and-forget mode (default: false)
asyncResponsestringNoMessage for async tools
parametersobjectNoJSON Schema for inputs

Async Tools#

For logging or notification tools where you don't need to return a result:
{
  "name": "log_event",
  "description": "Log an event for analytics",
  "async": true,
  "asyncResponse": "Event logged successfully.",
  "parameters": {
    "type": "object",
    "properties": {
      "event_type": { "type": "string" },
      "details": { "type": "string" }
    }
  }
}
The LLM receives the asyncResponse immediately while your webhook processes in the background.

Built-in Tools#

End Call Tool#

Allow the agent to end the call:
{
  "type": "endCall"
}

Transfer Call Tool#

Allow the agent to transfer the call:
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+31612345678",
      "description": "Sales afdeling",
      "message": "Ik verbind u door met sales."
    },
    {
      "type": "number",
      "number": "+31687654321",
      "description": "Support afdeling",
      "message": "Ik verbind u door met support."
    }
  ]
}

Example Implementation (Node.js)#

See ToolCallsPayload Schema and ToolDefinition Schema for complete details.
Modified at 2025-12-29 14:27:43
Previous
Assistant request
Next
Status update
Built with