Happ Docs

Tools & Actions

Enable your assistant to perform real actions through webhooks and API calls

Overview

Tools allow your AI assistant to go beyond text responses. With tools, the assistant can call external APIs, update CRM records, create bookings, look up data, and trigger custom workflows — all within the conversation.

For the full API reference, see api.happ.tools/reference.

How Tools Work

  1. You define a tool with a name, description, parameters, and a webhook URL
  2. During a conversation, the AI determines it needs to use a tool
  3. The assistant calls your webhook with the collected parameters
  4. Your webhook returns a result
  5. The AI uses the result to continue the conversation

The tool calling loop is recursive — the AI can call multiple tools in sequence, using results from one tool to inform the next call.

Creating a Tool

  1. Go to your assistant's Tools tab
  2. Click Add Tool
  3. Configure:

Basic Settings

FieldDescription
NameDescriptive function name (e.g., create_booking, check_order_status)
DescriptionWhat the tool does — the AI reads this to decide when to use it
TypeWhen the tool runs (see Tool Types below)

Tool Types

TypeWhen It RunsUse Case
Webhook ActionDuring conversation, when the AI decides to use itData lookups, bookings, CRM updates
Webhook InitAutomatically at the start of every conversationLoad customer profile, fetch context
Webhook Post-CallAfter a voice call endsSave call summary, update CRM
Client ToolHandled by the client application (no URL needed)UI actions, navigation

Webhook Configuration

FieldDescription
URLYour webhook endpoint (e.g., https://api.yoursite.com/happ/booking)
HTTP MethodGET, POST, PUT, DELETE, or PATCH
SecretShared secret for HMAC-SHA256 request signing

Parameters

Define what data the AI should collect from the conversation:

FieldDescription
NameParameter name (e.g., customer_name, date)
Typestring, number, boolean, array, or object
DescriptionWhat this parameter is — helps the AI collect the right info
RequiredWhether the parameter must be provided
Value Typellm_prompt (AI decides), constant (fixed value), or dynamic_variable

Execution Mode

ModeBehavior
ImmediatePause conversation until the tool returns a result
Post-Tool SpeechContinue speaking while the tool runs in the background
AsyncFire and forget — don't wait for a result

Sound Effects (Voice Calls)

For voice calls, play a sound while the tool executes:

SoundDescription
elevator1elevator4Elevator bell sounds
typingTyping sound effect

Via API

POST /api/assistant-tools
X-Access-Token: happ_your_token_here
Content-Type: application/json

{
  "assistantId": "your-assistant-uuid",
  "name": "create_booking",
  "description": "Book an appointment for the customer",
  "type": "webhook_action",
  "apiCallUrl": "https://api.yoursite.com/bookings",
  "httpMethod": "post",
  "executionMode": "immediate",
  "params": [
    {
      "name": "customer_name",
      "type": "string",
      "description": "The customer's full name",
      "isRequired": true
    },
    {
      "name": "date",
      "type": "string",
      "description": "Appointment date in YYYY-MM-DD format",
      "isRequired": true
    },
    {
      "name": "time",
      "type": "string",
      "description": "Appointment time in HH:MM format",
      "isRequired": true
    }
  ]
}

Webhook Request & Response

When the AI triggers a tool, Happ sends an HTTP request to your webhook:

{
  "customer_name": "John Smith",
  "date": "2025-03-15",
  "time": "14:00",
  "chatId": "chat-uuid"
}

Your webhook should return a JSON response:

{
  "result": "Booking confirmed. Confirmation number: #12345."
}

The AI uses your response text to continue the conversation.

Webhook Security

Requests are signed with HMAC-SHA256 using your webhook secret. Verify the X-Webhook-Signature header on your server before processing.

Built-in Tools

Two tools are always available (you don't need to create them):

turnOffAiMode

The AI can call this tool to transfer the conversation to a human operator. When called:

  • isUnderAiControl is set to false on the chat
  • The chat appears in the dashboard as needing human attention
  • If Telegram Push Notifications are configured, your team gets an instant alert
  • AI automatically re-enables after ~10 minutes of inactivity (only when the AI itself triggered the handoff via this tool; manually disabled chats do not auto-resume)

searchKnowledge

Available when the assistant has vector knowledge entries. Searches the knowledge base with a semantic query and returns the top 3 results.

Common Use Cases

Order Status

Name: check_order_status
Description: Look up the status of a customer's order
Method: GET
Parameters:
  - order_number (string, required): The order tracking number

Appointment Booking

Name: create_appointment
Description: Book an appointment for the customer
Method: POST
Parameters:
  - date (string, required): Preferred date
  - time (string, required): Preferred time
  - service (string, required): Type of service
  - name (string, required): Customer name
  - phone (string, required): Customer phone

CRM Update

Name: save_contact
Description: Save customer contact information
Method: POST
Parameters:
  - name (string, required): Customer name
  - email (string, optional): Email address
  - phone (string, optional): Phone number
  - notes (string, optional): Additional context

Best Practices

  1. Write clear descriptions — The AI uses the description to decide when to call the tool. Be specific
  2. Validate on your server — Always validate parameters before processing
  3. Return helpful text — The AI uses your response in its reply. Include confirmation numbers, status info, etc.
  4. Handle errors gracefully — Return clear error messages so the AI can communicate issues
  5. Keep it fast — Webhook responses should return within a few seconds. Use async mode for longer operations
  6. Always use a webhook secret — Verify HMAC signatures on every request