Documentation
API Reference
Documentation
API Reference
Book a meeting
Linkedin
Github
  1. Webhooks
  • Introduction
  • Get started
    • Quickstart
    • Authentication
  • Core concepts
    • Agents
    • Phone numbers
    • Calls
    • Webhooks
  • Webhooks
    • Overview
    • Assistant request
    • Tool calls
    • Status update
    • End of call report
    • Security
  • Guides
    • Campaigns
    • xAI Realtime Integration
    • Voice selection psychology
    • Analysis templates
    • BYOK Setup
    • Call analysis
    • Call Transfers
    • Custom Tools
    • Sip Trunks
    • Tool templates
    • Voicemail detection
    • Autonomous silence detection
    • Billing
    • Error codes
    • Rate limits
    • Troubleshooting
  • Api's
    • Campaigns
    • Agents
    • Voices
    • BYOK
    • Analysis templates
    • Tool templates
    • Organization
    • Phone numbers
    • Sip trunks
    • Calls
    • Call control
    • Usage
    • Domains
Documentation
API Reference
Documentation
API Reference
Book a meeting
Linkedin
Github
  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": "inbound_phone_call",
      "status": "in-progress"
    },
    "phone_number": {
      "number": "+31850835037",
      "name": "Flireo Demo"
    },
    "customer": {
      "number": "+31612345678"
    },
    "tool_call_list": [
      {
        "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": [
    {
      "tool_call_id": "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,
        "async_response": "Event logged successfully.",
        "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)
async_responsestringNoMessage 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,
  "async_response": "Event logged successfully.",
  "parameters": {
    "type": "object",
    "properties": {
      "event_type": { "type": "string" },
      "details": { "type": "string" }
    }
  }
}
The LLM receives the async_response immediately while your webhook processes in the background.

Built-in Tools#

End Call Tool#

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

Transfer Call Tool#

Allow the agent to transfer the call:
{
  "type": "transfer_call",
  "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 2026-01-16 16:46:42
Previous
Assistant request
Next
Status update
Built with