Millis AI Webhooks Documentation
Configuration Key in Agent Config: extra_prompt_webhook
The Prefetch Data Webhook is called before the conversation begins. It enables real-time customization and event notifications.
The configuration can be provided in one of the following formats:
String: The URL of the webhook endpoint.
Object:
Call Notification: Notify your system about an incoming call by receiving a webhook event.
Metadata Override: Dynamically override or add session metadata based on external systems.
Extra Prompt: Provide additional context to the agent’s system prompt.
Method: GET
Query Parameters:
session_id
(string): Unique session identifier.
agent_id
(string): ID of the agent handling the session.
from
(string): Caller’s phone number (if applicable).
to
(string): Receiver’s phone number (if applicable).
Additional session metadata as key-value pairs (if available).
Content-Type: application/json
.
Response Fields:
metadata
(object): Overrides or extends the current session metadata. Existing keys are updated, and new keys are added.
extra_prompt
(string): Additional text appended to the agent’s system prompt.
Configuration Key in Agent Config: session_data_webhook
The End-of-Call Webhook is triggered after a session concludes. It provides detailed information about the session for logging, analytics, or post-call processing.
The configuration can be provided in one of the following formats:
String: The URL of the webhook endpoint.
Object:
Method: POST
Payload (JSON):
chat
(string): JSON string representing the chat history (user and agent messages).
function_calls
(array): List of external functions invoked during the session.
ts
(timestamp): Session start time.
duration
(integer): Session duration in seconds.
agent_config
(object): Serialized agent configuration.
agent_id
(string): ID of the agent managing the session.
call_id
(string): Unique identifier for the call session.
chars_used
(integer): Number of characters processed during the session.
session_id
(string): Unique session identifier.
cost_breakdown
(array): List of cost components for different services.
voip
(object): Telephony details.
recording
(object): Call recording details.
metadata
(object): Final metadata for the session.
call_status
(string): Status of the call. Possible values:
user-ended
api-ended
voicemail-message
voicemail-hangup
agent-ended
timeout
error
chat_completion
error_message
(string): Description of any errors encountered during the session.
Request URL:
Payload:
Prefetch Webhook:
Use this webhook to notify your system about calls, adjust metadata dynamically, or provide extra prompts to enhance conversational context.
End-of-Call Webhook:
Designed for detailed post-call analytics and tracking.
Ensure secure storage of sensitive information like call recordings and metadata.
Security:
Use HTTPS for all webhooks.
Authenticate requests with headers or API keys as needed.
These webhooks provide a robust way to integrate Millis AI into your existing systems, offering flexibility and advanced customization for voice agent interactions.