### Example Routing Instructions Source: https://www.bolna.ai/docs/graph-agent/edges-and-routing This is a sample of routing instructions that can be prepended to a routing request. It guides the routing system to analyze user input and select the best matching edge. It also explains how to handle cases where no edge matches. ```text You are the Routing System for this conversation. Analyze the user's input and the available edges. Select the edge whose condition best matches. If no edge matches, stay on the current node. ``` -------------------------------- ### LLM Node Prompt Example Source: https://www.bolna.ai/docs/graph-agent/managing-nodes Define instructions for the LLM, including expected input format and validation rules. Use this to guide the LLM's behavior and ensure data integrity. ```text Collect the customer's 10-digit order number. ASK: 'Can you please share your 10-digit order number?' VALIDATION: - Accept only numeric input, exactly 10 digits. - If the customer gives fewer or more digits, ask once more. - After 2 failed attempts, offer to transfer to a human agent. ``` -------------------------------- ### Install Docker on Ubuntu Source: https://www.bolna.ai/docs/enterprise/on-premise-instructions Commands to add the official Docker repository and install the Docker engine and Compose plugin on an Ubuntu system. ```bash # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update # Install the latest version of Docker sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Verify Docker is running sudo docker run hello-world # Install Docker Compose plugin sudo apt install -y docker-compose-plugin # Verify Docker Compose version docker compose version ``` -------------------------------- ### LanceDB Configuration Example Source: https://www.bolna.ai/docs/api-reference/agent/v2/update Example configuration for using LanceDB as a vector store, specifying vector IDs for knowledgebases. ```json { "provider": "lancedb", "provider_config": { "vector_ids": [ "3c90c3cc-0d44-4b50-8822-8dd25736052a", "4d91c4dd-1e55-5c61-9933-9ee36847163b" ] } } ``` -------------------------------- ### OpenAPI Specification Example Source: https://www.bolna.ai/docs/api-reference/agent/v2/get_all An example snippet from the OpenAPI specification showing the configuration for using multiple knowledge bases simultaneously. ```yaml description: Array of vector ids to use multiple knowledgebases simultaneously example: - 3c90c3cc-0d44-4b50-8822-8dd25736052a - 4d91c4dd-1e55-5c61-9933-9ee36847163b type: object title: LanceDbConfig ``` -------------------------------- ### Per-Language Configuration Example (Hindi) Source: https://www.bolna.ai/docs/customizations/multilingual-config-reference Example of a per-language configuration entry for Hindi. This specifies the transcriber, synthesizer, system prompt, handoff message, and agent name for the Hindi language. ```json { "hi": { "transcriber": { "language": "hi" }, "synthesizer": { "provider": "sarvam", "provider_config": { "voice_id": "anushka", "model": "bulbul:v2" } }, "system_prompt": "आप एक सहायक एजेंट हैं। हिंदी में संक्षेप में उत्तर दें।", "handoff_message": "ठीक है, मैं हिंदी में बात करता हूँ।", "agent_name": "राज" } } ``` -------------------------------- ### Install a Specific Bolna Skill Source: https://www.bolna.ai/docs/skills Install only a particular skill from the Bolna Skills package. This is useful for adding only the 'create-agent' functionality without installing all other skills. ```bash npx skills add bolna-ai/skills --skill create-agent ``` -------------------------------- ### Look Up Account Balance API Request Example Source: https://www.bolna.ai/docs/tool-calling/custom-function-calls Example cURL command to fetch an account balance. Includes account ID and phone number for verification, and a custom request header. ```bash curl --location 'https://api.yourbank.com/accounts/balance?account_id=ACC-991042&phone=%2B919876543210' \ --header 'Authorization: Bearer fin_api_key_001' \ --header 'X-Request-Source: voice-agent' ``` -------------------------------- ### Example SIP INVITE with Custom Headers Source: https://www.bolna.ai/docs/sip-trunking/byot-inbound-headers This snippet shows an example of an INVITE message with custom SIP headers like X-CALLERNO, X-UCID, and X-ACCOUNT, which can be mapped to agent prompt variables. ```sip INVITE sip:+91XXXXXXXXXX@asterisk SIP/2.0 … X-CALLERNO: 0XXXXXXXXXX X-UCID: XXXXXXXXXXXXXXXXX X-ACCOUNT: ``` -------------------------------- ### Install Bolna Skills CLI Source: https://www.bolna.ai/docs/changelog/june-2026 Install the Bolna Skills command-line interface to enable AI coding assistants to manage Bolna voice agents. This command integrates the necessary tools for building, deploying, and operating voice agents. ```bash npx skills add bolna-ai/skills ``` -------------------------------- ### Example Extraction Prompts Source: https://www.bolna.ai/docs/using-extractions These prompts guide the LLM on what data to extract from a transcript. They can be simple questions or more complex instructions. ```text What was the outcome of the call? Was the customer satisfied? ``` ```text Did the agent answer all questions? ``` ```text Determine whether an agent handover is required based on the customer's statements. ``` -------------------------------- ### Create SIP Trunk with Username/Password Authentication Source: https://www.bolna.ai/docs/api-reference/sip-trunks/create Use this example to create a new SIP trunk using username and password authentication. Ensure you replace placeholder credentials with your actual SIP username and password. ```yaml POST /sip-trunks/trunks openapi: 3.1.0 info: title: Bolna API description: >- Use and leverage Bolna Voice AI using APIs through HTTP requests from any language in your applications and workflows. license: name: MIT version: 1.0.0 servers: - url: https://api.bolna.ai description: Production server security: - bearerAuth: [] paths: /sip-trunks/trunks: post: description: Create a new SIP trunk and register it with Bolna's media layer requestBody: description: SIP trunk configuration content: application/json: schema: $ref: '#/components/schemas/SIPTrunkCreateRequest' examples: userpass-example: summary: Username/Password authentication value: name: Zadarma Production provider: zadarma description: Main trunk for outbound sales auth_type: userpass auth_username: auth_password: gateways: - gateway_address: sip.zadarma.com port: 5060 priority: 1 allow: ulaw,alaw disallow: all inbound_enabled: true outbound_leading_plus_enabled: true ip-based-example: summary: IP-Based authentication value: name: Plivo Elastic Trunk provider: plivo auth_type: ip-based gateways: - gateway_address: 21467306465797919.zt.plivo.com port: 5060 priority: 1 ip_identifiers: - ip_address: 15.207.90.192/31 - ip_address: 204.89.151.128/27 inbound_enabled: true required: true responses: '201': description: SIP trunk created successfully content: application/json: schema: $ref: '#/components/schemas/SIPTrunkResponse' '400': description: validation error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: SIPTrunkCreateRequest: type: object required: - name - provider - auth_type - gateways properties: name: type: string description: Human-readable label. Must be unique per account. example: Zadarma Production provider: type: string description: >- SIP provider name (e.g. twilio, plivo, zadarma, telnyx, vonage, custom) example: zadarma description: type: string description: Optional description for internal reference auth_type: type: string enum: - userpass - ip-based description: Authentication method example: userpass auth_username: type: string description: SIP username. Required when auth_type is userpass. auth_password: type: string description: SIP password. Required when auth_type is userpass. gateways: type: array items: $ref: '#/components/schemas/SIPTrunkGateway' description: At least one gateway is required ip_identifiers: type: array items: $ref: '#/components/schemas/SIPTrunkIPIdentifier' description: Required when auth_type is ip-based allow: type: string default: ulaw,alaw description: Comma-separated codecs to allow disallow: type: string default: all description: Comma-separated codecs to disallow transport: type: string enum: - transport-udp - transport-tcp - transport-tls default: transport-udp description: SIP transport protocol. direct_media: ``` -------------------------------- ### Get Sub-Account Usage Source: https://www.bolna.ai/docs/api-reference/sub-accounts/usage Retrieve usage details for a specific sub-account. The usage can be tracked for up to 32 days. You can specify a start and end time for the usage calculation. ```APIDOC ## GET /sub-accounts/{sub_account_id}/usage ### Description Track usage for the sub-account upto 32 days ### Method GET ### Endpoint /sub-accounts/{sub_account_id}/usage ### Parameters #### Path Parameters - **sub_account_id** (string) - Required - The unique identifier of the sub-account. #### Query Parameters - **from** (string) - Optional - The start timestamp (in ISO 8601 UTC format) from which to calculate usage. If not provided, the start of the current month (UTC) is used by default. - **to** (string) - Optional - The end timestamp in ISO 8601 UTC format up to which usage is calculated. If not provided, the end of the current date (in UTC) will be used. ### Responses #### Success Response (200) - **from** (string) - The starting timestamp (in ISO 8601 UTC format) to calculate usage - **to** (string) - The ending timestamp (in ISO 8601 UTC format) to calculate usage - **total_records** (integer) - Total numbers of executions - **total_duration** (number) - Total duration in seconds - **total_cost** (number) - Total cumulative cost of executions **in cents** - **total_platform_cost** (number) - Total cumulative platform cost of executions **in cents** - **total_telephony_cost** (number) - Total cumulative telephony cost of executions **in cents** - **status_map** (object) - A map of call status with their counts. - **synthesizer_cost_map** (object) - Cost breakdown for synthesizer usage. - **transcriber_cost_map** (object) - Cost breakdown for transcriber usage. #### Response Example (200) { "from": "2025-06-25", "to": "2025-06-27T23:59:59.999999", "total_records": 12, "total_duration": 151, "total_cost": 31.754, "total_platform_cost": 22, "total_telephony_cost": 2.673, "status_map": { "completed": 11, "no-answer": 1 }, "synthesizer_cost_map": { "elevenlabs": { "eleven_turbo_v2_5": { "characters": 577, "cost": 5.77 } } }, "transcriber_cost_map": { "deepgram": { "nova-2": { "duration": 125.5993724, "cost": 1.233 } } } } #### Error Response (400) - **code** (integer) - Error code - **message** (string) - Error message ``` -------------------------------- ### API Request for Caller Identification Source: https://www.bolna.ai/docs/customizations/identify-incoming-callers This is an example GET request to an API endpoint for identifying callers. It includes parameters for the contact number, agent ID, and execution ID. ```http GET https://api.your-domain.com/api/customers?contact_number=+19876543210&agent_id=06f64cb2-...&execution_id=c4be1d0b-... ``` -------------------------------- ### Route Definition Example Source: https://www.bolna.ai/docs/api-reference/agent/v2/get_all Shows how to define a route for handling specific user utterances with a static response. ```yaml Route: route_name: "politics" utterances: - "Who do you think will win the elections?" - "Whom would you vote for?" response: "Hey, thanks but I do not have opinions on politics" score_threshold: 0.9 ``` -------------------------------- ### Example API Request Parameters Source: https://www.bolna.ai/docs/api-reference/agent/v2/get_all Demonstrates the structure for API requests, including the request type, URL, and optional API token and parameters. ```yaml request_type: GET url: "https://example.com/api/v2/agent" api_token: "your_api_token" param: "{\"call_transfer_number\": \"+19876543210\", \"call_sid\": \"%(call_sid)s\"}" ``` -------------------------------- ### Example Hangup Prompt for Bolna Voice AI Source: https://www.bolna.ai/docs/hangup-calls This prompt guides the AI in determining if a conversation is complete. It outlines conditions for ending the call based on user explicit statements, satisfaction, or goal achievement. Tune this prompt for optimal performance in your specific use case. ```text You are an AI assistant determining if a conversation is complete. A conversation is complete if: 1. The user explicitly says they want to stop (e.g., "That's all," "I'm done," "Goodbye," "thank you"). 2. The user seems satisfied, and their goal appears to be achieved. 3. The user's goal appears achieved based on the conversation history, even without explicit confirmation. If none of these apply, the conversation is not complete. ``` -------------------------------- ### POST /knowledgebase - Create Knowledgebase Source: https://www.bolna.ai/docs/api-reference/knowledgebase/create Upload a PDF document or provide a URL to create a knowledgebase, enhancing your Bolna Voice AI agent's information base and response accuracy. ```APIDOC ## POST /knowledgebase ### Description Create knowledgebase from a PDF file or URL. Provide either `file` or `url`, not both. ### Method POST ### Endpoint /knowledgebase ### Parameters #### Request Body - **file** (string, binary) - Required if `url` is not provided - PDF file to upload (max 20 MB). - **url** (string, uri) - Required if `file` is not provided - URL to scrape and ingest as knowledgebase. - **chunk_size** (integer) - Optional - Chunk size for embedding model. Default: 512. - **similarity_top_k** (integer) - Optional - Number of top similar nodes to return. Default: 15. - **overlapping** (integer) - Optional - Number of characters which overlap in between neighboring nodes. Default: 128. - **language_support** (string) - Optional - Enable multilingual support for the knowledgebase. When set to `multilingual`, enables cross-lingual retrieval across 100+ languages. If not provided, the default English-optimized configuration is used. ### Request Example ```json { "file": "", "chunk_size": 512, "similarity_top_k": 15, "overlapping": 128, "language_support": "multilingual" } ``` ### Response #### Success Response (200) - **rag_id** (string) - The ID of the knowledgebase. - **file_name** (string) - File name of the PDF uploaded or URL ingested. - **source_type** (string) - Type of source ingested (pdf or url). - **status** (string) - Status of the knowledgebase (processing, processed, or error). - **language_support** (string, nullable) - Language support mode of the knowledgebase (`multilingual` if enabled, `null` otherwise). #### Response Example ```json { "rag_id": "3c90c3xs0d444b5088228dd25736052a", "file_name": "sample-rag.pdf", "source_type": "pdf", "status": "processing", "language_support": "multilingual" } ``` ``` -------------------------------- ### OpenAPI UUID Example Source: https://www.bolna.ai/docs/api-reference/agent/v2/get Example of a UUID format for agent vector IDs. ```yaml format: uuid description: Array of vector ids to use multiple knowledgebases simultaneously example: - 3c90c3cc-0d44-4b50-8822-8dd25736052a - 4d91c4dd-1e55-5c61-9933-9ee36847163b ``` -------------------------------- ### Example LLM Agent Configuration for Custom LLM Source: https://www.bolna.ai/docs/providers This JSON configuration demonstrates how to set up a custom LLM agent. It includes parameters for token limits, penalties, temperature, and the base URL for an OpenAI-compatible API. ```json { "llm_agent": { "max_tokens": 100.0, "presence_penalty": 0.0, "base_url": "https://custom.llm.model/v1", "extraction_details": null, "top_p": 0.9, "agent_flow_type": "streaming", "request_json": false, "routes": null, "min_p": 0.1, "frequency_penalty": 0.0, "stop": null, "provider": "custom", "top_k": 0.0, "temperature": 0.2, "model": "custom-llm-model", "family": "llama" } } ``` -------------------------------- ### Start Services with Docker Compose Source: https://www.bolna.ai/docs/enterprise/on-premise-instructions Command to initialize and run the defined services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Menu Step Configuration Source: https://www.bolna.ai/docs/ivr-inbound-calls Use this step to present options to the caller and collect their selection via keypad input. Ensure 'options' array is populated with valid digits, labels, and optional agent routing. ```json { "step_id": "department", "type": "menu", "prompt": "Press 1 for Sales. Press 2 for Support.", "field_name": "department", "options": [ {"digit": "1", "label": "Sales", "agent_id": "sales-agent-id"}, {"digit": "2", "label": "Support", "agent_id": "support-agent-id"} ] } ``` -------------------------------- ### Example Edge Definition Source: https://www.bolna.ai/docs/graph-agent/introduction Defines a transition to the 'order_status' node when a customer provides a valid order number. This is an example of a conditional edge. ```json { "to_node_id": "order_status", "condition": "Customer provides a valid order number" } ``` -------------------------------- ### Get All Agents Source: https://www.bolna.ai/docs/api-reference/agent/v2/get_all Retrieves a list of all agents. This endpoint is useful for getting an overview of available agents or for populating agent selection UIs. ```APIDOC ## GET /agents/v2 ### Description Retrieves a list of all agents. ### Method GET ### Endpoint /agents/v2 ### Parameters #### Query Parameters - **vector_ids** (array[string]) - Optional - An array of vector IDs to use multiple knowledge bases simultaneously. ### Response #### Success Response (200) - **agents** (array[object]) - A list of agent objects. - **id** (string) - The unique identifier of the agent. - **name** (string) - The name of the agent. - **description** (string) - A description of the agent. #### Response Example { "agents": [ { "id": "agent-1", "name": "Example Agent 1", "description": "This is the first example agent." }, { "id": "agent-2", "name": "Example Agent 2", "description": "This is the second example agent." } ] } ``` -------------------------------- ### Create Knowledgebase Source: https://www.bolna.ai/docs/api-reference/knowledgebase/overview Ingest a new knowledgebase by providing a PDF or URL. ```APIDOC ## POST /knowledgebase ### Description Ingest a new knowledgebase by providing a PDF or URL. ### Method POST ### Endpoint /knowledgebase ``` -------------------------------- ### Complete Extraction Example Source: https://www.bolna.ai/docs/using-extractions A comprehensive example of extraction results, showcasing multiple categories and extractions with various data types and validation information. ```json { "extracted_data": { "Lead Quality": { "Call Outcome": { "subjective": "Customer expressed strong interest and asked about enterprise pricing options.", "objective": "interested", "confidence": 0.92, "confidence_label": "High", "reasoning_subjective": "Customer asked about enterprise pricing and requested a follow-up demo.", "reasoning_objective": "Customer explicitly expressed interest and agreed to a next step.", "validation": null } }, "Contact Info": { "Customer Email": { "subjective": "user@example.com", "objective": null, "confidence": 0.95, "confidence_label": "High", "reasoning_subjective": "Customer clearly provided their email address during the call.", "reasoning_objective": null, "validation": { "is_valid": true, "expected_type": "email" } } }, "Agent Handover": { "Agent Handover Needed": { "subjective": "", "objective": "No", "confidence": 0.88, "confidence_label": "High", "reasoning_subjective": null, "reasoning_objective": "Customer did not request to speak with a human agent at any point.", "validation": null } } } } ``` -------------------------------- ### Example DTMF Input Received by Agent Source: https://www.bolna.ai/docs/dtmf This is an example of the message format the agent receives when a caller enters digits using DTMF input. ```text dtmf_number: 9876543210 ``` -------------------------------- ### Create Support Ticket with POST Request Source: https://www.bolna.ai/docs/tool-calling/custom-function-calls This snippet demonstrates how to create a support ticket by sending a POST request to a helpdesk API. It includes details like caller phone, issue category, description, and priority. ```bash curl --location 'https://api.yourhelpdesk.com/tickets' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer helpdesk_key_789' \ --data '{ \ "caller_phone": "+919876543210", \ "issue_category": "billing", \ "description": "Customer was charged twice for their February subscription", \ "priority": "high" \ }' ``` -------------------------------- ### Example Extraction Test Results Source: https://www.bolna.ai/docs/using-extractions An example illustrating the structure of test results for specific extractions like 'RESCHEDULED VISIT TIME' and 'RESCHEDULED VISIT DATE'. ```text VISIT DETAILS ├─ RESCHEDULED VISIT TIME │ ├─ SUBJECTIVE: 14:00 │ ├─ OBJECTIVE: null │ └─ CONFIDENCE: 0.89 (High) ├─ RESCHEDULED VISIT DATE │ ├─ SUBJECTIVE: 24/03/2026 │ ├─ OBJECTIVE: null │ └─ CONFIDENCE: 0.91 (High) ``` -------------------------------- ### Set Up IVR Configuration via API Source: https://www.bolna.ai/docs/ivr-inbound-calls Use this API call to configure IVR settings for an agent. Ensure you replace placeholder IDs with your actual values. This example sets up a basic menu for department selection. ```bash curl -X POST "https://api.bolna.ai/inbound/setup" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "agent_id": "your-default-agent-id", "phone_number_id": "your-phone-number-id", "ivr_config": { "enabled": true, "voice": "Polly.Aditi", "welcome_message": "Welcome to Acme Corp.", "steps": [ { "step_id": "main_menu", "type": "menu", "prompt": "Press 1 for Sales. Press 2 for Support.", "field_name": "department", "options": [ {"digit": "1", "label": "Sales", "agent_id": "sales-agent-id"}, {"digit": "2", "label": "Support", "agent_id": "support-agent-id"} ] } ] } }' ``` ```json { "message": "Phone number is already mapped to the given agent. IVR config updated." } ``` -------------------------------- ### Extraction Result Example Source: https://www.bolna.ai/docs/changelog/april-2026 This JSON object shows an example of an extraction result, including confidence score, label, reasoning, and validation status for an email extraction. ```json { "subjective": "user@example.com", "objective": null, "confidence": 0.95, "confidence_label": "High", "reasoning_subjective": "Customer clearly provided their email address during the call.", "validation": { "is_valid": true, "expected_type": "email" } } ``` -------------------------------- ### Add Custom LLM Model Request Example Source: https://www.bolna.ai/docs/api-reference/user/add_model This example demonstrates how to structure a JSON request to add a custom LLM model, specifying its name and URL. ```yaml POST /user/model/custom openapi: 3.1.0 info: title: Bolna API description: >- Use and leverage Bolna Voice AI using APIs through HTTP requests from any language in your applications and workflows. license: name: MIT version: 1.0.0 servers: - url: https://api.bolna.ai description: Production server security: - bearerAuth: [] paths: /user/model/custom: post: description: Add a custom LLM Model requestBody: description: Add a custom LLM Model content: application/json: schema: required: - custom_model_name - custom_model_url properties: custom_model_name: type: string description: Human readable name for your custom model custom_model_url: type: string format: uri description: URL endpoint for the custom LLM model examples: example-1: summary: Example of adding a custom LLM model value: custom_model_name: Customer-care Model custom_model_url: https://custom.llm.model/v1 required: true responses: '200': description: agent status response content: application/json: schema: $ref: '#/components/schemas/AddModelResponse' '400': description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: AddModelResponse: properties: message: type: string example: model added successfully description: Success message for adding the custom model status: type: string enum: - added example: added description: status for the model sent in the request to be added type: object title: addmodelstatus Error: required: - error - message type: object properties: error: type: integer format: int32 message: type: string securitySchemes: bearerAuth: type: http scheme: bearer ``` -------------------------------- ### Webhook Payload Example Source: https://www.bolna.ai/docs/tool-calling/transfer-calls This is an example of the data your pre-call webhook endpoint will receive. It includes standard execution record fields merged with the custom fields defined in `pre_call_webhook_param`. ```json { "id": "", "agent_id": "", "status": "in-progress", "telephony_data": { "...": "..." }, "...": "...", "transfer_reason": "caller asked for billing support", "conversation_summary": "Caller could not resolve a billing issue with the agent.", "transferred_to": "+19876543210", "channel": "voice" } ```