AgenticUniverse - Previously Formi
  1. Interactions
AgenticUniverse - Previously Formi
  • Our Technical Note
    • Why Open AI is not Enough
    • How business Outcomes would Change Radically with AgenticUniverse
    • Our Research
      • STT - Nuances and Insights
      • Solving for STT Constraints
  • Generate Token
    • Login/Generate Token
      POST
  • Agent Configuration
    • Model Configuration
      • Configuration Helpers
        • Supported Providers
        • Supported Models
        • Supported Parameters
      • Get Model Configuration
      • Set Model Configuration
    • State Machine
      • Edge
        • Legacy
          • Create Edge
          • Edge Details
          • Update Edge
          • Delete Edge
        • Update edge properties
        • Get edge details
        • Delete an edge
        • Create an edge (transition) between two states
      • State
        • Create State from Template
        • Get State Information
        • Update State
        • Delete State
      • Get State Machine Structure
    • Prompt Templates
      • Get All Templates
      • Render Template
    • Tools
      • Get Tools List
      • Add Tool
      • Update Tool
      • Delete Tool
    • Get All Agents
      GET
    • Single Agent Details
      GET
    • Create Agent
      POST
    • Update Agent Details
      PUT
    • Enable Dashboard For An Outlet
      POST
    • Disable Dashboard For An Outlet
      POST
    • Get Call queue Sheet ID
      GET
  • Interactions
    • Pre-Interaction Context
      • Schedule an Interaction
      • Update an Interaction Id
      • Delete an Interaction Id
      • Clear all interactions
      • Get Summarized Interaction Info
    • Interaction Modalities
      • Video
        • Generation
          • Generate Welcome Video
      • Text
        • Start Interaction
        • Create Response
        • End Interaction
      • Voice
        • Connection Configuration
          • Quickstart
          • Connecting Twilio
          • Connecting Exotel
          • Formi WebSocket Configuration Guide
          • Create a New Connection Vendor
          • Get All Connection Vendors
          • Update a Connection Vendor
          • Delete a Connection Vendor
          • Get Agent's Connection Config
          • Add or Update Agent's Connection Config
    • Post Interaction Configuration
      • Email Destination Configuration
      • Variables CRUD
        • Get all required variables for the outlet with map
        • Modify variable definition for outlet
        • Add a new variable for the outlet
        • DELETE variable for outlet
        • Connect Variable to a destination
      • Destinations CRUD
        • Get all destinations for the outlet
        • Modify Destination for outlet
        • Add a new Destination for the outlet
        • DELETE Destinations for outlet
    • Get Interaction Summary
      GET
    • Resolve an Escalated Interaction
      POST
    • Get the Interaction list
      GET
    • Get Information regarding Single Interaction
      GET
  • Agent Utilisation
    • Get Credits Available
      GET
    • Interaction Utilisation
      GET
    • Model Utilisation
      GET
  • Webhooks
    • Get webhook URL
    • Update webhook URL
    • Get webhook metadata
    • Modify webhook metadata
    • Get reservation ingestion metadata
  • Untitled Endpoint
    POST
  1. Interactions

Post Interaction Configuration

1. Overview#

Post-Interaction Configuration sends API requests to endpoints that you require, after an interaction is over with the payload that you configure.
You can set up rules to analyze the discussion, send the results to your business tools like a CRM, and trigger any follow-up actions that are needed.

2. Architecture#

The data flow comprises of destinations, variables and mapping the variables with the destinations where the variables are sent in the payload;

2.1 Destinations (Action Layer)#

The system triggers all the configured destination endpoints and sends the variables mapped in the payload;
Currently there is no support for conditional post interaction triggers. This is an MVP Build Configuration Layer, conditional Destination triggers will be available in V1.
book_demo: Likely sends calendar links or CRM booking.
end_call: Gracefully concludes the flow.
notify_sales: Triggers alerts or CRM tasks for human follow-up.

2.1.1 What is a destination?#

Destination in our system is a webhook endpoint that we trigger at the end of each conversation.
We support the following methods:
POST
We support a static but configurable url, below are some examples:
https://api.example.com/webhook
https://api.formi.co.in/v2/destinations/email ( This is our email destination endpoint , see Email Destination Configuration for more details)
We support the static but configurable headers , below are some examples:
Content-Type: application/json
Authorization: Bearer token
We support the dynamic(populated by the extracted variables) configurable body, below are some examples:
{{phone_number}}
{{email_id}}
{{guest_name}}

2.2 Variables (Input Layer)#

Variables that you configure for are the input for this system.
These variables are extracted using the conversation transcript.
Based on the Destination variable map, the variables are sent to the destinations at the end of each conversation.

2.2.1 What is a variable?#

Variable is the data point that needs to be extracted from the conversation transcript.
Currently we support the following variable types:
String
Boolean
Integer
Float
Date
Time
Variables are created using our API layer.
Description: Its the prompt that the internal system uses to extract the variable from the conversation transcript , we can add more context to this prompt to improve the accuracy of the extraction.


3. Purpose#

Currently the purpose of this configuration is to enable downstream functions that businesses expect the agent to perform once the interaction is over, such as :
A notification on a CRM
A Booking Insertion on a PMS
Email Notification
Sending a WhatsApp message
Variable Creation API
Use Formi's Variable Creation API to explicitly create a variable
Outbound Interactions
Setup and Source & Queue Calls on our System

4. Quick Start: Post Interaction Configuration#

Setting up post-interaction configuration is a simple 4 step process for a destination:
Create a variable
Create a destination
Map the variable to destination
Verify the connection of variable to destination
All these can be currently done using the API layer , for which the reference is provided below.

1. Create Post-Call Variables#

API: POST /v2/post_call/data/variables
Define key variables like follow_up_time, call_outcome, etc.
Each variable includes:
Type: string, boolean, integer, float , date , time.
Description: Its the prompt that the internal system uses to extract the variables from the conversation transcript , we can add more context in this prompt to improve the accuracy of extraction.
Currently the LLM used for Variable extraction is gpt-4o , keeping this in mind while writing the variable prompt will give better results

2. Create Destinations#

API: POST /v2/post_call/data/destinations
Configure where post-call data should go (e.g., CRM, webhook)
Define for each destination:
Destination type
API method: POST, GET, etc.
Payload template using dynamic placeholders like {{phone_number}}, {{email_id}}

3. Map Variables to Destinations#

API: POST /v2/post_call/data/map
Link each variable to one or more destinations
Ensures data is routed correctly after each call

4. Verify Configuration#

View all variables: GET /v2/post_call/data/variables
View all destinations: GET /v2/post_call/data/destinations
Use these to confirm mappings and destination setup

5. Post-Call Execution#

When a call ends:
Mapped variables and default metadata are sent to each destination
Placeholders in the api_body are auto-filled with actual values

Defaults Always Sent in Payload#

These fields are always included in the payload regardless of variable mappings:
transcript
interaction_modality

5. Standard Destination Configuration#

We can use Formi Destinations for configuring standard Destinations without any dependency for external APIs.
Email Configuration - guide.
Sheets Configuration - guide.

6. API Reference#

This section details the API endpoints for managing Post Interaction Configuration variables and destinations.
Authentication: All endpoints require a JWT token in the Authorization header. The outlet_id is decoded from this token to identify the correct account.

Variables#

Variables store dynamic data captured after a call (e.g., call outcome, agent notes).

Create Variables#

Adds one or more new post-call variables for the outlet.
POST /v2/post_call/data/variables
Authorization Header
NameTypeRequiredDescription
tokenstringYesJWT token used to authenticate and extract the outlet_id.
Request Body
The body must be an array of variable objects.
[
    {
        "var_name": "customer_name",
        "var_type": "string",
        "description": "name of the customer as inferred from the conversation",
        "variable_id": null,
        "destination_ids": [
            32657790,
            81891481,
            22529718
        ]
    },
    {
        "var_name": "customer_phone_no.",
        "var_type": "string",
        "description": "phone No. of the customer as inferred from the conversation",
        "variable_id": 25589883,
        "destination_ids": [
            90824215
        ]
    }
]
Response
{
    "message": "success",
    "payload": [
        {
            "var_name": "string",
            "var_type": "email",
            "description": "string",
            "variable_id": 0,
            "destination_ids": [
                0
            ]
        }
    ]
}

Get All Variables#

Retrieves all post-call variables configured for the outlet.
GET /v2/post_call/data/variables
Response
The response contains a payload array, where each object represents a configured variable.
{
    "message": "success",
    "payload": [
        {
            "var_name": "name",
            "var_type": "string",
            "description": "Name of the customer",
            "variable_id": 54,
            "destination_ids": [
                4,
                5
            ]
        },
        {
            "var_name": "email_id",
            "var_type": "string",
            "description": "Email of the user",
            "variable_id": 55,
            "destination_ids": [
                4,
                5
            ]
        },
        {
            "var_name": "phone_number",
            "var_type": "string",
            "description": "phone number of the user",
            "variable_id": 56,
            "destination_ids": [
                4,
                4,
                5
            ]
        },
        {
            "var_name": "enquiry_type",
            "var_type": "string",
            "description": "enquiry asked by the user",
            "variable_id": 57,
            "destination_ids": [
                4,
                5
            ]
        },
        {
            "var_name": "occasion",
            "var_type": "string",
            "description": "occasion mentioned by the user",
            "variable_id": 58,
            "destination_ids": [
                4,
                5
            ]
        },
        {
            "var_name": "call_summary",
            "var_type": "string",
            "description": "Summary of the entire conversation with the user , described in around 30-40 words",
            "variable_id": 60,
            "destination_ids": [
                4,
                5
            ]
        }
    ]
}
Payload Fields
FieldTypeDescription
var_namestringUnique name of the variable.
var_typestringData type of the variable.
descriptionstringPurpose and usage of the variable.
variable_idintegerUnique ID for the variable.
destination_idsarray[integer]List of destination IDs this variable is mapped to.

Connect Variable to Destination#

Link a post-call variable to a destination for an outlet. This determines where specific variable data should be routed after a call.

Endpoint#


Request Body#

Content-Type: application/json
The body must be an array of objects, each mapping a variable to a destination.

Fields#

FieldTypeRequiredDescription
variable_idintegerYesID of the variable to connect. Must already exist for the outlet.
destination_idintegerYesID of the destination where the variable value should be sent.

Example Request#

[
  {
    "variable_id": 12,
    "destination_id": 4
  }
]

Example Response
{
  "success": false,
  "message": "Variable with ID not found"
}

Delete a Variable#

Deletes a specific post-call variable for an outlet.
DELETE /v2/post_call/data/outlet/{outlet_id}/variables
Query Parameters
NameTypeRequiredDescriptionExample
variable_idintegerYesThe ID of the variable you want to delete.14
Example Request
{
    "variable_id": 14
}
Response
{
  "success": true,
  "message": "Variable deleted successfully"
}

Destinations#

Destinations are external systems (like a CRM, webhook, or Slack) where post-call data is sent.

Create Destinations#

Adds one or more new destinations for the outlet.
POST /v2/post_call/data/destinations
Authorization Header
NameTypeRequiredDescription
tokenstringYesJWT token used to authenticate and extract the outlet_id.
Request Body
The body must be an array of destination objects.
[
    {
        "destination_name": "Webhook Destination",
        "destination_type": "custom",
        "api_url": "https://api.example.com/webhook",
        "api_method": "POST",
        "api_headers": "{\"Content-Type\": \"application/json\", \"Authorization\": \"Bearer token123\"}",
        "api_body": "{\"customer_name\": \"{{customer_name}}\", \"order_id\": \"{{order_id}}\"}"
    }
]

Get All Destinations#

Retrieve all post-call destinations configured for a specific outlet.

Endpoint#


Example Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OTcsInR5cGUiOiJPVVRMRVQifQ.q80hmm1uQlIVKLpfMLV10bleJPOFO48tgCN5zOVvxv4

Request#

{
  "destination": [
    {
      "destination_name": "CRM Webhook",
      "destination_type": "webhook",
      "api_url": "https://crm.example.com/webhook",
      "api_method": "POST",
      "api_headers": {
        "Authorization": "Bearer abcdef123456",
        "Content-Type": "application/json"
      },
      "api_body": {
        "lead_name": "John Doe",
        "contact_email": "johndoe@example.com",
        "phone_number": "+919876543210",
        "call_summary": "Customer interested in product demo",
        "location": "Bengaluru"
      }
    },
    {
      "destination_name": "Salesforce CRM",
      "destination_type": "crm",
      "api_url": "https://salesforce.example.com/api/leads",
      "api_method": "PUT",
      "api_headers": {
        "Authorization": "Bearer sf_token_987654",
        "Content-Type": "application/json",
        "X-Custom-Header": "custom-value"
      },
      "api_body": {
        "full_name": "Jane Smith",
        "email": "janesmith@example.com",
        "phone": "+918765432109",
        "lead_score": "85",
        "source": "Inbound call"
      }
    }
  ]
}

Response#

{
  "success": true,
  "message": "Destinations fetched successfully",
  "payload": [
    {
      "destination_name": "CRM Webhook",
      "destination_type": "webhook",
      "destination_id": 4,
      "api_url": "https://crm.example.com/api/lead",
      "api_method": "POST",
      "api_headers": {
        "Authorization": "Bearer ABC123",
        "Content-Type": "application/json"
      },
      "api_body": {
        "lead_name": "{{guest_name}}",
        "email": "{{email_id}}"
      }
    }
  ]
}

Example Error Response#

{
  "success": false,
  "message": "Outlet with ID not found"
}

Add a New Destination#

Add a new post-call destination configuration for a specific outlet.

Endpoint#


Authorization Header#

KeyTypeRequiredDescription
tokenstringYesJWT token used to authenticate the client. The outlet_id is extracted from the token.
Example Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OTcsInR5cGUiOiJPVVRMRVQifQ.q80hmm1uQlIVKLpfMLV10bleJPOFO48tgCN5zOVvxv4

Request Body#

Content-Type: application/json

Example Request Body#

{
  "destination": [
    {
      "destination_name": "CRM Webhook",
      "destination_type": "webhook",
      "api_url": "https://crm.example.com/webhook",
      "api_method": "POST",
      "api_headers": {
        "Authorization": "Bearer ABC123",
        "Content-Type": "application/json"
      },
      "api_body": {
        "lead_name": "{{guest_name}}",
        "contact_email": "{{email_id}}"
      }
    }
  ]
}

Response#

{
  "success": true,
  "message": "Destinations created successfully"
}

Delete a Destination#

Delete a configured destination from an outlet.

Endpoint#


Authorization Header#

KeyTypeRequiredDescription
tokenstringYesJWT token used to authenticate the API client and extract the outlet_id.
Example:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OTcsInR5cGUiOiJPVVRMRVQifQ.q80hmm1uQlIVKLpfMLV10bleJPOFO48tgCN5zOVvxv4

Query Parameter#

ParameterTypeRequiredDescription
destination_idintegerYesThe unique ID of the destination to be deleted.
Example:
{
    destination_id=5
}

Response#

{
  "success": true,
  "message": "Destination deleted successfully"
}

FAQs#


What is the Default Data Sent to Each Destination?#

Each destination receives data based on how it has been configured.
By default:
Only explicitly mapped post-call variables are sent.
Variables are passed as key-value pairs in the request body.
If a custom api_body is defined, dynamic placeholders like {{guest_name}} or {{email_id}} are replaced with actual values during runtime.

What is the Payload Template Sent to a Destination?#

The payload template defines the format of the data sent to a destination after a call.

How It Works:#

You define placeholders such as {{guest_name}}, {{email_id}}, etc.
These are automatically replaced at runtime with the generated post call variables that are mapped to this destination.
The final payload is sent as a JSON object.

Example Template:#

{
  "name": "{{guest_name}}",
  "email": "{{email_id}}",
  "phone": "{{phone_number}}"
}

What Are the Default Values Always Sent in the Payload?#

These fields are always included in the payload, even if not explicitly mapped:
FieldDescription
guest_nameName of the user interacting with the system
email_idEmail address of the user (if collected)
phone_numberPhone number of the user
brand_idIdentifier of the brand linked to the conversation
outlet_idID of the outlet or location
timestampWhen the call/conversation ended (ISO format)
call_idUnique ID for the call/session
call_outcomeOutcome of the call (e.g., interested, not_interested)
sourceSource of the lead (e.g., website, IVR, Facebook)

Best Practices#

Only GET and POST methods are supported for post-call destinations.
If a variable is used across multiple destinations, create it once and map it to all — do not duplicate it.
Use clear and meaningful descriptions for all variables.
Stick to lowercase snake_case naming convention for variables.

Final Notes#

Always use a valid token when calling the API.
Without it, the request will return unauthorized.
Before going live:
Test each destination using sample data.
Ensure the API accepts and responds correctly.
Modified at 2025-08-12 09:49:43
Previous
Add or Update Agent's Connection Config
Next
Email Destination Configuration
Built with