diff --git a/fern/apis/api/openapi.json b/fern/apis/api/openapi.json index 0ac803577..0950f358d 100644 --- a/fern/apis/api/openapi.json +++ b/fern/apis/api/openapi.json @@ -1,17 +1,17 @@ { "openapi": "3.0.0", "paths": { - "/call": { + "/assistant": { "post": { - "operationId": "CallController_create", - "summary": "Create Call", + "operationId": "AssistantController_create", + "summary": "Create Assistant", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateCallDTO" + "$ref": "#/components/schemas/CreateAssistantDTO" } } } @@ -22,21 +22,14 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/Call" - }, - { - "$ref": "#/components/schemas/CallBatchResponse" - } - ] + "$ref": "#/components/schemas/Assistant" } } } } }, "tags": [ - "Calls" + "Assistants" ], "security": [ { @@ -45,36 +38,9 @@ ] }, "get": { - "operationId": "CallController_findAll", - "summary": "List Calls", + "operationId": "AssistantController_findAll", + "summary": "List Assistants", "parameters": [ - { - "name": "id", - "required": false, - "in": "query", - "description": "This is the unique identifier for the call.", - "schema": { - "type": "string" - } - }, - { - "name": "assistantId", - "required": false, - "in": "query", - "description": "This will return calls with the specified assistantId.", - "schema": { - "type": "string" - } - }, - { - "name": "phoneNumberId", - "required": false, - "in": "query", - "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "schema": { - "type": "string" - } - }, { "name": "limit", "required": false, @@ -175,7 +141,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/Call" + "$ref": "#/components/schemas/Assistant" } } } @@ -183,7 +149,7 @@ } }, "tags": [ - "Calls" + "Assistants" ], "security": [ { @@ -192,10 +158,10 @@ ] } }, - "/call/{id}": { + "/assistant/{id}": { "get": { - "operationId": "CallController_findOne", - "summary": "Get Call", + "operationId": "AssistantController_findOne", + "summary": "Get Assistant", "parameters": [ { "name": "id", @@ -212,14 +178,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Call" + "$ref": "#/components/schemas/Assistant" } } } } }, "tags": [ - "Calls" + "Assistants" ], "security": [ { @@ -228,8 +194,8 @@ ] }, "patch": { - "operationId": "CallController_update", - "summary": "Update Call", + "operationId": "AssistantController_update", + "summary": "Update Assistant", "parameters": [ { "name": "id", @@ -245,7 +211,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateCallDTO" + "$ref": "#/components/schemas/UpdateAssistantDTO" } } } @@ -256,14 +222,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Call" + "$ref": "#/components/schemas/Assistant" } } } } }, "tags": [ - "Calls" + "Assistants" ], "security": [ { @@ -272,8 +238,8 @@ ] }, "delete": { - "operationId": "CallController_deleteCallData", - "summary": "Delete Call Data", + "operationId": "AssistantController_remove", + "summary": "Delete Assistant", "parameters": [ { "name": "id", @@ -290,14 +256,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Call" + "$ref": "#/components/schemas/Assistant" } } } } }, "tags": [ - "Calls" + "Assistants" ], "security": [ { @@ -306,61 +272,46 @@ ] } }, - "/chat": { - "get": { - "operationId": "ChatController_listChats", - "summary": "List Chats", - "parameters": [ - { - "name": "assistantId", - "required": false, - "in": "query", - "description": "This is the unique identifier for the assistant that will be used for the chat.", - "schema": { - "type": "string" - } - }, - { - "name": "workflowId", - "required": false, - "in": "query", - "description": "This is the unique identifier for the workflow that will be used for the chat.", - "schema": { - "type": "string" - } - }, - { - "name": "sessionId", - "required": false, - "in": "query", - "description": "This is the unique identifier for the session that will be used for the chat.", - "schema": { - "type": "string" + "/squad": { + "post": { + "operationId": "SquadController_create", + "summary": "Create Squad", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSquadDTO" + } } - }, - { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Squad" + } + } } - }, + } + }, + "tags": [ + "Squads" + ], + "security": [ { - "name": "sortOrder", - "required": false, - "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "schema": { - "enum": [ - "ASC", - "DESC" - ], - "type": "string" - } - }, + "bearer": [] + } + ] + }, + "get": { + "operationId": "SquadController_findAll", + "summary": "List Squads", + "parameters": [ { "name": "limit", "required": false, @@ -459,79 +410,63 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ChatPaginatedResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/Squad" + } } } } } }, "tags": [ - "Chats" + "Squads" ], "security": [ { "bearer": [] } ] - }, - "post": { - "operationId": "ChatController_createChat", - "summary": "Create Chat", - "description": "Creates a new chat. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive.", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateChatDTO" - } + } + }, + "/squad/{id}": { + "get": { + "operationId": "SquadController_findOne", + "summary": "Get Squad", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" } } - }, + ], "responses": { "200": { - "description": "Chat response - either non-streaming chat or streaming", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/Chat" - }, - { - "$ref": "#/components/schemas/CreateChatStreamResponse" - } - ] - } - } - } - }, - "201": { "description": "", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/Squad" } } } } }, "tags": [ - "Chats" + "Squads" ], "security": [ { "bearer": [] } ] - } - }, - "/chat/{id}": { - "get": { - "operationId": "ChatController_getChat", - "summary": "Get Chat", + }, + "patch": { + "operationId": "SquadController_update", + "summary": "Update Squad", "parameters": [ { "name": "id", @@ -542,20 +477,30 @@ } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSquadDTO" + } + } + } + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Chat" + "$ref": "#/components/schemas/Squad" } } } } }, "tags": [ - "Chats" + "Squads" ], "security": [ { @@ -564,8 +509,8 @@ ] }, "delete": { - "operationId": "ChatController_deleteChat", - "summary": "Delete Chat", + "operationId": "SquadController_remove", + "summary": "Delete Squad", "parameters": [ { "name": "id", @@ -582,14 +527,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Chat" + "$ref": "#/components/schemas/Squad" } } } } }, "tags": [ - "Chats" + "Squads" ], "security": [ { @@ -598,98 +543,42 @@ ] } }, - "/chat/responses": { + "/call": { "post": { - "operationId": "ChatController_createOpenAIChat", - "summary": "Create Chat (OpenAI Compatible)", + "operationId": "CallController_create", + "summary": "Create Call", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAIResponsesRequest" + "$ref": "#/components/schemas/CreateCallDTO" } } } }, "responses": { - "200": { - "description": "OpenAI Responses API format - either non-streaming or streaming", + "201": { + "description": "", "content": { "application/json": { "schema": { "oneOf": [ { - "$ref": "#/components/schemas/ResponseObject" - }, - { - "$ref": "#/components/schemas/ResponseTextDeltaEvent" - }, - { - "$ref": "#/components/schemas/ResponseTextDoneEvent" - }, - { - "$ref": "#/components/schemas/ResponseCompletedEvent" + "$ref": "#/components/schemas/Call" }, { - "$ref": "#/components/schemas/ResponseErrorEvent" + "$ref": "#/components/schemas/CallBatchResponse" } ] } } } - }, - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - } - }, - "tags": [ - "Chats" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/campaign": { - "post": { - "operationId": "CampaignController_create", - "summary": "Create Campaign", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateCampaignDTO" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Campaign" - } - } - } } }, "tags": [ - "Campaigns" + "Calls" ], "security": [ { @@ -698,50 +587,33 @@ ] }, "get": { - "operationId": "CampaignController_findAll", - "summary": "List Campaigns", + "operationId": "CallController_findAll", + "summary": "List Calls", "parameters": [ { "name": "id", "required": false, "in": "query", + "description": "This is the unique identifier for the call.", "schema": { "type": "string" } }, { - "name": "status", + "name": "assistantId", "required": false, "in": "query", + "description": "This will return calls with the specified assistantId.", "schema": { - "enum": [ - "scheduled", - "in-progress", - "ended" - ], "type": "string" } }, { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" - } - }, - { - "name": "sortOrder", + "name": "phoneNumberId", "required": false, "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", "schema": { - "enum": [ - "ASC", - "DESC" - ], "type": "string" } }, @@ -843,14 +715,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CampaignPaginatedResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/Call" + } } } } } }, "tags": [ - "Campaigns" + "Calls" ], "security": [ { @@ -859,10 +734,10 @@ ] } }, - "/campaign/{id}": { + "/call/{id}": { "get": { - "operationId": "CampaignController_findOne", - "summary": "Get Campaign", + "operationId": "CallController_findOne", + "summary": "Get Call", "parameters": [ { "name": "id", @@ -879,14 +754,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Campaign" + "$ref": "#/components/schemas/Call" } } } } }, "tags": [ - "Campaigns" + "Calls" ], "security": [ { @@ -895,8 +770,8 @@ ] }, "patch": { - "operationId": "CampaignController_update", - "summary": "Update Campaign", + "operationId": "CallController_update", + "summary": "Update Call", "parameters": [ { "name": "id", @@ -912,7 +787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateCampaignDTO" + "$ref": "#/components/schemas/UpdateCallDTO" } } } @@ -923,14 +798,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Campaign" + "$ref": "#/components/schemas/Call" } } } } }, "tags": [ - "Campaigns" + "Calls" ], "security": [ { @@ -939,85 +814,51 @@ ] }, "delete": { - "operationId": "CampaignController_remove", - "summary": "Delete Campaign", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Campaign" - } - } - } - } - }, - "tags": [ - "Campaigns" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/session": { - "post": { - "operationId": "SessionController_create", - "summary": "Create Session", + "operationId": "CallController_deleteCallData", + "summary": "Delete Call", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateSessionDTO" + "$ref": "#/components/schemas/DeleteCallDTO" } } } }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Session" + "$ref": "#/components/schemas/Call" } } } } }, "tags": [ - "Sessions" + "Calls" ], "security": [ { "bearer": [] } ] - }, + } + }, + "/chat": { "get": { - "operationId": "SessionController_findAllPaginated", - "summary": "List Sessions", + "operationId": "ChatController_listChats", + "summary": "List Chats", "parameters": [ { - "name": "name", + "name": "id", "required": false, "in": "query", - "description": "This is the name of the session to filter by.", + "description": "This is the unique identifier for the chat to filter by.", "schema": { "type": "string" } @@ -1026,16 +867,44 @@ "name": "assistantId", "required": false, "in": "query", - "description": "This is the ID of the assistant to filter sessions by.", + "description": "This is the unique identifier for the assistant that will be used for the chat.", "schema": { "type": "string" } }, { - "name": "workflowId", + "name": "assistantIdAny", "required": false, "in": "query", - "description": "This is the ID of the workflow to filter sessions by.", + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "schema": { + "example": "assistant-1,assistant-2,assistant-3", + "type": "string" + } + }, + { + "name": "squadId", + "required": false, + "in": "query", + "description": "This is the unique identifier for the squad that will be used for the chat.", + "schema": { + "type": "string" + } + }, + { + "name": "sessionId", + "required": false, + "in": "query", + "description": "This is the unique identifier for the session that will be used for the chat.", + "schema": { + "type": "string" + } + }, + { + "name": "previousChatId", + "required": false, + "in": "query", + "description": "This is the unique identifier for the previous chat to filter by.", "schema": { "type": "string" } @@ -1161,14 +1030,67 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SessionPaginatedResponse" + "$ref": "#/components/schemas/ChatPaginatedResponse" } } } } }, "tags": [ - "Sessions" + "Chats" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "operationId": "ChatController_createChat", + "summary": "Create Chat", + "description": "Creates a new chat with optional SMS delivery via transport field. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive. Transport field enables SMS delivery with two modes: (1) New conversation - provide transport.phoneNumberId and transport.customer to create a new session, (2) Existing conversation - provide sessionId to use existing session data. Cannot specify both sessionId and transport fields together. The transport.useLLMGeneratedMessageForOutbound flag controls whether input is processed by LLM (true, default) or forwarded directly as SMS (false).", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateChatDTO" + } + } + } + }, + "responses": { + "200": { + "description": "Chat response - either non-streaming chat or streaming", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Chat" + }, + { + "$ref": "#/components/schemas/CreateChatStreamResponse" + } + ] + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "Chats" ], "security": [ { @@ -1177,10 +1099,10 @@ ] } }, - "/session/{id}": { + "/chat/{id}": { "get": { - "operationId": "SessionController_findOne", - "summary": "Get Session", + "operationId": "ChatController_getChat", + "summary": "Get Chat", "parameters": [ { "name": "id", @@ -1197,14 +1119,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Session" + "$ref": "#/components/schemas/Chat" } } } } }, "tags": [ - "Sessions" + "Chats" ], "security": [ { @@ -1212,9 +1134,9 @@ } ] }, - "patch": { - "operationId": "SessionController_update", - "summary": "Update Session", + "delete": { + "operationId": "ChatController_deleteChat", + "summary": "Delete Chat", "parameters": [ { "name": "id", @@ -1225,64 +1147,83 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSessionDTO" - } - } - } - }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Session" + "$ref": "#/components/schemas/Chat" } } } } }, "tags": [ - "Sessions" + "Chats" ], "security": [ { "bearer": [] } ] - }, - "delete": { - "operationId": "SessionController_remove", - "summary": "Delete Session", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" + } + }, + "/chat/responses": { + "post": { + "operationId": "ChatController_createOpenAIChat", + "summary": "Create Chat (OpenAI Compatible)", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponsesRequest" + } } } - ], + }, "responses": { "200": { + "description": "OpenAI Responses API format - either non-streaming or streaming", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/ResponseObject" + }, + { + "$ref": "#/components/schemas/ResponseTextDeltaEvent" + }, + { + "$ref": "#/components/schemas/ResponseTextDoneEvent" + }, + { + "$ref": "#/components/schemas/ResponseCompletedEvent" + }, + { + "$ref": "#/components/schemas/ResponseErrorEvent" + } + ] + } + } + } + }, + "201": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Session" + "type": "object" } } } } }, "tags": [ - "Sessions" + "Chats" ], "security": [ { @@ -1291,17 +1232,17 @@ ] } }, - "/assistant": { + "/campaign": { "post": { - "operationId": "AssistantController_create", - "summary": "Create Assistant", + "operationId": "CampaignController_create", + "summary": "Create Campaign", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateAssistantDTO" + "$ref": "#/components/schemas/CreateCampaignDTO" } } } @@ -1312,14 +1253,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1328,9 +1269,53 @@ ] }, "get": { - "operationId": "AssistantController_findAll", - "summary": "List Assistants", + "operationId": "CampaignController_findAll", + "summary": "List Campaigns", "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "status", + "required": false, + "in": "query", + "schema": { + "enum": [ + "scheduled", + "in-progress", + "ended" + ], + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, { "name": "limit", "required": false, @@ -1429,17 +1414,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Assistant" - } + "$ref": "#/components/schemas/CampaignPaginatedResponse" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1448,10 +1430,10 @@ ] } }, - "/assistant/{id}": { + "/campaign/{id}": { "get": { - "operationId": "AssistantController_findOne", - "summary": "Get Assistant", + "operationId": "CampaignController_findOne", + "summary": "Get Campaign", "parameters": [ { "name": "id", @@ -1468,14 +1450,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1484,8 +1466,8 @@ ] }, "patch": { - "operationId": "AssistantController_update", - "summary": "Update Assistant", + "operationId": "CampaignController_update", + "summary": "Update Campaign", "parameters": [ { "name": "id", @@ -1501,7 +1483,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateAssistantDTO" + "$ref": "#/components/schemas/UpdateCampaignDTO" } } } @@ -1512,14 +1494,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1528,8 +1510,8 @@ ] }, "delete": { - "operationId": "AssistantController_remove", - "summary": "Delete Assistant", + "operationId": "CampaignController_remove", + "summary": "Delete Campaign", "parameters": [ { "name": "id", @@ -1546,14 +1528,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1562,48 +1544,17 @@ ] } }, - "/phone-number": { + "/session": { "post": { - "operationId": "PhoneNumberController_create", - "summary": "Create Phone Number", + "operationId": "SessionController_create", + "summary": "Create Session", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/CreateByoPhoneNumberDTO", - "twilio": "#/components/schemas/CreateTwilioPhoneNumberDTO", - "vonage": "#/components/schemas/CreateVonagePhoneNumberDTO", - "vapi": "#/components/schemas/CreateVapiPhoneNumberDTO", - "telnyx": "#/components/schemas/CreateTelnyxPhoneNumberDTO" - } - } + "$ref": "#/components/schemas/CreateSessionDTO" } } } @@ -1614,46 +1565,14 @@ "content": { "application/json": { "schema": { - "title": "PhoneNumber", - "oneOf": [ - { - "$ref": "#/components/schemas/ByoPhoneNumber", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/VonagePhoneNumber", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/VapiPhoneNumber", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/TelnyxPhoneNumber", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/ByoPhoneNumber", - "twilio": "#/components/schemas/TwilioPhoneNumber", - "vonage": "#/components/schemas/VonagePhoneNumber", - "vapi": "#/components/schemas/VapiPhoneNumber", - "telnyx": "#/components/schemas/TelnyxPhoneNumber" - } - } + "$ref": "#/components/schemas/Session" } } } } }, "tags": [ - "Phone Numbers" + "Sessions" ], "security": [ { @@ -1662,9 +1581,201 @@ ] }, "get": { - "operationId": "PhoneNumberController_findAll", - "summary": "List Phone Numbers", + "operationId": "SessionController_findAllPaginated", + "summary": "List Sessions", "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "description": "This is the unique identifier for the session to filter by.", + "schema": { + "type": "string" + } + }, + { + "name": "name", + "required": false, + "in": "query", + "description": "This is the name of the session to filter by.", + "schema": { + "type": "string" + } + }, + { + "name": "assistantId", + "required": false, + "in": "query", + "description": "This is the ID of the assistant to filter sessions by.", + "schema": { + "type": "string" + } + }, + { + "name": "assistantIdAny", + "required": false, + "in": "query", + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "schema": { + "example": "assistant-1,assistant-2,assistant-3", + "type": "string" + } + }, + { + "name": "squadId", + "required": false, + "in": "query", + "description": "This is the ID of the squad to filter sessions by.", + "schema": { + "type": "string" + } + }, + { + "name": "workflowId", + "required": false, + "in": "query", + "description": "This is the ID of the workflow to filter sessions by.", + "schema": { + "type": "string" + } + }, + { + "required": false, + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "name": "numberE164CheckEnabled", + "in": "query", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "required": false, + "description": "This is the extension that will be dialed after the call is answered.", + "name": "extension", + "in": "query", + "schema": { + "maxLength": 10, + "example": null, + "type": "string" + } + }, + { + "name": "assistantOverrides", + "required": false, + "description": "These are the overrides for the assistant's settings and template variables specific to this customer.\nThis allows customization of the assistant's behavior for individual customers in batch calls.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ], + "in": "query", + "schema": {} + }, + { + "required": false, + "description": "This is the number of the customer.", + "name": "number", + "in": "query", + "schema": { + "minLength": 3, + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the SIP URI of the customer.", + "name": "sipUri", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "required": false, + "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", + "name": "name", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the email of the customer.", + "name": "email", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, + { + "required": false, + "description": "This is the external ID of the customer.", + "name": "externalId", + "in": "query", + "schema": { + "maxLength": 40, + "type": "string" + } + }, + { + "name": "customerNumberAny", + "required": false, + "in": "query", + "description": "Filter by any of the specified customer phone numbers (comma-separated).", + "schema": { + "example": "+1234567890,+0987654321", + "type": "string" + } + }, + { + "name": "phoneNumberId", + "required": false, + "in": "query", + "description": "This will return sessions with the specified phoneNumberId.", + "schema": { + "type": "string" + } + }, + { + "name": "phoneNumberIdAny", + "required": false, + "in": "query", + "description": "This will return sessions with any of the specified phoneNumberIds.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, { "name": "limit", "required": false, @@ -1763,49 +1874,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "title": "PhoneNumber", - "oneOf": [ - { - "$ref": "#/components/schemas/ByoPhoneNumber", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/VonagePhoneNumber", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/VapiPhoneNumber", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/TelnyxPhoneNumber", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/ByoPhoneNumber", - "twilio": "#/components/schemas/TwilioPhoneNumber", - "vonage": "#/components/schemas/VonagePhoneNumber", - "vapi": "#/components/schemas/VapiPhoneNumber", - "telnyx": "#/components/schemas/TelnyxPhoneNumber" - } - } - } + "$ref": "#/components/schemas/SessionPaginatedResponse" } } } } }, "tags": [ - "Phone Numbers" + "Sessions" ], "security": [ { @@ -1814,10 +1890,10 @@ ] } }, - "/phone-number/{id}": { + "/session/{id}": { "get": { - "operationId": "PhoneNumberController_findOne", - "summary": "Get Phone Number", + "operationId": "SessionController_findOne", + "summary": "Get Session", "parameters": [ { "name": "id", @@ -1834,46 +1910,14 @@ "content": { "application/json": { "schema": { - "title": "PhoneNumber", - "oneOf": [ - { - "$ref": "#/components/schemas/ByoPhoneNumber", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/VonagePhoneNumber", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/VapiPhoneNumber", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/TelnyxPhoneNumber", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/ByoPhoneNumber", - "twilio": "#/components/schemas/TwilioPhoneNumber", - "vonage": "#/components/schemas/VonagePhoneNumber", - "vapi": "#/components/schemas/VapiPhoneNumber", - "telnyx": "#/components/schemas/TelnyxPhoneNumber" - } - } + "$ref": "#/components/schemas/Session" } } } } }, "tags": [ - "Phone Numbers" + "Sessions" ], "security": [ { @@ -1882,8 +1926,8 @@ ] }, "patch": { - "operationId": "PhoneNumberController_update", - "summary": "Update Phone Number", + "operationId": "SessionController_update", + "summary": "Update Session", "parameters": [ { "name": "id", @@ -1899,38 +1943,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateByoPhoneNumberDTO", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/UpdateTwilioPhoneNumberDTO", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/UpdateVonagePhoneNumberDTO", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/UpdateVapiPhoneNumberDTO", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/UpdateTelnyxPhoneNumberDTO", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/UpdateByoPhoneNumberDTO", - "twilio": "#/components/schemas/UpdateTwilioPhoneNumberDTO", - "vonage": "#/components/schemas/UpdateVonagePhoneNumberDTO", - "vapi": "#/components/schemas/UpdateVapiPhoneNumberDTO", - "telnyx": "#/components/schemas/UpdateTelnyxPhoneNumberDTO" - } - } + "$ref": "#/components/schemas/UpdateSessionDTO" } } } @@ -1941,46 +1954,14 @@ "content": { "application/json": { "schema": { - "title": "PhoneNumber", - "oneOf": [ - { - "$ref": "#/components/schemas/ByoPhoneNumber", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/VonagePhoneNumber", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/VapiPhoneNumber", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/TelnyxPhoneNumber", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/ByoPhoneNumber", - "twilio": "#/components/schemas/TwilioPhoneNumber", - "vonage": "#/components/schemas/VonagePhoneNumber", - "vapi": "#/components/schemas/VapiPhoneNumber", - "telnyx": "#/components/schemas/TelnyxPhoneNumber" - } - } + "$ref": "#/components/schemas/Session" } } } } }, "tags": [ - "Phone Numbers" + "Sessions" ], "security": [ { @@ -1989,8 +1970,8 @@ ] }, "delete": { - "operationId": "PhoneNumberController_remove", - "summary": "Delete Phone Number", + "operationId": "SessionController_remove", + "summary": "Delete Session", "parameters": [ { "name": "id", @@ -2007,46 +1988,14 @@ "content": { "application/json": { "schema": { - "title": "PhoneNumber", - "oneOf": [ - { - "$ref": "#/components/schemas/ByoPhoneNumber", - "title": "ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber", - "title": "TwilioPhoneNumber" - }, - { - "$ref": "#/components/schemas/VonagePhoneNumber", - "title": "VonagePhoneNumber" - }, - { - "$ref": "#/components/schemas/VapiPhoneNumber", - "title": "VapiPhoneNumber" - }, - { - "$ref": "#/components/schemas/TelnyxPhoneNumber", - "title": "TelnyxPhoneNumber" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "byo-phone-number": "#/components/schemas/ByoPhoneNumber", - "twilio": "#/components/schemas/TwilioPhoneNumber", - "vonage": "#/components/schemas/VonagePhoneNumber", - "vapi": "#/components/schemas/VapiPhoneNumber", - "telnyx": "#/components/schemas/TelnyxPhoneNumber" - } - } + "$ref": "#/components/schemas/Session" } } } } }, "tags": [ - "Phone Numbers" + "Sessions" ], "security": [ { @@ -2055,10 +2004,10 @@ ] } }, - "/tool": { + "/phone-number": { "post": { - "operationId": "ToolController_create", - "summary": "Create Tool", + "operationId": "PhoneNumberController_create", + "summary": "Create Phone Number", "parameters": [], "requestBody": { "required": true, @@ -2067,109 +2016,34 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsSendTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" }, { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" }, { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" }, { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" } ], "discriminator": { - "propertyName": "type", + "propertyName": "provider", "mapping": { - "apiRequest": "#/components/schemas/CreateApiRequestToolDTO", - "dtmf": "#/components/schemas/CreateDtmfToolDTO", - "endCall": "#/components/schemas/CreateEndCallToolDTO", - "function": "#/components/schemas/CreateFunctionToolDTO", - "transferCall": "#/components/schemas/CreateTransferCallToolDTO", - "handoff": "#/components/schemas/CreateHandoffToolDTO", - "bash": "#/components/schemas/CreateBashToolDTO", - "computer": "#/components/schemas/CreateComputerToolDTO", - "textEditor": "#/components/schemas/CreateTextEditorToolDTO", - "query": "#/components/schemas/CreateQueryToolDTO", - "google.calendar.event.create": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "google.sheets.row.append": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "google.calendar.availability.check": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "slack.message.send": "#/components/schemas/CreateSlackSendMessageToolDTO", - "sms": "#/components/schemas/CreateSmsToolDTO", - "mcp": "#/components/schemas/CreateMcpToolDTO", - "gohighlevel.calendar.availability.check": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "gohighlevel.calendar.event.create": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "gohighlevel.contact.create": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "gohighlevel.contact.get": "#/components/schemas/CreateGoHighLevelContactGetToolDTO" + "byo-phone-number": "#/components/schemas/CreateByoPhoneNumberDTO", + "twilio": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "vonage": "#/components/schemas/CreateVonagePhoneNumberDTO", + "vapi": "#/components/schemas/CreateVapiPhoneNumberDTO", + "telnyx": "#/components/schemas/CreateTelnyxPhoneNumberDTO" } } } @@ -2182,115 +2056,37 @@ "content": { "application/json": { "schema": { + "title": "PhoneNumber", "oneOf": [ { - "$ref": "#/components/schemas/ApiRequestTool", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/DtmfTool", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/EndCallTool", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/FunctionTool", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/GhlTool", - "title": "GhlTool" - }, - { - "$ref": "#/components/schemas/TransferCallTool", - "title": "TransferCallTool" - }, - { - "$ref": "#/components/schemas/HandoffTool", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/BashTool", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/ComputerTool", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/TextEditorTool", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/QueryTool", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/SlackSendMessageTool", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/SmsTool", - "title": "SmsSendTool" - }, - { - "$ref": "#/components/schemas/McpTool", - "title": "McpTool" + "$ref": "#/components/schemas/ByoPhoneNumber", + "title": "ByoPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "title": "GoHighLevelCalendarAvailabilityTool" + "$ref": "#/components/schemas/TwilioPhoneNumber", + "title": "TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "title": "GoHighLevelCalendarEventCreateTool" + "$ref": "#/components/schemas/VonagePhoneNumber", + "title": "VonagePhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactCreateTool", - "title": "GoHighLevelContactCreateTool" + "$ref": "#/components/schemas/VapiPhoneNumber", + "title": "VapiPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactGetTool", - "title": "GoHighLevelContactGetTool" + "$ref": "#/components/schemas/TelnyxPhoneNumber", + "title": "TelnyxPhoneNumber" } ], "discriminator": { - "propertyName": "type", + "propertyName": "provider", "mapping": { - "apiRequest": "#/components/schemas/ApiRequestTool", - "dtmf": "#/components/schemas/DtmfTool", - "endCall": "#/components/schemas/EndCallTool", - "function": "#/components/schemas/FunctionTool", - "transferCall": "#/components/schemas/TransferCallTool", - "handoff": "#/components/schemas/HandoffTool", - "bash": "#/components/schemas/BashTool", - "computer": "#/components/schemas/ComputerTool", - "textEditor": "#/components/schemas/TextEditorTool", - "query": "#/components/schemas/QueryTool", - "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", - "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", - "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "slack.message.send": "#/components/schemas/SlackSendMessageTool", - "sms": "#/components/schemas/SmsTool", - "mcp": "#/components/schemas/McpTool", - "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", - "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool" + "byo-phone-number": "#/components/schemas/ByoPhoneNumber", + "twilio": "#/components/schemas/TwilioPhoneNumber", + "vonage": "#/components/schemas/VonagePhoneNumber", + "vapi": "#/components/schemas/VapiPhoneNumber", + "telnyx": "#/components/schemas/TelnyxPhoneNumber" } } } @@ -2299,7 +2095,7 @@ } }, "tags": [ - "Tools" + "Phone Numbers" ], "security": [ { @@ -2308,8 +2104,8 @@ ] }, "get": { - "operationId": "ToolController_findAll", - "summary": "List Tools", + "operationId": "PhoneNumberController_findAll", + "summary": "List Phone Numbers", "parameters": [ { "name": "limit", @@ -2411,115 +2207,37 @@ "schema": { "type": "array", "items": { + "title": "PhoneNumber", "oneOf": [ { - "$ref": "#/components/schemas/ApiRequestTool", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/DtmfTool", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/EndCallTool", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/FunctionTool", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/GhlTool", - "title": "GhlTool" - }, - { - "$ref": "#/components/schemas/TransferCallTool", - "title": "TransferCallTool" - }, - { - "$ref": "#/components/schemas/HandoffTool", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/BashTool", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/ComputerTool", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/TextEditorTool", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/QueryTool", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/SlackSendMessageTool", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/SmsTool", - "title": "SmsSendTool" - }, - { - "$ref": "#/components/schemas/McpTool", - "title": "McpTool" + "$ref": "#/components/schemas/ByoPhoneNumber", + "title": "ByoPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "title": "GoHighLevelCalendarAvailabilityTool" + "$ref": "#/components/schemas/TwilioPhoneNumber", + "title": "TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "title": "GoHighLevelCalendarEventCreateTool" + "$ref": "#/components/schemas/VonagePhoneNumber", + "title": "VonagePhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactCreateTool", - "title": "GoHighLevelContactCreateTool" + "$ref": "#/components/schemas/VapiPhoneNumber", + "title": "VapiPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactGetTool", - "title": "GoHighLevelContactGetTool" + "$ref": "#/components/schemas/TelnyxPhoneNumber", + "title": "TelnyxPhoneNumber" } ], "discriminator": { - "propertyName": "type", + "propertyName": "provider", "mapping": { - "apiRequest": "#/components/schemas/ApiRequestTool", - "dtmf": "#/components/schemas/DtmfTool", - "endCall": "#/components/schemas/EndCallTool", - "function": "#/components/schemas/FunctionTool", - "transferCall": "#/components/schemas/TransferCallTool", - "handoff": "#/components/schemas/HandoffTool", - "bash": "#/components/schemas/BashTool", - "computer": "#/components/schemas/ComputerTool", - "textEditor": "#/components/schemas/TextEditorTool", - "query": "#/components/schemas/QueryTool", - "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", - "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", - "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "slack.message.send": "#/components/schemas/SlackSendMessageTool", - "sms": "#/components/schemas/SmsTool", - "mcp": "#/components/schemas/McpTool", - "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", - "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool" + "byo-phone-number": "#/components/schemas/ByoPhoneNumber", + "twilio": "#/components/schemas/TwilioPhoneNumber", + "vonage": "#/components/schemas/VonagePhoneNumber", + "vapi": "#/components/schemas/VapiPhoneNumber", + "telnyx": "#/components/schemas/TelnyxPhoneNumber" } } } @@ -2529,7 +2247,7 @@ } }, "tags": [ - "Tools" + "Phone Numbers" ], "security": [ { @@ -2538,19 +2256,171 @@ ] } }, - "/tool/{id}": { + "/v2/phone-number": { "get": { - "operationId": "ToolController_findOne", - "summary": "Get Tool", + "operationId": "PhoneNumberController_findAllPaginated", + "summary": "List Phone Numbers", "parameters": [ { - "name": "id", - "required": true, - "in": "path", + "name": "search", + "required": false, + "in": "query", + "description": "This will search phone numbers by name, number, or SIP URI (partial match, case-insensitive).", "schema": { + "maxLength": 100, "type": "string" } - } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "This is the maximum number of items to return. Defaults to 100.", + "schema": { + "minimum": 0, + "maximum": 1000, + "type": "number" + } + }, + { + "name": "createdAtGt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtGe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PhoneNumberPaginatedResponse" + } + } + } + } + }, + "tags": [ + "Phone Numbers" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/phone-number/{id}": { + "get": { + "operationId": "PhoneNumberController_findOne", + "summary": "Get Phone Number", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } ], "responses": { "200": { @@ -2558,115 +2428,144 @@ "content": { "application/json": { "schema": { + "title": "PhoneNumber", "oneOf": [ { - "$ref": "#/components/schemas/ApiRequestTool", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/DtmfTool", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/EndCallTool", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/FunctionTool", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/GhlTool", - "title": "GhlTool" - }, - { - "$ref": "#/components/schemas/TransferCallTool", - "title": "TransferCallTool" - }, - { - "$ref": "#/components/schemas/HandoffTool", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/BashTool", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/ComputerTool", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/TextEditorTool", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/QueryTool", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", - "title": "GoogleCalendarCreateEventTool" + "$ref": "#/components/schemas/ByoPhoneNumber", + "title": "ByoPhoneNumber" }, { - "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", - "title": "GoogleSheetsRowAppendTool" + "$ref": "#/components/schemas/TwilioPhoneNumber", + "title": "TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "title": "GoogleCalendarCheckAvailabilityTool" + "$ref": "#/components/schemas/VonagePhoneNumber", + "title": "VonagePhoneNumber" }, { - "$ref": "#/components/schemas/SlackSendMessageTool", - "title": "SlackSendMessageTool" + "$ref": "#/components/schemas/VapiPhoneNumber", + "title": "VapiPhoneNumber" }, { - "$ref": "#/components/schemas/SmsTool", - "title": "SmsSendTool" - }, + "$ref": "#/components/schemas/TelnyxPhoneNumber", + "title": "TelnyxPhoneNumber" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "byo-phone-number": "#/components/schemas/ByoPhoneNumber", + "twilio": "#/components/schemas/TwilioPhoneNumber", + "vonage": "#/components/schemas/VonagePhoneNumber", + "vapi": "#/components/schemas/VapiPhoneNumber", + "telnyx": "#/components/schemas/TelnyxPhoneNumber" + } + } + } + } + } + } + }, + "tags": [ + "Phone Numbers" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "operationId": "PhoneNumberController_update", + "summary": "Update Phone Number", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/UpdateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/UpdateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/UpdateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/UpdateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/UpdateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "byo-phone-number": "#/components/schemas/UpdateByoPhoneNumberDTO", + "twilio": "#/components/schemas/UpdateTwilioPhoneNumberDTO", + "vonage": "#/components/schemas/UpdateVonagePhoneNumberDTO", + "vapi": "#/components/schemas/UpdateVapiPhoneNumberDTO", + "telnyx": "#/components/schemas/UpdateTelnyxPhoneNumberDTO" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "PhoneNumber", + "oneOf": [ { - "$ref": "#/components/schemas/McpTool", - "title": "McpTool" + "$ref": "#/components/schemas/ByoPhoneNumber", + "title": "ByoPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "title": "GoHighLevelCalendarAvailabilityTool" + "$ref": "#/components/schemas/TwilioPhoneNumber", + "title": "TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "title": "GoHighLevelCalendarEventCreateTool" + "$ref": "#/components/schemas/VonagePhoneNumber", + "title": "VonagePhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactCreateTool", - "title": "GoHighLevelContactCreateTool" + "$ref": "#/components/schemas/VapiPhoneNumber", + "title": "VapiPhoneNumber" }, { - "$ref": "#/components/schemas/GoHighLevelContactGetTool", - "title": "GoHighLevelContactGetTool" + "$ref": "#/components/schemas/TelnyxPhoneNumber", + "title": "TelnyxPhoneNumber" } ], "discriminator": { - "propertyName": "type", + "propertyName": "provider", "mapping": { - "apiRequest": "#/components/schemas/ApiRequestTool", - "dtmf": "#/components/schemas/DtmfTool", - "endCall": "#/components/schemas/EndCallTool", - "function": "#/components/schemas/FunctionTool", - "transferCall": "#/components/schemas/TransferCallTool", - "handoff": "#/components/schemas/HandoffTool", - "bash": "#/components/schemas/BashTool", - "computer": "#/components/schemas/ComputerTool", - "textEditor": "#/components/schemas/TextEditorTool", - "query": "#/components/schemas/QueryTool", - "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", - "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", - "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", - "slack.message.send": "#/components/schemas/SlackSendMessageTool", - "sms": "#/components/schemas/SmsTool", - "mcp": "#/components/schemas/McpTool", - "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", - "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", - "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", - "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool" + "byo-phone-number": "#/components/schemas/ByoPhoneNumber", + "twilio": "#/components/schemas/TwilioPhoneNumber", + "vonage": "#/components/schemas/VonagePhoneNumber", + "vapi": "#/components/schemas/VapiPhoneNumber", + "telnyx": "#/components/schemas/TelnyxPhoneNumber" } } } @@ -2675,7 +2574,7 @@ } }, "tags": [ - "Tools" + "Phone Numbers" ], "security": [ { @@ -2683,9 +2582,9 @@ } ] }, - "patch": { - "operationId": "ToolController_update", - "summary": "Update Tool", + "delete": { + "operationId": "PhoneNumberController_remove", + "summary": "Delete Phone Number", "parameters": [ { "name": "id", @@ -2696,6 +2595,65 @@ } } ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "title": "PhoneNumber", + "oneOf": [ + { + "$ref": "#/components/schemas/ByoPhoneNumber", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/TwilioPhoneNumber", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/VonagePhoneNumber", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/VapiPhoneNumber", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/TelnyxPhoneNumber", + "title": "TelnyxPhoneNumber" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "byo-phone-number": "#/components/schemas/ByoPhoneNumber", + "twilio": "#/components/schemas/TwilioPhoneNumber", + "vonage": "#/components/schemas/VonagePhoneNumber", + "vapi": "#/components/schemas/VapiPhoneNumber", + "telnyx": "#/components/schemas/TelnyxPhoneNumber" + } + } + } + } + } + } + }, + "tags": [ + "Phone Numbers" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/tool": { + "post": { + "operationId": "ToolController_create", + "summary": "Create Tool", + "parameters": [], "requestBody": { "required": true, "content": { @@ -2703,109 +2661,123 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/UpdateApiRequestToolDTO", + "$ref": "#/components/schemas/CreateApiRequestToolDTO", "title": "ApiRequestTool" }, { - "$ref": "#/components/schemas/UpdateDtmfToolDTO", + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", "title": "DtmfTool" }, { - "$ref": "#/components/schemas/UpdateEndCallToolDTO", + "$ref": "#/components/schemas/CreateEndCallToolDTO", "title": "EndCallTool" }, { - "$ref": "#/components/schemas/UpdateFunctionToolDTO", + "$ref": "#/components/schemas/CreateFunctionToolDTO", "title": "FunctionTool" }, { - "$ref": "#/components/schemas/UpdateTransferCallToolDTO", + "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" }, { - "$ref": "#/components/schemas/UpdateHandoffToolDTO", + "$ref": "#/components/schemas/CreateHandoffToolDTO", "title": "HandoffTool" }, { - "$ref": "#/components/schemas/UpdateBashToolDTO", + "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, { - "$ref": "#/components/schemas/UpdateComputerToolDTO", + "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" }, { - "$ref": "#/components/schemas/UpdateTextEditorToolDTO", + "$ref": "#/components/schemas/CreateTextEditorToolDTO", "title": "TextEditorTool" }, { - "$ref": "#/components/schemas/UpdateQueryToolDTO", + "$ref": "#/components/schemas/CreateQueryToolDTO", "title": "QueryTool" }, { - "$ref": "#/components/schemas/UpdateGoogleCalendarCreateEventToolDTO", + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", "title": "GoogleCalendarCreateEventTool" }, { - "$ref": "#/components/schemas/UpdateGoogleSheetsRowAppendToolDTO", + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", "title": "GoogleSheetsRowAppendTool" }, { - "$ref": "#/components/schemas/UpdateGoogleCalendarCheckAvailabilityToolDTO", + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", "title": "GoogleCalendarCheckAvailabilityTool" }, { - "$ref": "#/components/schemas/UpdateSlackSendMessageToolDTO", + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", "title": "SlackSendMessageTool" }, { - "$ref": "#/components/schemas/UpdateSmsToolDTO", + "$ref": "#/components/schemas/CreateSmsToolDTO", "title": "SmsSendTool" }, { - "$ref": "#/components/schemas/UpdateMcpToolDTO", + "$ref": "#/components/schemas/CreateMcpToolDTO", "title": "McpTool" }, { - "$ref": "#/components/schemas/UpdateGoHighLevelCalendarAvailabilityToolDTO", + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", "title": "GoHighLevelCalendarAvailabilityTool" }, { - "$ref": "#/components/schemas/UpdateGoHighLevelCalendarEventCreateToolDTO", + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", "title": "GoHighLevelCalendarEventCreateTool" }, { - "$ref": "#/components/schemas/UpdateGoHighLevelContactCreateToolDTO", + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", "title": "GoHighLevelContactCreateTool" }, { - "$ref": "#/components/schemas/UpdateGoHighLevelContactGetToolDTO", + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ], "discriminator": { "propertyName": "type", "mapping": { - "apiRequest": "#/components/schemas/UpdateApiRequestToolDTO", - "dtmf": "#/components/schemas/UpdateDtmfToolDTO", - "endCall": "#/components/schemas/UpdateEndCallToolDTO", - "function": "#/components/schemas/UpdateFunctionToolDTO", - "transferCall": "#/components/schemas/UpdateTransferCallToolDTO", - "handoff": "#/components/schemas/UpdateHandoffToolDTO", - "bash": "#/components/schemas/UpdateBashToolDTO", - "computer": "#/components/schemas/UpdateComputerToolDTO", - "textEditor": "#/components/schemas/UpdateTextEditorToolDTO", - "query": "#/components/schemas/UpdateQueryToolDTO", - "google.calendar.event.create": "#/components/schemas/UpdateGoogleCalendarCreateEventToolDTO", - "google.sheets.row.append": "#/components/schemas/UpdateGoogleSheetsRowAppendToolDTO", - "google.calendar.availability.check": "#/components/schemas/UpdateGoogleCalendarCheckAvailabilityToolDTO", - "slack.message.send": "#/components/schemas/UpdateSlackSendMessageToolDTO", - "sms": "#/components/schemas/UpdateSmsToolDTO", - "mcp": "#/components/schemas/UpdateMcpToolDTO", - "gohighlevel.calendar.availability.check": "#/components/schemas/UpdateGoHighLevelCalendarAvailabilityToolDTO", - "gohighlevel.calendar.event.create": "#/components/schemas/UpdateGoHighLevelCalendarEventCreateToolDTO", - "gohighlevel.contact.create": "#/components/schemas/UpdateGoHighLevelContactCreateToolDTO", - "gohighlevel.contact.get": "#/components/schemas/UpdateGoHighLevelContactGetToolDTO" + "apiRequest": "#/components/schemas/CreateApiRequestToolDTO", + "dtmf": "#/components/schemas/CreateDtmfToolDTO", + "endCall": "#/components/schemas/CreateEndCallToolDTO", + "function": "#/components/schemas/CreateFunctionToolDTO", + "transferCall": "#/components/schemas/CreateTransferCallToolDTO", + "handoff": "#/components/schemas/CreateHandoffToolDTO", + "bash": "#/components/schemas/CreateBashToolDTO", + "computer": "#/components/schemas/CreateComputerToolDTO", + "textEditor": "#/components/schemas/CreateTextEditorToolDTO", + "query": "#/components/schemas/CreateQueryToolDTO", + "google.calendar.event.create": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "google.sheets.row.append": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "google.calendar.availability.check": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "slack.message.send": "#/components/schemas/CreateSlackSendMessageToolDTO", + "sms": "#/components/schemas/CreateSmsToolDTO", + "mcp": "#/components/schemas/CreateMcpToolDTO", + "gohighlevel.calendar.availability.check": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "gohighlevel.calendar.event.create": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "gohighlevel.contact.create": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "gohighlevel.contact.get": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "sipRequest": "#/components/schemas/CreateSipRequestToolDTO", + "voicemail": "#/components/schemas/CreateVoicemailToolDTO" } } } @@ -2813,7 +2785,7 @@ } }, "responses": { - "200": { + "201": { "description": "", "content": { "application/json": { @@ -2823,6 +2795,10 @@ "$ref": "#/components/schemas/ApiRequestTool", "title": "ApiRequestTool" }, + { + "$ref": "#/components/schemas/CodeTool", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/DtmfTool", "title": "DtmfTool" @@ -2902,12 +2878,21 @@ { "$ref": "#/components/schemas/GoHighLevelContactGetTool", "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/SipRequestTool", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/VoicemailTool", + "title": "VoicemailTool" } ], "discriminator": { "propertyName": "type", "mapping": { "apiRequest": "#/components/schemas/ApiRequestTool", + "code": "#/components/schemas/CodeTool", "dtmf": "#/components/schemas/DtmfTool", "endCall": "#/components/schemas/EndCallTool", "function": "#/components/schemas/FunctionTool", @@ -2926,7 +2911,9 @@ "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", - "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool" + "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool", + "sipRequest": "#/components/schemas/SipRequestTool", + "voicemail": "#/components/schemas/VoicemailTool" } } } @@ -2943,9 +2930,256 @@ } ] }, - "delete": { - "operationId": "ToolController_remove", - "summary": "Delete Tool", + "get": { + "operationId": "ToolController_findAll", + "summary": "List Tools", + "parameters": [ + { + "name": "limit", + "required": false, + "in": "query", + "description": "This is the maximum number of items to return. Defaults to 100.", + "schema": { + "minimum": 0, + "maximum": 1000, + "type": "number" + } + }, + { + "name": "createdAtGt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtGe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ApiRequestTool", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CodeTool", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/DtmfTool", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/EndCallTool", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/FunctionTool", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/GhlTool", + "title": "GhlTool" + }, + { + "$ref": "#/components/schemas/TransferCallTool", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/HandoffTool", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/BashTool", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/ComputerTool", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/TextEditorTool", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/QueryTool", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/SlackSendMessageTool", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/SmsTool", + "title": "SmsSendTool" + }, + { + "$ref": "#/components/schemas/McpTool", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactCreateTool", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactGetTool", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/SipRequestTool", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/VoicemailTool", + "title": "VoicemailTool" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "apiRequest": "#/components/schemas/ApiRequestTool", + "code": "#/components/schemas/CodeTool", + "dtmf": "#/components/schemas/DtmfTool", + "endCall": "#/components/schemas/EndCallTool", + "function": "#/components/schemas/FunctionTool", + "transferCall": "#/components/schemas/TransferCallTool", + "handoff": "#/components/schemas/HandoffTool", + "bash": "#/components/schemas/BashTool", + "computer": "#/components/schemas/ComputerTool", + "textEditor": "#/components/schemas/TextEditorTool", + "query": "#/components/schemas/QueryTool", + "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", + "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", + "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "slack.message.send": "#/components/schemas/SlackSendMessageTool", + "sms": "#/components/schemas/SmsTool", + "mcp": "#/components/schemas/McpTool", + "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", + "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool", + "sipRequest": "#/components/schemas/SipRequestTool", + "voicemail": "#/components/schemas/VoicemailTool" + } + } + } + } + } + } + } + }, + "tags": [ + "Tools" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/tool/{id}": { + "get": { + "operationId": "ToolController_findOne", + "summary": "Get Tool", "parameters": [ { "name": "id", @@ -2967,6 +3201,10 @@ "$ref": "#/components/schemas/ApiRequestTool", "title": "ApiRequestTool" }, + { + "$ref": "#/components/schemas/CodeTool", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/DtmfTool", "title": "DtmfTool" @@ -3046,12 +3284,21 @@ { "$ref": "#/components/schemas/GoHighLevelContactGetTool", "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/SipRequestTool", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/VoicemailTool", + "title": "VoicemailTool" } ], "discriminator": { "propertyName": "type", "mapping": { "apiRequest": "#/components/schemas/ApiRequestTool", + "code": "#/components/schemas/CodeTool", "dtmf": "#/components/schemas/DtmfTool", "endCall": "#/components/schemas/EndCallTool", "function": "#/components/schemas/FunctionTool", @@ -3070,7 +3317,9 @@ "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", - "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool" + "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool", + "sipRequest": "#/components/schemas/SipRequestTool", + "voicemail": "#/components/schemas/VoicemailTool" } } } @@ -3086,114 +3335,10 @@ "bearer": [] } ] - } - }, - "/file": { - "post": { - "operationId": "FileController_create", - "summary": "Upload File", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/CreateFileDTO" - } - } - } - }, - "responses": { - "201": { - "description": "File uploaded successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/File" - } - } - } - }, - "400": { - "description": "Invalid file" - } - }, - "tags": [ - "Files" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "get": { - "operationId": "FileController_findAll", - "summary": "List Files", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/File" - } - } - } - } - } - }, - "tags": [ - "Files" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/file/{id}": { - "get": { - "operationId": "FileController_findOne", - "summary": "Get File", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/File" - } - } - } - } - }, - "tags": [ - "Files" - ], - "security": [ - { - "bearer": [] - } - ] }, "patch": { - "operationId": "FileController_update", - "summary": "Update File", + "operationId": "ToolController_update", + "summary": "Update Tool", "parameters": [ { "name": "id", @@ -3209,119 +3354,261 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateFileDTO" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/File" + "oneOf": [ + { + "$ref": "#/components/schemas/UpdateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/UpdateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/UpdateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/UpdateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/UpdateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/UpdateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/UpdateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/UpdateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/UpdateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/UpdateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/UpdateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/UpdateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/UpdateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/UpdateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/UpdateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/UpdateSmsToolDTO", + "title": "SmsSendTool" + }, + { + "$ref": "#/components/schemas/UpdateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/UpdateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/UpdateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/UpdateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/UpdateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/UpdateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/UpdateVoicemailToolDTO", + "title": "VoicemailTool" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "apiRequest": "#/components/schemas/UpdateApiRequestToolDTO", + "dtmf": "#/components/schemas/UpdateDtmfToolDTO", + "endCall": "#/components/schemas/UpdateEndCallToolDTO", + "function": "#/components/schemas/UpdateFunctionToolDTO", + "transferCall": "#/components/schemas/UpdateTransferCallToolDTO", + "handoff": "#/components/schemas/UpdateHandoffToolDTO", + "bash": "#/components/schemas/UpdateBashToolDTO", + "computer": "#/components/schemas/UpdateComputerToolDTO", + "textEditor": "#/components/schemas/UpdateTextEditorToolDTO", + "query": "#/components/schemas/UpdateQueryToolDTO", + "google.calendar.event.create": "#/components/schemas/UpdateGoogleCalendarCreateEventToolDTO", + "google.sheets.row.append": "#/components/schemas/UpdateGoogleSheetsRowAppendToolDTO", + "google.calendar.availability.check": "#/components/schemas/UpdateGoogleCalendarCheckAvailabilityToolDTO", + "slack.message.send": "#/components/schemas/UpdateSlackSendMessageToolDTO", + "sms": "#/components/schemas/UpdateSmsToolDTO", + "mcp": "#/components/schemas/UpdateMcpToolDTO", + "gohighlevel.calendar.availability.check": "#/components/schemas/UpdateGoHighLevelCalendarAvailabilityToolDTO", + "gohighlevel.calendar.event.create": "#/components/schemas/UpdateGoHighLevelCalendarEventCreateToolDTO", + "gohighlevel.contact.create": "#/components/schemas/UpdateGoHighLevelContactCreateToolDTO", + "gohighlevel.contact.get": "#/components/schemas/UpdateGoHighLevelContactGetToolDTO", + "sipRequest": "#/components/schemas/UpdateSipRequestToolDTO", + "voicemail": "#/components/schemas/UpdateVoicemailToolDTO" + } } } } } }, - "tags": [ - "Files" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "delete": { - "operationId": "FileController_remove", - "summary": "Delete File", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], "responses": { "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/File" - } - } - } - } - }, - "tags": [ - "Files" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/knowledge-base": { - "post": { - "operationId": "KnowledgeBaseController_create", - "summary": "Create Knowledge Base", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateTrieveKnowledgeBaseDTO", - "title": "TrieveKnowledgeBaseDTO" - }, - { - "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", - "title": "CustomKnowledgeBaseDTO" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "trieve": "#/components/schemas/CreateTrieveKnowledgeBaseDTO", - "custom-knowledge-base": "#/components/schemas/CreateCustomKnowledgeBaseDTO" - } - } - } - } - } - }, - "responses": { - "201": { "description": "", "content": { "application/json": { "schema": { "oneOf": [ { - "$ref": "#/components/schemas/TrieveKnowledgeBase", - "title": "TrieveKnowledgeBase" + "$ref": "#/components/schemas/ApiRequestTool", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CodeTool", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/DtmfTool", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/EndCallTool", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/FunctionTool", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/GhlTool", + "title": "GhlTool" + }, + { + "$ref": "#/components/schemas/TransferCallTool", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/HandoffTool", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/BashTool", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/ComputerTool", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/TextEditorTool", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/QueryTool", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/SlackSendMessageTool", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/SmsTool", + "title": "SmsSendTool" + }, + { + "$ref": "#/components/schemas/McpTool", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactCreateTool", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactGetTool", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/SipRequestTool", + "title": "SipRequestTool" }, { - "$ref": "#/components/schemas/CustomKnowledgeBase", - "title": "CustomKnowledgeBase" + "$ref": "#/components/schemas/VoicemailTool", + "title": "VoicemailTool" } ], "discriminator": { - "propertyName": "provider", + "propertyName": "type", "mapping": { - "trieve": "#/components/schemas/TrieveKnowledgeBase", - "custom-knowledge-base": "#/components/schemas/CustomKnowledgeBase" + "apiRequest": "#/components/schemas/ApiRequestTool", + "code": "#/components/schemas/CodeTool", + "dtmf": "#/components/schemas/DtmfTool", + "endCall": "#/components/schemas/EndCallTool", + "function": "#/components/schemas/FunctionTool", + "transferCall": "#/components/schemas/TransferCallTool", + "handoff": "#/components/schemas/HandoffTool", + "bash": "#/components/schemas/BashTool", + "computer": "#/components/schemas/ComputerTool", + "textEditor": "#/components/schemas/TextEditorTool", + "query": "#/components/schemas/QueryTool", + "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", + "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", + "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "slack.message.send": "#/components/schemas/SlackSendMessageTool", + "sms": "#/components/schemas/SmsTool", + "mcp": "#/components/schemas/McpTool", + "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", + "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool", + "sipRequest": "#/components/schemas/SipRequestTool", + "voicemail": "#/components/schemas/VoicemailTool" } } } @@ -3330,7 +3617,7 @@ } }, "tags": [ - "Knowledge Base" + "Tools" ], "security": [ { @@ -3338,147 +3625,9 @@ } ] }, - "get": { - "operationId": "KnowledgeBaseController_findAll", - "summary": "List Knowledge Bases", - "parameters": [ - { - "name": "limit", - "required": false, - "in": "query", - "description": "This is the maximum number of items to return. Defaults to 100.", - "schema": { - "minimum": 0, - "maximum": 1000, - "type": "number" - } - }, - { - "name": "createdAtGt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtGe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBase", - "title": "TrieveKnowledgeBase" - }, - { - "$ref": "#/components/schemas/CustomKnowledgeBase", - "title": "CustomKnowledgeBase" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "trieve": "#/components/schemas/TrieveKnowledgeBase", - "custom-knowledge-base": "#/components/schemas/CustomKnowledgeBase" - } - } - } - } - } - } - } - }, - "tags": [ - "Knowledge Base" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/knowledge-base/{id}": { - "get": { - "operationId": "KnowledgeBaseController_findOne", - "summary": "Get Knowledge Base", + "delete": { + "operationId": "ToolController_remove", + "summary": "Delete Tool", "parameters": [ { "name": "id", @@ -3497,19 +3646,128 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/TrieveKnowledgeBase", - "title": "TrieveKnowledgeBase" + "$ref": "#/components/schemas/ApiRequestTool", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CodeTool", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/DtmfTool", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/EndCallTool", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/FunctionTool", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/GhlTool", + "title": "GhlTool" + }, + { + "$ref": "#/components/schemas/TransferCallTool", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/HandoffTool", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/BashTool", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/ComputerTool", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/TextEditorTool", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/QueryTool", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCreateEventTool", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/GoogleSheetsRowAppendTool", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/SlackSendMessageTool", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/SmsTool", + "title": "SmsSendTool" + }, + { + "$ref": "#/components/schemas/McpTool", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactCreateTool", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/GoHighLevelContactGetTool", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/SipRequestTool", + "title": "SipRequestTool" }, { - "$ref": "#/components/schemas/CustomKnowledgeBase", - "title": "CustomKnowledgeBase" + "$ref": "#/components/schemas/VoicemailTool", + "title": "VoicemailTool" } ], "discriminator": { - "propertyName": "provider", + "propertyName": "type", "mapping": { - "trieve": "#/components/schemas/TrieveKnowledgeBase", - "custom-knowledge-base": "#/components/schemas/CustomKnowledgeBase" + "apiRequest": "#/components/schemas/ApiRequestTool", + "code": "#/components/schemas/CodeTool", + "dtmf": "#/components/schemas/DtmfTool", + "endCall": "#/components/schemas/EndCallTool", + "function": "#/components/schemas/FunctionTool", + "transferCall": "#/components/schemas/TransferCallTool", + "handoff": "#/components/schemas/HandoffTool", + "bash": "#/components/schemas/BashTool", + "computer": "#/components/schemas/ComputerTool", + "textEditor": "#/components/schemas/TextEditorTool", + "query": "#/components/schemas/QueryTool", + "google.calendar.event.create": "#/components/schemas/GoogleCalendarCreateEventTool", + "google.sheets.row.append": "#/components/schemas/GoogleSheetsRowAppendTool", + "google.calendar.availability.check": "#/components/schemas/GoogleCalendarCheckAvailabilityTool", + "slack.message.send": "#/components/schemas/SlackSendMessageTool", + "sms": "#/components/schemas/SmsTool", + "mcp": "#/components/schemas/McpTool", + "gohighlevel.calendar.availability.check": "#/components/schemas/GoHighLevelCalendarAvailabilityTool", + "gohighlevel.calendar.event.create": "#/components/schemas/GoHighLevelCalendarEventCreateTool", + "gohighlevel.contact.create": "#/components/schemas/GoHighLevelContactCreateTool", + "gohighlevel.contact.get": "#/components/schemas/GoHighLevelContactGetTool", + "sipRequest": "#/components/schemas/SipRequestTool", + "voicemail": "#/components/schemas/VoicemailTool" } } } @@ -3518,93 +3776,73 @@ } }, "tags": [ - "Knowledge Base" + "Tools" ], "security": [ { "bearer": [] } ] - }, - "patch": { - "operationId": "KnowledgeBaseController_update", - "summary": "Update Knowledge Base", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateTrieveKnowledgeBaseDTO", - "title": "UpdateTrieveKnowledgeBaseDTO" - }, - { - "$ref": "#/components/schemas/UpdateCustomKnowledgeBaseDTO", - "title": "UpdateCustomKnowledgeBaseDTO" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "trieve": "#/components/schemas/UpdateTrieveKnowledgeBaseDTO", - "custom-knowledge-base": "#/components/schemas/UpdateCustomKnowledgeBaseDTO" - } - } - } - } - } - }, + } + }, + "/tool/code/test": { + "post": { + "operationId": "ToolController_testCodeExecution", + "summary": "Test Code Tool Execution", + "parameters": [], "responses": { "200": { - "description": "", + "description": "Code execution test result", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBase", - "title": "TrieveKnowledgeBase" + "type": "object", + "properties": { + "success": { + "type": "boolean" }, - { - "$ref": "#/components/schemas/CustomKnowledgeBase", - "title": "CustomKnowledgeBase" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "trieve": "#/components/schemas/TrieveKnowledgeBase", - "custom-knowledge-base": "#/components/schemas/CustomKnowledgeBase" + "result": { + "type": "object" + }, + "error": { + "type": "string" + }, + "logs": { + "type": "string" + }, + "executionTimeMs": { + "type": "number" } } } } } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } } }, "tags": [ - "Knowledge Base" + "Tools" ], "security": [ { "bearer": [] } ] - }, - "delete": { - "operationId": "KnowledgeBaseController_remove", - "summary": "Delete Knowledge Base", + } + }, + "/tool/{id}/mcp-children": { + "post": { + "operationId": "ToolController_mcpChildToolsDiscover", + "summary": "Discover MCP Child Tools", "parameters": [ { "name": "id", @@ -3621,30 +3859,20 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBase", - "title": "TrieveKnowledgeBase" - }, - { - "$ref": "#/components/schemas/CustomKnowledgeBase", - "title": "CustomKnowledgeBase" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "trieve": "#/components/schemas/TrieveKnowledgeBase", - "custom-knowledge-base": "#/components/schemas/CustomKnowledgeBase" - } + "type": "array", + "items": { + "$ref": "#/components/schemas/McpTool" } } } } + }, + "201": { + "description": "" } }, "tags": [ - "Knowledge Base" + "Tools" ], "security": [ { @@ -3653,28 +3881,38 @@ ] } }, - "/workflow": { - "get": { - "operationId": "WorkflowController_findAll", - "summary": "Get Workflows", + "/file": { + "post": { + "operationId": "FileController_create", + "summary": "Upload File", "parameters": [], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/CreateFileDTO" + } + } + } + }, "responses": { - "200": { - "description": "", + "201": { + "description": "File uploaded successfully", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Workflow" - } + "$ref": "#/components/schemas/File" } } } + }, + "400": { + "description": "Invalid file" } }, "tags": [ - "Workflow" + "Files" ], "security": [ { @@ -3682,34 +3920,27 @@ } ] }, - "post": { - "operationId": "WorkflowController_create", - "summary": "Create Workflow", + "get": { + "operationId": "FileController_findAll", + "summary": "List Files", "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateWorkflowDTO" - } - } - } - }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "type": "array", + "items": { + "$ref": "#/components/schemas/File" + } } } } } }, "tags": [ - "Workflow" + "Files" ], "security": [ { @@ -3718,10 +3949,10 @@ ] } }, - "/workflow/{id}": { + "/file/{id}": { "get": { - "operationId": "WorkflowController_findOne", - "summary": "Get Workflow", + "operationId": "FileController_findOne", + "summary": "Get File", "parameters": [ { "name": "id", @@ -3738,14 +3969,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/File" } } } } }, "tags": [ - "Workflow" + "Files" ], "security": [ { @@ -3753,9 +3984,9 @@ } ] }, - "delete": { - "operationId": "WorkflowController_delete", - "summary": "Delete Workflow", + "patch": { + "operationId": "FileController_update", + "summary": "Update File", "parameters": [ { "name": "id", @@ -3766,20 +3997,30 @@ } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateFileDTO" + } + } + } + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/File" } } } } }, "tags": [ - "Workflow" + "Files" ], "security": [ { @@ -3787,9 +4028,9 @@ } ] }, - "patch": { - "operationId": "WorkflowController_update", - "summary": "Update Workflow", + "delete": { + "operationId": "FileController_remove", + "summary": "Delete File", "parameters": [ { "name": "id", @@ -3800,30 +4041,20 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateWorkflowDTO" - } - } - } - }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/File" } } } } }, "tags": [ - "Workflow" + "Files" ], "security": [ { @@ -3832,46 +4063,52 @@ ] } }, - "/squad": { - "post": { - "operationId": "SquadController_create", - "summary": "Create Squad", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSquadDTO" - } + "/structured-output": { + "get": { + "operationId": "StructuredOutputController_findAll", + "summary": "List Structured Outputs", + "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "description": "This will return structured outputs where the id matches the specified value.", + "schema": { + "type": "string" } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Squad" - } - } + }, + { + "name": "name", + "required": false, + "in": "query", + "description": "This will return structured outputs where the name matches the specified value.", + "schema": { + "type": "string" } - } - }, - "tags": [ - "Squads" - ], - "security": [ + }, { - "bearer": [] - } - ] - }, - "get": { - "operationId": "SquadController_findAll", - "summary": "List Squads", - "parameters": [ + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, { "name": "limit", "required": false, @@ -3970,17 +4207,49 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Squad" - } + "$ref": "#/components/schemas/StructuredOutputPaginatedResponse" } } } } }, "tags": [ - "Squads" + "Structured Outputs" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "post": { + "operationId": "StructuredOutputController_create", + "summary": "Create Structured Output", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStructuredOutputDTO" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StructuredOutput" + } + } + } + } + }, + "tags": [ + "Structured Outputs" ], "security": [ { @@ -3989,10 +4258,10 @@ ] } }, - "/squad/{id}": { + "/structured-output/{id}": { "get": { - "operationId": "SquadController_findOne", - "summary": "Get Squad", + "operationId": "StructuredOutputController_findOne", + "summary": "Get Structured Output", "parameters": [ { "name": "id", @@ -4009,14 +4278,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Squad" + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Squads" + "Structured Outputs" ], "security": [ { @@ -4025,8 +4294,8 @@ ] }, "patch": { - "operationId": "SquadController_update", - "summary": "Update Squad", + "operationId": "StructuredOutputController_update", + "summary": "Update Structured Output", "parameters": [ { "name": "id", @@ -4035,6 +4304,14 @@ "schema": { "type": "string" } + }, + { + "name": "schemaOverride", + "required": true, + "in": "query", + "schema": { + "type": "string" + } } ], "requestBody": { @@ -4042,7 +4319,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateSquadDTO" + "$ref": "#/components/schemas/UpdateStructuredOutputDTO" } } } @@ -4053,14 +4330,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Squad" + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Squads" + "Structured Outputs" ], "security": [ { @@ -4069,8 +4346,8 @@ ] }, "delete": { - "operationId": "SquadController_remove", - "summary": "Delete Squad", + "operationId": "StructuredOutputController_remove", + "summary": "Delete Structured Output", "parameters": [ { "name": "id", @@ -4087,14 +4364,61 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Squad" + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Squads" + "Structured Outputs" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/structured-output/run": { + "post": { + "operationId": "StructuredOutputController_run", + "summary": "Run Structured Output", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StructuredOutputRunDTO" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StructuredOutput" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "Structured Outputs" ], "security": [ { @@ -4103,11 +4427,102 @@ ] } }, - "/test-suite": { + "/reporting/insight": { + "post": { + "operationId": "InsightController_create", + "summary": "Create Insight", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "title": "CreateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "title": "CreatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "title": "CreateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateTextInsightFromCallTableDTO", + "title": "CreateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "line": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "text": "#/components/schemas/CreateTextInsightFromCallTableDTO" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } + } + } + } + } + }, + "tags": [ + "Insight" + ], + "security": [ + { + "bearer": [] + } + ] + }, "get": { - "operationId": "TestSuiteController_findAllPaginated", - "summary": "List Test Suites", + "operationId": "InsightController_findAll", + "summary": "Get Insights", "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, { "name": "page", "required": false, @@ -4229,61 +4644,118 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuitesPaginatedResponse" + "$ref": "#/components/schemas/InsightPaginatedResponse" } } } } }, "tags": [ - "Test Suites" + "Insight" ], "security": [ { "bearer": [] } ] - }, - "post": { - "operationId": "TestSuiteController_create", - "summary": "Create Test Suite", - "parameters": [], + } + }, + "/reporting/insight/{id}": { + "patch": { + "operationId": "InsightController_update", + "summary": "Update Insight", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTestSuiteDto" + "oneOf": [ + { + "$ref": "#/components/schemas/UpdateBarInsightFromCallTableDTO", + "title": "UpdateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdatePieInsightFromCallTableDTO", + "title": "UpdatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdateLineInsightFromCallTableDTO", + "title": "UpdateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdateTextInsightFromCallTableDTO", + "title": "UpdateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/UpdateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/UpdatePieInsightFromCallTableDTO", + "line": "#/components/schemas/UpdateLineInsightFromCallTableDTO", + "text": "#/components/schemas/UpdateTextInsightFromCallTableDTO" + } + } } } } }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuite" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Test Suites" + "Insight" ], "security": [ { "bearer": [] } ] - } - }, - "/test-suite/{id}": { + }, "get": { - "operationId": "TestSuiteController_findOne", - "summary": "Get Test Suite", + "operationId": "InsightController_findOne", + "summary": "Get Insight", "parameters": [ { "name": "id", @@ -4300,14 +4772,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuite" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Test Suites" + "Insight" ], "security": [ { @@ -4315,9 +4809,67 @@ } ] }, - "patch": { - "operationId": "TestSuiteController_update", - "summary": "Update Test Suite", + "delete": { + "operationId": "InsightController_remove", + "summary": "Delete Insight", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } + } + } + } + } + }, + "tags": [ + "Insight" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/reporting/insight/{id}/run": { + "post": { + "operationId": "InsightController_run", + "summary": "Run Insight", "parameters": [ { "name": "id", @@ -4333,7 +4885,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateTestSuiteDto" + "$ref": "#/components/schemas/InsightRunDTO" } } } @@ -4344,48 +4896,97 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuite" + "$ref": "#/components/schemas/InsightRunResponse" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightRunResponse" } } } } }, "tags": [ - "Test Suites" + "Insight" ], "security": [ { "bearer": [] } ] - }, - "delete": { - "operationId": "TestSuiteController_remove", - "summary": "Delete Test Suite", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" + } + }, + "/reporting/insight/preview": { + "post": { + "operationId": "InsightController_preview", + "summary": "Preview Insight", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "title": "CreateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "title": "CreatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "title": "CreateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateTextInsightFromCallTableDTO", + "title": "CreateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "line": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "text": "#/components/schemas/CreateTextInsightFromCallTableDTO" + } + } + } } } - ], + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuite" + "$ref": "#/components/schemas/InsightRunResponse" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightRunResponse" } } } } }, "tags": [ - "Test Suites" + "Insight" ], "security": [ { @@ -4394,15 +4995,50 @@ ] } }, - "/test-suite/{testSuiteId}/test": { + "/eval": { + "post": { + "operationId": "EvalController_create", + "summary": "Create Eval", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEvalDTO" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, "get": { - "operationId": "TestSuiteTestController_findAllPaginated", - "summary": "List Tests", + "operationId": "EvalController_getPaginated", + "summary": "List Evals", "parameters": [ { - "name": "testSuiteId", - "required": true, - "in": "path", + "name": "id", + "required": false, + "in": "query", "schema": { "type": "string" } @@ -4528,27 +5164,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuiteTestsPaginatedResponse" + "$ref": "#/components/schemas/EvalPaginatedResponse" } } } } }, "tags": [ - "Test Suite Tests" + "Eval" ], "security": [ { "bearer": [] } ] - }, - "post": { - "operationId": "TestSuiteTestController_create", - "summary": "Create Test", + } + }, + "/eval/{id}": { + "patch": { + "operationId": "EvalController_update", + "summary": "Update Eval", "parameters": [ { - "name": "testSuiteId", + "name": "id", "required": true, "in": "path", "schema": { @@ -4561,78 +5199,36 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateTestSuiteTestVoiceDto", - "title": "TestSuiteTestVoice" - }, - { - "$ref": "#/components/schemas/CreateTestSuiteTestChatDto", - "title": "TestSuiteTestChat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/CreateTestSuiteTestVoiceDto", - "chat": "#/components/schemas/CreateTestSuiteTestChatDto" - } - } + "$ref": "#/components/schemas/UpdateEvalDTO" } } } }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice", - "title": "Voice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat", - "title": "Chat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/TestSuiteTestVoice", - "chat": "#/components/schemas/TestSuiteTestChat" - } - } + "$ref": "#/components/schemas/Eval" } } } } }, "tags": [ - "Test Suite Tests" + "Eval" ], "security": [ { "bearer": [] } ] - } - }, - "/test-suite/{testSuiteId}/test/{id}": { - "get": { - "operationId": "TestSuiteTestController_findOne", - "summary": "Get Test", + }, + "delete": { + "operationId": "EvalController_remove", + "summary": "Delete Eval", "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, { "name": "id", "required": true, @@ -4648,30 +5244,14 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice", - "title": "Voice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat", - "title": "Chat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/TestSuiteTestVoice", - "chat": "#/components/schemas/TestSuiteTestChat" - } - } + "$ref": "#/components/schemas/Eval" } } } } }, "tags": [ - "Test Suite Tests" + "Eval" ], "security": [ { @@ -4679,18 +5259,10 @@ } ] }, - "patch": { - "operationId": "TestSuiteTestController_update", - "summary": "Update Test", + "get": { + "operationId": "EvalController_get", + "summary": "Get Eval", "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, { "name": "id", "required": true, @@ -4700,81 +5272,67 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateTestSuiteTestVoiceDto", - "title": "TestSuiteTestVoice" - }, - { - "$ref": "#/components/schemas/UpdateTestSuiteTestChatDto", - "title": "TestSuiteTestChat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/UpdateTestSuiteTestVoiceDto", - "chat": "#/components/schemas/UpdateTestSuiteTestChatDto" - } - } - } - } - } - }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice", - "title": "Voice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat", - "title": "Chat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/TestSuiteTestVoice", - "chat": "#/components/schemas/TestSuiteTestChat" - } - } + "$ref": "#/components/schemas/Eval" } } } } }, "tags": [ - "Test Suite Tests" + "Eval" ], "security": [ { "bearer": [] } ] - }, + } + }, + "/eval/run/{id}": { "delete": { - "operationId": "TestSuiteTestController_remove", - "summary": "Delete Test", + "operationId": "EvalController_removeRun", + "summary": "Delete Eval Run", "parameters": [ { - "name": "testSuiteId", + "name": "id", "required": true, "in": "path", "schema": { "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvalRun" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "get": { + "operationId": "EvalController_getRun", + "summary": "Get Eval Run", + "parameters": [ { "name": "id", "required": true, @@ -4790,30 +5348,14 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice", - "title": "Voice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat", - "title": "Chat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "voice": "#/components/schemas/TestSuiteTestVoice", - "chat": "#/components/schemas/TestSuiteTestChat" - } - } + "$ref": "#/components/schemas/EvalRun" } } } } }, "tags": [ - "Test Suite Tests" + "Eval" ], "security": [ { @@ -4822,15 +5364,53 @@ ] } }, - "/test-suite/{testSuiteId}/run": { + "/eval/run": { + "post": { + "operationId": "EvalController_run", + "summary": "Create Eval Run", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEvalRunDTO" + } + } + } + }, + "responses": { + "200": { + "description": "" + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, "get": { - "operationId": "TestSuiteRunController_findAllPaginated", - "summary": "List Test Suite Runs", + "operationId": "EvalController_getRunsPaginated", + "summary": "List Eval Runs", "parameters": [ { - "name": "testSuiteId", - "required": true, - "in": "path", + "name": "id", + "required": false, + "in": "query", "schema": { "type": "string" } @@ -4956,58 +5536,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuiteRunsPaginatedResponse" - } - } - } - } - }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "TestSuiteRunController_create", - "summary": "Create Test Suite Run", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTestSuiteRunDto" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuiteRun" + "$ref": "#/components/schemas/EvalRunPaginatedResponse" } } } } }, "tags": [ - "Test Suite Runs" + "Eval" ], "security": [ { @@ -5016,19 +5552,11 @@ ] } }, - "/test-suite/{testSuiteId}/run/{id}": { + "/observability/scorecard/{id}": { "get": { - "operationId": "TestSuiteRunController_findOne", - "summary": "Get Test Suite Run", + "operationId": "ScorecardController_get", + "summary": "Get Scorecard", "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, { "name": "id", "required": true, @@ -5044,14 +5572,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuiteRun" + "$ref": "#/components/schemas/Scorecard" } } } } }, "tags": [ - "Test Suite Runs" + "Observability/Scorecard" ], "security": [ { @@ -5060,17 +5588,9 @@ ] }, "patch": { - "operationId": "TestSuiteRunController_update", - "summary": "Update Test Suite Run", + "operationId": "ScorecardController_update", + "summary": "Update Scorecard", "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, { "name": "id", "required": true, @@ -5085,7 +5605,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateTestSuiteRunDto" + "$ref": "#/components/schemas/UpdateScorecardDTO" } } } @@ -5096,14 +5616,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuiteRun" + "$ref": "#/components/schemas/Scorecard" } } } } }, "tags": [ - "Test Suite Runs" + "Observability/Scorecard" ], "security": [ { @@ -5112,17 +5632,9 @@ ] }, "delete": { - "operationId": "TestSuiteRunController_remove", - "summary": "Delete Test Suite Run", + "operationId": "ScorecardController_remove", + "summary": "Delete Scorecard", "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, { "name": "id", "required": true, @@ -5138,57 +5650,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuiteRun" - } - } - } - } - }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/analytics": { - "post": { - "operationId": "AnalyticsController_query", - "summary": "Create Analytics Queries", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AnalyticsQueryDTO" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AnalyticsQueryResult" - } + "$ref": "#/components/schemas/Scorecard" } } } - }, - "201": { - "description": "" } }, "tags": [ - "Analytics" + "Observability/Scorecard" ], "security": [ { @@ -5197,77 +5666,15 @@ ] } }, - "/logs": { + "/observability/scorecard": { "get": { - "operationId": "LoggingController_logsQuery", - "summary": "Get Logs", - "deprecated": true, + "operationId": "ScorecardController_getPaginated", + "summary": "List Scorecards", "parameters": [ { - "name": "type", - "required": false, - "in": "query", - "description": "This is the type of the log.", - "schema": { - "enum": [ - "API", - "Webhook", - "Call", - "Provider" - ], - "type": "string" - } - }, - { - "name": "webhookType", - "required": false, - "in": "query", - "description": "This is the type of the webhook, given the log is from a webhook.", - "schema": { - "type": "string" - } - }, - { - "name": "assistantId", - "required": false, - "in": "query", - "description": "This is the ID of the assistant.", - "schema": { - "type": "string" - } - }, - { - "name": "phoneNumberId", - "required": false, - "in": "query", - "description": "This is the ID of the phone number.", - "schema": { - "type": "string" - } - }, - { - "name": "customerId", - "required": false, - "in": "query", - "description": "This is the ID of the customer.", - "schema": { - "type": "string" - } - }, - { - "name": "squadId", - "required": false, - "in": "query", - "description": "This is the ID of the squad.", - "schema": { - "type": "string" - } - }, - { - "name": "callId", + "name": "id", "required": false, "in": "query", - "description": "This is the ID of the call.", "schema": { "type": "string" } @@ -5393,14 +5800,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LogsPaginatedResponse" + "$ref": "#/components/schemas/ScorecardPaginatedResponse" } } } } }, "tags": [ - "Logs" + "Observability/Scorecard" ], "security": [ { @@ -5408,105 +5815,143 @@ } ] }, - "delete": { - "operationId": "LoggingController_logsDeleteQuery", - "summary": "Delete Logs", - "deprecated": true, - "parameters": [ - { - "name": "type", - "required": false, - "in": "query", - "description": "This is the type of the log.", - "schema": { - "enum": [ - "API", - "Webhook", - "Call", - "Provider" - ], - "type": "string" + "post": { + "operationId": "ScorecardController_create", + "summary": "Create Scorecard", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateScorecardDTO" + } } - }, - { - "name": "assistantId", - "required": false, - "in": "query", - "schema": { - "type": "string" + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scorecard" + } + } } - }, + } + }, + "tags": [ + "Observability/Scorecard" + ], + "security": [ { - "name": "phoneNumberId", - "required": false, - "in": "query", - "description": "This is the ID of the phone number.", - "schema": { - "type": "string" - } - }, + "bearer": [] + } + ] + } + }, + "/provider/{provider}/{resourceName}": { + "post": { + "operationId": "ProviderResourceController_createProviderResource", + "summary": "Create Provider Resource", + "parameters": [ { - "name": "customerId", - "required": false, - "in": "query", - "description": "This is the ID of the customer.", + "name": "content-type", + "required": true, + "in": "header", "schema": { "type": "string" } }, { - "name": "squadId", - "required": false, - "in": "query", - "description": "This is the ID of the squad.", + "name": "provider", + "required": true, + "in": "path", + "description": "The provider (e.g., 11labs)", "schema": { + "enum": [ + "cartesia", + "11labs" + ], "type": "string" } }, { - "name": "callId", - "required": false, - "in": "query", - "description": "This is the ID of the call.", + "name": "resourceName", + "required": true, + "in": "path", + "description": "The resource name (e.g., pronunciation-dictionary)", "schema": { + "enum": [ + "pronunciation-dictionary" + ], "type": "string" } } ], "responses": { - "202": { - "description": "" + "201": { + "description": "Successfully created provider resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProviderResource" + } + } + } } }, "tags": [ - "Logs" + "Provider Resources" ], "security": [ { "bearer": [] } ] - } - }, - "/structured-output": { + }, "get": { - "operationId": "StructuredOutputController_findAll", - "summary": "List Structured Outputs", + "operationId": "ProviderResourceController_getProviderResourcesPaginated", + "summary": "List Provider Resources", "parameters": [ + { + "name": "provider", + "required": true, + "in": "path", + "description": "The provider (e.g., 11labs)", + "schema": { + "enum": [ + "cartesia", + "11labs" + ], + "type": "string" + } + }, + { + "name": "resourceName", + "required": true, + "in": "path", + "description": "The resource name (e.g., pronunciation-dictionary)", + "schema": { + "enum": [ + "pronunciation-dictionary" + ], + "type": "string" + } + }, { "name": "id", "required": false, "in": "query", - "description": "This will return structured outputs where the id matches the specified value.", "schema": { "type": "string" } }, { - "name": "name", + "name": "resourceId", "required": false, "in": "query", - "description": "This will return structured outputs where the name matches the specified value.", "schema": { "type": "string" } @@ -5628,141 +6073,83 @@ ], "responses": { "200": { - "description": "", + "description": "List of provider resources", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StructuredOutputPaginatedResponse" + "$ref": "#/components/schemas/ProviderResourcePaginatedResponse" } } } } }, "tags": [ - "Structured Outputs" + "Provider Resources" ], "security": [ { "bearer": [] } ] - }, - "post": { - "operationId": "StructuredOutputController_create", - "summary": "Create Structured Output", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateStructuredOutputDTO" - } + } + }, + "/provider/{provider}/{resourceName}/{id}": { + "get": { + "operationId": "ProviderResourceController_getProviderResource", + "summary": "Get Provider Resource", + "parameters": [ + { + "name": "provider", + "required": true, + "in": "path", + "description": "The provider (e.g., 11labs)", + "schema": { + "enum": [ + "cartesia", + "11labs" + ], + "type": "string" + } + }, + { + "name": "resourceName", + "required": true, + "in": "path", + "description": "The resource name (e.g., pronunciation-dictionary)", + "schema": { + "enum": [ + "pronunciation-dictionary" + ], + "type": "string" + } + }, + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "format": "uuid", + "type": "string" } } - }, + ], "responses": { - "201": { - "description": "", + "200": { + "description": "Successfully retrieved provider resource", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StructuredOutput" + "$ref": "#/components/schemas/ProviderResource" } } } + }, + "404": { + "description": "Provider resource not found" } }, "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/structured-output/{id}": { - "get": { - "operationId": "StructuredOutputController_findOne", - "summary": "Get Structured Output", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StructuredOutput" - } - } - } - } - }, - "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "patch": { - "operationId": "StructuredOutputController_update", - "summary": "Update Structured Output", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - }, - { - "name": "schemaOverride", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateStructuredOutputDTO" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StructuredOutput" - } - } - } - } - }, - "tags": [ - "Structured Outputs" + "Provider Resources" ], "security": [ { @@ -5771,284 +6158,8 @@ ] }, "delete": { - "operationId": "StructuredOutputController_remove", - "summary": "Delete Structured Output", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StructuredOutput" - } - } - } - } - }, - "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/provider/{provider}/{resourceName}": { - "post": { - "operationId": "ProviderResourceController_createProviderResource", - "summary": "Create Provider Resource", - "parameters": [ - { - "name": "content-type", - "required": true, - "in": "header", - "schema": { - "type": "string" - } - }, - { - "name": "provider", - "required": true, - "in": "path", - "description": "The provider (e.g., 11labs)", - "schema": { - "enum": [ - "11labs" - ], - "type": "string" - } - }, - { - "name": "resourceName", - "required": true, - "in": "path", - "description": "The resource name (e.g., pronunciation-dictionary)", - "schema": { - "enum": [ - "pronunciation-dictionary" - ], - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "Successfully created provider resource", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderResource" - } - } - } - } - }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "get": { - "operationId": "ProviderResourceController_getProviderResourcesPaginated", - "summary": "List Provider Resources", - "parameters": [ - { - "name": "provider", - "required": true, - "in": "path", - "description": "The provider (e.g., 11labs)", - "schema": { - "enum": [ - "11labs" - ], - "type": "string" - } - }, - { - "name": "resourceName", - "required": true, - "in": "path", - "description": "The resource name (e.g., pronunciation-dictionary)", - "schema": { - "enum": [ - "pronunciation-dictionary" - ], - "type": "string" - } - }, - { - "name": "id", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "resourceId", - "required": false, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" - } - }, - { - "name": "sortOrder", - "required": false, - "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "schema": { - "enum": [ - "ASC", - "DESC" - ], - "type": "string" - } - }, - { - "name": "limit", - "required": false, - "in": "query", - "description": "This is the maximum number of items to return. Defaults to 100.", - "schema": { - "minimum": 0, - "maximum": 1000, - "type": "number" - } - }, - { - "name": "createdAtGt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLt", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtGe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "createdAtLe", - "required": false, - "in": "query", - "description": "This will return items where the createdAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtGe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is greater than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "name": "updatedAtLe", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than or equal to the specified value.", - "schema": { - "format": "date-time", - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "List of provider resources", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderResourcePaginatedResponse" - } - } - } - } - }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/provider/{provider}/{resourceName}/{id}": { - "get": { - "operationId": "ProviderResourceController_getProviderResource", - "summary": "Get Provider Resource", + "operationId": "ProviderResourceController_deleteProviderResource", + "summary": "Delete Provider Resource", "parameters": [ { "name": "provider", @@ -6057,6 +6168,7 @@ "description": "The provider (e.g., 11labs)", "schema": { "enum": [ + "cartesia", "11labs" ], "type": "string" @@ -6086,7 +6198,7 @@ ], "responses": { "200": { - "description": "Successfully retrieved provider resource", + "description": "", "content": { "application/json": { "schema": { @@ -6108,9 +6220,9 @@ } ] }, - "delete": { - "operationId": "ProviderResourceController_deleteProviderResource", - "summary": "Delete Provider Resource", + "patch": { + "operationId": "ProviderResourceController_updateProviderResource", + "summary": "Update Provider Resource", "parameters": [ { "name": "provider", @@ -6119,6 +6231,7 @@ "description": "The provider (e.g., 11labs)", "schema": { "enum": [ + "cartesia", "11labs" ], "type": "string" @@ -6169,62 +6282,43 @@ "bearer": [] } ] - }, - "patch": { - "operationId": "ProviderResourceController_updateProviderResource", - "summary": "Update Provider Resource", - "parameters": [ - { - "name": "provider", - "required": true, - "in": "path", - "description": "The provider (e.g., 11labs)", - "schema": { - "enum": [ - "11labs" - ], - "type": "string" - } - }, - { - "name": "resourceName", - "required": true, - "in": "path", - "description": "The resource name (e.g., pronunciation-dictionary)", - "schema": { - "enum": [ - "pronunciation-dictionary" - ], - "type": "string" - } - }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "format": "uuid", - "type": "string" + } + }, + "/analytics": { + "post": { + "operationId": "AnalyticsController_query", + "summary": "Create Analytics Queries", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AnalyticsQueryDTO" + } } } - ], + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProviderResource" + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalyticsQueryResult" + } } } } }, - "404": { - "description": "Provider resource not found" + "201": { + "description": "" } }, "tags": [ - "Provider Resources" + "Analytics" ], "security": [ { @@ -6256,496 +6350,7 @@ } }, "schemas": { - "AnalysisCostBreakdown": { - "type": "object", - "properties": { - "summary": { - "type": "number", - "description": "This is the cost to summarize the call." - }, - "summaryPromptTokens": { - "type": "number", - "description": "This is the number of prompt tokens used to summarize the call." - }, - "summaryCompletionTokens": { - "type": "number", - "description": "This is the number of completion tokens used to summarize the call." - }, - "structuredData": { - "type": "number", - "description": "This is the cost to extract structured data from the call." - }, - "structuredDataPromptTokens": { - "type": "number", - "description": "This is the number of prompt tokens used to extract structured data from the call." - }, - "structuredDataCompletionTokens": { - "type": "number", - "description": "This is the number of completion tokens used to extract structured data from the call." - }, - "successEvaluation": { - "type": "number", - "description": "This is the cost to evaluate if the call was successful." - }, - "successEvaluationPromptTokens": { - "type": "number", - "description": "This is the number of prompt tokens used to evaluate if the call was successful." - }, - "successEvaluationCompletionTokens": { - "type": "number", - "description": "This is the number of completion tokens used to evaluate if the call was successful." - }, - "structuredOutput": { - "type": "number", - "description": "This is the cost to evaluate structuredOutputs from the call." - }, - "structuredOutputPromptTokens": { - "type": "number", - "description": "This is the number of prompt tokens used to evaluate structuredOutputs from the call." - }, - "structuredOutputCompletionTokens": { - "type": "number", - "description": "This is the number of completion tokens used to evaluate structuredOutputs from the call." - } - } - }, - "CostBreakdown": { - "type": "object", - "properties": { - "transport": { - "type": "number", - "description": "This is the cost of the transport provider, like Twilio or Vonage." - }, - "stt": { - "type": "number", - "description": "This is the cost of the speech-to-text service." - }, - "llm": { - "type": "number", - "description": "This is the cost of the language model." - }, - "tts": { - "type": "number", - "description": "This is the cost of the text-to-speech service." - }, - "vapi": { - "type": "number", - "description": "This is the cost of Vapi." - }, - "chat": { - "type": "number", - "description": "This is the cost of chat interactions." - }, - "total": { - "type": "number", - "description": "This is the total cost of the call." - }, - "llmPromptTokens": { - "type": "number", - "description": "This is the LLM prompt tokens used for the call." - }, - "llmCompletionTokens": { - "type": "number", - "description": "This is the LLM completion tokens used for the call." - }, - "ttsCharacters": { - "type": "number", - "description": "This is the TTS characters used for the call." - }, - "analysisCostBreakdown": { - "description": "This is the cost of the analysis.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisCostBreakdown" - } - ] - } - } - }, - "TranscriptPlan": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "This determines whether the transcript is stored in `call.artifact.transcript`. Defaults to true.\n\n@default true", - "example": true - }, - "assistantName": { - "type": "string", - "description": "This is the name of the assistant in the transcript. Defaults to 'AI'.\n\nUsage:\n- If you want to change the name of the assistant in the transcript, set this. Example, here is what the transcript would look like with `assistantName` set to 'Buyer':\n```\nUser: Hello, how are you?\nBuyer: I'm fine.\nUser: Do you want to buy a car?\nBuyer: No.\n```\n\n@default 'AI'" - }, - "userName": { - "type": "string", - "description": "This is the name of the user in the transcript. Defaults to 'User'.\n\nUsage:\n- If you want to change the name of the user in the transcript, set this. Example, here is what the transcript would look like with `userName` set to 'Seller':\n```\nSeller: Hello, how are you?\nAI: I'm fine.\nSeller: Do you want to buy a car?\nAI: No.\n```\n\n@default 'User'" - } - } - }, - "ArtifactPlan": { - "type": "object", - "properties": { - "recordingEnabled": { - "type": "boolean", - "description": "This determines whether assistant's calls are recorded. Defaults to true.\n\nUsage:\n- If you don't want to record the calls, set this to false.\n- If you want to record the calls when `assistant.hipaaEnabled` (deprecated) or `assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nYou can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended.\n\n@default true", - "example": true - }, - "recordingFormat": { - "type": "string", - "description": "This determines the format of the recording. Defaults to `wav;l16`.\n\n@default 'wav;l16'", - "enum": [ - "wav;l16", - "mp3" - ] - }, - "videoRecordingEnabled": { - "type": "boolean", - "description": "This determines whether the video is recorded during the call. Defaults to false. Only relevant for `webCall` type.\n\nYou can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended.\n\n@default false", - "example": false - }, - "pcapEnabled": { - "type": "boolean", - "description": "This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`.\n\nYou can find the packet capture at `call.artifact.pcapUrl` after the call is ended.\n\n@default true", - "example": true - }, - "pcapS3PathPrefix": { - "type": "string", - "description": "This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the packet capture to a specific path, set this to the path. Example: `/my-assistant-captures`.\n- If you want to upload the packet capture to the root of the bucket, set this to `/`.\n\n@default '/'", - "example": "/pcaps" - }, - "loggingEnabled": { - "type": "boolean", - "description": "This determines whether the call logs are enabled. Defaults to true.\n\n@default true", - "example": true - }, - "transcriptPlan": { - "description": "This is the plan for `call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.", - "allOf": [ - { - "$ref": "#/components/schemas/TranscriptPlan" - } - ] - }, - "recordingPath": { - "type": "string", - "description": "This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the recording to a specific path, set this to the path. Example: `/my-assistant-recordings`.\n- If you want to upload the recording to the root of the bucket, set this to `/`.\n\n@default '/'" - }, - "structuredOutputIds": { - "description": "This is an array of structured output IDs to be calculated during the call.\nThe outputs will be extracted and stored in `call.artifact.structuredOutputs` after the call is ended.", - "type": "array", - "items": { - "type": "string" - } - }, - "loggingPath": { - "type": "string", - "description": "This is the path where the call logs will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the call logs to a specific path, set this to the path. Example: `/my-assistant-logs`.\n- If you want to upload the call logs to the root of the bucket, set this to `/`.\n\n@default '/'" - } - } - }, - "Analysis": { - "type": "object", - "properties": { - "summary": { - "type": "string", - "description": "This is the summary of the call. Customize by setting `assistant.analysisPlan.summaryPrompt`." - }, - "structuredData": { - "type": "object", - "description": "This is the structured data extracted from the call. Customize by setting `assistant.analysisPlan.structuredDataPrompt` and/or `assistant.analysisPlan.structuredDataSchema`." - }, - "structuredDataMulti": { - "description": "This is the structured data catalog of the call. Customize by setting `assistant.analysisPlan.structuredDataMultiPlan`.", - "type": "array", - "items": { - "type": "object" - } - }, - "successEvaluation": { - "type": "string", - "description": "This is the evaluation of the call. Customize by setting `assistant.analysisPlan.successEvaluationPrompt` and/or `assistant.analysisPlan.successEvaluationRubric`." - } - } - }, - "Monitor": { - "type": "object", - "properties": { - "listenUrl": { - "type": "string", - "description": "This is the URL where the assistant's calls can be listened to in real-time. To enable, set `assistant.monitorPlan.listenEnabled` to `true`." - }, - "controlUrl": { - "type": "string", - "description": "This is the URL where the assistant's calls can be controlled in real-time. To enable, set `assistant.monitorPlan.controlEnabled` to `true`." - } - } - }, - "OpenAIMessage": { - "type": "object", - "properties": { - "content": { - "type": "string", - "nullable": true, - "maxLength": 100000000 - }, - "role": { - "type": "string", - "enum": [ - "assistant", - "function", - "user", - "system", - "tool" - ] - } - }, - "required": [ - "content", - "role" - ] - }, - "Mono": { - "type": "object", - "properties": { - "combinedUrl": { - "type": "string", - "description": "This is the combined recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." - }, - "assistantUrl": { - "type": "string", - "description": "This is the mono recording url for the assistant. To enable, set `assistant.artifactPlan.recordingEnabled`." - }, - "customerUrl": { - "type": "string", - "description": "This is the mono recording url for the customer. To enable, set `assistant.artifactPlan.recordingEnabled`." - } - } - }, - "Recording": { - "type": "object", - "properties": { - "stereoUrl": { - "type": "string", - "description": "This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." - }, - "videoUrl": { - "type": "string", - "description": "This is the video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`." - }, - "videoRecordingStartDelaySeconds": { - "type": "number", - "description": "This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps." - }, - "mono": { - "description": "This is the mono recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", - "allOf": [ - { - "$ref": "#/components/schemas/Mono" - } - ] - } - } - }, - "NodeArtifact": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "description": "These are the messages that were spoken during the node.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/BotMessage", - "title": "BotMessage" - }, - { - "$ref": "#/components/schemas/ToolCallMessage", - "title": "ToolCallMessage" - }, - { - "$ref": "#/components/schemas/ToolCallResultMessage", - "title": "ToolCallResultMessage" - } - ] - } - }, - "nodeName": { - "type": "string", - "description": "This is the node name." - }, - "variableValues": { - "type": "object", - "description": "These are the variable values that were extracted from the node." - } - } - }, - "TurnLatency": { - "type": "object", - "properties": { - "modelLatency": { - "type": "number", - "description": "This is the model latency for the first token." - }, - "voiceLatency": { - "type": "number", - "description": "This is the voice latency from the model output." - }, - "transcriberLatency": { - "type": "number", - "description": "This is the transcriber latency from the user speech." - }, - "endpointingLatency": { - "type": "number", - "description": "This is the endpointing latency." - }, - "turnLatency": { - "type": "number", - "description": "This is the latency for the whole turn." - } - } - }, - "PerformanceMetrics": { - "type": "object", - "properties": { - "turnLatencies": { - "description": "These are the individual latencies for each turn.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TurnLatency" - } - }, - "modelLatencyAverage": { - "type": "number", - "description": "This is the average latency for the model to output the first token." - }, - "voiceLatencyAverage": { - "type": "number", - "description": "This is the average latency for the text to speech." - }, - "transcriberLatencyAverage": { - "type": "number", - "description": "This is the average latency for the transcriber." - }, - "endpointingLatencyAverage": { - "type": "number", - "description": "This is the average latency for the endpointing." - }, - "turnLatencyAverage": { - "type": "number", - "description": "This is the average latency for complete turns." - } - } - }, - "Artifact": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "description": "These are the messages that were spoken during the call.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/BotMessage", - "title": "BotMessage" - }, - { - "$ref": "#/components/schemas/ToolCallMessage", - "title": "ToolCallMessage" - }, - { - "$ref": "#/components/schemas/ToolCallResultMessage", - "title": "ToolCallResultMessage" - } - ] - } - }, - "messagesOpenAIFormatted": { - "description": "These are the messages that were spoken during the call, formatted for OpenAI.", - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAIMessage" - } - }, - "recordingUrl": { - "type": "string", - "description": "This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", - "deprecated": true - }, - "stereoRecordingUrl": { - "type": "string", - "description": "This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", - "deprecated": true - }, - "videoRecordingUrl": { - "type": "string", - "description": "This is video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`.", - "deprecated": true - }, - "videoRecordingStartDelaySeconds": { - "type": "number", - "description": "This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps.", - "deprecated": true - }, - "recording": { - "description": "This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", - "allOf": [ - { - "$ref": "#/components/schemas/Recording" - } - ] - }, - "transcript": { - "type": "string", - "description": "This is the transcript of the call. This is derived from `artifact.messages` but provided for convenience." - }, - "pcapUrl": { - "type": "string", - "description": "This is the packet capture url for the call. This is only available for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`." - }, - "logUrl": { - "type": "string", - "description": "This is the url for the call logs. This includes all logging output during the call for debugging purposes." - }, - "nodes": { - "description": "This is the history of workflow nodes that were executed during the call.", - "type": "array", - "items": { - "$ref": "#/components/schemas/NodeArtifact" - } - }, - "variableValues": { - "type": "object", - "description": "These are the variable values at the end of the workflow execution." - }, - "performanceMetrics": { - "description": "This is the performance metrics for the call. It contains the turn latency, broken down by component.", - "allOf": [ - { - "$ref": "#/components/schemas/PerformanceMetrics" - } - ] - }, - "structuredOutputs": { - "type": "object", - "description": "These are the structured outputs that will be extracted from the call.\nTo enable, set `assistant.artifactPlan.structuredOutputIds` with the IDs of the structured outputs you want to extract." - } - } - }, - "FallbackTranscriberPlan": { + "FallbackTranscriberPlan": { "type": "object", "properties": { "transcribers": { @@ -6795,6 +6400,10 @@ { "$ref": "#/components/schemas/FallbackCartesiaTranscriber", "title": "Cartesia" + }, + { + "$ref": "#/components/schemas/FallbackSonioxTranscriber", + "title": "Soniox" } ] } @@ -6818,6 +6427,7 @@ "type": "string", "description": "This is the language that will be set for the transcription.", "enum": [ + "multi", "en" ] }, @@ -6835,29 +6445,42 @@ }, "endOfTurnConfidenceThreshold": { "type": "number", - "description": "This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected.\n\n@min 0\n@max 1\n@default 0.7", + "description": "This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@min 0\n@max 1\n@default 0.7", "minimum": 0, "maximum": 1, "example": 0.7 }, "minEndOfTurnSilenceWhenConfident": { "type": "number", - "description": "This is the minimum end of turn silence when confident in milliseconds.\n\n@default 160", + "description": "This is the minimum end of turn silence when confident in milliseconds.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@default 160", "minimum": 0, "example": 160 }, "wordFinalizationMaxWaitTime": { "type": "number", - "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", + "deprecated": true, "minimum": 0, "example": 160 }, "maxTurnSilence": { "type": "number", - "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", + "description": "This is the maximum turn silence time in milliseconds.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@default 400", "minimum": 0, "example": 400 }, + "vadAssistedEndpointingEnabled": { + "type": "boolean", + "description": "Use VAD to assist with endpointing decisions from the transcriber.\nWhen enabled, transcriber endpointing will be buffered if VAD detects the user is still speaking, preventing premature turn-taking.\nWhen disabled, transcriber endpointing will be used immediately regardless of VAD state, allowing for quicker but more aggressive turn-taking.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n\n@default true", + "example": true + }, + "speechModel": { + "type": "string", + "description": "This is the speech model used for the streaming session.\nNote: Keyterms prompting is not supported with multilingual streaming.\n@default 'universal-streaming-english'", + "enum": [ + "universal-streaming-english", + "universal-streaming-multilingual" + ] + }, "realtimeUrl": { "type": "string", "description": "The WebSocket URL that the transcriber connects to." @@ -6870,6 +6493,14 @@ "maxLength": 2500 } }, + "keytermsPrompt": { + "description": "Keyterms prompting improves recognition accuracy for specific words and phrases.\nCan include up to 100 keyterms, each up to 50 characters.\nCosts an additional $0.04/hour when enabled.", + "type": "array", + "items": { + "type": "string", + "maxLength": 50 + } + }, "endUtteranceSilenceThreshold": { "type": "number", "description": "The duration of the end utterance silence threshold in milliseconds." @@ -6879,7 +6510,7 @@ "description": "Disable partial transcripts.\nSet to `true` to not receive partial transcripts. Defaults to `false`." }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -7072,7 +6703,7 @@ "maximum": 70000 }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -7290,7 +6921,7 @@ ] }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -7327,6 +6958,19 @@ "minimum": 0, "maximum": 10, "example": 1 + }, + "excludedStatusCodes": { + "description": "This is the excluded status codes. If the response status code is in this list, the request will not be retried.\nBy default, the request will be retried for any non-2xx status code.", + "example": [ + 400, + 401, + 403, + 404 + ], + "type": "array", + "items": { + "type": "object" + } } }, "required": [ @@ -7345,13 +6989,30 @@ "maximum": 300, "example": 20 }, + "credentialId": { + "type": "string", + "description": "The credential ID for server authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "staticIpAddressesEnabled": { + "type": "boolean", + "description": "If enabled, requests will originate from a static set of IPs owned and managed by Vapi.\n\n@default false", + "example": false + }, + "encryptedPaths": { + "type": "array", + "description": "This is the paths to encrypt in the request body if credentialId and encryptionPlan are defined.", + "items": { + "type": "string" + } + }, "url": { "type": "string", "description": "This is where the request will be sent." }, "headers": { "type": "object", - "description": "These are the headers to include in the request.\n\nEach key-value pair represents a header name and its value." + "description": "These are the headers to include in the request.\n\nEach key-value pair represents a header name and its value.\n\nNote: Specifying an Authorization header here will override the authorization provided by the `credentialId` (if provided). This is an anti-pattern and should be avoided outside of edge case scenarios." }, "backoffPlan": { "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", @@ -7382,7 +7043,7 @@ ] }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -7442,7 +7103,8 @@ "base-conversationalai", "base-voicemail", "base-video", - "whisper" + "whisper", + "flux-general-en" ] }, { @@ -7508,6 +7170,7 @@ "pl", "pt", "pt-BR", + "pt-PT", "ro", "ru", "sk", @@ -7559,6 +7222,27 @@ "maximum": 1, "example": 0.4 }, + "eagerEotThreshold": { + "type": "number", + "description": "Eager end-of-turn confidence required to fire a eager end-of-turn event. Setting a value here will enable EagerEndOfTurn and SpeechResumed events. It is disabled by default. Only used with Flux models.", + "minimum": 0, + "maximum": 1, + "example": 0.3 + }, + "eotThreshold": { + "type": "number", + "description": "End-of-turn confidence required to finish a turn. Only used with Flux models.\n\n@default 0.7", + "minimum": 0.5, + "maximum": 0.9, + "example": 0.7 + }, + "eotTimeoutMs": { + "type": "number", + "description": "A turn will be finished when this much time has passed after speech, regardless of EOT confidence. Only used with Flux models.\n\n@default 5000", + "minimum": 500, + "maximum": 10000, + "example": 5000 + }, "keywords": { "description": "These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here.", "type": "array", @@ -7581,7 +7265,7 @@ "maximum": 500 }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -7604,14 +7288,20 @@ ] }, "model": { - "type": "string", "description": "This is the model that will be used for the transcription.", - "enum": [ - "scribe_v1" + "oneOf": [ + { + "enum": [ + "scribe_v1", + "scribe_v2", + "scribe_v2_realtime" + ] + } ] }, "language": { "type": "string", + "description": "This is the language that will be used for the transcription.", "enum": [ "aa", "ab", @@ -7800,8 +7490,36 @@ "zu" ] }, + "silenceThresholdSeconds": { + "type": "number", + "description": "This is the number of seconds of silence before VAD commits (0.3-3.0).", + "minimum": 0.3, + "maximum": 3, + "example": 1.5 + }, + "confidenceThreshold": { + "type": "number", + "description": "This is the VAD sensitivity (0.1-0.9, lower indicates more sensitive).", + "minimum": 0.1, + "maximum": 0.9, + "example": 0.4 + }, + "minSpeechDurationMs": { + "type": "number", + "description": "This is the minimum speech duration for VAD (50-2000ms).", + "minimum": 50, + "maximum": 2000, + "example": 100 + }, + "minSilenceDurationMs": { + "type": "number", + "description": "This is the minimum silence duration for VAD (50-2000ms).", + "minimum": 50, + "maximum": 2000, + "example": 100 + }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8137,8 +7855,22 @@ } ] }, + "region": { + "type": "string", + "enum": [ + "us-west", + "eu-west" + ], + "description": "Region for processing audio (us-west or eu-west)", + "example": "us-west" + }, + "receivePartialTranscripts": { + "type": "boolean", + "example": false, + "description": "Enable partial transcripts for low-latency streaming transcription" + }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8150,6 +7882,267 @@ "provider" ] }, + "SonioxTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "soniox" + ] + }, + "model": { + "type": "string", + "enum": [ + "stt-rt-v4" + ], + "description": "The Soniox model to use for transcription." + }, + "language": { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu" + ], + "description": "The language for transcription. Uses ISO 639-1 codes. Soniox supports 60+ languages with a single universal model." + }, + "languageHintsStrict": { + "type": "boolean", + "description": "When enabled, restricts transcription to the language specified in the language field. When disabled, the model can detect and transcribe any of 60+ supported languages. Defaults to true." + }, + "maxEndpointDelayMs": { + "type": "number", + "minimum": 500, + "maximum": 3000, + "description": "Maximum delay in milliseconds between when the speaker stops and when the endpoint is detected. Lower values mean faster turn-taking but more false endpoints. Range: 500-3000. Default: 500." + }, + "customVocabulary": { + "description": "Custom vocabulary terms to boost recognition accuracy. Useful for brand names, product names, and domain-specific terminology. Maps to Soniox context.terms.", + "type": "array", + "items": { + "type": "string" + } + }, + "fallbackPlan": { + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" + } + ] + } + }, + "required": [ + "provider" + ] + }, + "SpeechmaticsCustomVocabularyItem": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The word or phrase to add to the custom vocabulary.", + "minLength": 1, + "example": "Speechmatics" + }, + "soundsLike": { + "description": "Alternative phonetic representations of how the word might sound. This helps recognition when the word might be pronounced differently.", + "example": [ + "speech mattix" + ], + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "content" + ] + }, "SpeechmaticsTranscriber": { "type": "object", "properties": { @@ -8203,8 +8196,10 @@ "lv", "lt", "ms", + "en_ms", "mt", "cmn", + "cmn_en", "mr", "mn", "no", @@ -8216,9 +8211,12 @@ "sk", "sl", "es", + "en_es", "sw", "sv", + "tl", "ta", + "en_ta", "th", "tr", "uk", @@ -8228,8 +8226,88 @@ "cy" ] }, + "operatingPoint": { + "type": "string", + "description": "This is the operating point for the transcription. Choose between `standard` for faster turnaround with strong accuracy or `enhanced` for highest accuracy when precision is critical.\n\n@default 'enhanced'", + "example": "enhanced", + "enum": [ + "standard", + "enhanced" + ], + "default": "enhanced" + }, + "region": { + "type": "string", + "description": "This is the region for the Speechmatics API. Choose between EU (Europe) and US (United States) regions for lower latency and data sovereignty compliance.\n\n@default 'eu'", + "example": "us", + "enum": [ + "eu", + "us" + ], + "default": "eu" + }, + "enableDiarization": { + "type": "boolean", + "description": "This enables speaker diarization, which identifies and separates speakers in the transcription. Essential for multi-speaker conversations and conference calls.\n\n@default false", + "example": true, + "default": false + }, + "maxDelay": { + "type": "number", + "description": "This sets the maximum delay in milliseconds for partial transcripts. Balances latency and accuracy.\n\n@default 3000", + "example": 1500, + "minimum": 500, + "maximum": 10000, + "default": 3000 + }, + "customVocabulary": { + "example": [ + { + "content": "Speechmatics", + "soundsLike": [ + "speech mattix" + ] + } + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/SpeechmaticsCustomVocabularyItem" + } + }, + "numeralStyle": { + "type": "string", + "description": "This controls how numbers, dates, currencies, and other entities are formatted in the transcription output.\n\n@default 'written'", + "example": "spoken", + "enum": [ + "written", + "spoken" + ], + "default": "written" + }, + "endOfTurnSensitivity": { + "type": "number", + "description": "This is the sensitivity level for end-of-turn detection, which determines when a speaker has finished talking. Higher values are more sensitive.\n\n@default 0.5", + "example": 0.8, + "minimum": 0, + "maximum": 1, + "default": 0.5 + }, + "removeDisfluencies": { + "type": "boolean", + "description": "This enables removal of disfluencies (um, uh) from the transcript to create cleaner, more professional output.\n\nThis is only supported for the English language transcriber.\n\n@default false", + "example": true, + "default": false + }, + "minimumSpeechDuration": { + "type": "number", + "description": "This is the minimum duration in seconds for speech segments. Shorter segments will be filtered out. Helps remove noise and improve accuracy.\n\n@default 0.0", + "example": 0.2, + "minimum": 0, + "maximum": 5, + "default": 0 + }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8238,7 +8316,8 @@ } }, "required": [ - "provider" + "provider", + "customVocabulary" ] }, "TalkscriberTranscriber": { @@ -8365,7 +8444,7 @@ ] }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8391,6 +8470,7 @@ "type": "string", "description": "This is the model that will be used for the transcription.", "enum": [ + "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", @@ -8453,7 +8533,7 @@ ] }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8547,7 +8627,7 @@ ] }, "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "description": "This is the plan for transcriber provider fallbacks in the event that the primary transcriber provider fails.", "allOf": [ { "$ref": "#/components/schemas/FallbackTranscriberPlan" @@ -8574,6 +8654,7 @@ "type": "string", "description": "This is the language that will be set for the transcription.", "enum": [ + "multi", "en" ] }, @@ -8591,29 +8672,42 @@ }, "endOfTurnConfidenceThreshold": { "type": "number", - "description": "This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected.\n\n@min 0\n@max 1\n@default 0.7", + "description": "This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@min 0\n@max 1\n@default 0.7", "minimum": 0, "maximum": 1, "example": 0.7 }, "minEndOfTurnSilenceWhenConfident": { "type": "number", - "description": "This is the minimum end of turn silence when confident in milliseconds.\n\n@default 160", + "description": "This is the minimum end of turn silence when confident in milliseconds.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@default 160", "minimum": 0, "example": 160 }, "wordFinalizationMaxWaitTime": { "type": "number", - "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", + "deprecated": true, "minimum": 0, "example": 160 }, "maxTurnSilence": { "type": "number", - "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", + "description": "This is the maximum turn silence time in milliseconds.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n@default 400", "minimum": 0, "example": 400 }, + "vadAssistedEndpointingEnabled": { + "type": "boolean", + "description": "Use VAD to assist with endpointing decisions from the transcriber.\nWhen enabled, transcriber endpointing will be buffered if VAD detects the user is still speaking, preventing premature turn-taking.\nWhen disabled, transcriber endpointing will be used immediately regardless of VAD state, allowing for quicker but more aggressive turn-taking.\nNote: Only used if startSpeakingPlan.smartEndpointingPlan is not set.\n\n@default true", + "example": true + }, + "speechModel": { + "type": "string", + "description": "This is the speech model used for the streaming session.\nNote: Keyterms prompting is not supported with multilingual streaming.\n@default 'universal-streaming-english'", + "enum": [ + "universal-streaming-english", + "universal-streaming-multilingual" + ] + }, "realtimeUrl": { "type": "string", "description": "The WebSocket URL that the transcriber connects to." @@ -8626,6 +8720,14 @@ "maxLength": 2500 } }, + "keytermsPrompt": { + "description": "Keyterms prompting improves recognition accuracy for specific words and phrases.\nCan include up to 100 keyterms, each up to 50 characters.\nCosts an additional $0.04/hour when enabled.", + "type": "array", + "items": { + "type": "string", + "maxLength": 50 + } + }, "endUtteranceSilenceThreshold": { "type": "number", "description": "The duration of the end utterance silence threshold in milliseconds." @@ -9105,7 +9207,8 @@ "base-conversationalai", "base-voicemail", "base-video", - "whisper" + "whisper", + "flux-general-en" ] }, { @@ -9171,6 +9274,7 @@ "pl", "pt", "pt-BR", + "pt-PT", "ro", "ru", "sk", @@ -9222,6 +9326,27 @@ "maximum": 1, "example": 0.4 }, + "eagerEotThreshold": { + "type": "number", + "description": "Eager end-of-turn confidence required to fire a eager end-of-turn event. Setting a value here will enable EagerEndOfTurn and SpeechResumed events. It is disabled by default. Only used with Flux models.", + "minimum": 0, + "maximum": 1, + "example": 0.3 + }, + "eotThreshold": { + "type": "number", + "description": "End-of-turn confidence required to finish a turn. Only used with Flux models.\n\n@default 0.7", + "minimum": 0.5, + "maximum": 0.9, + "example": 0.7 + }, + "eotTimeoutMs": { + "type": "number", + "description": "A turn will be finished when this much time has passed after speech, regardless of EOT confidence. Only used with Flux models.\n\n@default 5000", + "minimum": 500, + "maximum": 10000, + "example": 5000 + }, "keywords": { "description": "These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here.", "type": "array", @@ -9259,14 +9384,20 @@ ] }, "model": { - "type": "string", "description": "This is the model that will be used for the transcription.", - "enum": [ - "scribe_v1" + "oneOf": [ + { + "enum": [ + "scribe_v1", + "scribe_v2", + "scribe_v2_realtime" + ] + } ] }, "language": { "type": "string", + "description": "This is the language that will be used for the transcription.", "enum": [ "aa", "ab", @@ -9454,6 +9585,34 @@ "zh", "zu" ] + }, + "silenceThresholdSeconds": { + "type": "number", + "description": "This is the number of seconds of silence before VAD commits (0.3-3.0).", + "minimum": 0.3, + "maximum": 3, + "example": 1.5 + }, + "confidenceThreshold": { + "type": "number", + "description": "This is the VAD sensitivity (0.1-0.9, lower indicates more sensitive).", + "minimum": 0.1, + "maximum": 0.9, + "example": 0.4 + }, + "minSpeechDurationMs": { + "type": "number", + "description": "This is the minimum speech duration for VAD (50-2000ms).", + "minimum": 50, + "maximum": 2000, + "example": 100 + }, + "minSilenceDurationMs": { + "type": "number", + "description": "This is the minimum silence duration for VAD (50-2000ms).", + "minimum": 50, + "maximum": 2000, + "example": 100 } }, "required": [ @@ -9783,6 +9942,249 @@ "$ref": "#/components/schemas/GladiaCustomVocabularyConfigDTO" } ] + }, + "region": { + "type": "string", + "enum": [ + "us-west", + "eu-west" + ], + "description": "Region for processing audio (us-west or eu-west)", + "example": "us-west" + }, + "receivePartialTranscripts": { + "type": "boolean", + "example": false, + "description": "Enable partial transcripts for low-latency streaming transcription" + } + }, + "required": [ + "provider" + ] + }, + "FallbackSonioxTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "soniox" + ] + }, + "model": { + "type": "string", + "enum": [ + "stt-rt-v4" + ], + "description": "The Soniox model to use for transcription." + }, + "language": { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu" + ], + "description": "The language for transcription. Uses ISO 639-1 codes. Soniox supports 60+ languages with a single universal model." + }, + "languageHintsStrict": { + "type": "boolean", + "description": "When enabled, restricts transcription to the language specified in the language field. When disabled, the model can detect and transcribe any of 60+ supported languages. Defaults to true." + }, + "maxEndpointDelayMs": { + "type": "number", + "minimum": 500, + "maximum": 3000, + "description": "Maximum delay in milliseconds between when the speaker stops and when the endpoint is detected. Lower values mean faster turn-taking but more false endpoints. Range: 500-3000. Default: 500." + }, + "customVocabulary": { + "description": "Custom vocabulary terms to boost recognition accuracy. Useful for brand names, product names, and domain-specific terminology. Maps to Soniox context.terms.", + "type": "array", + "items": { + "type": "string" + } } }, "required": [ @@ -9842,8 +10244,10 @@ "lv", "lt", "ms", + "en_ms", "mt", "cmn", + "cmn_en", "mr", "mn", "no", @@ -9855,9 +10259,12 @@ "sk", "sl", "es", + "en_es", "sw", "sv", + "tl", "ta", + "en_ta", "th", "tr", "uk", @@ -9866,10 +10273,91 @@ "vi", "cy" ] + }, + "operatingPoint": { + "type": "string", + "description": "This is the operating point for the transcription. Choose between `standard` for faster turnaround with strong accuracy or `enhanced` for highest accuracy when precision is critical.\n\n@default 'enhanced'", + "example": "enhanced", + "enum": [ + "standard", + "enhanced" + ], + "default": "enhanced" + }, + "region": { + "type": "string", + "description": "This is the region for the Speechmatics API. Choose between EU (Europe) and US (United States) regions for lower latency and data sovereignty compliance.\n\n@default 'eu'", + "example": "us", + "enum": [ + "eu", + "us" + ], + "default": "eu" + }, + "enableDiarization": { + "type": "boolean", + "description": "This enables speaker diarization, which identifies and separates speakers in the transcription. Essential for multi-speaker conversations and conference calls.\n\n@default false", + "example": true, + "default": false + }, + "maxDelay": { + "type": "number", + "description": "This sets the maximum delay in milliseconds for partial transcripts. Balances latency and accuracy.\n\n@default 3000", + "example": 1500, + "minimum": 500, + "maximum": 10000, + "default": 3000 + }, + "customVocabulary": { + "example": [ + { + "content": "Speechmatics", + "soundsLike": [ + "speech mattix" + ] + } + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/SpeechmaticsCustomVocabularyItem" + } + }, + "numeralStyle": { + "type": "string", + "description": "This controls how numbers, dates, currencies, and other entities are formatted in the transcription output.\n\n@default 'written'", + "example": "spoken", + "enum": [ + "written", + "spoken" + ], + "default": "written" + }, + "endOfTurnSensitivity": { + "type": "number", + "description": "This is the sensitivity level for end-of-turn detection, which determines when a speaker has finished talking. Higher values are more sensitive.\n\n@default 0.5", + "example": 0.8, + "minimum": 0, + "maximum": 1, + "default": 0.5 + }, + "removeDisfluencies": { + "type": "boolean", + "description": "This enables removal of disfluencies (um, uh) from the transcript to create cleaner, more professional output.\n\nThis is only supported for the English language transcriber.\n\n@default false", + "example": true, + "default": false + }, + "minimumSpeechDuration": { + "type": "number", + "description": "This is the minimum duration in seconds for speech segments. Shorter segments will be filtered out. Helps remove noise and improve accuracy.\n\n@default 0.0", + "example": 0.2, + "minimum": 0, + "maximum": 5, + "default": 0 } }, "required": [ - "provider" + "provider", + "customVocabulary" ] }, "FallbackTalkscriberTranscriber": { @@ -10014,6 +10502,7 @@ "type": "string", "description": "This is the model that will be used for the transcription.", "enum": [ + "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", @@ -10176,6 +10665,19 @@ "langfuse" ] }, + "promptName": { + "type": "string", + "description": "The name of a Langfuse prompt to link generations to. This enables tracking which prompt version was used for each generation. https://langfuse.com/docs/prompt-management/features/link-to-traces" + }, + "promptVersion": { + "type": "number", + "description": "The version number of the Langfuse prompt to link generations to. Used together with promptName to identify the exact prompt version. https://langfuse.com/docs/prompt-management/features/link-to-traces", + "minimum": 1 + }, + "traceName": { + "type": "string", + "description": "Custom name for the Langfuse trace. Supports Liquid templates.\n\nAvailable variables:\n- {{ call.id }} - Call UUID\n- {{ call.type }} - 'inboundPhoneCall', 'outboundPhoneCall', 'webCall'\n- {{ assistant.name }} - Assistant name\n- {{ assistant.id }} - Assistant ID\n\nExample: \"{{ assistant.name }} - {{ call.type }}\"\n\nDefaults to call ID if not provided." + }, "tags": { "description": "This is an array of tags to be added to the Langfuse trace. Tags allow you to categorize and filter traces. https://langfuse.com/docs/tracing-features/tags", "type": "array", @@ -10823,299 +11325,11 @@ ], "description": "The type of tool. \"dtmf\" for DTMF tool." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] - } - }, - "required": [ - "type" - ] - }, - "CreateEndCallToolDTO": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "endCall" - ], - "description": "The type of tool. \"endCall\" for End Call tool." - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] - } - }, - "required": [ - "type" - ] - }, - "CreateVoicemailToolDTO": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "description": "The type of tool. \"voicemail\" for Voicemail tool.", - "enum": [ - "voicemail" - ] - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] - } - }, - "required": [ - "type" - ] - }, - "JsonSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of output you'd like.\n\n`string`, `number`, `integer`, `boolean` are the primitive types and should be obvious.\n\n`array` and `object` are more interesting and quite powerful. They allow you to define nested structures.\n\nFor `array`, you can define the schema of the items in the array using the `items` property.\n\nFor `object`, you can define the properties of the object using the `properties` property.", - "enum": [ - "string", - "number", - "integer", - "boolean", - "array", - "object" - ] - }, - "items": { - "type": "object", - "description": "This is required if the type is \"array\". This is the schema of the items in the array.\n\nThis is of type JsonSchema. However, Swagger doesn't support circular references." - }, - "properties": { - "type": "object", - "description": "This is required if the type is \"object\". This specifies the properties of the object.\n\nThis is a map of string to JsonSchema. However, Swagger doesn't support circular references." - }, - "description": { - "type": "string", - "description": "This is the description to help the model understand what it needs to output." - }, - "pattern": { - "type": "string", - "description": "This is the pattern of the string. This is a regex that will be used to validate the data in question. To use a common format, use the `format` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs#supported-properties" - }, - "format": { - "type": "string", - "description": "This is the format of the string. To pass a regex, use the `pattern` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs?api-mode=chat&type-restrictions=string-restrictions", - "enum": [ - "date-time", - "time", - "date", - "duration", - "email", - "hostname", - "ipv4", - "ipv6", - "uuid" - ] - }, - "required": { - "description": "This is a list of properties that are required.\n\nThis only makes sense if the type is \"object\".", - "type": "array", - "items": { - "type": "string" - } - }, - "enum": { - "description": "This array specifies the allowed values that can be used to restrict the output of the model.", - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string", - "description": "This is the title of the schema." - } - }, - "required": [ - "type" - ] - }, - "OpenAIFunctionParameters": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.", - "enum": [ - "object" - ] - }, - "properties": { - "type": "object", - "description": "This provides a description of the properties required by the function.\nJSON Schema can be used to specify expectations for each property.\nRefer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.", - "additionalProperties": { - "$ref": "#/components/schemas/JsonSchema" - } - }, - "required": { - "description": "This specifies the properties that are required by the function.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "type", - "properties" - ] - }, - "OpenAIFunction": { - "type": "object", - "properties": { - "strict": { + "sipInfoDtmfEnabled": { "type": "boolean", - "description": "This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the [OpenAI guide](https://openai.com/index/introducing-structured-outputs-in-the-api/).\n\n@default false", + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", "default": false }, - "name": { - "type": "string", - "description": "This is the the name of the function to be called.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", - "maxLength": 64, - "pattern": "/^[a-zA-Z0-9_-]{1,64}$/" - }, - "description": { - "type": "string", - "description": "This is the description of what the function does, used by the AI to choose when and how to call the function.", - "maxLength": 1000 - }, - "parameters": { - "description": "These are the parameters the functions accepts, described as a JSON Schema object.\n\nSee the [OpenAI guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format.\n\nOmitting parameters defines a function with an empty parameter list.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunctionParameters" - } - ] - } - }, - "required": [ - "name" - ] - }, - "CreateFunctionToolDTO": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool. \"function\" for Function tool." - }, - "async": { - "type": "boolean", - "example": false, - "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." - }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunction" - } - ] - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -11129,18 +11343,7 @@ "type" ] }, - "GhlToolMetadata": { - "type": "object", - "properties": { - "workflowId": { - "type": "string" - }, - "locationId": { - "type": "string" - } - } - }, - "CreateGhlToolDTO": { + "CreateEndCallToolDTO": { "type": "object", "properties": { "messages": { @@ -11170,12 +11373,9 @@ "type": { "type": "string", "enum": [ - "ghl" + "endCall" ], - "description": "The type of tool. \"ghl\" for GHL tool." - }, - "metadata": { - "$ref": "#/components/schemas/GhlToolMetadata" + "description": "The type of tool. \"endCall\" for End Call tool." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -11187,22 +11387,10 @@ } }, "required": [ - "type", - "metadata" + "type" ] }, - "MakeToolMetadata": { - "type": "object", - "properties": { - "scenarioId": { - "type": "number" - }, - "triggerHookId": { - "type": "number" - } - } - }, - "CreateMakeToolDTO": { + "CreateVoicemailToolDTO": { "type": "object", "properties": { "messages": { @@ -11231,13 +11419,16 @@ }, "type": { "type": "string", + "description": "The type of tool. \"voicemail\" for Voicemail tool.", "enum": [ - "make" - ], - "description": "The type of tool. \"make\" for Make tool." + "voicemail" + ] }, - "metadata": { - "$ref": "#/components/schemas/MakeToolMetadata" + "beepDetectionEnabled": { + "type": "boolean", + "description": "This is the flag that enables beep detection for voicemail detection and applies only for twilio based calls.\n\n@default false", + "default": false, + "example": false }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -11249,188 +11440,147 @@ } }, "required": [ - "type", - "metadata" + "type" ] }, - "CustomMessage": { + "JsonSchema": { "type": "object", "properties": { - "contents": { - "type": "array", - "description": "This is an alternative to the `content` property. It allows to specify variants of the same content, one per language.\n\nUsage:\n- If your assistants are multilingual, you can provide content for each language.\n- If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.\n\nThis will override the `content` property.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TextContent", - "title": "Text" - } - ] - } - }, "type": { "type": "string", - "description": "This is a custom message.", + "description": "This is the type of output you'd like.\n\n`string`, `number`, `integer`, `boolean` are the primitive types and should be obvious.\n\n`array` and `object` are more interesting and quite powerful. They allow you to define nested structures.\n\nFor `array`, you can define the schema of the items in the array using the `items` property.\n\nFor `object`, you can define the properties of the object using the `properties` property.", "enum": [ - "custom-message" + "string", + "number", + "integer", + "boolean", + "array", + "object" ] }, - "content": { - "type": "string", - "description": "This is the content that the assistant will say when this message is triggered.", - "maxLength": 1000 - } - }, - "required": [ - "type" - ] - }, - "TransferDestinationAssistant": { - "type": "object", - "properties": { - "message": { - "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant.\n\nThis accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the `contents` field.", - "oneOf": [ - { - "type": "string" - }, + "items": { + "description": "This is required if the type is \"array\". This is the schema of the items in the array. This is a recursive reference to JsonSchema.", + "allOf": [ { - "$ref": "#/components/schemas/CustomMessage" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "type": { - "type": "string", - "enum": [ - "assistant" - ] + "properties": { + "type": "object", + "description": "This is required if the type is \"object\". This specifies the properties of the object. This is a map of property names to JsonSchema objects.", + "additionalProperties": { + "$ref": "#/components/schemas/JsonSchema" + } }, - "transferMode": { + "description": { "type": "string", - "description": "This is the mode to use for the transfer. Defaults to `rolling-history`.\n\n- `rolling-history`: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n system: assistant2 system message\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n- `swap-system-message-in-history`: This replaces the original system message with the new assistant's system message on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n- `delete-history`: This deletes the entire conversation history on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant2 first message\n user: Yes, please\n assistant: how can i help?\n user: i need help with my account\n\n- `swap-system-message-in-history-and-remove-transfer-tool-messages`: This replaces the original system message with the new assistant's system message on transfer and removes transfer tool messages from conversation history sent to the LLM.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n transfer-tool\n transfer-tool-result\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n@default 'rolling-history'", - "enum": [ - "rolling-history", - "swap-system-message-in-history", - "swap-system-message-in-history-and-remove-transfer-tool-messages", - "delete-history" - ] + "description": "This is the description to help the model understand what it needs to output." }, - "assistantName": { + "pattern": { "type": "string", - "description": "This is the assistant to transfer the call to." + "description": "This is the pattern of the string. This is a regex that will be used to validate the data in question. To use a common format, use the `format` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs#supported-properties" }, - "description": { + "format": { "type": "string", - "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." - } - }, - "required": [ - "type", - "assistantName" - ] - }, - "TransferFallbackPlan": { - "type": "object", - "properties": { - "message": { - "description": "This is the message the assistant will deliver to the customer if the transfer fails.", - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/CustomMessage" - } + "description": "This is the format of the string. To pass a regex, use the `pattern` property instead.\n\nOpenAI documentation: https://platform.openai.com/docs/guides/structured-outputs?api-mode=chat&type-restrictions=string-restrictions", + "enum": [ + "date-time", + "time", + "date", + "duration", + "email", + "hostname", + "ipv4", + "ipv6", + "uuid" ] }, - "endCallEnabled": { - "type": "boolean", - "description": "This controls what happens after delivering the failure message to the customer.\n- true: End the call after delivering the failure message (default)\n- false: Keep the assistant on the call to continue handling the customer's request\n\n@default true", - "default": true + "required": { + "description": "This is a list of properties that are required.\n\nThis only makes sense if the type is \"object\".", + "type": "array", + "items": { + "type": "string" + } + }, + "enum": { + "description": "This array specifies the allowed values that can be used to restrict the output of the model.", + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "This is the title of the schema." } }, "required": [ - "message" + "type" ] }, - "TransferAssistantModel": { + "OpenAIFunctionParameters": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", - "description": "The model provider for the transfer assistant", + "description": "This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.", "enum": [ - "openai", - "anthropic", - "google", - "custom-llm" + "object" ] }, - "model": { - "type": "string", - "description": "The model name - must be compatible with the selected provider", - "example": "gpt-4o" - }, - "messages": { - "type": "array", - "description": "These are the messages used to configure the transfer assistant.\n\n@default: ```\n[\n {\n role: 'system',\n content: 'You are a transfer assistant designed to facilitate call transfers. Your core responsibility is to manage the transfer process efficiently.\\n\\n## Core Responsibility\\n- Facilitate the transfer process by using transferSuccessful or transferCancel tools appropriately\\n\\n## When to Respond\\n- Answer questions about the transfer process or provide summaries when specifically asked by the operator\\n- Respond to direct questions about the current transfer situation\\n\\n## What to Avoid\\n- Do not discuss topics unrelated to the transfer\\n- Do not engage in general conversation\\n- Keep all interactions focused on facilitating the transfer\\n\\n## Transfer Tools\\n- Use transferSuccessful when the transfer should proceed\\n- Use transferCancel when the transfer cannot be completed\\n\\nStay focused on your core responsibility of facilitating transfers.'\n }\n]```\n\n**Default Behavior:** If you don't provide any messages or don't include a system message as the first message, the default system message above will be automatically added.\n\n**Override Default:** To replace the default system message, provide your own system message as the first message in the array.\n\n**Add Context:** You can provide additional messages (user, assistant, etc.) to add context while keeping the default system message, or combine them with your custom system message." + "properties": { + "type": "object", + "description": "This provides a description of the properties required by the function.\nJSON Schema can be used to specify expectations for each property.\nRefer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.", + "additionalProperties": { + "$ref": "#/components/schemas/JsonSchema" + } }, - "tools": { + "required": { + "description": "This specifies the properties that are required by the function.", "type": "array", - "description": "Tools available to the transfer assistant during warm-transfer-experimental.\n\n**Default Behavior:** The transfer assistant will ALWAYS have both `transferSuccessful` and `transferCancel` tools automatically added, regardless of what you provide here.\n\n**Default Tools:**\n- `transferSuccessful`: \"Call this function to confirm the transfer is successful and connect the customer. Use this when you detect a human has answered and is ready to take the call.\"\n- `transferCancel`: \"Call this function to cancel the transfer when no human answers or transfer should not proceed. Use this when you detect voicemail, busy signal, or no answer.\"\n\n**Customization:** You can override the default tools by providing `transferSuccessful` and/or `transferCancel` tools with custom `function` or `messages` configurations.\n\n**Additional Tools:** You can also provide other tools, but the two transfer tools will always be present and available to the assistant." + "items": { + "type": "string" + } } }, "required": [ - "provider", - "model" + "type", + "properties" ] }, - "TransferAssistant": { + "OpenAIFunction": { "type": "object", "properties": { + "strict": { + "type": "boolean", + "description": "This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the [OpenAI guide](https://openai.com/index/introducing-structured-outputs-in-the-api/).\n\n@default false", + "default": false + }, "name": { "type": "string", - "description": "Optional name for the transfer assistant", - "maxLength": 100, - "default": "transfer-assistant", - "example": "Sales Transfer Assistant" + "description": "This is the the name of the function to be called.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.", + "maxLength": 64, + "pattern": "/^[a-zA-Z0-9_-]{1,64}$/" }, - "model": { - "description": "Model configuration for the transfer assistant", + "description": { + "type": "string", + "description": "This is the description of what the function does, used by the AI to choose when and how to call the function." + }, + "parameters": { + "description": "These are the parameters the functions accepts, described as a JSON Schema object.\n\nSee the [OpenAI guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format.\n\nOmitting parameters defines a function with an empty parameter list.", "allOf": [ { - "$ref": "#/components/schemas/TransferAssistantModel" + "$ref": "#/components/schemas/OpenAIFunctionParameters" } ] - }, - "firstMessage": { - "type": "string", - "description": "This is the first message that the transfer assistant will say.\nThis can also be a URL to a custom audio file.\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", - "example": "Hello! I understand you need to be transferred. Let me connect you." - }, - "firstMessageMode": { - "type": "string", - "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state.\n\n@default 'assistant-speaks-first'", - "enum": [ - "assistant-speaks-first", - "assistant-speaks-first-with-model-generated-message", - "assistant-waits-for-user" - ], - "example": "assistant-speaks-first" - }, - "maxDurationSeconds": { - "type": "number", - "description": "This is the maximum duration in seconds for the transfer assistant conversation.\nAfter this time, the transfer will be cancelled automatically.\n@default 120", - "minimum": 10, - "maximum": 43200, - "example": 120 } }, "required": [ - "model" + "name" ] }, - "TransferCancelToolUserEditable": { + "CreateFunctionToolDTO": { "type": "object", "properties": { "messages": { @@ -11460,9 +11610,30 @@ "type": { "type": "string", "enum": [ - "transferCancel" + "function" ], - "description": "The type of tool. \"transferCancel\" for Transfer Cancel tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to cancel an ongoing transfer and return the call back to the original assistant when the transfer cannot be completed." + "description": "The type of tool. \"function\" for Function tool." + }, + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "function": { + "description": "This is the function definition of the tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -11477,7 +11648,18 @@ "type" ] }, - "TransferSuccessfulToolUserEditable": { + "GhlToolMetadata": { + "type": "object", + "properties": { + "workflowId": { + "type": "string" + }, + "locationId": { + "type": "string" + } + } + }, + "CreateGhlToolDTO": { "type": "object", "properties": { "messages": { @@ -11507,9 +11689,12 @@ "type": { "type": "string", "enum": [ - "transferSuccessful" + "ghl" ], - "description": "The type of tool. \"transferSuccessful\" for Transfer Successful tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to confirm that the transfer should proceed and finalize the handoff to the destination." + "description": "The type of tool. \"ghl\" for GHL tool." + }, + "metadata": { + "$ref": "#/components/schemas/GhlToolMetadata" }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -11521,115 +11706,105 @@ } }, "required": [ - "type" + "type", + "metadata" ] }, - "SummaryPlan": { + "MakeToolMetadata": { "type": "object", "properties": { - "messages": { - "description": "These are the messages used to generate the summary.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences. DO NOT return anything except the summary.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: The transcript of the call from `call.artifact.transcript` \n- {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content` \n- {{messages}}: The messages of the call from `assistant.model.messages` \n- {{endedReason}}: The ended reason of the call from `call.endedReason`", - "type": "array", - "items": { - "type": "object" - } - }, - "enabled": { - "type": "boolean", - "description": "This determines whether a summary is generated and stored in `call.analysis.summary`. Defaults to true.\n\nUsage:\n- If you want to disable the summary, set this to false.\n\n@default true" + "scenarioId": { + "type": "number" }, - "timeoutSeconds": { - "type": "number", - "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.summary` will be empty.\n\nUsage:\n- To guarantee the summary is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", - "minimum": 1, - "maximum": 60 + "triggerHookId": { + "type": "number" } } }, - "TransferPlan": { + "CreateMakeToolDTO": { "type": "object", "properties": { - "mode": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { "type": "string", - "description": "This configures how transfer is executed and the experience of the destination party receiving the call.\n\nUsage:\n- `blind-transfer`: The assistant forwards the call to the destination without any message or summary.\n- `blind-transfer-add-summary-to-sip-header`: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.\n- `warm-transfer-say-message`: The assistant dials the destination, delivers the `message` to the destination party, connects the customer, and leaves the call.\n- `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.\n- `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer.\n- `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.\n- `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call.\n- `warm-transfer-experimental`: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the `fallbackMessage` to the customer and optionally ends the call.\n\n@default 'blind-transfer'", "enum": [ - "blind-transfer", - "blind-transfer-add-summary-to-sip-header", - "warm-transfer-say-message", - "warm-transfer-say-summary", - "warm-transfer-twiml", - "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message", - "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary", - "warm-transfer-experimental" - ] + "make" + ], + "description": "The type of tool. \"make\" for Make tool." }, - "message": { - "description": "This is the message the assistant will deliver to the destination party before connecting the customer.\n\nUsage:\n- Used only when `mode` is `blind-transfer-add-summary-to-sip-header`, `warm-transfer-say-message`, `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`, or `warm-transfer-experimental`.", - "oneOf": [ - { - "type": "string" - }, + "metadata": { + "$ref": "#/components/schemas/MakeToolMetadata" + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "$ref": "#/components/schemas/CustomMessage" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] + } + }, + "required": [ + "type", + "metadata" + ] + }, + "CustomMessage": { + "type": "object", + "properties": { + "contents": { + "type": "array", + "description": "This is an alternative to the `content` property. It allows to specify variants of the same content, one per language.\n\nUsage:\n- If your assistants are multilingual, you can provide content for each language.\n- If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.\n\nThis will override the `content` property.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TextContent", + "title": "Text" + } + ] + } }, - "timeout": { - "type": "number", - "description": "This is the timeout in seconds for the warm-transfer-wait-for-operator-to-speak-first-and-then-say-message/summary\n\n@default 60", - "minimum": 1, - "maximum": 600, - "default": 60 - }, - "sipVerb": { - "type": "object", - "description": "This specifies the SIP verb to use while transferring the call.\n- 'refer': Uses SIP REFER to transfer the call (default)\n- 'bye': Ends current call with SIP BYE\n- 'dial': Uses SIP DIAL to transfer the call", - "default": "refer", + "type": { + "type": "string", + "description": "This is a custom message.", "enum": [ - "refer", - "bye", - "dial" + "custom-message" ] }, - "holdAudioUrl": { - "type": "string", - "description": "This is the URL to an audio file played while the customer is on hold during transfer.\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- Used when transferring calls to play hold audio for the customer.\n- Must be a publicly accessible URL to an audio file.\n- Supported formats: MP3 and WAV.\n- If not provided, the default hold audio will be used." - }, - "transferCompleteAudioUrl": { - "type": "string", - "description": "This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party.\nIt can be used to play a custom sound like 'beep' to notify that the transfer is complete.\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- Used when transferring calls to play hold audio for the destination party.\n- Must be a publicly accessible URL to an audio file.\n- Supported formats: MP3 and WAV." - }, - "twiml": { + "content": { "type": "string", - "description": "This is the TwiML instructions to execute on the destination call leg before connecting the customer.\n\nUsage:\n- Used only when `mode` is `warm-transfer-twiml`.\n- Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs.\n- Maximum length is 4096 characters.\n\nExample:\n```\nHello, transferring a customer to you.\n\nThey called about billing questions.\n```", - "maxLength": 4096 - }, - "summaryPlan": { - "description": "This is the plan for generating a summary of the call to present to the destination party.\n\nUsage:\n- Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary` or `warm-transfer-experimental`.", - "allOf": [ - { - "$ref": "#/components/schemas/SummaryPlan" - } - ] - }, - "sipHeadersInReferToEnabled": { - "type": "boolean", - "description": "This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params.\n\n@default false" - }, - "fallbackPlan": { - "description": "This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human).\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- If not provided when using `warm-transfer-experimental`, a default message will be used.", - "allOf": [ - { - "$ref": "#/components/schemas/TransferFallbackPlan" - } - ] + "description": "This is the content that the assistant will say when this message is triggered.", + "maxLength": 1000 } }, "required": [ - "mode" + "type" ] }, - "TransferDestinationNumber": { + "TransferDestinationAssistant": { "type": "object", "properties": { "message": { @@ -11646,38 +11821,22 @@ "type": { "type": "string", "enum": [ - "number" + "assistant" ] }, - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true - }, - "number": { - "type": "string", - "description": "This is the phone number to transfer the call to.", - "minLength": 3, - "maxLength": 40 - }, - "extension": { + "transferMode": { "type": "string", - "description": "This is the extension to dial after transferring the call to the `number`.", - "minLength": 1, - "maxLength": 10 + "description": "This is the mode to use for the transfer. Defaults to `rolling-history`.\n\n- `rolling-history`: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n system: assistant2 system message\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n- `swap-system-message-in-history`: This replaces the original system message with the new assistant's system message on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n- `delete-history`: This deletes the entire conversation history on transfer.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant2 first message\n user: Yes, please\n assistant: how can i help?\n user: i need help with my account\n\n- `swap-system-message-in-history-and-remove-transfer-tool-messages`: This replaces the original system message with the new assistant's system message on transfer and removes transfer tool messages from conversation history sent to the LLM.\n\n Example:\n\n Pre-transfer:\n system: assistant1 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n transfer-tool\n transfer-tool-result\n assistant: (destination.message)\n\n Post-transfer:\n system: assistant2 system message\n assistant: assistant1 first message\n user: hey, good morning\n assistant: how can i help?\n user: i need help with my account\n assistant: (destination.message)\n assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)\n\n@default 'rolling-history'", + "enum": [ + "rolling-history", + "swap-system-message-in-history", + "swap-system-message-in-history-and-remove-transfer-tool-messages", + "delete-history" + ] }, - "callerId": { + "assistantName": { "type": "string", - "description": "This is the caller ID to use when transferring the call to the `number`.\n\nUsage:\n- If not provided, the caller ID will be the number the call is coming from. Example, +14151111111 calls in to and the assistant transfers out to +16470000000. +16470000000 will see +14151111111 as the caller.\n- To change this behavior, provide a `callerId`.\n- Set to '{{customer.number}}' to always use the customer's number as the caller ID.\n- Set to '{{phoneNumber.number}}' to always use the phone number of the assistant as the caller ID.\n- Set to any E164 number to always use that number as the caller ID. This needs to be a number that is owned or verified by your Transport provider like Twilio.\n\nFor Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid", - "maxLength": 40 - }, - "transferPlan": { - "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`", - "allOf": [ - { - "$ref": "#/components/schemas/TransferPlan" - } - ] + "description": "This is the assistant to transfer the call to." }, "description": { "type": "string", @@ -11686,14 +11845,14 @@ }, "required": [ "type", - "number" + "assistantName" ] }, - "TransferDestinationSip": { + "TransferFallbackPlan": { "type": "object", "properties": { "message": { - "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant.\n\nThis accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the `contents` field.", + "description": "This is the message the assistant will deliver to the customer if the transfer fails.", "oneOf": [ { "type": "string" @@ -11703,421 +11862,647 @@ } ] }, - "type": { + "endCallEnabled": { + "type": "boolean", + "description": "This controls what happens after delivering the failure message to the customer.\n- true: End the call after delivering the failure message (default)\n- false: Keep the assistant on the call to continue handling the customer's request\n\n@default true", + "default": true + } + }, + "required": [ + "message" + ] + }, + "TransferAssistantModel": { + "type": "object", + "properties": { + "provider": { "type": "string", + "description": "The model provider for the transfer assistant", "enum": [ - "sip" + "openai", + "anthropic", + "google", + "custom-llm" ] }, - "sipUri": { + "model": { "type": "string", - "description": "This is the SIP URI to transfer the call to." - }, - "transferPlan": { - "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`", - "allOf": [ - { - "$ref": "#/components/schemas/TransferPlan" - } - ] + "description": "The model name - must be compatible with the selected provider", + "example": "gpt-4o" }, - "sipHeaders": { - "type": "object", - "description": "These are custom headers to be added to SIP refer during transfer call." + "messages": { + "type": "array", + "description": "These are the messages used to configure the transfer assistant.\n\n@default: ```\n[\n {\n role: 'system',\n content: 'You are a transfer assistant designed to facilitate call transfers. Your core responsibility is to manage the transfer process efficiently.\\n\\n## Core Responsibility\\n- Facilitate the transfer process by using transferSuccessful or transferCancel tools appropriately\\n\\n## When to Respond\\n- Answer questions about the transfer process or provide summaries when specifically asked by the operator\\n- Respond to direct questions about the current transfer situation\\n\\n## What to Avoid\\n- Do not discuss topics unrelated to the transfer\\n- Do not engage in general conversation\\n- Keep all interactions focused on facilitating the transfer\\n\\n## Transfer Tools\\n- Use transferSuccessful when the transfer should proceed\\n- Use transferCancel when the transfer cannot be completed\\n\\nStay focused on your core responsibility of facilitating transfers.'\n }\n]```\n\n**Default Behavior:** If you don't provide any messages or don't include a system message as the first message, the default system message above will be automatically added.\n\n**Override Default:** To replace the default system message, provide your own system message as the first message in the array.\n\n**Add Context:** You can provide additional messages (user, assistant, etc.) to add context while keeping the default system message, or combine them with your custom system message." }, - "description": { - "type": "string", - "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." + "tools": { + "type": "array", + "description": "Tools available to the transfer assistant during warm-transfer-experimental.\n\n**Default Behavior:** The transfer assistant will ALWAYS have both `transferSuccessful` and `transferCancel` tools automatically added, regardless of what you provide here.\n\n**Default Tools:**\n- `transferSuccessful`: \"Call this function to confirm the transfer is successful and connect the customer. Use this when you detect a human has answered and is ready to take the call.\"\n- `transferCancel`: \"Call this function to cancel the transfer when no human answers or transfer should not proceed. Use this when you detect voicemail, busy signal, or no answer.\"\n\n**Customization:** You can override the default tools by providing `transferSuccessful` and/or `transferCancel` tools with custom `function` or `messages` configurations.\n\n**Additional Tools:** You can also provide other tools, but the two transfer tools will always be present and available to the assistant." } }, "required": [ - "type", - "sipUri" + "provider", + "model" ] }, - "CreateTransferCallToolDTO": { + "RegexOption": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, "type": { "type": "string", + "description": "This is the type of the regex option. Options are:\n- `ignore-case`: Ignores the case of the text being matched. Add\n- `whole-word`: Matches whole words only.\n- `multi-line`: Matches across multiple lines.", "enum": [ - "transferCall" + "ignore-case", + "whole-word", + "multi-line" ] }, - "destinations": { - "type": "array", - "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" - } - ] - } - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "enabled": { + "type": "boolean", + "description": "This is whether to enable the option.\n\n@default false" } }, "required": [ - "type" + "type", + "enabled" ] }, - "ContextEngineeringPlanLastNMessages": { + "AssistantCustomEndpointingRule": { "type": "object", "properties": { "type": { "type": "string", + "description": "This endpointing rule is based on the last assistant message before customer started speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the last assistant message\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you have yes/no questions in your use case like \"are you interested in a loan?\", you can set a shorter timeout.\n- If you have questions where the customer may pause to look up information like \"what's my account number?\", you can set a longer timeout.", "enum": [ - "lastNMessages" + "assistant" ] }, - "maxMessages": { + "regex": { + "type": "string", + "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." + }, + "regexOptions": { + "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []", + "type": "array", + "items": { + "$ref": "#/components/schemas/RegexOption" + } + }, + "timeoutSeconds": { "type": "number", - "description": "This is the maximum number of messages to include in the context engineering plan.", - "minimum": 0 + "description": "This is the endpointing timeout in seconds, if the rule is matched.", + "minimum": 0, + "maximum": 15 } }, "required": [ "type", - "maxMessages" + "regex", + "timeoutSeconds" ] }, - "ContextEngineeringPlanNone": { + "CustomerCustomEndpointingRule": { "type": "object", "properties": { "type": { "type": "string", + "description": "This endpointing rule is based on current customer message as they are speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the current customer transcription\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you want to wait longer while customer is speaking numbers, you can set a longer timeout.", "enum": [ - "none" + "customer" ] + }, + "regex": { + "type": "string", + "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." + }, + "regexOptions": { + "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []", + "type": "array", + "items": { + "$ref": "#/components/schemas/RegexOption" + } + }, + "timeoutSeconds": { + "type": "number", + "description": "This is the endpointing timeout in seconds, if the rule is matched.", + "minimum": 0, + "maximum": 15 } }, "required": [ - "type" + "type", + "regex", + "timeoutSeconds" ] }, - "ContextEngineeringPlanAll": { + "BothCustomEndpointingRule": { "type": "object", "properties": { "type": { "type": "string", + "description": "This endpointing rule is based on both the last assistant message and the current customer message as they are speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the last assistant message and the current customer transcription\n- If assistant message matches `assistantRegex` AND customer message matches `customerRegex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you want to wait longer while customer is speaking numbers, you can set a longer timeout.", "enum": [ - "all" + "both" ] + }, + "assistantRegex": { + "type": "string", + "description": "This is the regex pattern to match the assistant's message.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." + }, + "assistantRegexOptions": { + "description": "These are the options for the assistant's message regex match. Defaults to all disabled.\n\n@default []", + "type": "array", + "items": { + "$ref": "#/components/schemas/RegexOption" + } + }, + "customerRegex": { + "type": "string" + }, + "customerRegexOptions": { + "description": "These are the options for the customer's message regex match. Defaults to all disabled.\n\n@default []", + "type": "array", + "items": { + "$ref": "#/components/schemas/RegexOption" + } + }, + "timeoutSeconds": { + "type": "number", + "description": "This is the endpointing timeout in seconds, if the rule is matched.", + "minimum": 0, + "maximum": 15 } }, "required": [ - "type" + "type", + "assistantRegex", + "customerRegex", + "timeoutSeconds" ] }, - "VariableExtractionAlias": { + "VapiSmartEndpointingPlan": { "type": "object", "properties": { - "key": { - "type": "string", - "description": "This is the key of the variable.\n\nThis variable will be accessible during the call as `{{key}}` and stored in `call.artifact.variableValues` after the call.\n\nRules:\n- Must start with a letter (a-z, A-Z).\n- Subsequent characters can be letters, numbers, or underscores.\n- Minimum length of 1 and maximum length of 40.", - "minLength": 1, - "maxLength": 40, - "pattern": "/^[a-zA-Z][a-zA-Z0-9_]*$/" - }, - "value": { + "provider": { "type": "string", - "description": "This is the value of the variable.\n\nThis can reference existing variables, use filters, and perform transformations.\n\nExamples: \"{{name}}\", \"{{customer.email}}\", \"Hello {{name | upcase}}\"", - "maxLength": 10000 + "description": "This is the provider for the smart endpointing plan.", + "enum": [ + "vapi", + "livekit", + "custom-endpointing-model" + ], + "example": "vapi" } }, "required": [ - "key", - "value" + "provider" ] }, - "VariableExtractionPlan": { - "type": "object", - "properties": { - "schema": { - "description": "This is the schema to extract.\n\nExamples:\n1. To extract object properties, you can use the following schema:\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n2. To extract nested properties, you can use the following schema:\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n3. To extract array items, you can use the following schema:\n```json\n{\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4. To extract array of objects, you can use the following schema:\n\n```json\n{\n \"type\": \"array\",\n \"name\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] - }, - "aliases": { - "description": "These are additional variables to create.\n\nThese will be accessible during the call as `{{key}}` and stored in `call.artifact.variableValues` after the call.\n\nExample:\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{name}}\"\n },\n {\n \"key\": \"fullName\",\n \"value\": \"{{firstName}} {{lastName}}\"\n },\n {\n \"key\": \"greeting\",\n \"value\": \"Hello {{name}}, welcome to {{company}}!\"\n },\n {\n \"key\": \"customerCity\",\n \"value\": \"{{addresses[0].city}}\"\n },\n {\n \"key\": \"something\",\n \"value\": \"{{any liquid}}\"\n }\n ]\n}\n```\n\nThis will create variables `customerName`, `fullName`, `greeting`, `customerCity`, and `something`. To access these variables, you can reference them as `{{customerName}}`, `{{fullName}}`, `{{greeting}}`, `{{customerCity}}`, and `{{something}}`.", - "type": "array", - "items": { - "$ref": "#/components/schemas/VariableExtractionAlias" - } - } - } - }, - "HandoffDestinationAssistant": { + "LivekitSmartEndpointingPlan": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", + "description": "This is the provider for the smart endpointing plan.", "enum": [ - "assistant" - ] - }, - "contextEngineeringPlan": { - "description": "This is the plan for manipulating the message context before handing off the call to the next assistant.", - "oneOf": [ - { - "$ref": "#/components/schemas/ContextEngineeringPlanLastNMessages", - "title": "Last N Messages" - }, - { - "$ref": "#/components/schemas/ContextEngineeringPlanNone", - "title": "None" - }, - { - "$ref": "#/components/schemas/ContextEngineeringPlanAll", - "title": "All" - } - ] - }, - "assistantName": { - "type": "string", - "description": "This is the assistant to transfer the call to. You must provide either assistantName or assistantId." + "vapi", + "livekit", + "custom-endpointing-model" + ], + "example": "livekit" }, - "assistantId": { + "waitFunction": { "type": "string", - "description": "This is the assistant id to transfer the call to. You must provide either assistantName or assistantId." - }, - "assistant": { - "description": "This is a transient assistant to transfer the call to. You may provide a transient assistant in the response `handoff-destination-request` in a dynamic handoff.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "variableExtractionPlan": { - "description": "This is the variable extraction plan for the handoff tool.", - "allOf": [ - { - "$ref": "#/components/schemas/VariableExtractionPlan" - } + "description": "This expression describes how long the bot will wait to start speaking based on the likelihood that the user has reached an endpoint.\n\nThis is a millisecond valued function. It maps probabilities (real numbers on [0,1]) to milliseconds that the bot should wait before speaking ([0, \\infty]). Any negative values that are returned are set to zero (the bot can't start talking in the past).\n\nA probability of zero represents very high confidence that the caller has stopped speaking, and would like the bot to speak to them. A probability of one represents very high confidence that the caller is still speaking.\n\nUnder the hood, this is parsed into a mathjs expression. Whatever you use to write your expression needs to be valid with respect to mathjs\n\n@default \"20 + 500 * sqrt(x) + 2500 * x^3\"", + "examples": [ + "70 + 4000 * x", + "200 + 8000 * x", + "4000 * (1 - cos(pi * x))" ] - }, - "description": { - "type": "string", - "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ - "type" + "provider" ] }, - "HandoffDestinationDynamic": { + "CustomEndpointingModelSmartEndpointingPlan": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", + "description": "This is the provider for the smart endpointing plan. Use `custom-endpointing-model` for custom endpointing providers that are not natively supported.", "enum": [ - "dynamic" - ] + "vapi", + "livekit", + "custom-endpointing-model" + ], + "example": "custom-endpointing-model" }, "server": { - "description": "This is where Vapi will send the handoff-destination-request webhook in a dynamic handoff.\n\nThe order of precedence is:\n\n1. tool.server.url\n2. assistant.server.url\n3. phoneNumber.server.url\n4. org.server.url", + "description": "This is where the endpointing request will be sent. If not provided, will be sent to `assistant.server`. If that does not exist either, will be sent to `org.server`.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"call.endpointing.request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"message\": \"Hello, how are you?\",\n \"time\": 1234567890,\n \"secondsFromStart\": 0\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n{\n \"timeoutSeconds\": 0.5\n}\n\nThe timeout is the number of seconds to wait before considering the user's speech as finished. The endpointing timeout is automatically reset each time a new transcript is received (and another `call.endpointing.request` is sent).", "allOf": [ { "$ref": "#/components/schemas/Server" } ] - }, - "description": { - "type": "string", - "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ - "type" + "provider" ] }, - "CreateHandoffToolDTO": { + "TranscriptionEndpointingPlan": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "onPunctuationSeconds": { + "type": "number", + "description": "The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model. Defaults to 0.1.\n\nThis setting exists because the transcriber punctuates the transcription when it's more confident that customer has completed a thought.\n\n@default 0.1", + "minimum": 0, + "maximum": 3, + "example": 0.1 }, - "type": { - "type": "string", - "description": "This is the type of the tool.\nWhen you're using handoff tool, we recommend adding this to your system prompt\n---\n# System context\n\nYou are part of a multi-agent system designed to make agent coordination and execution easy. Agents uses two primary abstraction: **Agents** and **Handoffs**. An agent encompasses instructions and tools and can hand off a conversation to another agent when appropriate. Handoffs are achieved by calling a handoff function, generally named `handoff_to_`. Handoffs between agents are handled seamlessly in the background; do not mention or draw attention to these handoffs in your conversation with the user.\n\n# Agent context\n\n{put your agent system prompt here}\n---", - "enum": [ - "handoff" + "onNoPunctuationSeconds": { + "type": "number", + "description": "The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model. Defaults to 1.5.\n\nThis setting exists to catch the cases where the transcriber was not confident enough to punctuate the transcription, but the customer is done and has been silent for a long time.\n\n@default 1.5", + "minimum": 0, + "maximum": 3, + "example": 1.5 + }, + "onNumberSeconds": { + "type": "number", + "description": "The minimum number of seconds to wait after transcription ending with a number before sending a request to the model. Defaults to 0.4.\n\nThis setting exists because the transcriber will sometimes punctuate the transcription ending with a number, even though the customer hasn't uttered the full number. This happens commonly for long numbers when the customer reads the number in chunks.\n\n@default 0.5", + "minimum": 0, + "maximum": 3, + "example": 0.5 + } + } + }, + "StartSpeakingPlan": { + "type": "object", + "properties": { + "waitSeconds": { + "type": "number", + "description": "This is how long assistant waits before speaking. Defaults to 0.4.\n\nThis is the minimum it will wait but if there is latency is the pipeline, this minimum will be exceeded. This is intended as a stopgap in case the pipeline is moving too fast.\n\nExample:\n- If model generates tokens and voice generates bytes within 100ms, the pipeline still waits 300ms before outputting speech.\n\nUsage:\n- If the customer is taking long pauses, set this to a higher value.\n- If the assistant is accidentally jumping in too much, set this to a higher value.\n\n@default 0.4", + "minimum": 0, + "maximum": 5, + "example": 0.4 + }, + "smartEndpointingEnabled": { + "example": false, + "deprecated": true, + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "enum": [ + "livekit" + ] + } ] }, - "destinations": { + "smartEndpointingPlan": { + "description": "This is the plan for smart endpointing. Pick between Vapi smart endpointing, LiveKit, or custom endpointing model (or nothing). We strongly recommend using livekit endpointing when working in English. LiveKit endpointing is not supported in other languages, yet.\n\nIf this is set, it will override and take precedence over `transcriptionEndpointingPlan`.\nThis plan will still be overridden by any matching `customEndpointingRules`.\n\nIf this is not set, the system will automatically use the transcriber's built-in endpointing capabilities if available.", + "oneOf": [ + { + "$ref": "#/components/schemas/VapiSmartEndpointingPlan", + "title": "Vapi" + }, + { + "$ref": "#/components/schemas/LivekitSmartEndpointingPlan", + "title": "Livekit" + }, + { + "$ref": "#/components/schemas/CustomEndpointingModelSmartEndpointingPlan", + "title": "Custom Endpointing Model" + } + ] + }, + "customEndpointingRules": { "type": "array", - "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", + "description": "These are the custom endpointing rules to set an endpointing timeout based on a regex on the customer's speech or the assistant's last message.\n\nUsage:\n- If you have yes/no questions like \"are you interested in a loan?\", you can set a shorter timeout.\n- If you have questions where the customer may pause to look up information like \"what's my account number?\", you can set a longer timeout.\n- If you want to wait longer while customer is enumerating a list of numbers, you can set a longer timeout.\n\nThese rules have the highest precedence and will override both `smartEndpointingPlan` and `transcriptionEndpointingPlan` when a rule is matched.\n\nThe rules are evaluated in order and the first one that matches will be used.\n\nOrder of precedence for endpointing:\n1. customEndpointingRules (if any match)\n2. smartEndpointingPlan (if set)\n3. transcriptionEndpointingPlan\n\n@default []", "items": { "oneOf": [ { - "$ref": "#/components/schemas/HandoffDestinationAssistant", + "$ref": "#/components/schemas/AssistantCustomEndpointingRule", "title": "Assistant" }, { - "$ref": "#/components/schemas/HandoffDestinationDynamic", - "title": "Dynamic" + "$ref": "#/components/schemas/CustomerCustomEndpointingRule", + "title": "Customer" + }, + { + "$ref": "#/components/schemas/BothCustomEndpointingRule", + "title": "Both" } ] } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "transcriptionEndpointingPlan": { + "description": "This determines how a customer speech is considered done (endpointing) using the transcription of customer's speech.\n\nOnce an endpoint is triggered, the request is sent to `assistant.model`.\n\nNote: This plan is only used if `smartEndpointingPlan` is not set and transcriber does not have built-in endpointing capabilities. If both are provided, `smartEndpointingPlan` takes precedence.\nThis plan will also be overridden by any matching `customEndpointingRules`.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TranscriptionEndpointingPlan" } ] } - }, - "required": [ - "type" - ] + } }, - "CreateCustomKnowledgeBaseDTO": { + "SmartDenoisingPlan": { "type": "object", "properties": { - "provider": { - "type": "string", - "description": "This knowledge base is bring your own knowledge base implementation.", - "enum": [ - "custom-knowledge-base" + "enabled": { + "type": "boolean", + "description": "Whether smart denoising using Krisp is enabled.", + "default": true + } + } + }, + "FourierDenoisingPlan": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether Fourier denoising is enabled. Note that this is experimental and may not work as expected.", + "default": false + }, + "mediaDetectionEnabled": { + "type": "boolean", + "description": "Whether automatic media detection is enabled. When enabled, the filter will automatically\ndetect consistent background TV/music/radio and switch to more aggressive filtering settings.\nOnly applies when enabled is true.", + "example": true, + "default": true + }, + "staticThreshold": { + "type": "number", + "description": "Static threshold in dB used as fallback when no baseline is established.", + "example": -35, + "minimum": -80, + "maximum": 0, + "default": -35 + }, + "baselineOffsetDb": { + "type": "number", + "description": "How far below the rolling baseline to filter audio, in dB.\nLower values (e.g., -10) are more aggressive, higher values (e.g., -20) are more conservative.", + "example": -15, + "minimum": -30, + "maximum": -5, + "default": -15 + }, + "windowSizeMs": { + "type": "number", + "description": "Rolling window size in milliseconds for calculating the audio baseline.\nLarger windows adapt more slowly but are more stable.", + "example": 3000, + "minimum": 1000, + "maximum": 30000, + "default": 3000 + }, + "baselinePercentile": { + "type": "number", + "description": "Percentile to use for baseline calculation (1-99).\nHigher percentiles (e.g., 85) focus on louder speech, lower percentiles (e.g., 50) include quieter speech.", + "example": 85, + "minimum": 1, + "maximum": 99, + "default": 85 + } + } + }, + "BackgroundSpeechDenoisingPlan": { + "type": "object", + "properties": { + "smartDenoisingPlan": { + "description": "Whether smart denoising using Krisp is enabled.", + "allOf": [ + { + "$ref": "#/components/schemas/SmartDenoisingPlan" + } ] }, - "server": { - "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", + "fourierDenoisingPlan": { + "description": "Whether Fourier denoising is enabled. Note that this is experimental and may not work as expected.\n\nThis can be combined with smart denoising, and will be run afterwards.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/FourierDenoisingPlan" } ] } - }, - "required": [ - "provider", - "server" - ] + } }, - "KnowledgeBase": { + "TransferAssistant": { "type": "object", "properties": { "name": { "type": "string", - "description": "The name of the knowledge base", - "example": "My Knowledge Base" - }, - "provider": { - "type": "string", - "description": "The provider of the knowledge base", - "enum": [ - "google" - ], - "example": "google" + "description": "Optional name for the transfer assistant", + "maxLength": 100, + "default": "transfer-assistant", + "example": "Sales Transfer Assistant" }, "model": { + "description": "Model configuration for the transfer assistant", + "allOf": [ + { + "$ref": "#/components/schemas/TransferAssistantModel" + } + ] + }, + "voice": { + "description": "These are the options for the transfer assistant's voice.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "transcriber": { + "description": "These are the options for the transfer assistant's transcriber.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "firstMessage": { "type": "string", - "description": "The model to use for the knowledge base", - "enum": [ - "gemini-2.5-pro", - "gemini-2.5-flash", - "gemini-2.5-flash-lite", - "gemini-2.0-flash-thinking-exp", - "gemini-2.0-pro-exp-02-05", - "gemini-2.0-flash", - "gemini-2.0-flash-lite", - "gemini-2.0-flash-exp", - "gemini-2.0-flash-realtime-exp", - "gemini-1.5-flash", - "gemini-1.5-flash-002", - "gemini-1.5-pro", - "gemini-1.5-pro-002", - "gemini-1.0-pro" + "description": "This is the first message that the transfer assistant will say.\nThis can also be a URL to a custom audio file.\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", + "example": "Hello! I understand you need to be transferred. Let me connect you." + }, + "backgroundSound": { + "description": "This is the background sound in the transfer assistant call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } ] }, - "description": { + "startSpeakingPlan": { + "description": "This is the plan for when the transfer assistant should start talking.\n\nYou should configure this if the transfer assistant needs different endpointing behavior than the base assistant.\n\nIf this is not set, the transfer assistant will inherit the start speaking plan from the base assistant.", + "allOf": [ + { + "$ref": "#/components/schemas/StartSpeakingPlan" + } + ] + }, + "firstMessageMode": { "type": "string", - "description": "A description of the knowledge base" + "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state.\n\n@default 'assistant-speaks-first'", + "enum": [ + "assistant-speaks-first", + "assistant-speaks-first-with-model-generated-message", + "assistant-waits-for-user" + ], + "example": "assistant-speaks-first" }, - "fileIds": { - "description": "The file IDs associated with this knowledge base", - "type": "array", - "items": { - "type": "string" - } + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum duration in seconds for the transfer assistant conversation.\nAfter this time, the transfer will be cancelled automatically.\n@default 120", + "minimum": 10, + "maximum": 43200, + "example": 120 + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "silenceTimeoutSeconds": { + "type": "number", + "description": "This is the number of seconds of silence to wait before ending the call. Defaults to 30.\n\n@default 30", + "minimum": 10, + "maximum": 3600 } }, "required": [ - "name", - "provider", - "description", - "fileIds" + "model" ] }, - "CreateQueryToolDTO": { + "TransferCancelToolUserEditable": { "type": "object", "properties": { "messages": { @@ -12147,16 +12532,9 @@ "type": { "type": "string", "enum": [ - "query" + "transferCancel" ], - "description": "The type of tool. \"query\" for Query tool." - }, - "knowledgeBases": { - "description": "The knowledge bases to query", - "type": "array", - "items": { - "$ref": "#/components/schemas/KnowledgeBase" - } + "description": "The type of tool. \"transferCancel\" for Transfer Cancel tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to cancel an ongoing transfer and return the call back to the original assistant when the transfer cannot be completed." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12171,7 +12549,7 @@ "type" ] }, - "CreateGoogleCalendarCreateEventToolDTO": { + "TransferSuccessfulToolUserEditable": { "type": "object", "properties": { "messages": { @@ -12201,9 +12579,9 @@ "type": { "type": "string", "enum": [ - "google.calendar.event.create" + "transferSuccessful" ], - "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." + "description": "The type of tool. \"transferSuccessful\" for Transfer Successful tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to confirm that the transfer should proceed and finalize the handoff to the destination." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12218,101 +12596,242 @@ "type" ] }, - "CreateGoogleSheetsRowAppendToolDTO": { + "SummaryPlan": { "type": "object", "properties": { "messages": { + "description": "These are the messages used to generate the summary.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert note-taker. You will be given a transcript of a call. Summarize the call in 2-3 sentences. DO NOT return anything except the summary.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: The transcript of the call from `call.artifact.transcript` \n- {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content` \n- {{messages}}: The messages of the call from `assistant.model.messages` \n- {{endedReason}}: The ended reason of the call from `call.endedReason`", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "type": "object" } }, + "enabled": { + "type": "boolean", + "description": "This determines whether a summary is generated and stored in `call.analysis.summary`. Defaults to true.\n\nUsage:\n- If you want to disable the summary, set this to false.\n\n@default true" + }, + "timeoutSeconds": { + "type": "number", + "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.summary` will be empty.\n\nUsage:\n- To guarantee the summary is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", + "minimum": 1, + "maximum": 60 + } + } + }, + "TransferPlan": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "description": "This configures how transfer is executed and the experience of the destination party receiving the call.\n\nUsage:\n- `blind-transfer`: The assistant forwards the call to the destination without any message or summary.\n- `blind-transfer-add-summary-to-sip-header`: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary.\n- `warm-transfer-say-message`: The assistant dials the destination, delivers the `message` to the destination party, connects the customer, and leaves the call.\n- `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call.\n- `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer.\n- `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer.\n- `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call.\n- `warm-transfer-experimental`: The assistant puts the customer on hold, dials the destination, and if the destination answers (and is human), delivers a message or summary before connecting the customer. If the destination is unreachable or not human (e.g., with voicemail detection), the assistant delivers the `fallbackMessage` to the customer and optionally ends the call.\n\n@default 'blind-transfer'", + "enum": [ + "blind-transfer", + "blind-transfer-add-summary-to-sip-header", + "warm-transfer-say-message", + "warm-transfer-say-summary", + "warm-transfer-twiml", + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message", + "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary", + "warm-transfer-experimental" + ] + }, + "message": { + "description": "This is the message the assistant will deliver to the destination party before connecting the customer.\n\nUsage:\n- Used only when `mode` is `blind-transfer-add-summary-to-sip-header`, `warm-transfer-say-message`, `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`, or `warm-transfer-experimental`.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/CustomMessage" + } + ] + }, + "timeout": { + "type": "number", + "description": "This is the timeout in seconds for the warm-transfer-wait-for-operator-to-speak-first-and-then-say-message/summary\n\n@default 60", + "minimum": 1, + "maximum": 600, + "default": 60 + }, + "sipVerb": { + "type": "object", + "description": "This specifies the SIP verb to use while transferring the call.\n- 'refer': Uses SIP REFER to transfer the call (default)\n- 'bye': Ends current call with SIP BYE\n- 'dial': Uses SIP DIAL to transfer the call", + "default": "refer", + "enum": [ + "refer", + "bye", + "dial" + ] + }, + "dialTimeout": { + "type": "number", + "description": "This sets the timeout for the dial operation in seconds. This is the duration the call will ring before timing out.\n\nOnly applicable when `sipVerb='dial'`. Not applicable for SIP REFER or BYE.\n\n@default 60", + "minimum": 1, + "maximum": 600, + "default": 60 + }, + "holdAudioUrl": { + "type": "string", + "description": "This is the URL to an audio file played while the customer is on hold during transfer.\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- Used when transferring calls to play hold audio for the customer.\n- Must be a publicly accessible URL to an audio file.\n- Supported formats: MP3 and WAV.\n- If not provided, the default hold audio will be used." + }, + "transferCompleteAudioUrl": { + "type": "string", + "description": "This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party.\nIt can be used to play a custom sound like 'beep' to notify that the transfer is complete.\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- Used when transferring calls to play hold audio for the destination party.\n- Must be a publicly accessible URL to an audio file.\n- Supported formats: MP3 and WAV." + }, + "contextEngineeringPlan": { + "description": "This is the plan for manipulating the message context before initiating the warm transfer.\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- These messages will automatically be added to the transferAssistant's system message.\n- If 'none', we will not add any transcript to the transferAssistant's system message.\n- If you want to provide your own messages, use transferAssistant.model.messages instead.\n\n@default { type: 'all' }", + "oneOf": [ + { + "$ref": "#/components/schemas/ContextEngineeringPlanLastNMessages", + "title": "Last N Messages" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanNone", + "title": "None" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanAll", + "title": "All" + } + ] + }, + "twiml": { + "type": "string", + "description": "This is the TwiML instructions to execute on the destination call leg before connecting the customer.\n\nUsage:\n- Used only when `mode` is `warm-transfer-twiml`.\n- Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs.\n- Maximum length is 4096 characters.\n\nExample:\n```\nHello, transferring a customer to you.\n\nThey called about billing questions.\n```", + "maxLength": 4096 + }, + "summaryPlan": { + "description": "This is the plan for generating a summary of the call to present to the destination party.\n\nUsage:\n- Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary` or `warm-transfer-experimental`.", + "allOf": [ + { + "$ref": "#/components/schemas/SummaryPlan" + } + ] + }, + "sipHeadersInReferToEnabled": { + "type": "boolean", + "description": "This flag includes the sipHeaders from above in the refer to sip uri as url encoded query params.\n\n@default false" + }, + "fallbackPlan": { + "description": "This configures the fallback plan when the transfer fails (destination unreachable, busy, or not human).\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- If not provided when using `warm-transfer-experimental`, a default message will be used.", + "allOf": [ + { + "$ref": "#/components/schemas/TransferFallbackPlan" + } + ] + } + }, + "required": [ + "mode" + ] + }, + "TransferDestinationNumber": { + "type": "object", + "properties": { + "message": { + "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant.\n\nThis accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the `contents` field.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/CustomMessage" + } + ] + }, "type": { "type": "string", "enum": [ - "google.sheets.row.append" - ], - "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." + "number" + ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "numberE164CheckEnabled": { + "type": "boolean", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "default": true + }, + "number": { + "type": "string", + "description": "This is the phone number to transfer the call to.", + "minLength": 3, + "maxLength": 40 + }, + "extension": { + "type": "string", + "description": "This is the extension to dial after transferring the call to the `number`.", + "minLength": 1, + "maxLength": 10 + }, + "callerId": { + "type": "string", + "description": "This is the caller ID to use when transferring the call to the `number`.\n\nUsage:\n- If not provided, the caller ID will be the number the call is coming **from**.\n Example: a customer with number +14151111111 calls in to and the assistant transfers out to +16470000000. +16470000000 will see +14151111111 as the caller.\n For inbound calls, the caller ID is the customer's number. For outbound calls, the caller ID is the phone number of the assistant.\n- To change this behavior, provide a `callerId`.\n- Set to '{{customer.number}}' to always use the customer's number as the caller ID.\n- Set to '{{phoneNumber.number}}' to always use the phone number of the assistant as the caller ID.\n- Set to any E164 number to always use that number as the caller ID. This needs to be a number that is owned or verified by your Transport provider like Twilio.\n\nFor Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid", + "maxLength": 40 + }, + "transferPlan": { + "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TransferPlan" } ] + }, + "description": { + "type": "string", + "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ - "type" + "type", + "number" ] }, - "CreateGoogleCalendarCheckAvailabilityToolDTO": { + "TransferDestinationSip": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "message": { + "description": "This is spoken to the customer before connecting them to the destination.\n\nUsage:\n- If this is not provided and transfer tool messages is not provided, default is \"Transferring the call now\".\n- If set to \"\", nothing is spoken. This is useful when you want to silently transfer. This is especially useful when transferring between assistants in a squad. In this scenario, you likely also want to set `assistant.firstMessageMode=assistant-speaks-first-with-model-generated-message` for the destination assistant.\n\nThis accepts a string or a ToolMessageStart class. Latter is useful if you want to specify multiple messages for different languages through the `contents` field.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/CustomMessage" + } + ] }, "type": { "type": "string", "enum": [ - "google.calendar.availability.check" - ], - "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." + "sip" + ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "sipUri": { + "type": "string", + "description": "This is the SIP URI to transfer the call to." + }, + "transferPlan": { + "description": "This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`.\n\n@default `transferPlan.mode='blind-transfer'`", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TransferPlan" } ] + }, + "sipHeaders": { + "type": "object", + "description": "These are custom headers to be added to SIP refer during transfer call." + }, + "description": { + "type": "string", + "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." } }, "required": [ - "type" + "type", + "sipUri" ] }, - "CreateSlackSendMessageToolDTO": { + "CreateTransferCallToolDTO": { "type": "object", "properties": { "messages": { @@ -12342,37 +12861,382 @@ "type": { "type": "string", "enum": [ - "slack.message.send" - ], - "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } + "transferCall" ] - } - }, - "required": [ - "type" - ] - }, - "McpToolMetadata": { + }, + "destinations": { + "type": "array", + "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "Sip" + } + ] + } + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "ContextEngineeringPlanLastNMessages": { "type": "object", "properties": { - "protocol": { + "type": { "type": "string", "enum": [ - "sse", - "shttp" - ], - "description": "This is the protocol used for MCP communication. Defaults to Streamable HTTP." + "lastNMessages" + ] + }, + "maxMessages": { + "type": "number", + "description": "This is the maximum number of messages to include in the context engineering plan.", + "minimum": 0 + } + }, + "required": [ + "type", + "maxMessages" + ] + }, + "ContextEngineeringPlanNone": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "none" + ] + } + }, + "required": [ + "type" + ] + }, + "ContextEngineeringPlanAll": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "all" + ] + } + }, + "required": [ + "type" + ] + }, + "ContextEngineeringPlanUserAndAssistantMessages": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "userAndAssistantMessages" + ] + } + }, + "required": [ + "type" + ] + }, + "VariableExtractionAlias": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "This is the key of the variable.\n\nThis variable will be accessible during the call as `{{key}}` and stored in `call.artifact.variableValues` after the call.\n\nRules:\n- Must start with a letter (a-z, A-Z).\n- Subsequent characters can be letters, numbers, or underscores.\n- Minimum length of 1 and maximum length of 40.", + "minLength": 1, + "maxLength": 40, + "pattern": "/^[a-zA-Z][a-zA-Z0-9_]*$/" + }, + "value": { + "type": "string", + "description": "This is the value of the variable.\n\nThis can reference existing variables, use filters, and perform transformations.\n\nExamples: \"{{name}}\", \"{{customer.email}}\", \"Hello {{name | upcase}}\"", + "maxLength": 10000 + } + }, + "required": [ + "key", + "value" + ] + }, + "VariableExtractionPlan": { + "type": "object", + "properties": { + "schema": { + "description": "This is the schema to extract.\n\nExamples:\n1. To extract object properties, you can use the following schema:\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n2. To extract nested properties, you can use the following schema:\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n3. To extract array items, you can use the following schema:\n```json\n{\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4. To extract array of objects, you can use the following schema:\n\n```json\n{\n \"type\": \"array\",\n \"name\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } + ] + }, + "aliases": { + "description": "These are additional variables to create.\n\nThese will be accessible during the call as `{{key}}` and stored in `call.artifact.variableValues` after the call.\n\nExample:\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{name}}\"\n },\n {\n \"key\": \"fullName\",\n \"value\": \"{{firstName}} {{lastName}}\"\n },\n {\n \"key\": \"greeting\",\n \"value\": \"Hello {{name}}, welcome to {{company}}!\"\n },\n {\n \"key\": \"customerCity\",\n \"value\": \"{{addresses[0].city}}\"\n },\n {\n \"key\": \"something\",\n \"value\": \"{{any liquid}}\"\n }\n ]\n}\n```\n\nThis will create variables `customerName`, `fullName`, `greeting`, `customerCity`, and `something`. To access these variables, you can reference them as `{{customerName}}`, `{{fullName}}`, `{{greeting}}`, `{{customerCity}}`, and `{{something}}`.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VariableExtractionAlias" + } } } }, - "CreateMcpToolDTO": { + "HandoffDestinationAssistant": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "assistant" + ] + }, + "contextEngineeringPlan": { + "description": "This is the plan for manipulating the message context before handing off the call to the next assistant.", + "oneOf": [ + { + "$ref": "#/components/schemas/ContextEngineeringPlanLastNMessages", + "title": "Last N Messages" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanNone", + "title": "None" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanAll", + "title": "All" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanUserAndAssistantMessages", + "title": "User And Assistant Messages" + } + ] + }, + "assistantName": { + "type": "string", + "description": "This is the assistant to transfer the call to. You must provide either assistantName or assistantId." + }, + "assistantId": { + "type": "string", + "description": "This is the assistant id to transfer the call to. You must provide either assistantName or assistantId." + }, + "assistant": { + "description": "This is a transient assistant to transfer the call to. You may provide a transient assistant in the response `handoff-destination-request` in a dynamic handoff.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "variableExtractionPlan": { + "description": "This is the variable extraction plan for the handoff tool.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + }, + "assistantOverrides": { + "description": "These are the assistant overrides to apply to the destination assistant.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "description": { + "type": "string", + "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." + } + }, + "required": [ + "type" + ] + }, + "HandoffDestinationDynamic": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "dynamic" + ] + }, + "server": { + "description": "This is where Vapi will send the handoff-destination-request webhook in a dynamic handoff.\n\nThe order of precedence is:\n\n1. tool.server.url\n2. assistant.server.url\n3. phoneNumber.server.url\n4. org.server.url", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "description": { + "type": "string", + "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." + } + }, + "required": [ + "type" + ] + }, + "SquadMemberDTO": { + "type": "object", + "properties": { + "assistantDestinations": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Transfer Destination" + }, + { + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Handoff Destination" + } + ] + } + }, + "assistantId": { + "type": "string", + "nullable": true, + "description": "This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead." + }, + "assistant": { + "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "This can be used to override the assistant's settings and provide values for it's template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + } + } + }, + "CreateSquadDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the squad." + }, + "members": { + "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SquadMemberDTO" + } + }, + "membersOverrides": { + "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + } + }, + "required": [ + "members" + ] + }, + "HandoffDestinationSquad": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "squad" + ] + }, + "contextEngineeringPlan": { + "description": "This is the plan for manipulating the message context before handing off the call to the squad.", + "oneOf": [ + { + "$ref": "#/components/schemas/ContextEngineeringPlanLastNMessages", + "title": "Last N Messages" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanNone", + "title": "None" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanAll", + "title": "All" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanUserAndAssistantMessages", + "title": "User And Assistant Messages" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad id to transfer the call to." + }, + "squad": { + "description": "This is a transient squad to transfer the call to.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "entryAssistantName": { + "type": "string", + "description": "This is the name of the entry assistant to start with when handing off to the squad.\nIf not provided, the first member of the squad will be used." + }, + "variableExtractionPlan": { + "description": "This is the variable extraction plan for the handoff tool.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + }, + "squadOverrides": { + "description": "These are the overrides to apply to the squad configuration.\nMaps to squad-level membersOverrides.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "description": { + "type": "string", + "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." + } + }, + "required": [ + "type" + ] + }, + "CreateHandoffToolDTO": { "type": "object", "properties": { "messages": { @@ -12401,22 +13265,39 @@ }, "type": { "type": "string", + "description": "This is the type of the tool.\nWhen you're using handoff tool, we recommend adding this to your system prompt\n---\n# System context\n\nYou are part of a multi-agent system designed to make agent coordination and execution easy. Agents uses two primary abstraction: **Agents** and **Handoffs**. An agent encompasses instructions and tools and can hand off a conversation to another agent when appropriate. Handoffs are achieved by calling a handoff function, generally named `handoff_to_`. Handoffs between agents are handled seamlessly in the background; do not mention or draw attention to these handoffs in your conversation with the user.\n\n# Agent context\n\n{put your agent system prompt here}\n---", "enum": [ - "mcp" - ], - "description": "The type of tool. \"mcp\" for MCP tool." + "handoff" + ] }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "destinations": { + "type": "array", + "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/HandoffDestinationDynamic", + "title": "Dynamic" + }, + { + "$ref": "#/components/schemas/HandoffDestinationSquad", + "title": "Squad" + } + ] + } + }, + "function": { + "description": "This is the optional function definition that will be passed to the LLM.\nIf this is not defined, we will construct this based on the other properties.\n\nFor example, given the following tools definition:\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\nWe will construct the following function definition:\n```json\n{\n \"function\": {\n \"name\": \"handoff_to_assistant-123\",\n \"description\": \"\n Use this function to handoff the call to the next assistant.\n Only use it when instructions explicitly ask you to use the handoff_to_assistant function.\n DO NOT call this function unless you are instructed to do so.\n Here are the destinations you can handoff the call to:\n 1. assistant-123. When: customer wants to be handed off to assistant-123\n 2. assistant-456. When: customer wants to be handed off to assistant-456\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Options: assistant-123 (customer wants to be handed off to assistant-123), assistant-456 (customer wants to be handed off to assistant-456)\",\n \"enum\": [\"assistant-123\", \"assistant-456\"]\n },\n },\n \"required\": [\"destination\"]\n }\n }\n}\n```\n\nTo override this function, please provide an OpenAI function definition and refer to it in the system prompt.\nYou may override parts of the function definition (i.e. you may only want to change the function name for your prompt).\nIf you choose to override the function parameters, it must include `destination` as a required parameter, and it must evaluate to either an assistantId, assistantName, or a the string literal `dynamic`.\n\nTo pass custom parameters to the server in a dynamic handoff, you can use the function parameters, with `dynamic` as the destination.\n```json\n{\n \"function\": {\n \"name\": \"dynamic_handoff\",\n \"description\": \"\n Call this function when the customer is ready to be handed off to the next assistant\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n },\n \"required\": [\"destination\", \"customerAreaCode\", \"customerIntent\", \"customerSentiment\"]\n }\n }\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/OpenAIFunction" } ] }, - "metadata": { - "$ref": "#/components/schemas/McpToolMetadata" - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -12430,7 +13311,87 @@ "type" ] }, - "CreateGoHighLevelCalendarAvailabilityToolDTO": { + "CreateCustomKnowledgeBaseDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This knowledge base is bring your own knowledge base implementation.", + "enum": [ + "custom-knowledge-base" + ] + }, + "server": { + "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + } + }, + "required": [ + "provider", + "server" + ] + }, + "KnowledgeBase": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the knowledge base", + "example": "My Knowledge Base" + }, + "provider": { + "type": "string", + "description": "The provider of the knowledge base", + "enum": [ + "google" + ], + "example": "google" + }, + "model": { + "type": "string", + "description": "The model to use for the knowledge base", + "enum": [ + "gemini-3-flash-preview", + "gemini-2.5-pro", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-2.0-flash-thinking-exp", + "gemini-2.0-pro-exp-02-05", + "gemini-2.0-flash", + "gemini-2.0-flash-lite", + "gemini-2.0-flash-exp", + "gemini-2.0-flash-realtime-exp", + "gemini-1.5-flash", + "gemini-1.5-flash-002", + "gemini-1.5-pro", + "gemini-1.5-pro-002", + "gemini-1.0-pro" + ] + }, + "description": { + "type": "string", + "description": "A description of the knowledge base" + }, + "fileIds": { + "description": "The file IDs associated with this knowledge base", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "provider", + "description", + "fileIds" + ] + }, + "CreateQueryToolDTO": { "type": "object", "properties": { "messages": { @@ -12460,9 +13421,16 @@ "type": { "type": "string", "enum": [ - "gohighlevel.calendar.availability.check" + "query" ], - "description": "The type of tool. \"gohighlevel.calendar.availability.check\" for GoHighLevel Calendar Availability Check tool." + "description": "The type of tool. \"query\" for Query tool." + }, + "knowledgeBases": { + "description": "The knowledge bases to query", + "type": "array", + "items": { + "$ref": "#/components/schemas/KnowledgeBase" + } }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12477,7 +13445,7 @@ "type" ] }, - "CreateGoHighLevelCalendarEventCreateToolDTO": { + "CreateGoogleCalendarCreateEventToolDTO": { "type": "object", "properties": { "messages": { @@ -12507,9 +13475,9 @@ "type": { "type": "string", "enum": [ - "gohighlevel.calendar.event.create" + "google.calendar.event.create" ], - "description": "The type of tool. \"gohighlevel.calendar.event.create\" for GoHighLevel Calendar Event Create tool." + "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12524,7 +13492,7 @@ "type" ] }, - "CreateGoHighLevelContactCreateToolDTO": { + "CreateGoogleSheetsRowAppendToolDTO": { "type": "object", "properties": { "messages": { @@ -12554,9 +13522,9 @@ "type": { "type": "string", "enum": [ - "gohighlevel.contact.create" + "google.sheets.row.append" ], - "description": "The type of tool. \"gohighlevel.contact.create\" for GoHighLevel Contact Create tool." + "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12571,7 +13539,7 @@ "type" ] }, - "CreateGoHighLevelContactGetToolDTO": { + "CreateGoogleCalendarCheckAvailabilityToolDTO": { "type": "object", "properties": { "messages": { @@ -12601,9 +13569,9 @@ "type": { "type": "string", "enum": [ - "gohighlevel.contact.get" + "google.calendar.availability.check" ], - "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." + "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -12618,29 +13586,363 @@ "type" ] }, - "AnyscaleModel": { + "CreateSlackSendMessageToolDTO": { "type": "object", "properties": { "messages": { - "description": "This is the starting state for the conversation.", - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAIMessage" - } - }, - "tools": { "type": "array", - "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "slack.message.send" + ], + "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "McpToolMetadata": { + "type": "object", + "properties": { + "protocol": { + "type": "string", + "enum": [ + "sse", + "shttp" + ], + "description": "This is the protocol used for MCP communication. Defaults to Streamable HTTP." + } + } + }, + "CreateMcpToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "mcp" + ], + "description": "The type of tool. \"mcp\" for MCP tool." + }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "metadata": { + "$ref": "#/components/schemas/McpToolMetadata" + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "CreateGoHighLevelCalendarAvailabilityToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.calendar.availability.check" + ], + "description": "The type of tool. \"gohighlevel.calendar.availability.check\" for GoHighLevel Calendar Availability Check tool." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "CreateGoHighLevelCalendarEventCreateToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.calendar.event.create" + ], + "description": "The type of tool. \"gohighlevel.calendar.event.create\" for GoHighLevel Calendar Event Create tool." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "CreateGoHighLevelContactCreateToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.contact.create" + ], + "description": "The type of tool. \"gohighlevel.contact.create\" for GoHighLevel Contact Create tool." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "CreateGoHighLevelContactGetToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.contact.get" + ], + "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type" + ] + }, + "OpenAIMessage": { + "type": "object", + "properties": { + "content": { + "type": "string", + "nullable": true, + "maxLength": 100000000 + }, + "role": { + "type": "string", + "enum": [ + "assistant", + "function", + "user", + "system", + "tool" + ] + } + }, + "required": [ + "content", + "role" + ] + }, + "AnyscaleModel": { + "type": "object", + "properties": { + "messages": { + "description": "This is the starting state for the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIMessage" + } + }, + "tools": { + "type": "array", + "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" }, { "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -12712,6 +14014,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -12732,10 +14042,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -12817,6 +14123,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -12888,6 +14198,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -12908,10 +14226,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "model": { "type": "string", "description": "The specific Anthropic/Claude model that will be used.", @@ -12924,7 +14238,11 @@ "claude-3-5-haiku-20241022", "claude-3-7-sonnet-20250219", "claude-opus-4-20250514", - "claude-sonnet-4-20250514" + "claude-opus-4-5-20251101", + "claude-opus-4-6", + "claude-sonnet-4-20250514", + "claude-sonnet-4-5-20250929", + "claude-haiku-4-5-20251001" ] }, "provider": { @@ -12969,7 +14287,7 @@ "provider" ] }, - "CerebrasModel": { + "AnthropicBedrockModel": { "type": "object", "properties": { "messages": { @@ -12992,6 +14310,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13063,6 +14385,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13083,22 +14413,38 @@ } ] }, - "knowledgeBaseId": { + "provider": { "type": "string", - "description": "This is the ID of the knowledge base the model will use." + "description": "The provider identifier for Anthropic via AWS Bedrock.", + "enum": [ + "anthropic-bedrock" + ] }, "model": { "type": "string", - "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", + "description": "The specific Anthropic/Claude model that will be used via Bedrock.", "enum": [ - "llama3.1-8b", - "llama-3.3-70b" + "claude-3-opus-20240229", + "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", + "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-20241022", + "claude-3-5-haiku-20241022", + "claude-3-7-sonnet-20250219", + "claude-opus-4-20250514", + "claude-opus-4-5-20251101", + "claude-opus-4-6", + "claude-sonnet-4-20250514", + "claude-sonnet-4-5-20250929", + "claude-haiku-4-5-20251001" ] }, - "provider": { - "type": "string", - "enum": [ - "cerebras" + "thinking": { + "description": "Optional configuration for Anthropic's thinking feature.\nOnly applicable for claude-3-7-sonnet-20250219 model.\nIf provided, maxTokens must be greater than thinking.budgetTokens.", + "allOf": [ + { + "$ref": "#/components/schemas/AnthropicThinkingConfig" + } ] }, "temperature": { @@ -13124,11 +14470,11 @@ } }, "required": [ - "model", - "provider" + "provider", + "model" ] }, - "CustomLLMModel": { + "CerebrasModel": { "type": "object", "properties": { "messages": { @@ -13151,6 +14497,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13222,6 +14572,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13242,50 +14600,20 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, - "provider": { + "model": { "type": "string", - "description": "This is the provider that will be used for the model. Any service, including your own server, that is compatible with the OpenAI API can be used.", + "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", "enum": [ - "custom-llm" + "llama3.1-8b", + "llama-3.3-70b" ] }, - "metadataSendMode": { + "provider": { "type": "string", - "description": "This determines whether metadata is sent in requests to the custom provider.\n\n- `off` will not send any metadata. payload will look like `{ messages }`\n- `variable` will send `assistant.metadata` as a variable on the payload. payload will look like `{ messages, metadata }`\n- `destructured` will send `assistant.metadata` fields directly on the payload. payload will look like `{ messages, ...metadata }`\n\nFurther, `variable` and `destructured` will send `call`, `phoneNumber`, and `customer` objects in the payload.\n\nDefault is `variable`.", "enum": [ - "off", - "variable", - "destructured" + "cerebras" ] }, - "headers": { - "type": "object", - "description": "Custom headers to send with requests. These headers can override default OpenAI headers except for Authorization (which should be specified using a custom-llm credential).", - "additionalProperties": { - "type": "string" - }, - "example": { - "X-Custom-Header": "value" - } - }, - "url": { - "type": "string", - "description": "These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1" - }, - "timeoutSeconds": { - "type": "number", - "description": "This sets the timeout for the connection to the custom provider without needing to stream any tokens back. Default is 20 seconds.", - "minimum": 0, - "maximum": 300 - }, - "model": { - "type": "string", - "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" - }, "temperature": { "type": "number", "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", @@ -13309,12 +14637,11 @@ } }, "required": [ - "provider", - "url", - "model" + "model", + "provider" ] }, - "DeepInfraModel": { + "CustomLLMModel": { "type": "object", "properties": { "messages": { @@ -13337,6 +14664,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13408,6 +14739,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13428,16 +14767,46 @@ } ] }, - "knowledgeBaseId": { + "provider": { "type": "string", - "description": "This is the ID of the knowledge base the model will use." + "description": "This is the provider that will be used for the model. Any service, including your own server, that is compatible with the OpenAI API can be used.", + "enum": [ + "custom-llm" + ] }, - "provider": { + "metadataSendMode": { "type": "string", + "description": "This determines whether metadata is sent in requests to the custom provider.\n\n- `off` will not send any metadata. payload will look like `{ messages }`\n- `variable` will send `assistant.metadata` as a variable on the payload. payload will look like `{ messages, metadata }`\n- `destructured` will send `assistant.metadata` fields directly on the payload. payload will look like `{ messages, ...metadata }`\n\nFurther, `variable` and `destructured` will send `call`, `phoneNumber`, and `customer` objects in the payload.\n\nDefault is `variable`.", "enum": [ - "deepinfra" + "off", + "variable", + "destructured" ] }, + "headers": { + "type": "object", + "description": "Custom headers to send with requests. These headers can override default OpenAI headers except for Authorization (which should be specified using a custom-llm credential).", + "additionalProperties": { + "type": "string" + }, + "example": { + "X-Custom-Header": "value" + } + }, + "url": { + "type": "string", + "description": "These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1" + }, + "wordLevelConfidenceEnabled": { + "type": "boolean", + "description": "This determines whether the transcriber's word level confidence is sent in requests to the custom provider. Default is false.\nThis only works for Deepgram transcribers." + }, + "timeoutSeconds": { + "type": "number", + "description": "This sets the timeout for the connection to the custom provider without needing to stream any tokens back. Default is 20 seconds.", + "minimum": 0, + "maximum": 300 + }, "model": { "type": "string", "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" @@ -13466,10 +14835,11 @@ }, "required": [ "provider", + "url", "model" ] }, - "DeepSeekModel": { + "DeepInfraModel": { "type": "object", "properties": { "messages": { @@ -13492,6 +14862,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13563,6 +14937,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13583,23 +14965,15 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, - "model": { + "provider": { "type": "string", - "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", "enum": [ - "deepseek-chat", - "deepseek-reasoner" + "deepinfra" ] }, - "provider": { + "model": { "type": "string", - "enum": [ - "deep-seek" - ] + "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" }, "temperature": { "type": "number", @@ -13624,11 +14998,178 @@ } }, "required": [ - "model", - "provider" + "provider", + "model" ] }, - "GeminiMultimodalLivePrebuiltVoiceConfig": { + "DeepSeekModel": { + "type": "object", + "properties": { + "messages": { + "description": "This is the starting state for the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIMessage" + } + }, + "tools": { + "type": "array", + "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" + } + ] + } + }, + "toolIds": { + "description": "These are the tools that the assistant can use during the call. To use transient tools, use `tools`.\n\nBoth `tools` and `toolIds` can be used together.", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledgeBase": { + "description": "These are the options for the knowledge base.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", + "title": "Custom" + } + ] + }, + "model": { + "type": "string", + "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", + "enum": [ + "deepseek-chat", + "deepseek-reasoner" + ] + }, + "provider": { + "type": "string", + "enum": [ + "deep-seek" + ] + }, + "temperature": { + "type": "number", + "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.", + "minimum": 50, + "maximum": 10000 + }, + "emotionRecognitionEnabled": { + "type": "boolean", + "description": "This determines whether we detect user's emotion while they speak and send it as an additional info to model.\n\nDefault `false` because the model is usually are good at understanding the user's emotion from text.\n\n@default false" + }, + "numFastTurns": { + "type": "number", + "description": "This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.\n\nDefault is 0.\n\n@default 0", + "minimum": 0 + } + }, + "required": [ + "model", + "provider" + ] + }, + "GeminiMultimodalLivePrebuiltVoiceConfig": { "type": "object", "properties": { "voiceName": { @@ -13720,6 +15261,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13791,6 +15336,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13811,14 +15364,11 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "model": { "type": "string", "description": "This is the Google model that will be used.", "enum": [ + "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", @@ -13899,6 +15449,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -13970,6 +15524,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -13990,10 +15552,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "model": { "type": "string", "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", @@ -14007,6 +15565,7 @@ "llama3-8b-8192", "llama3-70b-8192", "gemma2-9b-it", + "moonshotai/kimi-k2-instruct-0905", "meta-llama/llama-4-maverick-17b-128e-instruct", "meta-llama/llama-4-scout-17b-16e-instruct", "mistral-saba-24b", @@ -14070,6 +15629,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -14141,6 +15704,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -14161,10 +15732,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "model": { "type": "string", "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", @@ -14228,6 +15795,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -14299,6 +15870,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -14319,10 +15898,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "description": "This is the provider that will be used for the model.", @@ -14334,7 +15909,12 @@ "type": "string", "description": "This is the OpenAI model that will be used.\n\nWhen using Vapi OpenAI or your own Azure Credentials, you have the option to specify the region for the selected model. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest region that make sense.\nThis is helpful when you are required to comply with Data Residency rules. Learn more about Azure regions here https://azure.microsoft.com/en-us/explore/global-infrastructure/data-residency/.\n\n@default undefined", "enum": [ + "gpt-5.2", + "gpt-5.2-chat-latest", + "gpt-5.1", + "gpt-5.1-chat-latest", "gpt-5", + "gpt-5-chat-latest", "gpt-5-mini", "gpt-5-nano", "gpt-4.1-2025-04-14", @@ -14352,6 +15932,8 @@ "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-2025-08-28", + "gpt-realtime-mini-2025-12-15", "gpt-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", @@ -14376,12 +15958,20 @@ "gpt-4.1-2025-04-14:westus3", "gpt-4.1-2025-04-14:northcentralus", "gpt-4.1-2025-04-14:southcentralus", + "gpt-4.1-2025-04-14:westeurope", + "gpt-4.1-2025-04-14:germanywestcentral", + "gpt-4.1-2025-04-14:polandcentral", + "gpt-4.1-2025-04-14:spaincentral", "gpt-4.1-mini-2025-04-14:westus", "gpt-4.1-mini-2025-04-14:eastus2", "gpt-4.1-mini-2025-04-14:eastus", "gpt-4.1-mini-2025-04-14:westus3", "gpt-4.1-mini-2025-04-14:northcentralus", "gpt-4.1-mini-2025-04-14:southcentralus", + "gpt-4.1-mini-2025-04-14:westeurope", + "gpt-4.1-mini-2025-04-14:germanywestcentral", + "gpt-4.1-mini-2025-04-14:polandcentral", + "gpt-4.1-mini-2025-04-14:spaincentral", "gpt-4.1-nano-2025-04-14:westus", "gpt-4.1-nano-2025-04-14:eastus2", "gpt-4.1-nano-2025-04-14:westus3", @@ -14393,6 +15983,10 @@ "gpt-4o-2024-11-20:eastus", "gpt-4o-2024-11-20:westus3", "gpt-4o-2024-11-20:southcentralus", + "gpt-4o-2024-11-20:westeurope", + "gpt-4o-2024-11-20:germanywestcentral", + "gpt-4o-2024-11-20:polandcentral", + "gpt-4o-2024-11-20:spaincentral", "gpt-4o-2024-08-06:westus", "gpt-4o-2024-08-06:westus3", "gpt-4o-2024-08-06:eastus", @@ -14435,104 +16029,6 @@ "fallbackModels": { "type": "array", "description": "These are the fallback models that will be used if the primary model fails. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest fallbacks that make sense.", - "enum": [ - "gpt-5", - "gpt-5-mini", - "gpt-5-nano", - "gpt-4.1-2025-04-14", - "gpt-4.1-mini-2025-04-14", - "gpt-4.1-nano-2025-04-14", - "gpt-4.1", - "gpt-4.1-mini", - "gpt-4.1-nano", - "chatgpt-4o-latest", - "o3", - "o3-mini", - "o4-mini", - "o1-mini", - "o1-mini-2024-09-12", - "gpt-4o-realtime-preview-2024-10-01", - "gpt-4o-realtime-preview-2024-12-17", - "gpt-4o-mini-realtime-preview-2024-12-17", - "gpt-4o-mini-2024-07-18", - "gpt-4o-mini", - "gpt-4o", - "gpt-4o-2024-05-13", - "gpt-4o-2024-08-06", - "gpt-4o-2024-11-20", - "gpt-4-turbo", - "gpt-4-turbo-2024-04-09", - "gpt-4-turbo-preview", - "gpt-4-0125-preview", - "gpt-4-1106-preview", - "gpt-4", - "gpt-4-0613", - "gpt-3.5-turbo", - "gpt-3.5-turbo-0125", - "gpt-3.5-turbo-1106", - "gpt-3.5-turbo-16k", - "gpt-3.5-turbo-0613", - "gpt-4.1-2025-04-14:westus", - "gpt-4.1-2025-04-14:eastus2", - "gpt-4.1-2025-04-14:eastus", - "gpt-4.1-2025-04-14:westus3", - "gpt-4.1-2025-04-14:northcentralus", - "gpt-4.1-2025-04-14:southcentralus", - "gpt-4.1-mini-2025-04-14:westus", - "gpt-4.1-mini-2025-04-14:eastus2", - "gpt-4.1-mini-2025-04-14:eastus", - "gpt-4.1-mini-2025-04-14:westus3", - "gpt-4.1-mini-2025-04-14:northcentralus", - "gpt-4.1-mini-2025-04-14:southcentralus", - "gpt-4.1-nano-2025-04-14:westus", - "gpt-4.1-nano-2025-04-14:eastus2", - "gpt-4.1-nano-2025-04-14:westus3", - "gpt-4.1-nano-2025-04-14:northcentralus", - "gpt-4.1-nano-2025-04-14:southcentralus", - "gpt-4o-2024-11-20:swedencentral", - "gpt-4o-2024-11-20:westus", - "gpt-4o-2024-11-20:eastus2", - "gpt-4o-2024-11-20:eastus", - "gpt-4o-2024-11-20:westus3", - "gpt-4o-2024-11-20:southcentralus", - "gpt-4o-2024-08-06:westus", - "gpt-4o-2024-08-06:westus3", - "gpt-4o-2024-08-06:eastus", - "gpt-4o-2024-08-06:eastus2", - "gpt-4o-2024-08-06:northcentralus", - "gpt-4o-2024-08-06:southcentralus", - "gpt-4o-mini-2024-07-18:westus", - "gpt-4o-mini-2024-07-18:westus3", - "gpt-4o-mini-2024-07-18:eastus", - "gpt-4o-mini-2024-07-18:eastus2", - "gpt-4o-mini-2024-07-18:northcentralus", - "gpt-4o-mini-2024-07-18:southcentralus", - "gpt-4o-2024-05-13:eastus2", - "gpt-4o-2024-05-13:eastus", - "gpt-4o-2024-05-13:northcentralus", - "gpt-4o-2024-05-13:southcentralus", - "gpt-4o-2024-05-13:westus3", - "gpt-4o-2024-05-13:westus", - "gpt-4-turbo-2024-04-09:eastus2", - "gpt-4-0125-preview:eastus", - "gpt-4-0125-preview:northcentralus", - "gpt-4-0125-preview:southcentralus", - "gpt-4-1106-preview:australia", - "gpt-4-1106-preview:canadaeast", - "gpt-4-1106-preview:france", - "gpt-4-1106-preview:india", - "gpt-4-1106-preview:norway", - "gpt-4-1106-preview:swedencentral", - "gpt-4-1106-preview:uk", - "gpt-4-1106-preview:westus", - "gpt-4-1106-preview:westus3", - "gpt-4-0613:canadaeast", - "gpt-3.5-turbo-0125:canadaeast", - "gpt-3.5-turbo-0125:northcentralus", - "gpt-3.5-turbo-0125:southcentralus", - "gpt-3.5-turbo-1106:canadaeast", - "gpt-3.5-turbo-1106:westus" - ], "example": [ "gpt-4-0125-preview", "gpt-4-0613" @@ -14540,7 +16036,12 @@ "items": { "type": "string", "enum": [ + "gpt-5.2", + "gpt-5.2-chat-latest", + "gpt-5.1", + "gpt-5.1-chat-latest", "gpt-5", + "gpt-5-chat-latest", "gpt-5-mini", "gpt-5-nano", "gpt-4.1-2025-04-14", @@ -14558,6 +16059,8 @@ "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-2025-08-28", + "gpt-realtime-mini-2025-12-15", "gpt-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", @@ -14582,12 +16085,20 @@ "gpt-4.1-2025-04-14:westus3", "gpt-4.1-2025-04-14:northcentralus", "gpt-4.1-2025-04-14:southcentralus", + "gpt-4.1-2025-04-14:westeurope", + "gpt-4.1-2025-04-14:germanywestcentral", + "gpt-4.1-2025-04-14:polandcentral", + "gpt-4.1-2025-04-14:spaincentral", "gpt-4.1-mini-2025-04-14:westus", "gpt-4.1-mini-2025-04-14:eastus2", "gpt-4.1-mini-2025-04-14:eastus", "gpt-4.1-mini-2025-04-14:westus3", "gpt-4.1-mini-2025-04-14:northcentralus", "gpt-4.1-mini-2025-04-14:southcentralus", + "gpt-4.1-mini-2025-04-14:westeurope", + "gpt-4.1-mini-2025-04-14:germanywestcentral", + "gpt-4.1-mini-2025-04-14:polandcentral", + "gpt-4.1-mini-2025-04-14:spaincentral", "gpt-4.1-nano-2025-04-14:westus", "gpt-4.1-nano-2025-04-14:eastus2", "gpt-4.1-nano-2025-04-14:westus3", @@ -14599,6 +16110,10 @@ "gpt-4o-2024-11-20:eastus", "gpt-4o-2024-11-20:westus3", "gpt-4o-2024-11-20:southcentralus", + "gpt-4o-2024-11-20:westeurope", + "gpt-4o-2024-11-20:germanywestcentral", + "gpt-4o-2024-11-20:polandcentral", + "gpt-4o-2024-11-20:spaincentral", "gpt-4o-2024-08-06:westus", "gpt-4o-2024-08-06:westus3", "gpt-4o-2024-08-06:eastus", @@ -14647,6 +16162,19 @@ "strip-unsupported-validation" ] }, + "promptCacheRetention": { + "type": "string", + "description": "This controls the prompt cache retention policy for models that support extended caching (GPT-4.1, GPT-5 series).\n\n- `in_memory`: Default behavior, cache retained in GPU memory only\n- `24h`: Extended caching, keeps cached prefixes active for up to 24 hours by offloading to GPU-local storage\n\nOnly applies to models: gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.1-chat-latest, gpt-5, gpt-5-codex, gpt-4.1\n\n@default undefined (uses API default which is 'in_memory')", + "enum": [ + "in_memory", + "24h" + ] + }, + "promptCacheKey": { + "type": "string", + "description": "This is the prompt cache key for models that support extended caching (GPT-4.1, GPT-5 series).\n\nProviding a cache key allows you to share cached prefixes across requests.\n\n@default undefined", + "maxLength": 64 + }, "temperature": { "type": "number", "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", @@ -14697,6 +16225,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -14768,6 +16300,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -14788,10 +16328,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -14852,6 +16388,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -14923,6 +16463,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -14943,10 +16491,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -15007,6 +16551,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -15078,6 +16626,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -15098,10 +16654,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -15181,7 +16733,12 @@ "description": "This is the OpenAI model that will be used.\n\nWhen using Vapi OpenAI or your own Azure Credentials, you have the option to specify the region for the selected model. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest region that make sense.\nThis is helpful when you are required to comply with Data Residency rules. Learn more about Azure regions here https://azure.microsoft.com/en-us/explore/global-infrastructure/data-residency/.", "maxLength": 100, "enum": [ + "gpt-5.2", + "gpt-5.2-chat-latest", + "gpt-5.1", + "gpt-5.1-chat-latest", "gpt-5", + "gpt-5-chat-latest", "gpt-5-mini", "gpt-5-nano", "gpt-4.1-2025-04-14", @@ -15220,12 +16777,20 @@ "gpt-4.1-2025-04-14:westus3", "gpt-4.1-2025-04-14:northcentralus", "gpt-4.1-2025-04-14:southcentralus", + "gpt-4.1-2025-04-14:westeurope", + "gpt-4.1-2025-04-14:germanywestcentral", + "gpt-4.1-2025-04-14:polandcentral", + "gpt-4.1-2025-04-14:spaincentral", "gpt-4.1-mini-2025-04-14:westus", "gpt-4.1-mini-2025-04-14:eastus2", "gpt-4.1-mini-2025-04-14:eastus", "gpt-4.1-mini-2025-04-14:westus3", "gpt-4.1-mini-2025-04-14:northcentralus", "gpt-4.1-mini-2025-04-14:southcentralus", + "gpt-4.1-mini-2025-04-14:westeurope", + "gpt-4.1-mini-2025-04-14:germanywestcentral", + "gpt-4.1-mini-2025-04-14:polandcentral", + "gpt-4.1-mini-2025-04-14:spaincentral", "gpt-4.1-nano-2025-04-14:westus", "gpt-4.1-nano-2025-04-14:eastus2", "gpt-4.1-nano-2025-04-14:westus3", @@ -15237,6 +16802,10 @@ "gpt-4o-2024-11-20:eastus", "gpt-4o-2024-11-20:westus3", "gpt-4o-2024-11-20:southcentralus", + "gpt-4o-2024-11-20:westeurope", + "gpt-4o-2024-11-20:germanywestcentral", + "gpt-4o-2024-11-20:polandcentral", + "gpt-4o-2024-11-20:spaincentral", "gpt-4o-2024-08-06:westus", "gpt-4o-2024-08-06:westus3", "gpt-4o-2024-08-06:eastus", @@ -15317,11 +16886,71 @@ "claude-3-5-haiku-20241022", "claude-3-7-sonnet-20250219", "claude-opus-4-20250514", - "claude-sonnet-4-20250514" + "claude-opus-4-5-20251101", + "claude-opus-4-6", + "claude-sonnet-4-20250514", + "claude-sonnet-4-5-20250929", + "claude-haiku-4-5-20251001" + ] + }, + "thinking": { + "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnthropicThinkingConfig" + } + ] + }, + "temperature": { + "type": "number", + "description": "This is the temperature of the model.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.", + "minimum": 50, + "maximum": 10000 + } + }, + "required": [ + "provider", + "model" + ] + }, + "WorkflowAnthropicBedrockModel": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the provider of the model (`anthropic-bedrock`).", + "enum": [ + "anthropic-bedrock" + ] + }, + "model": { + "type": "string", + "description": "This is the specific model that will be used.", + "maxLength": 100, + "enum": [ + "claude-3-opus-20240229", + "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", + "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-20241022", + "claude-3-5-haiku-20241022", + "claude-3-7-sonnet-20250219", + "claude-opus-4-20250514", + "claude-opus-4-5-20251101", + "claude-opus-4-6", + "claude-sonnet-4-20250514", + "claude-sonnet-4-5-20250929", + "claude-haiku-4-5-20251001" ] }, "thinking": { - "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- Only applicable for `claude-3-7-sonnet-20250219` model.\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`.", + "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`.", "allOf": [ { "$ref": "#/components/schemas/AnthropicThinkingConfig" @@ -15361,6 +16990,7 @@ "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", "maxLength": 100, "enum": [ + "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", @@ -15489,6 +17119,10 @@ "$ref": "#/components/schemas/WorkflowAnthropicModel", "title": "WorkflowAnthropicModel" }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, { "$ref": "#/components/schemas/WorkflowGoogleModel", "title": "WorkflowGoogleModel" @@ -15545,6 +17179,10 @@ { "$ref": "#/components/schemas/CartesiaTranscriber", "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" } ] }, @@ -15591,6 +17229,10 @@ "$ref": "#/components/schemas/PlayHTVoice", "title": "PlayHTVoice" }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, { "$ref": "#/components/schemas/RimeAIVoice", "title": "RimeAIVoice" @@ -15634,6 +17276,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -15705,6 +17351,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] } @@ -15775,6 +17429,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -15846,6 +17504,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] }, @@ -15871,910 +17537,953 @@ "name" ] }, - "AIEdgeCondition": { + "VoicemailDetectionBackoffPlan": { "type": "object", "properties": { - "type": { + "startAtSeconds": { + "type": "number", + "description": "This is the number of seconds to wait before starting the first retry attempt.", + "minimum": 0, + "default": 5 + }, + "frequencySeconds": { + "type": "number", + "description": "This is the interval in seconds between retry attempts.", + "minimum": 2.5, + "default": 5 + }, + "maxRetries": { + "type": "number", + "description": "This is the maximum number of retry attempts before giving up.", + "minimum": 1, + "maximum": 10, + "default": 6 + } + } + }, + "GoogleVoicemailDetectionPlan": { + "type": "object", + "properties": { + "beepMaxAwaitSeconds": { + "type": "number", + "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", + "minimum": 0, + "maximum": 30, + "default": 30 + }, + "provider": { "type": "string", + "description": "This is the provider to use for voicemail detection.", "enum": [ - "ai" + "google" ] }, - "prompt": { + "backoffPlan": { + "description": "This is the backoff plan for the voicemail detection.", + "allOf": [ + { + "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" + } + ] + }, + "type": { "type": "string", - "description": "This is the prompt for the AI edge condition. It should evaluate to a boolean.", - "maxLength": 1000 + "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", + "enum": [ + "audio", + "transcript" + ] } }, "required": [ - "type", - "prompt" + "provider" ] }, - "Edge": { + "OpenAIVoicemailDetectionPlan": { "type": "object", "properties": { - "condition": { - "oneOf": [ + "beepMaxAwaitSeconds": { + "type": "number", + "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", + "minimum": 0, + "maximum": 30, + "default": 30 + }, + "provider": { + "type": "string", + "description": "This is the provider to use for voicemail detection.", + "enum": [ + "openai" + ] + }, + "backoffPlan": { + "description": "This is the backoff plan for the voicemail detection.", + "allOf": [ { - "$ref": "#/components/schemas/AIEdgeCondition", - "title": "AIEdgeCondition" + "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" } ] }, - "from": { - "type": "string", - "maxLength": 80 - }, - "to": { + "type": { "type": "string", - "maxLength": 80 - }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the edge." + "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", + "enum": [ + "audio", + "transcript" + ] } }, "required": [ - "from", - "to" + "provider" ] }, - "SecurityFilterBase": { - "type": "object", - "properties": {} - }, - "SecurityFilterPlan": { + "TwilioVoicemailDetectionPlan": { "type": "object", "properties": { - "enabled": { - "type": "boolean", - "description": "Whether the security filter is enabled.\n@default false", - "default": false + "provider": { + "type": "string", + "description": "This is the provider to use for voicemail detection.", + "enum": [ + "twilio" + ] }, - "filters": { - "description": "Array of security filter types to apply.\nIf array is not empty, only those security filters are run.", - "example": "[{ type: \"sql-injection\" }, { type: \"xss\" }]", + "voicemailDetectionTypes": { "type": "array", - "items": { - "$ref": "#/components/schemas/SecurityFilterBase" - } - }, - "mode": { - "type": "string", - "description": "Mode of operation when a security threat is detected.\n- 'sanitize': Remove or replace the threatening content\n- 'reject': Replace the entire transcript with replacement text\n- 'replace': Replace threatening patterns with replacement text\n@default 'sanitize'", + "description": "These are the AMD messages from Twilio that are considered as voicemail. Default is ['machine_end_beep', 'machine_end_silence'].\n\n@default {Array} ['machine_end_beep', 'machine_end_silence']", "enum": [ - "sanitize", - "reject", - "replace" + "machine_start", + "human", + "fax", + "unknown", + "machine_end_beep", + "machine_end_silence", + "machine_end_other" ], - "default": "sanitize" - }, - "replacementText": { - "type": "string", - "description": "Text to use when replacing filtered content.\n@default '[FILTERED]'", - "default": "[FILTERED]" - } - } - }, - "CompliancePlan": { - "type": "object", - "properties": { - "hipaaEnabled": { - "type": "boolean", - "description": "When this is enabled, no logs, recordings, or transcriptions will be stored.\nAt the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.", - "example": { - "hipaaEnabled": false + "example": [ + "machine_end_beep", + "machine_end_silence" + ], + "items": { + "type": "string", + "enum": [ + "machine_start", + "human", + "fax", + "unknown", + "machine_end_beep", + "machine_end_silence", + "machine_end_other" + ] } }, - "pciEnabled": { + "enabled": { "type": "boolean", - "description": "When this is enabled, the user will be restricted to use PCI-compliant providers, and no logs or transcripts are stored.\nAt the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false.", - "example": { - "pciEnabled": false - } + "description": "This sets whether the assistant should detect voicemail. Defaults to true.\n\n@default true" }, - "securityFilterPlan": { - "description": "This is the security filter plan for the assistant. It allows filtering of transcripts for security threats before sending to LLM.", - "allOf": [ - { - "$ref": "#/components/schemas/SecurityFilterPlan" - } - ] + "machineDetectionTimeout": { + "type": "number", + "description": "The number of seconds that Twilio should attempt to perform answering machine detection before timing out and returning AnsweredBy as unknown. Default is 30 seconds.\n\nIncreasing this value will provide the engine more time to make a determination. This can be useful when DetectMessageEnd is provided in the MachineDetection parameter and there is an expectation of long answering machine greetings that can exceed 30 seconds.\n\nDecreasing this value will reduce the amount of time the engine has to make a determination. This can be particularly useful when the Enable option is provided in the MachineDetection parameter and you want to limit the time for initial detection.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 30", + "minimum": 3, + "maximum": 59 + }, + "machineDetectionSpeechThreshold": { + "type": "number", + "description": "The number of milliseconds that is used as the measuring stick for the length of the speech activity. Durations lower than this value will be interpreted as a human, longer as a machine. Default is 2400 milliseconds.\n\nIncreasing this value will reduce the chance of a False Machine (detected machine, actually human) for a long human greeting (e.g., a business greeting) but increase the time it takes to detect a machine.\n\nDecreasing this value will reduce the chances of a False Human (detected human, actually machine) for short voicemail greetings. The value of this parameter may need to be reduced by more than 1000ms to detect very short voicemail greetings. A reduction of that significance can result in increased False Machine detections. Adjusting the MachineDetectionSpeechEndThreshold is likely the better approach for short voicemails. Decreasing MachineDetectionSpeechThreshold will also reduce the time it takes to detect a machine.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 2400", + "minimum": 1000, + "maximum": 6000 + }, + "machineDetectionSpeechEndThreshold": { + "type": "number", + "description": "The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Default is 1200 milliseconds.\n\nIncreasing this value will typically be used to better address the short voicemail greeting scenarios. For short voicemails, there is typically 1000-2000ms of audio followed by 1200-2400ms of silence and then additional audio before the beep. Increasing the MachineDetectionSpeechEndThreshold to ~2500ms will treat the 1200-2400ms of silence as a gap in the greeting but not the end of the greeting and will result in a machine detection. The downsides of such a change include:\n- Increasing the delay for human detection by the amount you increase this parameter, e.g., a change of 1200ms to 2500ms increases human detection delay by 1300ms.\n- Cases where a human has two utterances separated by a period of silence (e.g. a \"Hello\", then 2000ms of silence, and another \"Hello\") may be interpreted as a machine.\n\nDecreasing this value will result in faster human detection. The consequence is that it can lead to increased False Human (detected human, actually machine) detections because a silence gap in a voicemail greeting (not necessarily just in short voicemail scenarios) can be incorrectly interpreted as the end of speech.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 1200", + "minimum": 500, + "maximum": 5000 + }, + "machineDetectionSilenceTimeout": { + "type": "number", + "description": "The number of milliseconds of initial silence after which an unknown AnsweredBy result will be returned. Default is 5000 milliseconds.\n\nIncreasing this value will result in waiting for a longer period of initial silence before returning an 'unknown' AMD result.\n\nDecreasing this value will result in waiting for a shorter period of initial silence before returning an 'unknown' AMD result.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 5000", + "minimum": 2000, + "maximum": 10000 } - } + }, + "required": [ + "provider" + ] }, - "StructuredDataPlan": { + "VapiVoicemailDetectionPlan": { "type": "object", "properties": { - "messages": { - "description": "These are the messages used to generate the structured data.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert data extractor. You will be given a transcript of a call. Extract structured data per the JSON Schema. DO NOT return anything except the structured data.\\n\\nJson Schema:\\\\n{{schema}}\\n\\nOnly respond with the JSON.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`- {{endedReason}}: the ended reason of the call from `call.endedReason`", - "type": "array", - "items": { - "type": "object" - } + "beepMaxAwaitSeconds": { + "type": "number", + "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", + "minimum": 0, + "maximum": 30, + "default": 30 }, - "enabled": { - "type": "boolean", - "description": "This determines whether structured data is generated and stored in `call.analysis.structuredData`. Defaults to false.\n\nUsage:\n- If you want to extract structured data, set this to true and provide a `schema`.\n\n@default false" + "provider": { + "type": "string", + "description": "This is the provider to use for voicemail detection.", + "enum": [ + "vapi" + ] }, - "schema": { - "description": "This is the schema of the structured data. The output is stored in `call.analysis.structuredData`.\n\nComplete guide on JSON Schema can be found [here](https://ajv.js.org/json-schema.html#json-data-type).", + "backoffPlan": { + "description": "This is the backoff plan for the voicemail detection.", "allOf": [ { - "$ref": "#/components/schemas/JsonSchema" + "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" } ] }, - "timeoutSeconds": { - "type": "number", - "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.structuredData` will be empty.\n\nUsage:\n- To guarantee the structured data is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", - "minimum": 1, - "maximum": 60 + "type": { + "type": "string", + "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", + "enum": [ + "audio", + "transcript" + ] } - } + }, + "required": [ + "provider" + ] }, - "StructuredDataMultiPlan": { + "TransferHookAction": { "type": "object", "properties": { - "key": { + "type": { "type": "string", - "description": "This is the key of the structured data plan in the catalog." + "description": "This is the type of action - must be \"transfer\"", + "enum": [ + "transfer" + ] }, - "plan": { - "description": "This is an individual structured data plan in the catalog.", - "allOf": [ + "destination": { + "description": "This is the destination details for the transfer - can be a phone number or SIP URI", + "oneOf": [ { - "$ref": "#/components/schemas/StructuredDataPlan" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } ] } }, "required": [ - "key", - "plan" + "type" ] }, - "SuccessEvaluationPlan": { + "FunctionCallHookAction": { "type": "object", "properties": { - "rubric": { - "type": "string", - "enum": [ - "NumericScale", - "DescriptiveScale", - "Checklist", - "Matrix", - "PercentageScale", - "LikertScale", - "AutomaticRubric", - "PassFail" - ], - "description": "This enforces the rubric of the evaluation. The output is stored in `call.analysis.successEvaluation`.\n\nOptions include:\n- 'NumericScale': A scale of 1 to 10.\n- 'DescriptiveScale': A scale of Excellent, Good, Fair, Poor.\n- 'Checklist': A checklist of criteria and their status.\n- 'Matrix': A grid that evaluates multiple criteria across different performance levels.\n- 'PercentageScale': A scale of 0% to 100%.\n- 'LikertScale': A scale of Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree.\n- 'AutomaticRubric': Automatically break down evaluation into several criteria, each with its own score.\n- 'PassFail': A simple 'true' if call passed, 'false' if not.\n\nDefault is 'PassFail'." - }, "messages": { - "description": "These are the messages used to generate the success evaluation.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert call evaluator. You will be given a transcript of a call and the system prompt of the AI participant. Determine if the call was successful based on the objectives inferred from the system prompt. DO NOT return anything except the result.\\n\\nRubric:\\\\n{{rubric}}\\n\\nOnly respond with the result.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here was the system prompt of the call:\\n\\n{{systemPrompt}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric`- {{endedReason}}: the ended reason of the call from `call.endedReason`", "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "type": "object" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] } }, - "enabled": { - "type": "boolean", - "description": "This determines whether a success evaluation is generated and stored in `call.analysis.successEvaluation`. Defaults to true.\n\nUsage:\n- If you want to disable the success evaluation, set this to false.\n\n@default true" + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool. \"function\" for Function tool." }, - "timeoutSeconds": { - "type": "number", - "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.successEvaluation` will be empty.\n\nUsage:\n- To guarantee the success evaluation is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", - "minimum": 1, - "maximum": 60 - } - } - }, - "AnalysisPlan": { - "type": "object", - "properties": { - "minMessagesThreshold": { - "type": "number", - "description": "The minimum number of messages required to run the analysis plan.\nIf the number of messages is less than this, analysis will be skipped.\n@default 2", - "minimum": 0 + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." }, - "summaryPlan": { - "description": "This is the plan for generating the summary of the call. This outputs to `call.analysis.summary`.", + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ { - "$ref": "#/components/schemas/SummaryPlan" + "$ref": "#/components/schemas/Server" } ] }, - "structuredDataPlan": { - "description": "This is the plan for generating the structured data from the call. This outputs to `call.analysis.structuredData`.", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/StructuredDataPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "structuredDataMultiPlan": { - "description": "This is an array of structured data plan catalogs. Each entry includes a `key` and a `plan` for generating the structured data from the call. This outputs to `call.analysis.structuredDataMulti`.", - "type": "array", - "items": { - "$ref": "#/components/schemas/StructuredDataMultiPlan" - } - }, - "successEvaluationPlan": { - "description": "This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`.", + "function": { + "description": "This is the function definition of the tool.", "allOf": [ { - "$ref": "#/components/schemas/SuccessEvaluationPlan" + "$ref": "#/components/schemas/OpenAIFunction" } ] - }, - "outcomeIds": { - "description": "This is an array of outcome UUIDs to be calculated during analysis.\nThe outcomes will be calculated and stored in `call.analysis.outcomes`.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "RegexOption": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of the regex option. Options are:\n- `ignore-case`: Ignores the case of the text being matched. Add\n- `whole-word`: Matches whole words only.\n- `multi-line`: Matches across multiple lines.", - "enum": [ - "ignore-case", - "whole-word", - "multi-line" - ] - }, - "enabled": { - "type": "boolean", - "description": "This is whether to enable the option.\n\n@default false" } }, "required": [ - "type", - "enabled" + "type" ] }, - "AssistantCustomEndpointingRule": { + "SayHookAction": { "type": "object", "properties": { "type": { "type": "string", - "description": "This endpointing rule is based on the last assistant message before customer started speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the last assistant message\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you have yes/no questions in your use case like \"are you interested in a loan?\", you can set a shorter timeout.\n- If you have questions where the customer may pause to look up information like \"what's my account number?\", you can set a longer timeout.", + "description": "This is the type of action - must be \"say\"", "enum": [ - "assistant" + "say" ] }, - "regex": { - "type": "string", - "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." - }, - "regexOptions": { - "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []", - "type": "array", - "items": { - "$ref": "#/components/schemas/RegexOption" - } + "prompt": { + "description": "This is the prompt for the assistant to generate a response based on existing conversation.\nCan be a string or an array of chat messages.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Ask the user if they're still in the call", + [ + { + "role": "system", + "content": "You are a helpful assistant, and would like to know if the user is still in the call based on the conversation history in {{transcript}}" + } + ] + ] }, - "timeoutSeconds": { - "type": "number", - "description": "This is the endpointing timeout in seconds, if the rule is matched.", - "minimum": 0, - "maximum": 15 + "exact": { + "type": "object", + "description": "This is the message to say" } }, "required": [ - "type", - "regex", - "timeoutSeconds" + "type" ] }, - "CustomerCustomEndpointingRule": { + "MessageAddHookAction": { "type": "object", "properties": { "type": { "type": "string", - "description": "This endpointing rule is based on current customer message as they are speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the current customer transcription\n- If a match is found based on `regex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you want to wait longer while customer is speaking numbers, you can set a longer timeout.", + "description": "This is the type of action - must be \"message.add\"", "enum": [ - "customer" + "message.add" ] }, - "regex": { - "type": "string", - "description": "This is the regex pattern to match.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." - }, - "regexOptions": { - "description": "These are the options for the regex match. Defaults to all disabled.\n\n@default []", - "type": "array", - "items": { - "$ref": "#/components/schemas/RegexOption" - } + "message": { + "description": "The message to add to the conversation in OpenAI format", + "example": { + "role": "system", + "content": "Context update from hook" + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIMessage" + } + ] }, - "timeoutSeconds": { - "type": "number", - "description": "This is the endpointing timeout in seconds, if the rule is matched.", - "minimum": 0, - "maximum": 15 + "triggerResponseEnabled": { + "type": "boolean", + "description": "Whether to trigger an assistant response after adding the message", + "default": true } }, "required": [ "type", - "regex", - "timeoutSeconds" + "message" ] }, - "BothCustomEndpointingRule": { + "CallHookFilter": { "type": "object", "properties": { "type": { "type": "string", - "description": "This endpointing rule is based on both the last assistant message and the current customer message as they are speaking.\n\nFlow:\n- Assistant speaks\n- Customer starts speaking\n- Customer transcription comes in\n- This rule is evaluated on the last assistant message and the current customer transcription\n- If assistant message matches `assistantRegex` AND customer message matches `customerRegex`, the endpointing timeout is set to `timeoutSeconds`\n\nUsage:\n- If you want to wait longer while customer is speaking numbers, you can set a longer timeout.", + "description": "This is the type of filter - currently only \"oneOf\" is supported", "enum": [ - "both" - ] + "oneOf" + ], + "maxLength": 1000 }, - "assistantRegex": { + "key": { "type": "string", - "description": "This is the regex pattern to match the assistant's message.\n\nNote:\n- This works by using the `RegExp.test` method in Node.JS. Eg. `/hello/.test(\"hello there\")` will return `true`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead.\n- `RegExp.test` does substring matching, so `/cat/.test(\"I love cats\")` will return `true`. To do full string matching, send \"^cat$\"." + "description": "This is the key to filter on (e.g. \"call.endedReason\")", + "maxLength": 1000 }, - "assistantRegexOptions": { - "description": "These are the options for the assistant's message regex match. Defaults to all disabled.\n\n@default []", + "oneOf": { + "description": "This is the array of possible values to match against", "type": "array", "items": { - "$ref": "#/components/schemas/RegexOption" + "type": "string", + "maxLength": 1000 } + } + }, + "required": [ + "type", + "key", + "oneOf" + ] + }, + "CallHookCallEnding": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "call.ending" + ], + "maxLength": 1000 }, - "customerRegex": { - "type": "string" - }, - "customerRegexOptions": { - "description": "These are the options for the customer's message regex match. Defaults to all disabled.\n\n@default []", + "do": { "type": "array", + "description": "This is the set of actions to perform when the hook triggers", "items": { - "$ref": "#/components/schemas/RegexOption" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + }, + { + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" + } + ] } }, - "timeoutSeconds": { - "type": "number", - "description": "This is the endpointing timeout in seconds, if the rule is matched.", - "minimum": 0, - "maximum": 15 + "filters": { + "description": "This is the set of filters that must match for the hook to trigger", + "type": "array", + "items": { + "$ref": "#/components/schemas/CallHookFilter" + } } }, "required": [ - "type", - "assistantRegex", - "customerRegex", - "timeoutSeconds" + "on", + "do" ] }, - "VapiSmartEndpointingPlan": { + "CallHookAssistantSpeechInterrupted": { "type": "object", "properties": { - "provider": { + "on": { "type": "string", - "description": "This is the provider for the smart endpointing plan.", + "description": "This is the event that triggers this hook", "enum": [ - "vapi", - "livekit", - "custom-endpointing-model" + "assistant.speech.interrupted" ], - "example": "vapi" + "maxLength": 1000 + }, + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + }, + { + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" + } + ] + } } }, "required": [ - "provider" + "on", + "do" ] }, - "LivekitSmartEndpointingPlan": { + "CallHookCustomerSpeechInterrupted": { "type": "object", "properties": { - "provider": { + "on": { "type": "string", - "description": "This is the provider for the smart endpointing plan.", + "description": "This is the event that triggers this hook", "enum": [ - "vapi", - "livekit", - "custom-endpointing-model" + "customer.speech.interrupted" ], - "example": "livekit" + "maxLength": 1000 }, - "waitFunction": { - "type": "string", - "description": "This expression describes how long the bot will wait to start speaking based on the likelihood that the user has reached an endpoint.\n\nThis is a millisecond valued function. It maps probabilities (real numbers on [0,1]) to milliseconds that the bot should wait before speaking ([0, \\infty]). Any negative values that are returned are set to zero (the bot can't start talking in the past).\n\nA probability of zero represents very high confidence that the caller has stopped speaking, and would like the bot to speak to them. A probability of one represents very high confidence that the caller is still speaking.\n\nUnder the hood, this is parsed into a mathjs expression. Whatever you use to write your expression needs to be valid with respect to mathjs\n\n@default \"20 + 500 * sqrt(x) + 2500 * x^3\"", - "examples": [ - "70 + 4000 * x", - "200 + 8000 * x", - "4000 * (1 - cos(pi * x))" - ] + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + }, + { + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" + } + ] + } } }, "required": [ - "provider" + "on", + "do" ] }, - "CustomEndpointingModelSmartEndpointingPlan": { + "ToolCallHookAction": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", - "description": "This is the provider for the smart endpointing plan. Use `custom-endpointing-model` for custom endpointing providers that are not natively supported.", + "description": "This is the type of action - must be \"tool\"", "enum": [ - "vapi", - "livekit", - "custom-endpointing-model" - ], - "example": "custom-endpointing-model" + "tool" + ] }, - "server": { - "description": "This is where the endpointing request will be sent. If not provided, will be sent to `assistant.server`. If that does not exist either, will be sent to `org.server`.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"call.endpointing.request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"message\": \"Hello, how are you?\",\n \"time\": 1234567890,\n \"secondsFromStart\": 0\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n{\n \"timeoutSeconds\": 0.5\n}\n\nThe timeout is the number of seconds to wait before considering the user's speech as finished. The endpointing timeout is automatically reset each time a new transcript is received (and another `call.endpointing.request` is sent).", - "allOf": [ + "tool": { + "description": "This is the tool to call. To use an existing tool, send `toolId` instead.", + "oneOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] + }, + "toolId": { + "type": "string", + "description": "This is the tool to call. To use a transient tool, send `tool` instead." } }, "required": [ - "provider" + "type" ] }, - "TranscriptionEndpointingPlan": { + "CustomerSpeechTimeoutOptions": { "type": "object", "properties": { - "onPunctuationSeconds": { + "timeoutSeconds": { "type": "number", - "description": "The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model. Defaults to 0.1.\n\nThis setting exists because the transcriber punctuates the transcription when it's more confident that customer has completed a thought.\n\n@default 0.1", - "minimum": 0, - "maximum": 3, - "example": 0.1 + "description": "This is the timeout in seconds before action is triggered.\nThe clock starts when the assistant finishes speaking and remains active until the user speaks.\n\n@default 7.5", + "minimum": 1, + "maximum": 1000 }, - "onNoPunctuationSeconds": { + "triggerMaxCount": { "type": "number", - "description": "The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model. Defaults to 1.5.\n\nThis setting exists to catch the cases where the transcriber was not confident enough to punctuate the transcription, but the customer is done and has been silent for a long time.\n\n@default 1.5", - "minimum": 0, - "maximum": 3, - "example": 1.5 + "description": "This is the maximum number of times the hook will trigger in a call.\n\n@default 3", + "minimum": 1, + "maximum": 10 }, - "onNumberSeconds": { - "type": "number", - "description": "The minimum number of seconds to wait after transcription ending with a number before sending a request to the model. Defaults to 0.4.\n\nThis setting exists because the transcriber will sometimes punctuate the transcription ending with a number, even though the customer hasn't uttered the full number. This happens commonly for long numbers when the customer reads the number in chunks.\n\n@default 0.5", - "minimum": 0, - "maximum": 3, - "example": 0.5 + "triggerResetMode": { + "type": "object", + "description": "This is whether the counter for hook trigger resets the user speaks.\n\n@default never" } - } + }, + "required": [ + "timeoutSeconds" + ] }, - "StartSpeakingPlan": { + "CallHookCustomerSpeechTimeout": { "type": "object", "properties": { - "waitSeconds": { - "type": "number", - "description": "This is how long assistant waits before speaking. Defaults to 0.4.\n\nThis is the minimum it will wait but if there is latency is the pipeline, this minimum will be exceeded. This is intended as a stopgap in case the pipeline is moving too fast.\n\nExample:\n- If model generates tokens and voice generates bytes within 100ms, the pipeline still waits 300ms before outputting speech.\n\nUsage:\n- If the customer is taking long pauses, set this to a higher value.\n- If the assistant is accidentally jumping in too much, set this to a higher value.\n\n@default 0.4", - "minimum": 0, - "maximum": 5, - "example": 0.4 - }, - "smartEndpointingEnabled": { - "example": false, - "deprecated": true, - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "enum": [ - "livekit" - ] - } - ] - }, - "smartEndpointingPlan": { - "description": "This is the plan for smart endpointing. Pick between Vapi smart endpointing or LiveKit smart endpointing (or nothing). We strongly recommend using livekit endpointing when working in English. LiveKit endpointing is not supported in other languages, yet.\n\nIf this is set, it will override and take precedence over `transcriptionEndpointingPlan`.\nThis plan will still be overridden by any matching `customEndpointingRules`.", - "oneOf": [ - { - "$ref": "#/components/schemas/VapiSmartEndpointingPlan", - "title": "Vapi" - }, - { - "$ref": "#/components/schemas/LivekitSmartEndpointingPlan", - "title": "Livekit" - }, - { - "$ref": "#/components/schemas/CustomEndpointingModelSmartEndpointingPlan", - "title": "Custom Endpointing Model" - } - ] + "on": { + "type": "string", + "description": "Must be either \"customer.speech.timeout\" or match the pattern \"customer.speech.timeout[property=value]\"", + "maxLength": 1000 }, - "customEndpointingRules": { + "do": { "type": "array", - "description": "These are the custom endpointing rules to set an endpointing timeout based on a regex on the customer's speech or the assistant's last message.\n\nUsage:\n- If you have yes/no questions like \"are you interested in a loan?\", you can set a shorter timeout.\n- If you have questions where the customer may pause to look up information like \"what's my account number?\", you can set a longer timeout.\n- If you want to wait longer while customer is enumerating a list of numbers, you can set a longer timeout.\n\nThese rules have the highest precedence and will override both `smartEndpointingPlan` and `transcriptionEndpointingPlan` when a rule is matched.\n\nThe rules are evaluated in order and the first one that matches will be used.\n\nOrder of precedence for endpointing:\n1. customEndpointingRules (if any match)\n2. smartEndpointingPlan (if set)\n3. transcriptionEndpointingPlan\n\n@default []", + "description": "This is the set of actions to perform when the hook triggers", "items": { "oneOf": [ { - "$ref": "#/components/schemas/AssistantCustomEndpointingRule", - "title": "Assistant" + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" }, { - "$ref": "#/components/schemas/CustomerCustomEndpointingRule", - "title": "Customer" + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" }, { - "$ref": "#/components/schemas/BothCustomEndpointingRule", - "title": "Both" + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" } ] } }, - "transcriptionEndpointingPlan": { - "description": "This determines how a customer speech is considered done (endpointing) using the transcription of customer's speech.\n\nOnce an endpoint is triggered, the request is sent to `assistant.model`.\n\nNote: This plan is only used if `smartEndpointingPlan` is not set. If both are provided, `smartEndpointingPlan` takes precedence.\nThis plan will also be overridden by any matching `customEndpointingRules`.", + "options": { + "description": "This is the set of filters that must match for the hook to trigger", "allOf": [ { - "$ref": "#/components/schemas/TranscriptionEndpointingPlan" + "$ref": "#/components/schemas/CustomerSpeechTimeoutOptions" } ] + }, + "name": { + "type": "string", + "description": "This is the name of the hook, it can be set by the user to identify the hook.\nIf no name is provided, the hook will be auto generated as UUID.\n\n@default UUID", + "maxLength": 1000 } - } + }, + "required": [ + "on", + "do" + ] }, - "StopSpeakingPlan": { + "CallHookModelResponseTimeout": { "type": "object", "properties": { - "numWords": { - "type": "number", - "description": "This is the number of words that the customer has to say before the assistant will stop talking.\n\nWords like \"stop\", \"actually\", \"no\", etc. will always interrupt immediately regardless of this value.\n\nWords like \"okay\", \"yeah\", \"right\" will never interrupt.\n\nWhen set to 0, `voiceSeconds` is used in addition to the transcriptions to determine the customer has started speaking.\n\nDefaults to 0.\n\n@default 0", - "minimum": 0, - "maximum": 10, - "example": 0 - }, - "voiceSeconds": { - "type": "number", - "description": "This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking.\n\nConsiderations:\n- A lower value might be more responsive but could potentially pick up non-speech sounds.\n- A higher value reduces false positives but might slightly delay the detection of speech onset.\n\nThis is only used if `numWords` is set to 0.\n\nDefaults to 0.2\n\n@default 0.2", - "minimum": 0, - "maximum": 0.5, - "example": 0.2 + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "enum": [ + "model.response.timeout" + ], + "maxLength": 1000 }, - "backoffSeconds": { - "type": "number", - "description": "This is the seconds to wait before the assistant will start talking again after being interrupted.\n\nDefaults to 1.\n\n@default 1", - "minimum": 0, - "maximum": 10, - "example": 1 + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + }, + { + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" + } + ] + } + } + }, + "required": [ + "on", + "do" + ] + }, + "AIEdgeCondition": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "ai" + ] }, - "acknowledgementPhrases": { - "description": "These are the phrases that will never interrupt the assistant, even if numWords threshold is met.\nThese are typically acknowledgement or backchanneling phrases.", - "example": [ - "i understand", - "i see", - "i got it", - "i hear you", - "im listening", - "im with you", - "right", - "okay", - "ok", - "sure", - "alright", - "got it", - "understood", - "yeah", - "yes", - "uh-huh", - "mm-hmm", - "gotcha", - "mhmm", - "ah", - "yeah okay", - "yeah sure" - ], - "default": [ - "i understand", - "i see", - "i got it", - "i hear you", - "im listening", - "im with you", - "right", - "okay", - "ok", - "sure", - "alright", - "got it", - "understood", - "yeah", - "yes", - "uh-huh", - "mm-hmm", - "gotcha", - "mhmm", - "ah", - "yeah okay", - "yeah sure" - ], - "type": "array", - "items": { - "type": "string", - "maxLength": 240 - } - }, - "interruptionPhrases": { - "description": "These are the phrases that will always interrupt the assistant immediately, regardless of numWords.\nThese are typically phrases indicating disagreement or desire to stop.", - "example": [ - "stop", - "shut", - "up", - "enough", - "quiet", - "silence", - "but", - "dont", - "not", - "no", - "hold", - "wait", - "cut", - "pause", - "nope", - "nah", - "nevermind", - "never", - "bad", - "actually" - ], - "default": [ - "stop", - "shut", - "up", - "enough", - "quiet", - "silence", - "but", - "dont", - "not", - "no", - "hold", - "wait", - "cut", - "pause", - "nope", - "nah", - "nevermind", - "never", - "bad", - "actually" - ], - "type": "array", - "items": { - "type": "string", - "maxLength": 240 - } - } - } - }, - "MonitorPlan": { - "type": "object", - "properties": { - "listenEnabled": { - "type": "boolean", - "description": "This determines whether the assistant's calls allow live listening. Defaults to true.\n\nFetch `call.monitor.listenUrl` to get the live listening URL.\n\n@default true", - "example": false - }, - "listenAuthenticationEnabled": { - "type": "boolean", - "description": "This enables authentication on the `call.monitor.listenUrl`.\n\nIf `listenAuthenticationEnabled` is `true`, the `call.monitor.listenUrl` will require an `Authorization: Bearer ` header.\n\n@default false", - "example": false - }, - "controlEnabled": { - "type": "boolean", - "description": "This determines whether the assistant's calls allow live control. Defaults to true.\n\nFetch `call.monitor.controlUrl` to get the live control URL.\n\nTo use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: https://docs.vapi.ai/api-reference/messages/client-inbound-message\n\n@default true", - "example": false - }, - "controlAuthenticationEnabled": { - "type": "boolean", - "description": "This enables authentication on the `call.monitor.controlUrl`.\n\nIf `controlAuthenticationEnabled` is `true`, the `call.monitor.controlUrl` will require an `Authorization: Bearer ` header.\n\n@default false", - "example": false - } - } - }, - "SmartDenoisingPlan": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether smart denoising using Krisp is enabled.", - "default": false - } - } - }, - "FourierDenoisingPlan": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether Fourier denoising is enabled. Note that this is experimental and may not work as expected.", - "default": false - }, - "mediaDetectionEnabled": { - "type": "boolean", - "description": "Whether automatic media detection is enabled. When enabled, the filter will automatically\ndetect consistent background TV/music/radio and switch to more aggressive filtering settings.\nOnly applies when enabled is true.", - "example": true, - "default": true - }, - "staticThreshold": { - "type": "number", - "description": "Static threshold in dB used as fallback when no baseline is established.", - "example": -35, - "minimum": -80, - "maximum": 0, - "default": -35 - }, - "baselineOffsetDb": { - "type": "number", - "description": "How far below the rolling baseline to filter audio, in dB.\nLower values (e.g., -10) are more aggressive, higher values (e.g., -20) are more conservative.", - "example": -15, - "minimum": -30, - "maximum": -5, - "default": -15 - }, - "windowSizeMs": { - "type": "number", - "description": "Rolling window size in milliseconds for calculating the audio baseline.\nLarger windows adapt more slowly but are more stable.", - "example": 3000, - "minimum": 1000, - "maximum": 30000, - "default": 3000 - }, - "baselinePercentile": { - "type": "number", - "description": "Percentile to use for baseline calculation (1-99).\nHigher percentiles (e.g., 85) focus on louder speech, lower percentiles (e.g., 50) include quieter speech.", - "example": 85, - "minimum": 1, - "maximum": 99, - "default": 85 + "prompt": { + "type": "string", + "description": "This is the prompt for the AI edge condition. It should evaluate to a boolean.", + "maxLength": 1000 } - } + }, + "required": [ + "type", + "prompt" + ] }, - "BackgroundSpeechDenoisingPlan": { + "Edge": { "type": "object", "properties": { - "smartDenoisingPlan": { - "description": "Whether smart denoising using Krisp is enabled.", - "allOf": [ - { - "$ref": "#/components/schemas/SmartDenoisingPlan" - } - ] - }, - "fourierDenoisingPlan": { - "description": "Whether Fourier denoising is enabled. Note that this is experimental and may not work as expected.\n\nThis can be combined with smart denoising, and will be run afterwards.", - "allOf": [ + "condition": { + "oneOf": [ { - "$ref": "#/components/schemas/FourierDenoisingPlan" + "$ref": "#/components/schemas/AIEdgeCondition", + "title": "AIEdgeCondition" } ] - } - } - }, - "KeypadInputPlan": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "This keeps track of whether the user has enabled keypad input.\nBy default, it is off.\n\n@default false" }, - "timeoutSeconds": { - "type": "number", - "description": "This is the time in seconds to wait before processing the input.\nIf the input is not received within this time, the input will be ignored.\nIf set to \"off\", the input will be processed when the user enters a delimiter or immediately if no delimiter is used.\n\n@default 2", - "minimum": 0, - "maximum": 10 + "from": { + "type": "string", + "maxLength": 80 }, - "delimiters": { + "to": { "type": "string", - "description": "This is the delimiter(s) that will be used to process the input.\nCan be '#', '*', or an empty array.", - "enum": [ - "#", - "*", - "" - ] + "maxLength": 80 + }, + "metadata": { + "type": "object", + "description": "This is for metadata you want to store on the edge." } - } + }, + "required": [ + "from", + "to" + ] }, - "WorkflowUserEditable": { + "RecordingConsentPlanStayOnLine": { "type": "object", "properties": { - "nodes": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ConversationNode", - "title": "ConversationNode" - }, - { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" - } - ] - } + "message": { + "type": "string", + "description": "This is the message asking for consent to record the call.\nIf the type is `stay-on-line`, the message should ask the user to hang up if they do not consent.\nIf the type is `verbal`, the message should ask the user to verbally consent or decline.", + "maxLength": 1000, + "examples": [ + "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.", + "This call may be recorded for quality and training purposes. Say \"I agree\" if you consent to being recorded, or \"I disagree\" if you do not consent." + ] }, - "model": { - "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", + "voice": { + "description": "This is the voice to use for the consent message. If not specified, inherits from the assistant's voice.\nUse a different voice for the consent message for a better user experience.", "oneOf": [ { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" }, { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" }, { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" }, { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, - "transcriber": { - "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", - "oneOf": [ + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, { - "$ref": "#/components/schemas/AssemblyAITranscriber", - "title": "AssemblyAITranscriber" + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" }, { - "$ref": "#/components/schemas/AzureSpeechTranscriber", - "title": "AzureSpeechTranscriber" + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" }, { - "$ref": "#/components/schemas/CustomTranscriber", - "title": "CustomTranscriber" + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" }, { - "$ref": "#/components/schemas/DeepgramTranscriber", - "title": "DeepgramTranscriber" + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" }, { - "$ref": "#/components/schemas/ElevenLabsTranscriber", - "title": "ElevenLabsTranscriber" + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" }, { - "$ref": "#/components/schemas/GladiaTranscriber", - "title": "GladiaTranscriber" + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" }, { - "$ref": "#/components/schemas/GoogleTranscriber", - "title": "GoogleTranscriber" + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" }, { - "$ref": "#/components/schemas/SpeechmaticsTranscriber", - "title": "SpeechmaticsTranscriber" + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" }, { - "$ref": "#/components/schemas/TalkscriberTranscriber", - "title": "TalkscriberTranscriber" + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" }, { - "$ref": "#/components/schemas/OpenAITranscriber", - "title": "OpenAITranscriber" + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" }, { - "$ref": "#/components/schemas/CartesiaTranscriber", - "title": "CartesiaTranscriber" + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" } ] }, + "type": { + "type": "string", + "description": "This is the type of recording consent plan. This type assumes consent is granted if the user stays on the line.", + "enum": [ + "stay-on-line" + ], + "example": "stay-on-line" + }, + "waitSeconds": { + "type": "number", + "description": "Number of seconds to wait before transferring to the assistant if user stays on the call", + "minimum": 1, + "maximum": 6, + "default": 3, + "example": 3 + } + }, + "required": [ + "message", + "type" + ] + }, + "RecordingConsentPlanVerbal": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "This is the message asking for consent to record the call.\nIf the type is `stay-on-line`, the message should ask the user to hang up if they do not consent.\nIf the type is `verbal`, the message should ask the user to verbally consent or decline.", + "maxLength": 1000, + "examples": [ + "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.", + "This call may be recorded for quality and training purposes. Say \"I agree\" if you consent to being recorded, or \"I disagree\" if you do not consent." + ] + }, "voice": { - "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "description": "This is the voice to use for the consent message. If not specified, inherits from the assistant's voice.\nUse a different voice for the consent message for a better user experience.", "oneOf": [ { "$ref": "#/components/schemas/AzureVoice", @@ -16816,6 +18525,10 @@ "$ref": "#/components/schemas/PlayHTVoice", "title": "PlayHTVoice" }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, { "$ref": "#/components/schemas/RimeAIVoice", "title": "RimeAIVoice" @@ -16846,1644 +18559,2044 @@ } ] }, - "observabilityPlan": { - "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", - "oneOf": [ - { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" - } + "type": { + "type": "string", + "description": "This is the type of recording consent plan. This type assumes consent is granted if the user verbally consents or declines.", + "enum": [ + "verbal" + ], + "example": "verbal" + }, + "declineTool": { + "type": "object", + "description": "Tool to execute if user verbally declines recording consent" + }, + "declineToolId": { + "type": "string", + "description": "ID of existing tool to execute if user verbally declines recording consent" + } + }, + "required": [ + "message", + "type" + ] + }, + "SecurityFilterBase": { + "type": "object", + "properties": {} + }, + "SecurityFilterPlan": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the security filter is enabled.\n@default false", + "default": false + }, + "filters": { + "description": "Array of security filter types to apply.\nIf array is not empty, only those security filters are run.", + "example": "[{ type: \"sql-injection\" }, { type: \"xss\" }]", + "type": "array", + "items": { + "$ref": "#/components/schemas/SecurityFilterBase" + } + }, + "mode": { + "type": "string", + "description": "Mode of operation when a security threat is detected.\n- 'sanitize': Remove or replace the threatening content\n- 'reject': Replace the entire transcript with replacement text\n- 'replace': Replace threatening patterns with replacement text\n@default 'sanitize'", + "enum": [ + "sanitize", + "reject", + "replace" ], + "default": "sanitize" + }, + "replacementText": { + "type": "string", + "description": "Text to use when replacing filtered content.\n@default '[FILTERED]'", + "default": "[FILTERED]" + } + } + }, + "CompliancePlan": { + "type": "object", + "properties": { + "hipaaEnabled": { + "type": "boolean", + "description": "When this is enabled, no logs, recordings, or transcriptions will be stored.\nAt the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.", + "example": { + "hipaaEnabled": false + } + }, + "pciEnabled": { + "type": "boolean", + "description": "When this is enabled, the user will be restricted to use PCI-compliant providers, and no logs or transcripts are stored.\nAt the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false.", + "example": { + "pciEnabled": false + } + }, + "securityFilterPlan": { + "description": "This is the security filter plan for the assistant. It allows filtering of transcripts for security threats before sending to LLM.", "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$ref": "#/components/schemas/SecurityFilterPlan" } ] }, - "backgroundSound": { - "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "recordingConsentPlan": { "oneOf": [ { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" + "$ref": "#/components/schemas/RecordingConsentPlanStayOnLine", + "title": "RecordingConsentStayOnLinePlan" }, { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + "$ref": "#/components/schemas/RecordingConsentPlanVerbal", + "title": "RecordingConsentPlanVerbal" } - ] - }, - "hooks": { + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "stay-on-line": "#/components/schemas/RecordingConsentPlanStayOnLine", + "verbal": "#/components/schemas/RecordingConsentPlanVerbal" + } + } + } + } + }, + "StructuredDataPlan": { + "type": "object", + "properties": { + "messages": { + "description": "These are the messages used to generate the structured data.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert data extractor. You will be given a transcript of a call. Extract structured data per the JSON Schema. DO NOT return anything except the structured data.\\n\\nJson Schema:\\\\n{{schema}}\\n\\nOnly respond with the JSON.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`- {{endedReason}}: the ended reason of the call from `call.endedReason`", "type": "array", - "description": "This is a set of actions that will be performed on certain events.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" - }, - { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" - }, - { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" - }, - { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" - } - ] + "type": "object" } }, - "credentials": { - "type": "array", - "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", - "title": "AnthropicCredential" - }, - { - "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", - "title": "AnyscaleCredential" - }, - { - "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", - "title": "AssemblyAICredential" - }, - { - "$ref": "#/components/schemas/CreateAzureCredentialDTO", - "title": "AzureCredential" - }, - { - "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "title": "AzureOpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "title": "ByoSipTrunkCredential" - }, - { - "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", - "title": "CartesiaCredential" - }, - { - "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", - "title": "CerebrasCredential" - }, - { - "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", - "title": "CloudflareCredential" - }, - { - "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", - "title": "CustomLLMCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" - }, - { - "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" - }, - { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" - }, - { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCredentialDTO", - "title": "GoogleCredential" - }, - { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" - }, - { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" - }, - { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" - }, - { - "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" - }, - { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" - }, - { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" - }, - { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, - { - "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" - }, - { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" - }, - { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" - }, - { - "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", - "title": "PlayHTCredential" - }, - { - "$ref": "#/components/schemas/CreateRimeAICredentialDTO", - "title": "RimeAICredential" - }, - { - "$ref": "#/components/schemas/CreateRunpodCredentialDTO", - "title": "RunpodCredential" - }, - { - "$ref": "#/components/schemas/CreateS3CredentialDTO", - "title": "S3Credential" - }, - { - "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", - "title": "SmallestAICredential" - }, - { - "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "title": "SpeechmaticsCredential" - }, - { - "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", - "title": "SupabaseCredential" - }, - { - "$ref": "#/components/schemas/CreateTavusCredentialDTO", - "title": "TavusCredential" - }, - { - "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" - }, - { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" - }, - { - "$ref": "#/components/schemas/CreateTwilioCredentialDTO", - "title": "TwilioCredential" - }, - { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" - }, - { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" - }, - { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" - }, - { - "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "title": "SlackOAuth2AuthorizationCredential" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "title": "GoHighLevelMCPCredential" - }, - { - "$ref": "#/components/schemas/CreateInworldCredentialDTO", - "title": "InworldCredential" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", - "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", - "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", - "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", - "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "azure": "#/components/schemas/CreateAzureCredentialDTO", - "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", - "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", - "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", - "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", - "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", - "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", - "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", - "gcp": "#/components/schemas/CreateGcpCredentialDTO", - "gladia": "#/components/schemas/CreateGladiaCredentialDTO", - "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "google": "#/components/schemas/CreateGoogleCredentialDTO", - "groq": "#/components/schemas/CreateGroqCredentialDTO", - "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", - "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", - "lmnt": "#/components/schemas/CreateLmntCredentialDTO", - "make": "#/components/schemas/CreateMakeCredentialDTO", - "openai": "#/components/schemas/CreateOpenAICredentialDTO", - "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", - "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", - "playht": "#/components/schemas/CreatePlayHTCredentialDTO", - "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", - "runpod": "#/components/schemas/CreateRunpodCredentialDTO", - "s3": "#/components/schemas/CreateS3CredentialDTO", - "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", - "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", - "tavus": "#/components/schemas/CreateTavusCredentialDTO", - "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", - "twilio": "#/components/schemas/CreateTwilioCredentialDTO", - "vonage": "#/components/schemas/CreateVonageCredentialDTO", - "webhook": "#/components/schemas/CreateWebhookCredentialDTO", - "xai": "#/components/schemas/CreateXAiCredentialDTO", - "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", - "hume": "#/components/schemas/CreateHumeCredentialDTO", - "mistral": "#/components/schemas/CreateMistralCredentialDTO", - "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "trieve": "#/components/schemas/CreateTrieveCredentialDTO", - "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" - } - } - } - }, - "name": { - "type": "string", - "maxLength": 80 - }, - "edges": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Edge" - } - }, - "globalPrompt": { - "type": "string", - "maxLength": 5000 + "enabled": { + "type": "boolean", + "description": "This determines whether structured data is generated and stored in `call.analysis.structuredData`. Defaults to false.\n\nUsage:\n- If you want to extract structured data, set this to true and provide a `schema`.\n\n@default false" }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", + "schema": { + "description": "This is the schema of the structured data. The output is stored in `call.analysis.structuredData`.\n\nComplete guide on JSON Schema can be found [here](https://ajv.js.org/json-schema.html#json-data-type).", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "timeoutSeconds": { + "type": "number", + "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.structuredData` will be empty.\n\nUsage:\n- To guarantee the structured data is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", + "minimum": 1, + "maximum": 60 + } + } + }, + "StructuredDataMultiPlan": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "This is the key of the structured data plan in the catalog." + }, + "plan": { + "description": "This is an individual structured data plan in the catalog.", "allOf": [ { - "$ref": "#/components/schemas/CompliancePlan" + "$ref": "#/components/schemas/StructuredDataPlan" } ] + } + }, + "required": [ + "key", + "plan" + ] + }, + "SuccessEvaluationPlan": { + "type": "object", + "properties": { + "rubric": { + "type": "string", + "enum": [ + "NumericScale", + "DescriptiveScale", + "Checklist", + "Matrix", + "PercentageScale", + "LikertScale", + "AutomaticRubric", + "PassFail" + ], + "description": "This enforces the rubric of the evaluation. The output is stored in `call.analysis.successEvaluation`.\n\nOptions include:\n- 'NumericScale': A scale of 1 to 10.\n- 'DescriptiveScale': A scale of Excellent, Good, Fair, Poor.\n- 'Checklist': A checklist of criteria and their status.\n- 'Matrix': A grid that evaluates multiple criteria across different performance levels.\n- 'PercentageScale': A scale of 0% to 100%.\n- 'LikertScale': A scale of Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree.\n- 'AutomaticRubric': Automatically break down evaluation into several criteria, each with its own score.\n- 'PassFail': A simple 'true' if call passed, 'false' if not.\n\nDefault is 'PassFail'." }, - "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "messages": { + "description": "These are the messages used to generate the success evaluation.\n\n@default: ```\n[\n {\n \"role\": \"system\",\n \"content\": \"You are an expert call evaluator. You will be given a transcript of a call and the system prompt of the AI participant. Determine if the call was successful based on the objectives inferred from the system prompt. DO NOT return anything except the result.\\n\\nRubric:\\\\n{{rubric}}\\n\\nOnly respond with the result.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here is the transcript:\\n\\n{{transcript}}\\n\\n\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Here was the system prompt of the call:\\n\\n{{systemPrompt}}\\n\\n. Here is the ended reason of the call:\\n\\n{{endedReason}}\\n\\n\"\n }\n]```\n\nYou can customize by providing any messages you want.\n\nHere are the template variables available:\n- {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric`- {{endedReason}}: the ended reason of the call from `call.endedReason`", + "type": "array", + "items": { + "type": "object" + } + }, + "enabled": { + "type": "boolean", + "description": "This determines whether a success evaluation is generated and stored in `call.analysis.successEvaluation`. Defaults to true.\n\nUsage:\n- If you want to disable the success evaluation, set this to false.\n\n@default true" + }, + "timeoutSeconds": { + "type": "number", + "description": "This is how long the request is tried before giving up. When request times out, `call.analysis.successEvaluation` will be empty.\n\nUsage:\n- To guarantee the success evaluation is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds", + "minimum": 1, + "maximum": 60 + } + } + }, + "AnalysisPlan": { + "type": "object", + "properties": { + "minMessagesThreshold": { + "type": "number", + "description": "The minimum number of messages required to run the analysis plan.\nIf the number of messages is less than this, analysis will be skipped.\n@default 2", + "minimum": 0 + }, + "summaryPlan": { + "description": "This is the plan for generating the summary of the call. This outputs to `call.analysis.summary`.", "allOf": [ { - "$ref": "#/components/schemas/AnalysisPlan" + "$ref": "#/components/schemas/SummaryPlan" } ] }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "structuredDataPlan": { + "description": "This is the plan for generating the structured data from the call. This outputs to `call.analysis.structuredData`.", "allOf": [ { - "$ref": "#/components/schemas/ArtifactPlan" + "$ref": "#/components/schemas/StructuredDataPlan" } ] }, - "startSpeakingPlan": { - "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "structuredDataMultiPlan": { + "description": "This is an array of structured data plan catalogs. Each entry includes a `key` and a `plan` for generating the structured data from the call. This outputs to `call.analysis.structuredDataMulti`.", + "type": "array", + "items": { + "$ref": "#/components/schemas/StructuredDataMultiPlan" + } + }, + "successEvaluationPlan": { + "description": "This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`.", "allOf": [ { - "$ref": "#/components/schemas/StartSpeakingPlan" + "$ref": "#/components/schemas/SuccessEvaluationPlan" } ] }, - "stopSpeakingPlan": { - "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", - "allOf": [ + "outcomeIds": { + "description": "This is an array of outcome UUIDs to be calculated during analysis.\nThe outcomes will be calculated and stored in `call.analysis.outcomes`.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TranscriptPlan": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "This determines whether the transcript is stored in `call.artifact.transcript`. Defaults to true.\n\n@default true", + "example": true + }, + "assistantName": { + "type": "string", + "description": "This is the name of the assistant in the transcript. Defaults to 'AI'.\n\nUsage:\n- If you want to change the name of the assistant in the transcript, set this. Example, here is what the transcript would look like with `assistantName` set to 'Buyer':\n```\nUser: Hello, how are you?\nBuyer: I'm fine.\nUser: Do you want to buy a car?\nBuyer: No.\n```\n\n@default 'AI'" + }, + "userName": { + "type": "string", + "description": "This is the name of the user in the transcript. Defaults to 'User'.\n\nUsage:\n- If you want to change the name of the user in the transcript, set this. Example, here is what the transcript would look like with `userName` set to 'Seller':\n```\nSeller: Hello, how are you?\nAI: I'm fine.\nSeller: Do you want to buy a car?\nAI: No.\n```\n\n@default 'User'" + } + } + }, + "ComplianceOverride": { + "type": "object", + "properties": { + "forceStoreOnHipaaEnabled": { + "type": "boolean", + "description": "Force storage for this output under HIPAA. Only enable if output contains no sensitive data.", + "example": false + } + } + }, + "CreateStructuredOutputDTO": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of structured output.\n\n- 'ai': Uses an LLM to extract structured data from the conversation (default).\n- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.\n\nDefaults to 'ai' if not specified.", + "enum": [ + "ai", + "regex" + ], + "default": "ai" + }, + "regex": { + "type": "string", + "description": "This is the regex pattern to match against the transcript.\n\nOnly used when type is 'regex'. Supports both raw patterns (e.g. '\\d+') and\nregex literal format (e.g. '/\\d+/gi'). Uses RE2 syntax for safety.\n\nThe result depends on the schema type:\n- boolean: true if the pattern matches, false otherwise\n- string: the first match or first capture group\n- number/integer: the first match parsed as a number\n- array: all matches", + "minLength": 1, + "maxLength": 1000 + }, + "model": { + "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.\ni.e.:\n`{{structuredOutput}}`\n`{{structuredOutput.name}}`\n`{{structuredOutput.description}}`\n`{{structuredOutput.schema}}`\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", + "oneOf": [ { - "$ref": "#/components/schemas/StopSpeakingPlan" + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" } ] }, - "monitorPlan": { - "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, "allOf": [ { - "$ref": "#/components/schemas/MonitorPlan" + "$ref": "#/components/schemas/ComplianceOverride" } ] }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", + "name": { + "type": "string", + "description": "This is the name of the structured output.", + "minLength": 1, + "maxLength": 40 + }, + "schema": { + "description": "This is the JSON Schema definition for the structured output.\n\nThis is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", "allOf": [ { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "credentialIds": { - "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "description": { + "type": "string", + "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." + }, + "assistantIds": { + "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", "type": "array", "items": { "type": "string" } }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", - "allOf": [ - { - "$ref": "#/components/schemas/KeypadInputPlan" - } - ] + "workflowIds": { + "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "nodes", "name", - "edges" + "schema" ] }, - "VapiModel": { + "ScorecardMetric": { "type": "object", "properties": { - "messages": { - "description": "This is the starting state for the conversation.", + "structuredOutputId": { + "type": "string", + "description": "This is the unique identifier for the structured output that will be used to evaluate the scorecard.\nThe structured output must be of type number or boolean only for now." + }, + "conditions": { + "description": "These are the conditions that will be used to evaluate the scorecard.\nEach condition will have a comparator, value, and points that will be used to calculate the final score.\nThe points will be added to the overall score if the condition is met.\nThe overall score will be normalized to a 100 point scale to ensure uniformity across different scorecards.", "type": "array", "items": { - "$ref": "#/components/schemas/OpenAIMessage" + "type": "object" } + } + }, + "required": [ + "structuredOutputId", + "conditions" + ] + }, + "CreateScorecardDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 80 }, - "tools": { + "description": { + "type": "string", + "description": "This is the description of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 500 + }, + "metrics": { + "description": "These are the metrics that will be used to evaluate the scorecard.\nEach metric will have a set of conditions and points that will be used to generate the score.", "type": "array", - "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - } - ] + "$ref": "#/components/schemas/ScorecardMetric" } }, - "toolIds": { - "description": "These are the tools that the assistant can use during the call. To use transient tools, use `tools`.\n\nBoth `tools` and `toolIds` can be used together.", + "assistantIds": { + "description": "These are the assistant IDs that this scorecard is linked to.\nWhen linked to assistants, this scorecard will be available for evaluation during those assistants' calls.", "type": "array", "items": { "type": "string" } + } + }, + "required": [ + "metrics" + ] + }, + "ArtifactPlan": { + "type": "object", + "properties": { + "recordingEnabled": { + "type": "boolean", + "description": "This determines whether assistant's calls are recorded. Defaults to true.\n\nUsage:\n- If you don't want to record the calls, set this to false.\n- If you want to record the calls when `assistant.hipaaEnabled` (deprecated) or `assistant.compliancePlan.hipaaEnabled` explicity set this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nYou can find the recording at `call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended.\n\n@default true", + "example": true }, - "knowledgeBase": { - "description": "These are the options for the knowledge base.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", - "title": "Custom" - } - ] - }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, - "provider": { + "recordingFormat": { "type": "string", + "description": "This determines the format of the recording. Defaults to `wav;l16`.\n\n@default 'wav;l16'", "enum": [ - "vapi" + "wav;l16", + "mp3" ] }, - "workflowId": { + "recordingUseCustomStorageEnabled": { + "type": "boolean", + "description": "This determines whether to use custom storage (S3 or GCP) for call recordings when storage credentials are configured.\n\nWhen set to false, recordings will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured.\n\nUsage:\n- Set to false if you have custom storage configured but want to store recordings on Vapi's storage for this assistant.\n- Set to true (or leave unset) to use your custom storage for recordings when available.\n\n@default true", + "example": true + }, + "videoRecordingEnabled": { + "type": "boolean", + "description": "This determines whether the video is recorded during the call. Defaults to false. Only relevant for `webCall` type.\n\nYou can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended.\n\n@default false", + "example": false + }, + "fullMessageHistoryEnabled": { + "type": "boolean", + "description": "This determines whether the artifact contains the full message history, even after handoff context engineering. Defaults to false.", + "example": false + }, + "pcapEnabled": { + "type": "boolean", + "description": "This determines whether the SIP packet capture is enabled. Defaults to true. Only relevant for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`.\n\nYou can find the packet capture at `call.artifact.pcapUrl` after the call is ended.\n\n@default true", + "example": true + }, + "pcapS3PathPrefix": { "type": "string", - "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead." + "description": "This is the path where the SIP packet capture will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the packet capture to a specific path, set this to the path. Example: `/my-assistant-captures`.\n- If you want to upload the packet capture to the root of the bucket, set this to `/`.\n\n@default '/'", + "example": "/pcaps" }, - "workflow": { - "description": "This is the workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.", + "pcapUseCustomStorageEnabled": { + "type": "boolean", + "description": "This determines whether to use custom storage (S3 or GCP) for SIP packet captures when storage credentials are configured.\n\nWhen set to false, packet captures will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured.\n\nUsage:\n- Set to false if you have custom storage configured but want to store packet captures on Vapi's storage for this assistant.\n- Set to true (or leave unset) to use your custom storage for packet captures when available.\n\n@default true", + "example": true + }, + "loggingEnabled": { + "type": "boolean", + "description": "This determines whether the call logs are enabled. Defaults to true.\n\n@default true", + "example": true + }, + "loggingUseCustomStorageEnabled": { + "type": "boolean", + "description": "This determines whether to use custom storage (S3 or GCP) for call logs when storage credentials are configured.\n\nWhen set to false, logs will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured.\n\nUsage:\n- Set to false if you have custom storage configured but want to store logs on Vapi's storage for this assistant.\n- Set to true (or leave unset) to use your custom storage for logs when available.\n\n@default true", + "example": true + }, + "transcriptPlan": { + "description": "This is the plan for `call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.", "allOf": [ { - "$ref": "#/components/schemas/WorkflowUserEditable" + "$ref": "#/components/schemas/TranscriptPlan" } ] }, - "model": { + "recordingPath": { "type": "string", - "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" - }, - "temperature": { - "type": "number", - "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", - "minimum": 0, - "maximum": 2 - }, - "maxTokens": { - "type": "number", - "description": "This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.", - "minimum": 50, - "maximum": 10000 - }, - "emotionRecognitionEnabled": { - "type": "boolean", - "description": "This determines whether we detect user's emotion while they speak and send it as an additional info to model.\n\nDefault `false` because the model is usually are good at understanding the user's emotion from text.\n\n@default false" + "description": "This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the recording to a specific path, set this to the path. Example: `/my-assistant-recordings`.\n- If you want to upload the recording to the root of the bucket, set this to `/`.\n\n@default '/'" }, - "numFastTurns": { - "type": "number", - "description": "This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.\n\nDefault is 0.\n\n@default 0", - "minimum": 0 - } - }, - "required": [ - "provider", - "model" - ] - }, - "XaiModel": { - "type": "object", - "properties": { - "messages": { - "description": "This is the starting state for the conversation.", + "structuredOutputIds": { + "description": "This is an array of structured output IDs to be calculated during the call.\nThe outputs will be extracted and stored in `call.artifact.structuredOutputs` after the call is ended.", "type": "array", "items": { - "$ref": "#/components/schemas/OpenAIMessage" + "type": "string" } }, - "tools": { + "structuredOutputs": { + "description": "This is an array of transient structured outputs to be calculated during the call.\nThe outputs will be extracted and stored in `call.artifact.structuredOutputs` after the call is ended.\nUse this to provide inline structured output configurations instead of referencing existing ones via structuredOutputIds.", "type": "array", - "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - } - ] + "$ref": "#/components/schemas/CreateStructuredOutputDTO" } }, - "toolIds": { - "description": "These are the tools that the assistant can use during the call. To use transient tools, use `tools`.\n\nBoth `tools` and `toolIds` can be used together.", + "scorecardIds": { + "description": "This is an array of scorecard IDs that will be evaluated based on the structured outputs extracted during the call.\nThe scorecards will be evaluated and the results will be stored in `call.artifact.scorecards` after the call has ended.", "type": "array", "items": { "type": "string" } }, - "knowledgeBase": { - "description": "These are the options for the knowledge base.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", - "title": "Custom" - } - ] - }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, - "model": { - "type": "string", - "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", - "enum": [ - "grok-beta", - "grok-2", - "grok-3" - ] + "scorecards": { + "description": "This is the array of scorecards that will be evaluated based on the structured outputs extracted during the call.\nThe scorecards will be evaluated and the results will be stored in `call.artifact.scorecards` after the call has ended.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateScorecardDTO" + } }, - "provider": { + "loggingPath": { "type": "string", - "enum": [ - "xai" - ] + "description": "This is the path where the call logs will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard.\n\nIf credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it.\n\nUsage:\n- If you want to upload the call logs to a specific path, set this to the path. Example: `/my-assistant-logs`.\n- If you want to upload the call logs to the root of the bucket, set this to `/`.\n\n@default '/'" + } + } + }, + "StopSpeakingPlan": { + "type": "object", + "properties": { + "numWords": { + "type": "number", + "description": "This is the number of words that the customer has to say before the assistant will stop talking.\n\nWords like \"stop\", \"actually\", \"no\", etc. will always interrupt immediately regardless of this value.\n\nWords like \"okay\", \"yeah\", \"right\" will never interrupt.\n\nWhen set to 0, `voiceSeconds` is used in addition to the transcriptions to determine the customer has started speaking.\n\nDefaults to 0.\n\n@default 0", + "minimum": 0, + "maximum": 10, + "example": 0 }, - "temperature": { + "voiceSeconds": { "type": "number", - "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", + "description": "This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking.\n\nConsiderations:\n- A lower value might be more responsive but could potentially pick up non-speech sounds.\n- A higher value reduces false positives but might slightly delay the detection of speech onset.\n\nThis is only used if `numWords` is set to 0.\n\nDefaults to 0.2\n\n@default 0.2", "minimum": 0, - "maximum": 2 + "maximum": 0.5, + "example": 0.2 }, - "maxTokens": { + "backoffSeconds": { "type": "number", - "description": "This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.", - "minimum": 50, - "maximum": 10000 + "description": "This is the seconds to wait before the assistant will start talking again after being interrupted.\n\nDefaults to 1.\n\n@default 1", + "minimum": 0, + "maximum": 10, + "example": 1 }, - "emotionRecognitionEnabled": { - "type": "boolean", - "description": "This determines whether we detect user's emotion while they speak and send it as an additional info to model.\n\nDefault `false` because the model is usually are good at understanding the user's emotion from text.\n\n@default false" + "acknowledgementPhrases": { + "description": "These are the phrases that will never interrupt the assistant, even if numWords threshold is met.\nThese are typically acknowledgement or backchanneling phrases.", + "example": [ + "i understand", + "i see", + "i got it", + "i hear you", + "im listening", + "im with you", + "right", + "okay", + "ok", + "sure", + "alright", + "got it", + "understood", + "yeah", + "yes", + "uh-huh", + "mm-hmm", + "gotcha", + "mhmm", + "ah", + "yeah okay", + "yeah sure" + ], + "default": [ + "i understand", + "i see", + "i got it", + "i hear you", + "im listening", + "im with you", + "right", + "okay", + "ok", + "sure", + "alright", + "got it", + "understood", + "yeah", + "yes", + "uh-huh", + "mm-hmm", + "gotcha", + "mhmm", + "ah", + "yeah okay", + "yeah sure" + ], + "type": "array", + "items": { + "type": "string", + "maxLength": 240 + } }, - "numFastTurns": { - "type": "number", - "description": "This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.\n\nDefault is 0.\n\n@default 0", - "minimum": 0 + "interruptionPhrases": { + "description": "These are the phrases that will always interrupt the assistant immediately, regardless of numWords.\nThese are typically phrases indicating disagreement or desire to stop.", + "example": [ + "stop", + "shut", + "up", + "enough", + "quiet", + "silence", + "but", + "dont", + "not", + "no", + "hold", + "wait", + "cut", + "pause", + "nope", + "nah", + "nevermind", + "never", + "bad", + "actually" + ], + "default": [ + "stop", + "shut", + "up", + "enough", + "quiet", + "silence", + "but", + "dont", + "not", + "no", + "hold", + "wait", + "cut", + "pause", + "nope", + "nah", + "nevermind", + "never", + "bad", + "actually" + ], + "type": "array", + "items": { + "type": "string", + "maxLength": 240 + } } - }, - "required": [ - "model", - "provider" - ] + } }, - "ExactReplacement": { + "MonitorPlan": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "This is the exact replacement type. You can use this to replace a specific word or phrase with a different word or phrase.\n\nUsage:\n- Replace \"hello\" with \"hi\": { type: 'exact', key: 'hello', value: 'hi' }\n- Replace \"good morning\" with \"good day\": { type: 'exact', key: 'good morning', value: 'good day' }\n- Replace a specific name: { type: 'exact', key: 'John Doe', value: 'Jane Smith' }\n- Replace an acronym: { type: 'exact', key: 'AI', value: 'Artificial Intelligence' }\n- Replace a company name with its phonetic pronunciation: { type: 'exact', key: 'Vapi', value: 'Vappy' }", - "enum": [ - "exact" - ] + "listenEnabled": { + "type": "boolean", + "description": "This determines whether the assistant's calls allow live listening. Defaults to true.\n\nFetch `call.monitor.listenUrl` to get the live listening URL.\n\n@default true", + "example": false }, - "replaceAllEnabled": { + "listenAuthenticationEnabled": { "type": "boolean", - "description": "This option let's you control whether to replace all instances of the key or only the first one. By default, it only replaces the first instance.\nExamples:\n- For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: false }. Before: \"hello world, hello universe\" | After: \"hi world, hello universe\"\n- For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: true }. Before: \"hello world, hello universe\" | After: \"hi world, hi universe\"\n@default false", - "default": false + "description": "This enables authentication on the `call.monitor.listenUrl`.\n\nIf `listenAuthenticationEnabled` is `true`, the `call.monitor.listenUrl` will require an `Authorization: Bearer ` header.\n\n@default false", + "example": false }, - "key": { - "type": "string", - "description": "This is the key to replace." + "controlEnabled": { + "type": "boolean", + "description": "This determines whether the assistant's calls allow live control. Defaults to true.\n\nFetch `call.monitor.controlUrl` to get the live control URL.\n\nTo use, send any control message via a POST request to `call.monitor.controlUrl`. Here are the types of controls supported: https://docs.vapi.ai/api-reference/messages/client-inbound-message\n\n@default true", + "example": false }, - "value": { - "type": "string", - "description": "This is the value that will replace the match.", - "maxLength": 1000 + "controlAuthenticationEnabled": { + "type": "boolean", + "description": "This enables authentication on the `call.monitor.controlUrl`.\n\nIf `controlAuthenticationEnabled` is `true`, the `call.monitor.controlUrl` will require an `Authorization: Bearer ` header.\n\n@default false", + "example": false + }, + "monitorIds": { + "description": "This the set of monitor ids that are attached to the assistant.\nThe source of truth for the monitor ids is the assistant_monitor join table.\nThis field can be used for transient assistants and to update assistants with new monitor ids.\n\n@default []", + "example": [ + "123e4567-e89b-12d3-a456-426614174000" + ], + "type": "array", + "items": { + "type": "string" + } } - }, - "required": [ - "type", - "key", - "value" - ] + } }, - "RegexReplacement": { + "KeypadInputPlan": { "type": "object", "properties": { - "type": { + "enabled": { + "type": "boolean", + "description": "This keeps track of whether the user has enabled keypad input.\nBy default, it is off.\n\n@default false" + }, + "timeoutSeconds": { + "type": "number", + "description": "This is the time in seconds to wait before processing the input.\nIf the input is not received within this time, the input will be ignored.\nIf set to \"off\", the input will be processed when the user enters a delimiter or immediately if no delimiter is used.\n\n@default 2", + "minimum": 0, + "maximum": 10 + }, + "delimiters": { "type": "string", - "description": "This is the regex replacement type. You can use this to replace a word or phrase that matches a pattern.\n\nUsage:\n- Replace all numbers with \"some number\": { type: 'regex', regex: '\\\\d+', value: 'some number' }\n- Replace email addresses with \"[EMAIL]\": { type: 'regex', regex: '\\\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Z|a-z]{2,}\\\\b', value: '[EMAIL]' }\n- Replace phone numbers with a formatted version: { type: 'regex', regex: '(\\\\d{3})(\\\\d{3})(\\\\d{4})', value: '($1) $2-$3' }\n- Replace all instances of \"color\" or \"colour\" with \"hue\": { type: 'regex', regex: 'colou?r', value: 'hue' }\n- Capitalize the first letter of every sentence: { type: 'regex', regex: '(?<=\\\\. |^)[a-z]', value: (match) => match.toUpperCase() }", + "description": "This is the delimiter(s) that will be used to process the input.\nCan be '#', '*', or an empty array.", "enum": [ - "regex" + "#", + "*", + "" ] - }, - "regex": { - "type": "string", - "description": "This is the regex pattern to replace.\n\nNote:\n- This works by using the `string.replace` method in Node.JS. Eg. `\"hello there\".replace(/hello/g, \"hi\")` will return `\"hi there\"`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead." - }, - "options": { - "description": "These are the options for the regex replacement. Defaults to all disabled.\n\n@default []", - "type": "array", - "items": { - "$ref": "#/components/schemas/RegexOption" - } - }, - "value": { - "type": "string", - "description": "This is the value that will replace the match.", - "maxLength": 1000 } - }, - "required": [ - "type", - "regex", - "value" - ] + } }, - "FormatPlan": { + "WorkflowUserEditable": { "type": "object", "properties": { - "enabled": { - "type": "boolean", - "description": "This determines whether the chunk is formatted before being sent to the voice provider. This helps with enunciation. This includes phone numbers, emails and addresses. Default `true`.\n\nUsage:\n- To rely on the voice provider's formatting logic, set this to `false`.\n\nIf `voice.chunkPlan.enabled` is `false`, this is automatically `false` since there's no chunk to format.\n\n@default true", - "example": true - }, - "numberToDigitsCutoff": { - "type": "number", - "description": "This is the cutoff after which a number is converted to individual digits instead of being spoken as words.\n\nExample:\n- If cutoff 2025, \"12345\" is converted to \"1 2 3 4 5\" while \"1200\" is converted to \"twelve hundred\".\n\nUsage:\n- If your use case doesn't involve IDs like zip codes, set this to a high value.\n- If your use case involves IDs that are shorter than 5 digits, set this to a lower value.\n\n@default 2025", - "minimum": 0, - "example": 2025 - }, - "replacements": { + "nodes": { "type": "array", - "description": "These are the custom replacements you can make to the chunk before it is sent to the voice provider.\n\nUsage:\n- To replace a specific word or phrase with a different word or phrase, use the `ExactReplacement` type. Eg. `{ type: 'exact', key: 'hello', value: 'hi' }`\n- To replace a word or phrase that matches a pattern, use the `RegexReplacement` type. Eg. `{ type: 'regex', regex: '\\\\b[a-zA-Z]{5}\\\\b', value: 'hi' }`\n\n@default []", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ExactReplacement", - "title": "ExactReplacement" + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" }, { - "$ref": "#/components/schemas/RegexReplacement", - "title": "RegexReplacement" + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" } ] } }, - "formattersEnabled": { - "type": "array", - "description": "List of formatters to apply. If not provided, all default formatters will be applied.\nIf provided, only the specified formatters will be applied.\nNote: Some essential formatters like angle bracket removal will always be applied.\n@default undefined", - "enum": [ - "markdown", - "asterisk", - "quote", - "dash", - "newline", - "colon", - "acronym", - "dollarAmount", - "email", - "date", - "time", - "distance", - "unit", - "percentage", - "phoneNumber", - "number", - "stripAsterisk" + "model": { + "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] + }, + "transcriber": { + "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "voice": { + "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "observabilityPlan": { + "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", + "oneOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } ], - "items": { - "type": "string", - "enum": [ - "markdown", - "asterisk", - "quote", - "dash", - "newline", - "colon", - "acronym", - "dollarAmount", - "email", - "date", - "time", - "distance", - "unit", - "percentage", - "phoneNumber", - "number", - "stripAsterisk" - ] - } - } - } - }, - "ChunkPlan": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "This determines whether the model output is chunked before being sent to the voice provider. Default `true`.\n\nUsage:\n- To rely on the voice provider's audio generation logic, set this to `false`.\n- If seeing issues with quality, set this to `true`.\n\nIf disabled, Vapi-provided audio control tokens like will not work.\n\n@default true", - "example": true + "allOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan" + } + ] }, - "minCharacters": { - "type": "number", - "description": "This is the minimum number of characters in a chunk.\n\nUsage:\n- To increase quality, set this to a higher value.\n- To decrease latency, set this to a lower value.\n\n@default 30", - "minimum": 1, - "maximum": 80, - "example": 30 + "backgroundSound": { + "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } + ] }, - "punctuationBoundaries": { + "hooks": { "type": "array", - "description": "These are the punctuations that are considered valid boundaries for a chunk to be created.\n\nUsage:\n- To increase quality, constrain to fewer boundaries.\n- To decrease latency, enable all.\n\nDefault is automatically set to balance the trade-off between quality and latency based on the provider.", - "enum": [ - "。", - ",", - ".", - "!", - "?", - ";", - ")", - "،", - "۔", - "।", - "॥", - "|", - "||", - ",", - ":" - ], - "example": [ - "。", - ",", - ".", - "!", - "?", - ";", - "،", - "۔", - "।", - "॥", - "|", - "||", - ",", - ":" - ], + "description": "This is a set of actions that will be performed on certain events.", "items": { - "type": "string", - "enum": [ - "。", - ",", - ".", - "!", - "?", - ";", - ")", - "،", - "۔", - "।", - "॥", - "|", - "||", - ",", - ":" + "oneOf": [ + { + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" + } ] } }, - "formatPlan": { - "description": "This is the plan for formatting the chunk before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/FormatPlan" - } - ] - } - } - }, - "FallbackPlan": { - "type": "object", - "properties": { - "voices": { + "credentials": { "type": "array", - "description": "This is the list of voices to fallback to in the event that the primary voice provider fails.", + "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/FallbackAzureVoice", - "title": "Azure" + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" }, { - "$ref": "#/components/schemas/FallbackCartesiaVoice", - "title": "Cartesia" + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" }, { - "$ref": "#/components/schemas/FallbackHumeVoice", - "title": "Hume" + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" }, { - "$ref": "#/components/schemas/FallbackCustomVoice", - "title": "CustomVoice" + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" }, { - "$ref": "#/components/schemas/FallbackDeepgramVoice", - "title": "Deepgram" + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" }, { - "$ref": "#/components/schemas/FallbackElevenLabsVoice", - "title": "ElevenLabs" + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" }, { - "$ref": "#/components/schemas/FallbackVapiVoice", - "title": "Vapi" + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" }, { - "$ref": "#/components/schemas/FallbackLMNTVoice", - "title": "LMNT" + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" }, { - "$ref": "#/components/schemas/FallbackOpenAIVoice", - "title": "OpenAI" + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" }, { - "$ref": "#/components/schemas/FallbackPlayHTVoice", - "title": "PlayHT" + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" }, { - "$ref": "#/components/schemas/FallbackRimeAIVoice", - "title": "RimeAI" + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" }, { - "$ref": "#/components/schemas/FallbackSmallestAIVoice", - "title": "Smallest AI" + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" }, { - "$ref": "#/components/schemas/FallbackTavusVoice", - "title": "TavusVoice" + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" }, { - "$ref": "#/components/schemas/FallbackNeuphonicVoice", - "title": "Neuphonic" + "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", + "title": "DeepSeekCredential" }, { - "$ref": "#/components/schemas/FallbackSesameVoice", - "title": "Sesame" + "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", + "title": "ElevenLabsCredential" }, { - "$ref": "#/components/schemas/FallbackInworldVoice", - "title": "Inworld" - } - ] - } - } - }, - "required": [ - "voices" - ] - }, - "AzureVoice": { - "type": "object", - "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true - }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used.", - "enum": [ - "azure" - ] - }, - "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "andrew", - "brian", - "emma" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "Azure Voice ID" - } - ] - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } - ] - }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.5, - "maximum": 2 - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackPlan" - } - ] - } - }, - "required": [ - "provider", - "voiceId" - ] - }, - "CartesiaExperimentalControls": { - "type": "object", - "properties": { - "speed": { + "$ref": "#/components/schemas/CreateGcpCredentialDTO", + "title": "GcpCredential" + }, + { + "$ref": "#/components/schemas/CreateGladiaCredentialDTO", + "title": "GladiaCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "title": "GhlCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCredentialDTO", + "title": "GoogleCredential" + }, + { + "$ref": "#/components/schemas/CreateGroqCredentialDTO", + "title": "GroqCredential" + }, + { + "$ref": "#/components/schemas/CreateHumeCredentialDTO", + "title": "HumeCredential" + }, + { + "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", + "title": "InflectionAICredential" + }, + { + "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", + "title": "LangfuseCredential" + }, + { + "$ref": "#/components/schemas/CreateLmntCredentialDTO", + "title": "LmntCredential" + }, + { + "$ref": "#/components/schemas/CreateMakeCredentialDTO", + "title": "MakeCredential" + }, + { + "$ref": "#/components/schemas/CreateMistralCredentialDTO", + "title": "MistralCredential" + }, + { + "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", + "title": "NeuphonicCredential" + }, + { + "$ref": "#/components/schemas/CreateOpenAICredentialDTO", + "title": "OpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", + "title": "OpenRouterCredential" + }, + { + "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", + "title": "PerplexityAICredential" + }, + { + "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", + "title": "PlayHTCredential" + }, + { + "$ref": "#/components/schemas/CreateRimeAICredentialDTO", + "title": "RimeAICredential" + }, + { + "$ref": "#/components/schemas/CreateRunpodCredentialDTO", + "title": "RunpodCredential" + }, + { + "$ref": "#/components/schemas/CreateS3CredentialDTO", + "title": "S3Credential" + }, + { + "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", + "title": "SmallestAICredential" + }, + { + "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "title": "SpeechmaticsCredential" + }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, + { + "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", + "title": "SupabaseCredential" + }, + { + "$ref": "#/components/schemas/CreateTavusCredentialDTO", + "title": "TavusCredential" + }, + { + "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", + "title": "TogetherAICredential" + }, + { + "$ref": "#/components/schemas/CreateTrieveCredentialDTO", + "title": "TrieveCredential" + }, + { + "$ref": "#/components/schemas/CreateTwilioCredentialDTO", + "title": "TwilioCredential" + }, + { + "$ref": "#/components/schemas/CreateVonageCredentialDTO", + "title": "VonageCredential" + }, + { + "$ref": "#/components/schemas/CreateWebhookCredentialDTO", + "title": "WebhookCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, + { + "$ref": "#/components/schemas/CreateXAiCredentialDTO", + "title": "XAiCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "title": "GoogleCalendarOAuth2ClientCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "title": "GoogleCalendarOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "title": "GoogleSheetsOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "title": "SlackOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "title": "GoHighLevelMCPCredential" + }, + { + "$ref": "#/components/schemas/CreateInworldCredentialDTO", + "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", + "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", + "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", + "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "azure": "#/components/schemas/CreateAzureCredentialDTO", + "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", + "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", + "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", + "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", + "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", + "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", + "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", + "gcp": "#/components/schemas/CreateGcpCredentialDTO", + "gladia": "#/components/schemas/CreateGladiaCredentialDTO", + "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "google": "#/components/schemas/CreateGoogleCredentialDTO", + "groq": "#/components/schemas/CreateGroqCredentialDTO", + "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", + "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", + "lmnt": "#/components/schemas/CreateLmntCredentialDTO", + "make": "#/components/schemas/CreateMakeCredentialDTO", + "openai": "#/components/schemas/CreateOpenAICredentialDTO", + "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", + "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", + "playht": "#/components/schemas/CreatePlayHTCredentialDTO", + "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", + "runpod": "#/components/schemas/CreateRunpodCredentialDTO", + "s3": "#/components/schemas/CreateS3CredentialDTO", + "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", + "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", + "tavus": "#/components/schemas/CreateTavusCredentialDTO", + "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", + "twilio": "#/components/schemas/CreateTwilioCredentialDTO", + "vonage": "#/components/schemas/CreateVonageCredentialDTO", + "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", + "xai": "#/components/schemas/CreateXAiCredentialDTO", + "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", + "hume": "#/components/schemas/CreateHumeCredentialDTO", + "mistral": "#/components/schemas/CreateMistralCredentialDTO", + "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", + "trieve": "#/components/schemas/CreateTrieveCredentialDTO", + "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "inworld": "#/components/schemas/CreateInworldCredentialDTO", + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" + } + } + } + }, + "voicemailDetection": { + "description": "This is the voicemail detection plan for the workflow.", "oneOf": [ { "type": "string", "enum": [ - "slowest", - "slow", - "normal", - "fast", - "fastest" - ], - "example": "normal" + "off" + ] }, { - "type": "number", - "minimum": -1, - "maximum": 1, - "example": 0.5 + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" } ] }, - "emotion": { - "type": "string", - "enum": [ - "anger:lowest", - "anger:low", - "anger:high", - "anger:highest", - "positivity:lowest", - "positivity:low", - "positivity:high", - "positivity:highest", - "surprise:lowest", - "surprise:low", - "surprise:high", - "surprise:highest", - "sadness:lowest", - "sadness:low", - "sadness:high", - "sadness:highest", - "curiosity:lowest", - "curiosity:low", - "curiosity:high", - "curiosity:highest" - ], - "example": [ - "happiness:high" - ] - } - } - }, - "CartesiaVoice": { - "type": "object", - "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true - }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used.", - "enum": [ - "cartesia" - ] + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum duration of the call in seconds.\n\nAfter this duration, the call will automatically end.\n\nDefault is 1800 (30 minutes), max is 43200 (12 hours), and min is 10 seconds.", + "minimum": 10, + "maximum": 43200, + "example": 600 }, - "voiceId": { + "name": { "type": "string", - "description": "The ID of the particular voice you want to use." + "maxLength": 80 }, - "model": { - "type": "string", - "description": "This is the model that will be used. This is optional and will default to the correct model for the voiceId.", - "enum": [ - "sonic-2", - "sonic-english", - "sonic-multilingual", - "sonic-preview", - "sonic" - ], - "example": "sonic-english" + "edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } }, - "language": { + "globalPrompt": { "type": "string", - "description": "This is the language that will be used. This is optional and will default to the correct language for the voiceId.", - "enum": [ - "en", - "de", - "es", - "fr", - "ja", - "pt", - "zh", - "hi", - "it", - "ko", - "nl", - "pl", - "ru", - "sv", - "tr" - ], - "example": "en" + "maxLength": 5000 }, - "experimentalControls": { - "description": "Experimental controls for Cartesia voice generation", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", "allOf": [ { - "$ref": "#/components/schemas/CartesiaExperimentalControls" + "$ref": "#/components/schemas/Server" } ] }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", "allOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "$ref": "#/components/schemas/CompliancePlan" } ] }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", "allOf": [ { - "$ref": "#/components/schemas/FallbackPlan" + "$ref": "#/components/schemas/AnalysisPlan" } ] - } - }, - "required": [ - "provider", - "voiceId" - ] - }, - "CustomVoice": { - "type": "object", - "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true - }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.", - "enum": [ - "custom-voice" - ] }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", "allOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "$ref": "#/components/schemas/ArtifactPlan" } ] }, - "server": { - "description": "This is where the voice request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"voice-request\",\n \"text\": \"Hello, world!\",\n \"sampleRate\": 24000,\n ...other metadata about the call...\n }\n}\n\nResponse Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:\n```\nresponse.on('data', (chunk: Buffer) => {\n outputStream.write(chunk);\n});\n```", + "startSpeakingPlan": { + "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/StartSpeakingPlan" } ] }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "stopSpeakingPlan": { + "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", "allOf": [ { - "$ref": "#/components/schemas/FallbackPlan" + "$ref": "#/components/schemas/StopSpeakingPlan" } ] - } - }, - "required": [ - "provider", - "server" - ] - }, - "DeepgramVoice": { - "type": "object", - "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used.", - "enum": [ - "deepgram" + "monitorPlan": { + "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/MonitorPlan" + } ] }, - "voiceId": { - "type": "string", - "description": "This is the provider-specific ID that will be used.", - "enum": [ - "asteria", - "luna", - "stella", - "athena", - "hera", - "orion", - "arcas", - "perseus", - "angus", - "orpheus", - "helios", - "zeus", - "thalia", - "andromeda", - "helena", - "apollo", - "arcas", - "aries", - "amalthea", - "asteria", - "athena", - "atlas", - "aurora", - "callista", - "cora", - "cordelia", - "delia", - "draco", - "electra", - "harmonia", - "hera", - "hermes", - "hyperion", - "iris", - "janus", - "juno", - "jupiter", - "luna", - "mars", - "minerva", - "neptune", - "odysseus", - "ophelia", - "orion", - "orpheus", - "pandora", - "phoebe", - "pluto", - "saturn", - "selene", - "theia", - "vesta", - "zeus" - ], - "title": "This is the Deepgram Voice ID" - }, - "model": { - "type": "string", - "description": "This is the model that will be used. Defaults to 'aura-2' when not specified.", - "enum": [ - "aura", - "aura-2" - ], - "example": "aura-2" - }, - "mipOptOut": { - "type": "boolean", - "description": "If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out\n\nThis will only be used if you are using your own Deepgram API key.\n\n@default false", - "example": false, - "default": false - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", "allOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" } ] }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "credentialIds": { + "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "type": "array", + "items": { + "type": "string" + } + }, + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", "allOf": [ { - "$ref": "#/components/schemas/FallbackPlan" + "$ref": "#/components/schemas/KeypadInputPlan" } ] + }, + "voicemailMessage": { + "type": "string", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 } }, "required": [ - "provider", - "voiceId" - ] - }, - "ElevenLabsPronunciationDictionaryLocator": { - "type": "object", - "properties": { - "pronunciationDictionaryId": { - "type": "string", - "description": "This is the ID of the pronunciation dictionary to use.", - "title": "This is the ElevenLabs Pronunciation Dictionary ID" - }, - "versionId": { - "type": "string", - "description": "This is the version ID of the pronunciation dictionary to use.", - "title": "This is the ElevenLabs Pronunciation Dictionary Version ID" - } - }, - "required": [ - "pronunciationDictionaryId", - "versionId" + "nodes", + "name", + "edges" ] }, - "ElevenLabsVoice": { + "VapiModel": { "type": "object", "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true + "messages": { + "description": "This is the starting state for the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIMessage" + } + }, + "tools": { + "type": "array", + "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" + } + ] + } + }, + "toolIds": { + "description": "These are the tools that the assistant can use during the call. To use transient tools, use `tools`.\n\nBoth `tools` and `toolIds` can be used together.", + "type": "array", + "items": { + "type": "string" + } + }, + "knowledgeBase": { + "description": "These are the options for the knowledge base.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", + "title": "Custom" + } + ] }, "provider": { "type": "string", - "description": "This is the voice provider that will be used.", "enum": [ - "11labs" + "vapi" ] }, - "voiceId": { - "description": "This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library.", - "oneOf": [ - { - "type": "string", - "enum": [ - "burt", - "marissa", - "andrea", - "sarah", - "phillip", - "steve", - "joseph", - "myra", - "paula", - "ryan", - "drew", - "paul", - "mrb", - "matilda", - "mark" - ], - "title": "Preset Voice Options" - }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead." + }, + "workflow": { + "description": "This is the workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.", + "allOf": [ { - "type": "string", - "title": "11Labs Voice ID" + "$ref": "#/components/schemas/WorkflowUserEditable" } ] }, - "stability": { - "type": "number", - "description": "Defines the stability for voice settings.", - "minimum": 0, - "maximum": 1, - "example": 0.5 + "model": { + "type": "string", + "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b" }, - "similarityBoost": { + "temperature": { "type": "number", - "description": "Defines the similarity boost for voice settings.", + "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", "minimum": 0, - "maximum": 1, - "example": 0.75 + "maximum": 2 }, - "style": { + "maxTokens": { "type": "number", - "description": "Defines the style for voice settings.", - "minimum": 0, - "maximum": 1, - "example": 0 + "description": "This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.", + "minimum": 50, + "maximum": 10000 }, - "useSpeakerBoost": { + "emotionRecognitionEnabled": { "type": "boolean", - "description": "Defines the use speaker boost for voice settings.", - "example": false + "description": "This determines whether we detect user's emotion while they speak and send it as an additional info to model.\n\nDefault `false` because the model is usually are good at understanding the user's emotion from text.\n\n@default false" }, - "speed": { + "numFastTurns": { "type": "number", - "description": "Defines the speed for voice settings.", - "minimum": 0.7, - "maximum": 1.2, - "example": 0.9 + "description": "This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.\n\nDefault is 0.\n\n@default 0", + "minimum": 0 + } + }, + "required": [ + "provider", + "model" + ] + }, + "XaiModel": { + "type": "object", + "properties": { + "messages": { + "description": "This is the starting state for the conversation.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIMessage" + } }, - "optimizeStreamingLatency": { - "type": "number", - "description": "Defines the optimize streaming latency for voice settings. Defaults to 3.", - "minimum": 0, - "maximum": 4, - "example": 3 + "tools": { + "type": "array", + "description": "These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.\n\nBoth `tools` and `toolIds` can be used together.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" + } + ] + } }, - "enableSsmlParsing": { - "type": "boolean", - "description": "This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency.\n\n@default false", - "example": false + "toolIds": { + "description": "These are the tools that the assistant can use during the call. To use transient tools, use `tools`.\n\nBoth `tools` and `toolIds` can be used together.", + "type": "array", + "items": { + "type": "string" + } }, - "autoMode": { - "type": "boolean", - "description": "Defines the auto mode for voice settings. Defaults to false.", - "example": false + "knowledgeBase": { + "description": "These are the options for the knowledge base.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateCustomKnowledgeBaseDTO", + "title": "Custom" + } + ] }, "model": { "type": "string", - "description": "This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.", + "description": "This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b", "enum": [ - "eleven_multilingual_v2", - "eleven_turbo_v2", - "eleven_turbo_v2_5", - "eleven_flash_v2", - "eleven_flash_v2_5", - "eleven_monolingual_v1" - ], - "example": "eleven_turbo_v2_5" + "grok-beta", + "grok-2", + "grok-3", + "grok-4-fast-reasoning", + "grok-4-fast-non-reasoning" + ] }, - "language": { + "provider": { "type": "string", - "description": "This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided." - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } + "enum": [ + "xai" ] }, - "pronunciationDictionaryLocators": { - "description": "This is the pronunciation dictionary locators to use.", - "type": "array", - "items": { - "$ref": "#/components/schemas/ElevenLabsPronunciationDictionaryLocator" - } + "temperature": { + "type": "number", + "description": "This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.", + "minimum": 0, + "maximum": 2 }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackPlan" - } - ] + "maxTokens": { + "type": "number", + "description": "This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.", + "minimum": 50, + "maximum": 10000 + }, + "emotionRecognitionEnabled": { + "type": "boolean", + "description": "This determines whether we detect user's emotion while they speak and send it as an additional info to model.\n\nDefault `false` because the model is usually are good at understanding the user's emotion from text.\n\n@default false" + }, + "numFastTurns": { + "type": "number", + "description": "This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.\n\nDefault is 0.\n\n@default 0", + "minimum": 0 } }, "required": [ - "provider", - "voiceId" + "model", + "provider" ] }, - "HumeVoice": { + "ExactReplacement": { "type": "object", "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true - }, - "provider": { + "type": { "type": "string", - "description": "This is the voice provider that will be used.", + "description": "This is the exact replacement type. You can use this to replace a specific word or phrase with a different word or phrase.\n\nUsage:\n- Replace \"hello\" with \"hi\": { type: 'exact', key: 'hello', value: 'hi' }\n- Replace \"good morning\" with \"good day\": { type: 'exact', key: 'good morning', value: 'good day' }\n- Replace a specific name: { type: 'exact', key: 'John Doe', value: 'Jane Smith' }\n- Replace an acronym: { type: 'exact', key: 'AI', value: 'Artificial Intelligence' }\n- Replace a company name with its phonetic pronunciation: { type: 'exact', key: 'Vapi', value: 'Vappy' }", "enum": [ - "hume" + "exact" ] }, - "model": { - "type": "string", - "description": "This is the model that will be used.", - "enum": [ - "octave" - ], - "example": "octave" + "replaceAllEnabled": { + "type": "boolean", + "description": "This option let's you control whether to replace all instances of the key or only the first one. By default, it only replaces the first instance.\nExamples:\n- For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: false }. Before: \"hello world, hello universe\" | After: \"hi world, hello universe\"\n- For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: true }. Before: \"hello world, hello universe\" | After: \"hi world, hi universe\"\n@default false", + "default": false }, - "voiceId": { + "key": { "type": "string", - "description": "The ID of the particular voice you want to use." - }, - "isCustomHumeVoice": { - "type": "boolean", - "description": "Indicates whether the chosen voice is a preset Hume AI voice or a custom voice.", - "example": false + "description": "This is the key to replace." }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } + "value": { + "type": "string", + "description": "This is the value that will replace the match.", + "maxLength": 1000 + } + }, + "required": [ + "type", + "key", + "value" + ] + }, + "RegexReplacement": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the regex replacement type. You can use this to replace a word or phrase that matches a pattern.\n\nUsage:\n- Replace all numbers with \"some number\": { type: 'regex', regex: '\\\\d+', value: 'some number' }\n- Replace email addresses with \"[EMAIL]\": { type: 'regex', regex: '\\\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Z|a-z]{2,}\\\\b', value: '[EMAIL]' }\n- Replace phone numbers with a formatted version: { type: 'regex', regex: '(\\\\d{3})(\\\\d{3})(\\\\d{4})', value: '($1) $2-$3' }\n- Replace all instances of \"color\" or \"colour\" with \"hue\": { type: 'regex', regex: 'colou?r', value: 'hue' }\n- Capitalize the first letter of every sentence: { type: 'regex', regex: '(?<=\\\\. |^)[a-z]', value: (match) => match.toUpperCase() }", + "enum": [ + "regex" ] }, - "description": { + "regex": { "type": "string", - "description": "Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent').\n\nIf a Voice is specified in the request, this description serves as acting instructions.\nIf no Voice is specified, a new voice is generated based on this description." + "description": "This is the regex pattern to replace.\n\nNote:\n- This works by using the `string.replace` method in Node.JS. Eg. `\"hello there\".replace(/hello/g, \"hi\")` will return `\"hi there\"`.\n\nHot tip:\n- In JavaScript, escape `\\` when sending the regex pattern. Eg. `\"hello\\sthere\"` will be sent over the wire as `\"hellosthere\"`. Send `\"hello\\\\sthere\"` instead." }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackPlan" - } - ] + "options": { + "description": "These are the options for the regex replacement. Defaults to all disabled.\n\n@default []", + "type": "array", + "items": { + "$ref": "#/components/schemas/RegexOption" + } + }, + "value": { + "type": "string", + "description": "This is the value that will replace the match.", + "maxLength": 1000 } }, "required": [ - "provider", - "voiceId" + "type", + "regex", + "value" ] }, - "LMNTVoice": { + "FormatPlan": { "type": "object", "properties": { - "cachingEnabled": { + "enabled": { "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true + "description": "This determines whether the chunk is formatted before being sent to the voice provider. This helps with enunciation. This includes phone numbers, emails and addresses. Default `true`.\n\nUsage:\n- To rely on the voice provider's formatting logic, set this to `false`.\n\nIf `voice.chunkPlan.enabled` is `false`, this is automatically `false` since there's no chunk to format.\n\n@default true", + "example": true }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used.", + "numberToDigitsCutoff": { + "type": "number", + "description": "This is the cutoff after which a number is converted to individual digits instead of being spoken as words.\n\nExample:\n- If cutoff 2025, \"12345\" is converted to \"1 2 3 4 5\" while \"1200\" is converted to \"twelve hundred\".\n\nUsage:\n- If your use case doesn't involve IDs like zip codes, set this to a high value.\n- If your use case involves IDs that are shorter than 5 digits, set this to a lower value.\n\n@default 2025", + "minimum": 0, + "example": 2025 + }, + "replacements": { + "type": "array", + "description": "These are the custom replacements you can make to the chunk before it is sent to the voice provider.\n\nUsage:\n- To replace a specific word or phrase with a different word or phrase, use the `ExactReplacement` type. Eg. `{ type: 'exact', key: 'hello', value: 'hi' }`\n- To replace a word or phrase that matches a pattern, use the `RegexReplacement` type. Eg. `{ type: 'regex', regex: '\\\\b[a-zA-Z]{5}\\\\b', value: 'hi' }`\n\n@default []", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ExactReplacement", + "title": "ExactReplacement" + }, + { + "$ref": "#/components/schemas/RegexReplacement", + "title": "RegexReplacement" + } + ] + } + }, + "formattersEnabled": { + "type": "array", + "description": "List of formatters to apply. If not provided, all default formatters will be applied.\nIf provided, only the specified formatters will be applied.\nNote: Some essential formatters like angle bracket removal will always be applied.\n@default undefined", "enum": [ - "lmnt" + "markdown", + "asterisk", + "quote", + "dash", + "newline", + "colon", + "acronym", + "dollarAmount", + "email", + "date", + "time", + "distance", + "unit", + "percentage", + "phoneNumber", + "number", + "stripAsterisk" + ], + "items": { + "type": "string", + "enum": [ + "markdown", + "asterisk", + "quote", + "dash", + "newline", + "colon", + "acronym", + "dollarAmount", + "email", + "date", + "time", + "distance", + "unit", + "percentage", + "phoneNumber", + "number", + "stripAsterisk" + ] + } + } + } + }, + "ChunkPlan": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "This determines whether the model output is chunked before being sent to the voice provider. Default `true`.\n\nUsage:\n- To rely on the voice provider's audio generation logic, set this to `false`.\n- If seeing issues with quality, set this to `true`.\n\nIf disabled, Vapi-provided audio control tokens like will not work.\n\n@default true", + "example": true + }, + "minCharacters": { + "type": "number", + "description": "This is the minimum number of characters in a chunk.\n\nUsage:\n- To increase quality, set this to a higher value.\n- To decrease latency, set this to a lower value.\n\n@default 30", + "minimum": 1, + "maximum": 80, + "example": 30 + }, + "punctuationBoundaries": { + "type": "array", + "description": "These are the punctuations that are considered valid boundaries for a chunk to be created.\n\nUsage:\n- To increase quality, constrain to fewer boundaries.\n- To decrease latency, enable all.\n\nDefault is automatically set to balance the trade-off between quality and latency based on the provider.", + "enum": [ + "。", + ",", + ".", + "!", + "?", + ";", + ")", + "،", + "۔", + "।", + "॥", + "|", + "||", + ",", + ":" + ], + "example": [ + "。", + ",", + ".", + "!", + "?", + ";", + "،", + "۔", + "।", + "॥", + "|", + "||", + ",", + ":" + ], + "items": { + "type": "string", + "enum": [ + "。", + ",", + ".", + "!", + "?", + ";", + ")", + "،", + "۔", + "।", + "॥", + "|", + "||", + ",", + ":" + ] + } + }, + "formatPlan": { + "description": "This is the plan for formatting the chunk before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/FormatPlan" + } + ] + } + } + }, + "FallbackPlan": { + "type": "object", + "properties": { + "voices": { + "type": "array", + "description": "This is the list of voices to fallback to in the event that the primary voice provider fails.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FallbackAzureVoice", + "title": "Azure" + }, + { + "$ref": "#/components/schemas/FallbackCartesiaVoice", + "title": "Cartesia" + }, + { + "$ref": "#/components/schemas/FallbackHumeVoice", + "title": "Hume" + }, + { + "$ref": "#/components/schemas/FallbackCustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/FallbackDeepgramVoice", + "title": "Deepgram" + }, + { + "$ref": "#/components/schemas/FallbackElevenLabsVoice", + "title": "ElevenLabs" + }, + { + "$ref": "#/components/schemas/FallbackVapiVoice", + "title": "Vapi" + }, + { + "$ref": "#/components/schemas/FallbackLMNTVoice", + "title": "LMNT" + }, + { + "$ref": "#/components/schemas/FallbackOpenAIVoice", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/FallbackPlayHTVoice", + "title": "PlayHT" + }, + { + "$ref": "#/components/schemas/FallbackWellSaidVoice", + "title": "WellSaid" + }, + { + "$ref": "#/components/schemas/FallbackRimeAIVoice", + "title": "RimeAI" + }, + { + "$ref": "#/components/schemas/FallbackSmallestAIVoice", + "title": "Smallest AI" + }, + { + "$ref": "#/components/schemas/FallbackTavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/FallbackNeuphonicVoice", + "title": "Neuphonic" + }, + { + "$ref": "#/components/schemas/FallbackSesameVoice", + "title": "Sesame" + }, + { + "$ref": "#/components/schemas/FallbackInworldVoice", + "title": "Inworld" + } + ] + } + } + }, + "required": [ + "voices" + ] + }, + "AzureVoice": { + "type": "object", + "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, + "provider": { + "type": "string", + "description": "This is the voice provider that will be used.", + "enum": [ + "azure" ] }, "voiceId": { @@ -18492,456 +20605,245 @@ { "type": "string", "enum": [ - "amy", - "ansel", - "autumn", - "ava", - "brandon", - "caleb", - "cassian", - "chloe", - "dalton", - "daniel", - "dustin", - "elowen", - "evander", - "huxley", - "james", - "juniper", - "kennedy", - "lauren", - "leah", - "lily", - "lucas", - "magnus", - "miles", - "morgan", - "natalie", - "nathan", - "noah", - "nyssa", - "oliver", - "paige", - "ryan", - "sadie", - "sophie", - "stella", - "terrence", - "tyler", - "vesper", - "violet", - "warrick", - "zain", - "zeke", - "zoe" + "andrew", + "brian", + "emma" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "LMNT Voice ID" + "title": "Azure Voice ID" + } + ] + }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" } ] }, "speed": { "type": "number", "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, + "minimum": 0.5, + "maximum": 2 + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] + } + }, + "required": [ + "provider", + "voiceId" + ] + }, + "CartesiaExperimentalControls": { + "type": "object", + "properties": { + "speed": { + "oneOf": [ + { + "type": "string", + "enum": [ + "slowest", + "slow", + "normal", + "fast", + "fastest" + ], + "example": "normal" + }, + { + "type": "number", + "minimum": -1, + "maximum": 1, + "example": 0.5 + } + ] + }, + "emotion": { + "type": "string", + "enum": [ + "anger:lowest", + "anger:low", + "anger:high", + "anger:highest", + "positivity:lowest", + "positivity:low", + "positivity:high", + "positivity:highest", + "surprise:lowest", + "surprise:low", + "surprise:high", + "surprise:highest", + "sadness:lowest", + "sadness:low", + "sadness:high", + "sadness:highest", + "curiosity:lowest", + "curiosity:low", + "curiosity:high", + "curiosity:highest" + ], + "example": [ + "happiness:high" + ] + } + } + }, + "CartesiaGenerationConfigExperimental": { + "type": "object", + "properties": { + "accentLocalization": { + "type": "integer", + "description": "Toggle accent localization for sonic-3: 0 (disabled, default) or 1 (enabled). When enabled, the voice adapts to match the transcript language accent while preserving vocal characteristics.", + "example": 0, + "minimum": 0, + "maximum": 1, + "default": 0 + } + } + }, + "CartesiaGenerationConfig": { + "type": "object", + "properties": { + "speed": { + "type": "number", + "description": "Fine-grained speed control for sonic-3. Only available for sonic-3 model.", + "example": 1, + "minimum": 0.6, + "maximum": 1.5, + "default": 1 + }, + "volume": { + "type": "number", + "description": "Fine-grained volume control for sonic-3. Only available for sonic-3 model.", + "example": 1, + "minimum": 0.5, "maximum": 2, - "example": null + "default": 1 + }, + "experimental": { + "description": "Experimental model controls for sonic-3. These are subject to breaking changes.", + "allOf": [ + { + "$ref": "#/components/schemas/CartesiaGenerationConfigExperimental" + } + ] + } + } + }, + "CartesiaVoice": { + "type": "object", + "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, + "provider": { + "type": "string", + "description": "This is the voice provider that will be used.", + "enum": [ + "cartesia" + ] + }, + "voiceId": { + "type": "string", + "description": "The ID of the particular voice you want to use." + }, + "model": { + "type": "string", + "description": "This is the model that will be used. This is optional and will default to the correct model for the voiceId.", + "enum": [ + "sonic-3", + "sonic-2", + "sonic-english", + "sonic-multilingual", + "sonic-preview", + "sonic" + ], + "example": "sonic-english" }, "language": { - "description": "Two letter ISO 639-1 language code. Use \"auto\" for auto-detection.", + "type": "string", + "description": "This is the language that will be used. This is optional and will default to the correct language for the voiceId.", "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", "bg", - "bh", - "bi", - "bm", "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", "cs", - "cu", - "cv", - "cy", "da", "de", - "dv", - "dz", - "ee", "el", "en", - "eo", "es", - "et", - "eu", - "fa", - "ff", "fi", - "fj", - "fo", "fr", - "fy", - "ga", - "gd", - "gl", - "gn", "gu", - "gv", - "ha", "he", "hi", - "ho", "hr", - "ht", "hu", - "hy", - "hz", - "ia", "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", "it", - "iu", "ja", - "jv", "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", "kn", "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", "ml", - "mn", "mr", "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", "nl", - "nn", "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", "pa", - "pi", "pl", - "ps", "pt", - "qu", - "rm", - "rn", "ro", "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", "sv", - "sw", "ta", "te", - "tg", "th", - "ti", - "tk", "tl", - "tn", - "to", "tr", - "ts", - "tt", - "tw", - "ty", - "ug", "uk", - "ur", - "uz", - "ve", "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yue", - "yo", - "za", - "zh", - "zu", - "auto" + "zh" ], - "example": "en", - "oneOf": [ + "example": "en" + }, + "experimentalControls": { + "description": "Experimental controls for Cartesia voice generation", + "allOf": [ { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bh", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yue", - "yo", - "za", - "zh", - "zu" - ], - "title": "ISO 639-1 Language Code" - }, + "$ref": "#/components/schemas/CartesiaExperimentalControls" + } + ] + }, + "generationConfig": { + "description": "Generation config for fine-grained control of sonic-3 voice output (speed, volume, and experimental controls). Only available for sonic-3 model.", + "allOf": [ { - "type": "string", - "enum": [ - "auto" - ], - "title": "Auto-detect" + "$ref": "#/components/schemas/CartesiaGenerationConfig" } ] }, + "pronunciationDictId": { + "type": "string", + "description": "Pronunciation dictionary ID for sonic-3. Allows custom pronunciations for specific words. Only available for sonic-3 model.", + "example": "dict_abc123" + }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ @@ -18964,7 +20866,7 @@ "voiceId" ] }, - "NeuphonicVoice": { + "CustomVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -18975,51 +20877,24 @@ }, "provider": { "type": "string", - "description": "This is the voice provider that will be used.", + "description": "This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.", "enum": [ - "neuphonic" + "custom-voice" ] }, - "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [], - "title": "Preset Voice Options" - }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ { - "type": "string", - "title": "Neuphonic Voice ID" + "$ref": "#/components/schemas/ChunkPlan" } ] }, - "model": { - "type": "string", - "description": "This is the model that will be used. Defaults to 'neu_fast' if not specified.", - "enum": [ - "neu_hq", - "neu_fast" - ], - "example": "neu_fast" - }, - "language": { - "type": "object", - "description": "This is the language (ISO 639-1) that is enforced for the model.", - "example": "en" - }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, - "maximum": 2, - "example": null - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "server": { + "description": "This is where the voice request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"voice-request\",\n \"text\": \"Hello, world!\",\n \"sampleRate\": 24000,\n ...other metadata about the call...\n }\n}\n\nResponse Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:\n```\nresponse.on('data', (chunk: Buffer) => {\n outputStream.write(chunk);\n});\n```", "allOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "$ref": "#/components/schemas/Server" } ] }, @@ -19034,11 +20909,10 @@ }, "required": [ "provider", - "voiceId", - "language" + "server" ] }, - "OpenAIVoice": { + "DeepgramVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19051,50 +20925,93 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "openai" + "deepgram" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.\nPlease note that ash, ballad, coral, sage, and verse may only be used with realtime models.", - "oneOf": [ - { - "type": "string", - "enum": [ - "alloy", - "echo", - "fable", - "onyx", - "nova", - "shimmer" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "OpenAI Voice ID" - } - ] - }, - "model": { "type": "string", - "description": "This is the model that will be used for text-to-speech.", + "description": "This is the provider-specific ID that will be used.", "enum": [ - "tts-1", - "tts-1-hd", - "gpt-4o-mini-tts" - ] + "asteria", + "luna", + "stella", + "athena", + "hera", + "orion", + "arcas", + "perseus", + "angus", + "orpheus", + "helios", + "zeus", + "thalia", + "andromeda", + "helena", + "apollo", + "arcas", + "aries", + "amalthea", + "asteria", + "athena", + "atlas", + "aurora", + "callista", + "cora", + "cordelia", + "delia", + "draco", + "electra", + "harmonia", + "hera", + "hermes", + "hyperion", + "iris", + "janus", + "juno", + "jupiter", + "luna", + "mars", + "minerva", + "neptune", + "odysseus", + "ophelia", + "orion", + "orpheus", + "pandora", + "phoebe", + "pluto", + "saturn", + "selene", + "theia", + "vesta", + "zeus", + "celeste", + "estrella", + "nestor", + "sirio", + "carina", + "alvaro", + "diana", + "aquila", + "selena", + "javier" + ], + "title": "This is the Deepgram Voice ID" }, - "instructions": { + "model": { "type": "string", - "description": "This is a prompt that allows you to control the voice of your generated audio.\nDoes not work with 'tts-1' or 'tts-1-hd' models.", - "maxLength": 10000 + "description": "This is the model that will be used. Defaults to 'aura-2' when not specified.", + "enum": [ + "aura", + "aura-2" + ], + "example": "aura-2" }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, - "maximum": 4, - "example": null + "mipOptOut": { + "type": "boolean", + "description": "If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out\n\nThis will only be used if you are using your own Deepgram API key.\n\n@default false", + "example": false, + "default": false }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19118,7 +21035,26 @@ "voiceId" ] }, - "PlayHTVoice": { + "ElevenLabsPronunciationDictionaryLocator": { + "type": "object", + "properties": { + "pronunciationDictionaryId": { + "type": "string", + "description": "This is the ID of the pronunciation dictionary to use.", + "title": "This is the ElevenLabs Pronunciation Dictionary ID" + }, + "versionId": { + "type": "string", + "description": "This is the version ID of the pronunciation dictionary to use.", + "title": "This is the ElevenLabs Pronunciation Dictionary Version ID" + } + }, + "required": [ + "pronunciationDictionaryId", + "versionId" + ] + }, + "ElevenLabsVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19131,140 +21067,106 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "playht" + "11labs" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", + "description": "This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library.", "oneOf": [ { "type": "string", "enum": [ - "jennifer", - "melissa", - "will", - "chris", - "matt", - "jack", - "ruby", - "davis", - "donna", - "michael" + "burt", + "marissa", + "andrea", + "sarah", + "phillip", + "steve", + "joseph", + "myra", + "paula", + "ryan", + "drew", + "paul", + "mrb", + "matilda", + "mark" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "PlayHT Voice ID" + "title": "11Labs Voice ID" } ] }, - "speed": { + "stability": { "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.1, - "maximum": 5, - "example": null + "description": "Defines the stability for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0.5 }, - "temperature": { + "similarityBoost": { "type": "number", - "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.", - "minimum": 0.1, - "maximum": 2, - "example": null + "description": "Defines the similarity boost for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0.75 }, - "emotion": { - "type": "string", - "description": "An emotion to be applied to the speech.", - "enum": [ - "female_happy", - "female_sad", - "female_angry", - "female_fearful", - "female_disgust", - "female_surprised", - "male_happy", - "male_sad", - "male_angry", - "male_fearful", - "male_disgust", - "male_surprised" - ], - "example": null - }, - "voiceGuidance": { + "style": { "type": "number", - "description": "A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.", - "minimum": 1, - "maximum": 6, - "example": null + "description": "Defines the style for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0 }, - "styleGuidance": { + "useSpeakerBoost": { + "type": "boolean", + "description": "Defines the use speaker boost for voice settings.", + "example": false + }, + "speed": { "type": "number", - "description": "A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.", - "minimum": 1, - "maximum": 30, - "example": null + "description": "Defines the speed for voice settings.", + "minimum": 0.7, + "maximum": 1.2, + "example": 0.9 }, - "textGuidance": { + "optimizeStreamingLatency": { "type": "number", - "description": "A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.", - "minimum": 1, - "maximum": 2, - "example": null + "description": "Defines the optimize streaming latency for voice settings. Defaults to 3.", + "minimum": 0, + "maximum": 4, + "example": 3 + }, + "enableSsmlParsing": { + "type": "boolean", + "description": "This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency.\n\n@default false", + "example": false + }, + "autoMode": { + "type": "boolean", + "description": "Defines the auto mode for voice settings. Defaults to false.", + "example": false }, "model": { "type": "string", - "description": "Playht voice model/engine to use.", + "description": "This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.", "enum": [ - "PlayHT2.0", - "PlayHT2.0-turbo", - "Play3.0-mini", - "PlayDialog" - ] + "eleven_multilingual_v2", + "eleven_turbo_v2", + "eleven_turbo_v2_5", + "eleven_flash_v2", + "eleven_flash_v2_5", + "eleven_monolingual_v1", + "eleven_v3" + ], + "example": "eleven_turbo_v2_5" }, "language": { "type": "string", - "description": "The language to use for the speech.", - "enum": [ - "afrikaans", - "albanian", - "amharic", - "arabic", - "bengali", - "bulgarian", - "catalan", - "croatian", - "czech", - "danish", - "dutch", - "english", - "french", - "galician", - "german", - "greek", - "hebrew", - "hindi", - "hungarian", - "indonesian", - "italian", - "japanese", - "korean", - "malay", - "mandarin", - "polish", - "portuguese", - "russian", - "serbian", - "spanish", - "swedish", - "tagalog", - "thai", - "turkish", - "ukrainian", - "urdu", - "xhosa" - ] + "description": "This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided." }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19274,6 +21176,13 @@ } ] }, + "pronunciationDictionaryLocators": { + "description": "This is the pronunciation dictionary locators to use.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ElevenLabsPronunciationDictionaryLocator" + } + }, "fallbackPlan": { "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ @@ -19288,7 +21197,7 @@ "voiceId" ] }, - "RimeAIVoice": { + "WellSaidVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19301,150 +21210,31 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "rime-ai" + "wellsaid" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "abbie", - "allison", - "ally", - "alona", - "amber", - "ana", - "antoine", - "armon", - "brenda", - "brittany", - "carol", - "colin", - "courtney", - "elena", - "elliot", - "eva", - "geoff", - "gerald", - "hank", - "helen", - "hera", - "jen", - "joe", - "joy", - "juan", - "kendra", - "kendrick", - "kenneth", - "kevin", - "kris", - "linda", - "madison", - "marge", - "marina", - "marissa", - "marta", - "maya", - "nicholas", - "nyles", - "phil", - "reba", - "rex", - "rick", - "ritu", - "rob", - "rodney", - "rohan", - "rosco", - "samantha", - "sandy", - "selena", - "seth", - "sharon", - "stan", - "tamra", - "tanya", - "tibur", - "tj", - "tyler", - "viv", - "yadira", - "marsh", - "bayou", - "creek", - "brook", - "flower", - "spore", - "glacier", - "gulch", - "alpine", - "cove", - "lagoon", - "tundra", - "steppe", - "mesa", - "grove", - "rainforest", - "moraine", - "wildflower", - "peak", - "boulder", - "gypsum", - "zest", - "luna", - "celeste", - "orion", - "ursa", - "astra", - "esther", - "estelle", - "andromeda" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "RimeAI Voice ID" - } - ] + "type": "string", + "description": "The WellSaid speaker ID to synthesize." }, "model": { "type": "string", - "description": "This is the model that will be used. Defaults to 'arcana' when not specified.", + "description": "This is the model that will be used.", "enum": [ - "arcana", - "mistv2", - "mist" - ], - "example": "arcana" - }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.1, - "example": null - }, - "pauseBetweenBrackets": { - "type": "boolean", - "description": "This is a flag that controls whether to add slight pauses using angle brackets. Example: \"Hi. <200> I'd love to have a conversation with you.\" adds a 200ms pause between the first and second sentences.", - "example": false - }, - "phonemizeBetweenBrackets": { - "type": "boolean", - "description": "This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: \"{h'El.o} World\" will pronounce \"Hello\" as expected.", - "example": false + "caruso", + "legacy" + ] }, - "reduceLatency": { + "enableSsml": { "type": "boolean", - "description": "This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency", - "example": false + "description": "Enables limited SSML translation for input text." }, - "inlineSpeedAlpha": { - "type": "string", - "description": "This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha", - "example": null + "libraryIds": { + "description": "Array of library IDs to use for voice synthesis.", + "type": "array", + "items": { + "type": "string" + } }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19468,7 +21258,7 @@ "voiceId" ] }, - "SesameVoice": { + "HumeVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19481,20 +21271,26 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "sesame" + "hume" ] }, - "voiceId": { - "type": "string", - "description": "This is the provider-specific ID that will be used.", - "title": "Sesame Voice ID. This should be either a name (a built-in voice) or a UUID (a custom voice)." - }, "model": { "type": "string", "description": "This is the model that will be used.", "enum": [ - "csm-1b" - ] + "octave", + "octave2" + ], + "example": "octave2" + }, + "voiceId": { + "type": "string", + "description": "The ID of the particular voice you want to use." + }, + "isCustomHumeVoice": { + "type": "boolean", + "description": "Indicates whether the chosen voice is a preset Hume AI voice or a custom voice.", + "example": false }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19504,6 +21300,10 @@ } ] }, + "description": { + "type": "string", + "description": "Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent').\n\nIf a Voice is specified in the request, this description serves as acting instructions.\nIf no Voice is specified, a new voice is generated based on this description." + }, "fallbackPlan": { "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ @@ -19515,11 +21315,10 @@ }, "required": [ "provider", - "voiceId", - "model" + "voiceId" ] }, - "SmallestAIVoice": { + "LMNTVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19532,7 +21331,7 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "smallest-ai" + "lmnt" ] }, "voiceId": { @@ -19541,193 +21340,470 @@ { "type": "string", "enum": [ - "emily", - "jasmine", - "arman", + "amy", + "ansel", + "autumn", + "ava", + "brandon", + "caleb", + "cassian", + "chloe", + "dalton", + "daniel", + "dustin", + "elowen", + "evander", + "huxley", "james", - "mithali", - "aravind", - "raj", - "diya", - "raman", - "ananya", - "isha", - "william", - "aarav", - "monika", - "niharika", - "deepika", - "raghav", - "kajal", - "radhika", - "mansi", - "nisha", - "saurabh", - "pooja", - "saina", - "sanya" + "juniper", + "kennedy", + "lauren", + "leah", + "lily", + "lucas", + "magnus", + "miles", + "morgan", + "natalie", + "nathan", + "noah", + "nyssa", + "oliver", + "paige", + "ryan", + "sadie", + "sophie", + "stella", + "terrence", + "tyler", + "vesper", + "violet", + "warrick", + "zain", + "zeke", + "zoe" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "Smallest AI Voice ID" + "title": "LMNT Voice ID" } ] }, - "model": { - "type": "string", - "description": "Smallest AI voice model to use. Defaults to 'lightning' when not specified.", - "enum": [ - "lightning" - ] - }, "speed": { "type": "number", "description": "This is the speed multiplier that will be used.", + "minimum": 0.25, + "maximum": 2, "example": null }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } - ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackPlan" - } - ] - } - }, - "required": [ - "provider", - "voiceId" - ] - }, - "TavusConversationProperties": { - "type": "object", - "properties": { - "maxCallDuration": { - "type": "number", - "description": "The maximum duration of the call in seconds. The default `maxCallDuration` is 3600 seconds (1 hour).\nOnce the time limit specified by this parameter has been reached, the conversation will automatically shut down." - }, - "participantLeftTimeout": { - "type": "number", - "description": "The duration in seconds after which the call will be automatically shut down once the last participant leaves." - }, - "participantAbsentTimeout": { - "type": "number", - "description": "Starting from conversation creation, the duration in seconds after which the call will be automatically shut down if no participant joins the call.\nDefault is 300 seconds (5 minutes)." - }, - "enableRecording": { - "type": "boolean", - "description": "If true, the user will be able to record the conversation." - }, - "enableTranscription": { - "type": "boolean", - "description": "If true, the user will be able to transcribe the conversation.\nYou can find more instructions on displaying transcriptions if you are using your custom DailyJS components here.\nYou need to have an event listener on Daily that listens for `app-messages`." - }, - "applyGreenscreen": { - "type": "boolean", - "description": "If true, the background will be replaced with a greenscreen (RGB values: `[0, 255, 155]`).\nYou can use WebGL on the frontend to make the greenscreen transparent or change its color." - }, "language": { - "type": "string", - "description": "The language of the conversation. Please provide the **full language name**, not the two-letter code.\nIf you are using your own TTS voice, please ensure it supports the language you provide.\nIf you are using a stock replica or default persona, please note that only ElevenLabs and Cartesia supported languages are available.\nYou can find a full list of supported languages for Cartesia here, for ElevenLabs here, and for PlayHT here." - }, - "recordingS3BucketName": { - "type": "string", - "description": "The name of the S3 bucket where the recording will be stored." - }, - "recordingS3BucketRegion": { - "type": "string", - "description": "The region of the S3 bucket where the recording will be stored." - }, - "awsAssumeRoleArn": { - "type": "string", - "description": "The ARN of the role that will be assumed to access the S3 bucket." - } - } - }, - "TavusVoice": { - "type": "object", - "properties": { - "cachingEnabled": { - "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true - }, - "provider": { - "type": "string", - "description": "This is the voice provider that will be used.", + "description": "Two letter ISO 639-1 language code. Use \"auto\" for auto-detection.", "enum": [ - "tavus" - ] - }, - "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "r52da2535a" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "Tavus Voice ID" - } - ] - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } - ] - }, - "personaId": { - "type": "string", - "description": "This is the unique identifier for the persona that the replica will use in the conversation." - }, - "callbackUrl": { - "type": "string", - "description": "This is the url that will receive webhooks with updates regarding the conversation state." - }, - "conversationName": { - "type": "string", - "description": "This is the name for the conversation." - }, - "conversationalContext": { - "type": "string", - "description": "This is the context that will be appended to any context provided in the persona, if one is provided." - }, - "customGreeting": { - "type": "string", - "description": "This is the custom greeting that the replica will give once a participant joines the conversation." - }, - "properties": { - "description": "These are optional properties used to customize the conversation.", - "allOf": [ - { - "$ref": "#/components/schemas/TavusConversationProperties" - } - ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackPlan" - } + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu", + "auto" + ], + "example": "en", + "oneOf": [ + { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu" + ], + "title": "ISO 639-1 Language Code" + }, + { + "type": "string", + "enum": [ + "auto" + ], + "title": "Auto-detect" + } + ] + }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } ] } }, @@ -19736,7 +21812,7 @@ "voiceId" ] }, - "VapiVoice": { + "NeuphonicVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19749,32 +21825,43 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "vapi" + "neuphonic" ] }, "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "Neuphonic Voice ID" + } + ] + }, + "model": { "type": "string", - "description": "The voices provided by Vapi", + "description": "This is the model that will be used. Defaults to 'neu_fast' if not specified.", "enum": [ - "Elliot", - "Kylie", - "Rohan", - "Lily", - "Savannah", - "Hana", - "Neha", - "Cole", - "Harry", - "Paige", - "Spencer" - ] + "neu_hq", + "neu_fast" + ], + "example": "neu_fast" + }, + "language": { + "type": "object", + "description": "This is the language (ISO 639-1) that is enforced for the model.", + "example": "en" }, "speed": { "type": "number", - "description": "This is the speed multiplier that will be used.\n\n@default 1", + "description": "This is the speed multiplier that will be used.", "minimum": 0.25, "maximum": 2, - "default": 1 + "example": null }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19795,10 +21882,11 @@ }, "required": [ "provider", - "voiceId" + "voiceId", + "language" ] }, - "InworldVoice": { + "OpenAIVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19811,93 +21899,52 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "inworld" + "openai" ] }, "voiceId": { + "description": "This is the provider-specific ID that will be used.\nPlease note that ash, ballad, coral, sage, and verse may only be used with realtime models.", + "oneOf": [ + { + "type": "string", + "enum": [ + "alloy", + "echo", + "fable", + "onyx", + "nova", + "shimmer", + "marin", + "cedar" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "OpenAI Voice ID" + } + ] + }, + "model": { "type": "string", - "description": "Available voices by language:\n• en: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Hades, Julia, Pixie, Mark, Olivia, Priya, Ronald, Sarah, Shaun, Theodore, Timothy, Wendy, Dominus\n• zh: Yichen, Xiaoyin, Xinyi, Jing\n• nl: Erik, Katrien, Lennart, Lore\n• fr: Alain, Hélène, Mathieu, Étienne\n• de: Johanna, Josef\n• it: Gianni, Orietta\n• ja: Asuka, Satoshi\n• ko: Hyunwoo, Minji, Seojun, Yoona\n• pl: Szymon, Wojciech\n• pt: Heitor, Maitê\n• es: Diego, Lupita, Miguel, Rafael", - "maxLength": 120, - "title": "Inworld Voice ID", + "description": "This is the model that will be used for text-to-speech.", "enum": [ - "Alex", - "Ashley", - "Craig", - "Deborah", - "Dennis", - "Edward", - "Elizabeth", - "Hades", - "Julia", - "Pixie", - "Mark", - "Olivia", - "Priya", - "Ronald", - "Sarah", - "Shaun", - "Theodore", - "Timothy", - "Wendy", - "Dominus", - "Yichen", - "Xiaoyin", - "Xinyi", - "Jing", - "Erik", - "Katrien", - "Lennart", - "Lore", - "Alain", - "Hélène", - "Mathieu", - "Étienne", - "Johanna", - "Josef", - "Gianni", - "Orietta", - "Asuka", - "Satoshi", - "Hyunwoo", - "Minji", - "Seojun", - "Yoona", - "Szymon", - "Wojciech", - "Heitor", - "Maitê", - "Diego", - "Lupita", - "Miguel", - "Rafael" - ], - "example": "Alex" + "tts-1", + "tts-1-hd", + "gpt-4o-mini-tts" + ] }, - "model": { + "instructions": { "type": "string", - "description": "This is the model that will be used.", - "enum": [ - "inworld-tts-1" - ], - "default": "inworld-tts-1" + "description": "This is a prompt that allows you to control the voice of your generated audio.\nDoes not work with 'tts-1' or 'tts-1-hd' models.", + "maxLength": 10000 }, - "languageCode": { - "type": "string", - "description": "Language code for Inworld TTS synthesis", - "default": "en", - "enum": [ - "en", - "zh", - "ko", - "nl", - "fr", - "es", - "ja", - "de", - "it", - "pl", - "pt" - ] + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.25, + "maximum": 4, + "example": null }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -19921,7 +21968,7 @@ "voiceId" ] }, - "MinimaxVoice": { + "PlayHTVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -19934,61 +21981,140 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "minimax" + "playht" ] }, "voiceId": { - "type": "string", - "description": "This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID.", - "title": "This is the Minimax Voice ID" + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [ + "jennifer", + "melissa", + "will", + "chris", + "matt", + "jack", + "ruby", + "davis", + "donna", + "michael" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "PlayHT Voice ID" + } + ] }, - "model": { - "type": "string", - "description": "This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'.\nspeech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks.\nspeech-02-turbo is designed for real-time applications with low latency.\n\n@default \"speech-02-turbo\"", - "enum": [ - "speech-02-hd", - "speech-02-turbo" - ], - "example": "speech-02-turbo", - "default": "speech-02-turbo" + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.1, + "maximum": 5, + "example": null + }, + "temperature": { + "type": "number", + "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.", + "minimum": 0.1, + "maximum": 2, + "example": null }, "emotion": { "type": "string", - "description": "The emotion to use for the voice. If not provided, will use auto-detect mode.\nOptions include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral'", - "example": "happy" + "description": "An emotion to be applied to the speech.", + "enum": [ + "female_happy", + "female_sad", + "female_angry", + "female_fearful", + "female_disgust", + "female_surprised", + "male_happy", + "male_sad", + "male_angry", + "male_fearful", + "male_disgust", + "male_surprised" + ], + "example": null }, - "pitch": { + "voiceGuidance": { "type": "number", - "description": "Voice pitch adjustment. Range from -12 to 12 semitones.\n@default 0", - "minimum": -12, - "maximum": 12, - "example": 0, - "default": 0 + "description": "A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.", + "minimum": 1, + "maximum": 6, + "example": null }, - "speed": { + "styleGuidance": { "type": "number", - "description": "Voice speed adjustment. Range from 0.5 to 2.0.\n@default 1.0", - "minimum": 0.5, - "maximum": 2, - "example": 1, - "default": 1 + "description": "A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.", + "minimum": 1, + "maximum": 30, + "example": null }, - "volume": { + "textGuidance": { "type": "number", - "description": "Voice volume adjustment. Range from 0.5 to 2.0.\n@default 1.0", - "minimum": 0.5, + "description": "A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.", + "minimum": 1, "maximum": 2, - "example": 1, - "default": 1 + "example": null }, - "region": { + "model": { "type": "string", - "description": "The region for Minimax API. Defaults to \"worldwide\".", + "description": "Playht voice model/engine to use.", "enum": [ - "worldwide", - "china" - ], - "default": "worldwide" + "PlayHT2.0", + "PlayHT2.0-turbo", + "Play3.0-mini", + "PlayDialog" + ] + }, + "language": { + "type": "string", + "description": "The language to use for the speech.", + "enum": [ + "afrikaans", + "albanian", + "amharic", + "arabic", + "bengali", + "bulgarian", + "catalan", + "croatian", + "czech", + "danish", + "dutch", + "english", + "french", + "galician", + "german", + "greek", + "hebrew", + "hindi", + "hungarian", + "indonesian", + "italian", + "japanese", + "korean", + "malay", + "mandarin", + "polish", + "portuguese", + "russian", + "serbian", + "spanish", + "swedish", + "tagalog", + "thai", + "turkish", + "ukrainian", + "urdu", + "xhosa" + ] }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -20012,7 +22138,7 @@ "voiceId" ] }, - "FallbackAzureVoice": { + "RimeAIVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20025,7 +22151,7 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "azure" + "rime-ai" ] }, "voiceId": { @@ -20034,23 +22160,141 @@ { "type": "string", "enum": [ - "andrew", - "brian", - "emma" + "abbie", + "allison", + "ally", + "alona", + "amber", + "ana", + "antoine", + "armon", + "brenda", + "brittany", + "carol", + "colin", + "courtney", + "elena", + "elliot", + "eva", + "geoff", + "gerald", + "hank", + "helen", + "hera", + "jen", + "joe", + "joy", + "juan", + "kendra", + "kendrick", + "kenneth", + "kevin", + "kris", + "linda", + "madison", + "marge", + "marina", + "marissa", + "marta", + "maya", + "nicholas", + "nyles", + "phil", + "reba", + "rex", + "rick", + "ritu", + "rob", + "rodney", + "rohan", + "rosco", + "samantha", + "sandy", + "selena", + "seth", + "sharon", + "stan", + "tamra", + "tanya", + "tibur", + "tj", + "tyler", + "viv", + "yadira", + "marsh", + "bayou", + "creek", + "brook", + "flower", + "spore", + "glacier", + "gulch", + "alpine", + "cove", + "lagoon", + "tundra", + "steppe", + "mesa", + "grove", + "rainforest", + "moraine", + "wildflower", + "peak", + "boulder", + "gypsum", + "zest", + "luna", + "celeste", + "orion", + "ursa", + "astra", + "esther", + "estelle", + "andromeda" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "Azure Voice ID" + "title": "RimeAI Voice ID" } ] }, + "model": { + "type": "string", + "description": "This is the model that will be used. Defaults to 'arcana' when not specified.", + "enum": [ + "arcana", + "mistv2", + "mist" + ], + "example": "arcana" + }, "speed": { "type": "number", "description": "This is the speed multiplier that will be used.", - "minimum": 0.5, - "maximum": 2 + "minimum": 0.1, + "example": null + }, + "pauseBetweenBrackets": { + "type": "boolean", + "description": "This is a flag that controls whether to add slight pauses using angle brackets. Example: \"Hi. <200> I'd love to have a conversation with you.\" adds a 200ms pause between the first and second sentences.", + "example": false + }, + "phonemizeBetweenBrackets": { + "type": "boolean", + "description": "This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: \"{h'El.o} World\" will pronounce \"Hello\" as expected.", + "example": false + }, + "reduceLatency": { + "type": "boolean", + "description": "This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency", + "example": false + }, + "inlineSpeedAlpha": { + "type": "string", + "description": "This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha", + "example": null }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -20059,6 +22303,14 @@ "$ref": "#/components/schemas/ChunkPlan" } ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] } }, "required": [ @@ -20066,7 +22318,7 @@ "voiceId" ] }, - "FallbackCartesiaVoice": { + "SesameVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20079,70 +22331,45 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "cartesia" + "sesame" ] }, "voiceId": { "type": "string", - "description": "The ID of the particular voice you want to use." + "description": "This is the provider-specific ID that will be used.", + "title": "Sesame Voice ID. This should be either a name (a built-in voice) or a UUID (a custom voice)." }, "model": { "type": "string", - "description": "This is the model that will be used. This is optional and will default to the correct model for the voiceId.", - "enum": [ - "sonic-2", - "sonic-english", - "sonic-multilingual", - "sonic-preview", - "sonic" - ], - "example": "sonic-english" - }, - "language": { - "type": "string", - "description": "This is the language that will be used. This is optional and will default to the correct language for the voiceId.", + "description": "This is the model that will be used.", "enum": [ - "en", - "de", - "es", - "fr", - "ja", - "pt", - "zh", - "hi", - "it", - "ko", - "nl", - "pl", - "ru", - "sv", - "tr" - ], - "example": "en" + "csm-1b" + ] }, - "experimentalControls": { - "description": "Experimental controls for Cartesia voice generation", + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ { - "$ref": "#/components/schemas/CartesiaExperimentalControls" + "$ref": "#/components/schemas/ChunkPlan" } ] }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "$ref": "#/components/schemas/FallbackPlan" } ] } }, "required": [ "provider", - "voiceId" + "voiceId", + "model" ] }, - "FallbackCustomVoice": { + "SmallestAIVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20153,19 +22380,63 @@ }, "provider": { "type": "string", - "description": "This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.", + "description": "This is the voice provider that will be used.", "enum": [ - "custom-voice" + "smallest-ai" ] }, - "server": { - "description": "This is where the voice request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"voice-request\",\n \"text\": \"Hello, world!\",\n \"sampleRate\": 24000,\n ...other metadata about the call...\n }\n}\n\nResponse Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:\n```\nresponse.on('data', (chunk: Buffer) => {\n outputStream.write(chunk);\n});\n```", - "allOf": [ + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ { - "$ref": "#/components/schemas/Server" + "type": "string", + "enum": [ + "emily", + "jasmine", + "arman", + "james", + "mithali", + "aravind", + "raj", + "diya", + "raman", + "ananya", + "isha", + "william", + "aarav", + "monika", + "niharika", + "deepika", + "raghav", + "kajal", + "radhika", + "mansi", + "nisha", + "saurabh", + "pooja", + "saina", + "sanya" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "Smallest AI Voice ID" } ] }, + "model": { + "type": "string", + "description": "Smallest AI voice model to use. Defaults to 'lightning' when not specified.", + "enum": [ + "lightning" + ] + }, + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "example": null + }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ @@ -20173,119 +22444,67 @@ "$ref": "#/components/schemas/ChunkPlan" } ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] } }, "required": [ "provider", - "server" + "voiceId" ] }, - "FallbackDeepgramVoice": { + "TavusConversationProperties": { "type": "object", "properties": { - "cachingEnabled": { + "maxCallDuration": { + "type": "number", + "description": "The maximum duration of the call in seconds. The default `maxCallDuration` is 3600 seconds (1 hour).\nOnce the time limit specified by this parameter has been reached, the conversation will automatically shut down." + }, + "participantLeftTimeout": { + "type": "number", + "description": "The duration in seconds after which the call will be automatically shut down once the last participant leaves." + }, + "participantAbsentTimeout": { + "type": "number", + "description": "Starting from conversation creation, the duration in seconds after which the call will be automatically shut down if no participant joins the call.\nDefault is 300 seconds (5 minutes)." + }, + "enableRecording": { "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true + "description": "If true, the user will be able to record the conversation." }, - "provider": { + "enableTranscription": { + "type": "boolean", + "description": "If true, the user will be able to transcribe the conversation.\nYou can find more instructions on displaying transcriptions if you are using your custom DailyJS components here.\nYou need to have an event listener on Daily that listens for `app-messages`." + }, + "applyGreenscreen": { + "type": "boolean", + "description": "If true, the background will be replaced with a greenscreen (RGB values: `[0, 255, 155]`).\nYou can use WebGL on the frontend to make the greenscreen transparent or change its color." + }, + "language": { "type": "string", - "description": "This is the voice provider that will be used.", - "enum": [ - "deepgram" - ] + "description": "The language of the conversation. Please provide the **full language name**, not the two-letter code.\nIf you are using your own TTS voice, please ensure it supports the language you provide.\nIf you are using a stock replica or default persona, please note that only ElevenLabs and Cartesia supported languages are available.\nYou can find a full list of supported languages for Cartesia here, for ElevenLabs here, and for PlayHT here." }, - "voiceId": { + "recordingS3BucketName": { "type": "string", - "description": "This is the provider-specific ID that will be used.", - "enum": [ - "asteria", - "luna", - "stella", - "athena", - "hera", - "orion", - "arcas", - "perseus", - "angus", - "orpheus", - "helios", - "zeus", - "thalia", - "andromeda", - "helena", - "apollo", - "arcas", - "aries", - "amalthea", - "asteria", - "athena", - "atlas", - "aurora", - "callista", - "cora", - "cordelia", - "delia", - "draco", - "electra", - "harmonia", - "hera", - "hermes", - "hyperion", - "iris", - "janus", - "juno", - "jupiter", - "luna", - "mars", - "minerva", - "neptune", - "odysseus", - "ophelia", - "orion", - "orpheus", - "pandora", - "phoebe", - "pluto", - "saturn", - "selene", - "theia", - "vesta", - "zeus" - ], - "title": "This is the Deepgram Voice ID" + "description": "The name of the S3 bucket where the recording will be stored." }, - "model": { + "recordingS3BucketRegion": { "type": "string", - "description": "This is the model that will be used. Defaults to 'aura-2' when not specified.", - "enum": [ - "aura", - "aura-2" - ], - "example": "aura-2" - }, - "mipOptOut": { - "type": "boolean", - "description": "If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out\n\nThis will only be used if you are using your own Deepgram API key.\n\n@default false", - "example": false, - "default": false + "description": "The region of the S3 bucket where the recording will be stored." }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } - ] + "awsAssumeRoleArn": { + "type": "string", + "description": "The ARN of the role that will be assumed to access the S3 bucket." } - }, - "required": [ - "provider", - "voiceId" - ] + } }, - "FallbackElevenLabsVoice": { + "TavusVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20298,111 +22517,151 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "11labs" + "tavus" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library.", + "description": "This is the provider-specific ID that will be used.", "oneOf": [ { "type": "string", "enum": [ - "burt", - "marissa", - "andrea", - "sarah", - "phillip", - "steve", - "joseph", - "myra", - "paula", - "ryan", - "drew", - "paul", - "mrb", - "matilda", - "mark" + "r52da2535a" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "11Labs Voice ID" + "title": "Tavus Voice ID" } ] }, - "stability": { - "type": "number", - "description": "Defines the stability for voice settings.", - "minimum": 0, - "maximum": 1, - "example": 0.5 + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] }, - "similarityBoost": { - "type": "number", - "description": "Defines the similarity boost for voice settings.", - "minimum": 0, - "maximum": 1, - "example": 0.75 + "personaId": { + "type": "string", + "description": "This is the unique identifier for the persona that the replica will use in the conversation." }, - "style": { - "type": "number", - "description": "Defines the style for voice settings.", - "minimum": 0, - "maximum": 1, - "example": 0 + "callbackUrl": { + "type": "string", + "description": "This is the url that will receive webhooks with updates regarding the conversation state." }, - "useSpeakerBoost": { - "type": "boolean", - "description": "Defines the use speaker boost for voice settings.", - "example": false + "conversationName": { + "type": "string", + "description": "This is the name for the conversation." }, - "speed": { - "type": "number", - "description": "Defines the speed for voice settings.", - "minimum": 0.7, - "maximum": 1.2, - "example": 0.9 + "conversationalContext": { + "type": "string", + "description": "This is the context that will be appended to any context provided in the persona, if one is provided." }, - "optimizeStreamingLatency": { - "type": "number", - "description": "Defines the optimize streaming latency for voice settings. Defaults to 3.", - "minimum": 0, - "maximum": 4, - "example": 3 + "customGreeting": { + "type": "string", + "description": "This is the custom greeting that the replica will give once a participant joines the conversation." }, - "enableSsmlParsing": { - "type": "boolean", - "description": "This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency.\n\n@default false", - "example": false + "properties": { + "description": "These are optional properties used to customize the conversation.", + "allOf": [ + { + "$ref": "#/components/schemas/TavusConversationProperties" + } + ] }, - "autoMode": { + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] + } + }, + "required": [ + "provider", + "voiceId" + ] + }, + "VapiPronunciationDictionaryLocator": { + "type": "object", + "properties": { + "pronunciationDictId": { + "type": "string", + "description": "The pronunciation dictionary ID", + "example": "pdict_abc123" + }, + "versionId": { + "type": "string", + "description": "Version ID (only required for ElevenLabs, ignored for Cartesia)", + "example": "ver_abc123" + } + }, + "required": [ + "pronunciationDictId" + ] + }, + "VapiVoice": { + "type": "object", + "properties": { + "cachingEnabled": { "type": "boolean", - "description": "Defines the auto mode for voice settings. Defaults to false.", - "example": false + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true }, - "model": { + "provider": { "type": "string", - "description": "This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.", + "description": "This is the voice provider that will be used.", "enum": [ - "eleven_multilingual_v2", - "eleven_turbo_v2", - "eleven_turbo_v2_5", - "eleven_flash_v2", - "eleven_flash_v2_5", - "eleven_monolingual_v1" - ], - "example": "eleven_turbo_v2_5" + "vapi" + ] }, - "language": { + "voiceId": { "type": "string", - "description": "This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided." + "description": "The voices provided by Vapi", + "enum": [ + "Elliot", + "Kylie", + "Rohan", + "Lily", + "Savannah", + "Hana", + "Neha", + "Cole", + "Harry", + "Paige", + "Spencer", + "Nico", + "Kai", + "Emma", + "Sagar", + "Neil", + "Leah", + "Tara", + "Jess", + "Leo", + "Dan", + "Mia", + "Zac", + "Zoe" + ] }, - "pronunciationDictionaryLocators": { - "description": "This is the pronunciation dictionary locators to use.", + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.\n\n@default 1", + "minimum": 0.25, + "maximum": 2, + "default": 1 + }, + "pronunciationDictionary": { + "description": "List of pronunciation dictionary locators for custom word pronunciations.", "type": "array", "items": { - "$ref": "#/components/schemas/ElevenLabsPronunciationDictionaryLocator" + "$ref": "#/components/schemas/VapiPronunciationDictionaryLocator" } }, "chunkPlan": { @@ -20412,6 +22671,14 @@ "$ref": "#/components/schemas/ChunkPlan" } ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] } }, "required": [ @@ -20419,7 +22686,7 @@ "voiceId" ] }, - "FallbackHumeVoice": { + "InworldVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20432,29 +22699,128 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "hume" + "inworld" ] }, + "voiceId": { + "type": "string", + "description": "Available voices by language:\n• en: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Hades, Julia, Pixie, Mark, Olivia, Priya, Ronald, Sarah, Shaun, Theodore, Timothy, Wendy, Dominus, Hana, Clive, Carter, Blake, Luna\n• zh: Yichen, Xiaoyin, Xinyi, Jing\n• nl: Erik, Katrien, Lennart, Lore\n• fr: Alain, Hélène, Mathieu, Étienne\n• de: Johanna, Josef\n• it: Gianni, Orietta\n• ja: Asuka, Satoshi\n• ko: Hyunwoo, Minji, Seojun, Yoona\n• pl: Szymon, Wojciech\n• pt: Heitor, Maitê\n• es: Diego, Lupita, Miguel, Rafael\n• ru: Svetlana, Elena, Dmitry, Nikolai\n• hi: Riya, Manoj\n• he: Yael, Oren\n• ar: Nour, Omar", + "maxLength": 120, + "title": "Inworld Voice ID", + "enum": [ + "Alex", + "Ashley", + "Craig", + "Deborah", + "Dennis", + "Edward", + "Elizabeth", + "Hades", + "Julia", + "Pixie", + "Mark", + "Olivia", + "Priya", + "Ronald", + "Sarah", + "Shaun", + "Theodore", + "Timothy", + "Wendy", + "Dominus", + "Hana", + "Clive", + "Carter", + "Blake", + "Luna", + "Yichen", + "Xiaoyin", + "Xinyi", + "Jing", + "Erik", + "Katrien", + "Lennart", + "Lore", + "Alain", + "Hélène", + "Mathieu", + "Étienne", + "Johanna", + "Josef", + "Gianni", + "Orietta", + "Asuka", + "Satoshi", + "Hyunwoo", + "Minji", + "Seojun", + "Yoona", + "Szymon", + "Wojciech", + "Heitor", + "Maitê", + "Diego", + "Lupita", + "Miguel", + "Rafael", + "Svetlana", + "Elena", + "Dmitry", + "Nikolai", + "Riya", + "Manoj", + "Yael", + "Oren", + "Nour", + "Omar" + ], + "example": "Alex" + }, "model": { "type": "string", "description": "This is the model that will be used.", "enum": [ - "octave" + "inworld-tts-1" ], - "example": "octave" + "default": "inworld-tts-1" }, - "voiceId": { + "languageCode": { "type": "string", - "description": "The ID of the particular voice you want to use." + "description": "Language code for Inworld TTS synthesis", + "default": "en", + "enum": [ + "en", + "zh", + "ko", + "nl", + "fr", + "es", + "ja", + "de", + "it", + "pl", + "pt", + "ru", + "hi", + "he", + "ar" + ] }, - "isCustomHumeVoice": { - "type": "boolean", - "description": "Indicates whether the chosen voice is a preset Hume AI voice or a custom voice.", - "example": false + "temperature": { + "type": "number", + "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature of 1.1 will be used. The temperature parameter controls variance.\nHigher values will make the output more random and can lead to more expressive results. Lower values will make it more deterministic.\nSee https://docs.inworld.ai/docs/tts/capabilities/generating-audio#additional-configurations for more details.", + "minimum": 0.1, + "maximum": 2, + "default": 1.1, + "example": null }, - "description": { - "type": "string", - "description": "Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent').\n\nIf a Voice is specified in the request, this description serves as acting instructions.\nIf no Voice is specified, a new voice is generated based on this description." + "speakingRate": { + "type": "number", + "description": "A floating point number between 0.5, inclusive, and 1.5, inclusive. If equal to null or not provided, the model's default speaking speed of 1.0 will be used.\nValues above 0.8 are recommended for higher quality.\nSee https://docs.inworld.ai/docs/tts/capabilities/generating-audio#additional-configurations for more details.", + "minimum": 0.5, + "maximum": 1.5, + "default": 1, + "example": null }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -20463,6 +22829,14 @@ "$ref": "#/components/schemas/ChunkPlan" } ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] } }, "required": [ @@ -20470,7 +22844,7 @@ "voiceId" ] }, - "FallbackLMNTVoice": { + "MinimaxVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20483,465 +22857,115 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "lmnt" + "minimax" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "amy", - "ansel", - "autumn", - "ava", - "brandon", - "caleb", - "cassian", - "chloe", - "dalton", - "daniel", - "dustin", - "elowen", - "evander", - "huxley", - "james", - "juniper", - "kennedy", - "lauren", - "leah", - "lily", - "lucas", - "magnus", - "miles", - "morgan", - "natalie", - "nathan", - "noah", - "nyssa", - "oliver", - "paige", - "ryan", - "sadie", - "sophie", - "stella", - "terrence", - "tyler", - "vesper", - "violet", - "warrick", - "zain", - "zeke", - "zoe" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "LMNT Voice ID" - } - ] + "type": "string", + "description": "This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID.", + "title": "This is the Minimax Voice ID" + }, + "model": { + "type": "string", + "description": "This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'.\nspeech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks.\nspeech-02-turbo is designed for real-time applications with low latency.\n\n@default \"speech-02-turbo\"", + "enum": [ + "speech-02-hd", + "speech-02-turbo", + "speech-2.5-turbo-preview" + ], + "example": "speech-02-turbo", + "default": "speech-02-turbo" + }, + "emotion": { + "type": "string", + "description": "The emotion to use for the voice. If not provided, will use auto-detect mode.\nOptions include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral'", + "example": "happy" + }, + "pitch": { + "type": "number", + "description": "Voice pitch adjustment. Range from -12 to 12 semitones.\n@default 0", + "minimum": -12, + "maximum": 12, + "example": 0, + "default": 0 }, "speed": { "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, + "description": "Voice speed adjustment. Range from 0.5 to 2.0.\n@default 1.0", + "minimum": 0.5, "maximum": 2, - "example": null + "example": 1, + "default": 1 }, - "language": { - "description": "Two letter ISO 639-1 language code. Use \"auto\" for auto-detection.", + "volume": { + "type": "number", + "description": "Voice volume adjustment. Range from 0.5 to 2.0.\n@default 1.0", + "minimum": 0.5, + "maximum": 2, + "example": 1, + "default": 1 + }, + "region": { + "type": "string", + "description": "The region for Minimax API. Defaults to \"worldwide\".", "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bh", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yue", - "yo", - "za", - "zh", - "zu", - "auto" + "worldwide", + "china" ], - "example": "en", - "oneOf": [ - { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bh", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yue", - "yo", - "za", - "zh", - "zu" - ], - "title": "ISO 639-1 Language Code" - }, - { - "type": "string", - "enum": [ - "auto" - ], - "title": "Auto-detect" - } + "default": "worldwide" + }, + "languageBoost": { + "type": "string", + "description": "Language hint for MiniMax T2A. Example: yue (Cantonese), zh (Chinese), en (English).", + "enum": [ + "Chinese", + "Chinese,Yue", + "English", + "Arabic", + "Russian", + "Spanish", + "French", + "Portuguese", + "German", + "Turkish", + "Dutch", + "Ukrainian", + "Vietnamese", + "Indonesian", + "Japanese", + "Italian", + "Korean", + "Thai", + "Polish", + "Romanian", + "Greek", + "Czech", + "Finnish", + "Hindi", + "Bulgarian", + "Danish", + "Hebrew", + "Malay", + "Persian", + "Slovak", + "Swedish", + "Croatian", + "Filipino", + "Hungarian", + "Norwegian", + "Slovenian", + "Catalan", + "Nynorsk", + "Tamil", + "Afrikaans", + "auto" ] }, + "textNormalizationEnabled": { + "type": "boolean", + "description": "Enable MiniMax text normalization to improve number reading and formatting.", + "default": true + }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ @@ -20949,6 +22973,14 @@ "$ref": "#/components/schemas/ChunkPlan" } ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackPlan" + } + ] } }, "required": [ @@ -20956,7 +22988,7 @@ "voiceId" ] }, - "FallbackNeuphonicVoice": { + "FallbackMinimaxVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -20969,43 +23001,114 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "neuphonic" + "minimax" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "Neuphonic Voice ID" - } - ] + "type": "string", + "description": "This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID.", + "title": "This is the Minimax Voice ID" }, "model": { "type": "string", - "description": "This is the model that will be used. Defaults to 'neu_fast' if not specified.", + "description": "This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'.\nspeech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks.\nspeech-02-turbo is designed for real-time applications with low latency.\n\n@default \"speech-02-turbo\"", "enum": [ - "neu_hq", - "neu_fast" + "speech-02-hd", + "speech-02-turbo", + "speech-2.5-turbo-preview" ], - "example": "neu_fast" + "example": "speech-02-turbo", + "default": "speech-02-turbo" }, - "language": { - "type": "object", - "description": "This is the language (ISO 639-1) that is enforced for the model.", - "example": "en" + "emotion": { + "type": "string", + "description": "The emotion to use for the voice. If not provided, will use auto-detect mode.\nOptions include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral'", + "example": "happy" + }, + "pitch": { + "type": "number", + "description": "Voice pitch adjustment. Range from -12 to 12 semitones.\n@default 0", + "minimum": -12, + "maximum": 12, + "example": 0, + "default": 0 }, "speed": { "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, + "description": "Voice speed adjustment. Range from 0.5 to 2.0.\n@default 1.0", + "minimum": 0.5, "maximum": 2, - "example": null + "example": 1, + "default": 1 + }, + "volume": { + "type": "number", + "description": "Voice volume adjustment. Range from 0.5 to 2.0.\n@default 1.0", + "minimum": 0.5, + "maximum": 2, + "example": 1, + "default": 1 + }, + "region": { + "type": "string", + "description": "The region for Minimax API. Defaults to \"worldwide\".", + "enum": [ + "worldwide", + "china" + ], + "default": "worldwide" + }, + "languageBoost": { + "type": "string", + "description": "Language hint for MiniMax T2A. Example: yue (Cantonese), zh (Chinese), en (English).", + "enum": [ + "Chinese", + "Chinese,Yue", + "English", + "Arabic", + "Russian", + "Spanish", + "French", + "Portuguese", + "German", + "Turkish", + "Dutch", + "Ukrainian", + "Vietnamese", + "Indonesian", + "Japanese", + "Italian", + "Korean", + "Thai", + "Polish", + "Romanian", + "Greek", + "Czech", + "Finnish", + "Hindi", + "Bulgarian", + "Danish", + "Hebrew", + "Malay", + "Persian", + "Slovak", + "Swedish", + "Croatian", + "Filipino", + "Hungarian", + "Norwegian", + "Slovenian", + "Catalan", + "Nynorsk", + "Tamil", + "Afrikaans", + "auto" + ] + }, + "textNormalizationEnabled": { + "type": "boolean", + "description": "Enable MiniMax text normalization to improve number reading and formatting.", + "default": true }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21018,11 +23121,10 @@ }, "required": [ "provider", - "voiceId", - "language" + "voiceId" ] }, - "FallbackOpenAIVoice": { + "FallbackWellSaidVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21035,50 +23137,31 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "openai" + "wellsaid" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.\nPlease note that ash, ballad, coral, sage, and verse may only be used with realtime models.", - "oneOf": [ - { - "type": "string", - "enum": [ - "alloy", - "echo", - "fable", - "onyx", - "nova", - "shimmer" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "OpenAI Voice ID" - } - ] + "type": "string", + "description": "The WellSaid speaker ID to synthesize." }, "model": { "type": "string", - "description": "This is the model that will be used for text-to-speech.", + "description": "This is the model that will be used.", "enum": [ - "tts-1", - "tts-1-hd", - "gpt-4o-mini-tts" + "caruso", + "legacy" ] }, - "instructions": { - "type": "string", - "description": "This is a prompt that allows you to control the voice of your generated audio.\nDoes not work with 'tts-1' or 'tts-1-hd' models.", - "maxLength": 10000 + "enableSsml": { + "type": "boolean", + "description": "Enables limited SSML translation for input text." }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.25, - "maximum": 4, - "example": null + "libraryIds": { + "description": "Array of library IDs to use for voice synthesis.", + "type": "array", + "items": { + "type": "string" + } }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21094,7 +23177,7 @@ "voiceId" ] }, - "FallbackPlayHTVoice": { + "FallbackAzureVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21107,7 +23190,7 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "playht" + "azure" ] }, "voiceId": { @@ -21116,131 +23199,23 @@ { "type": "string", "enum": [ - "jennifer", - "melissa", - "will", - "chris", - "matt", - "jack", - "ruby", - "davis", - "donna", - "michael" + "andrew", + "brian", + "emma" ], "title": "Preset Voice Options" }, { "type": "string", - "title": "PlayHT Voice ID" + "title": "Azure Voice ID" } ] }, "speed": { "type": "number", "description": "This is the speed multiplier that will be used.", - "minimum": 0.1, - "maximum": 5, - "example": null - }, - "temperature": { - "type": "number", - "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.", - "minimum": 0.1, - "maximum": 2, - "example": null - }, - "emotion": { - "type": "string", - "description": "An emotion to be applied to the speech.", - "enum": [ - "female_happy", - "female_sad", - "female_angry", - "female_fearful", - "female_disgust", - "female_surprised", - "male_happy", - "male_sad", - "male_angry", - "male_fearful", - "male_disgust", - "male_surprised" - ], - "example": null - }, - "voiceGuidance": { - "type": "number", - "description": "A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.", - "minimum": 1, - "maximum": 6, - "example": null - }, - "styleGuidance": { - "type": "number", - "description": "A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.", - "minimum": 1, - "maximum": 30, - "example": null - }, - "textGuidance": { - "type": "number", - "description": "A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.", - "minimum": 1, - "maximum": 2, - "example": null - }, - "model": { - "type": "string", - "description": "Playht voice model/engine to use.", - "enum": [ - "PlayHT2.0", - "PlayHT2.0-turbo", - "Play3.0-mini", - "PlayDialog" - ] - }, - "language": { - "type": "string", - "description": "The language to use for the speech.", - "enum": [ - "afrikaans", - "albanian", - "amharic", - "arabic", - "bengali", - "bulgarian", - "catalan", - "croatian", - "czech", - "danish", - "dutch", - "english", - "french", - "galician", - "german", - "greek", - "hebrew", - "hindi", - "hungarian", - "indonesian", - "italian", - "japanese", - "korean", - "malay", - "mandarin", - "polish", - "portuguese", - "russian", - "serbian", - "spanish", - "swedish", - "tagalog", - "thai", - "turkish", - "ukrainian", - "urdu", - "xhosa" - ] + "minimum": 0.5, + "maximum": 2 }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21256,7 +23231,7 @@ "voiceId" ] }, - "FallbackRimeAIVoice": { + "FallbackCartesiaVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21269,150 +23244,95 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "rime-ai" + "cartesia" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "abbie", - "allison", - "ally", - "alona", - "amber", - "ana", - "antoine", - "armon", - "brenda", - "brittany", - "carol", - "colin", - "courtney", - "elena", - "elliot", - "eva", - "geoff", - "gerald", - "hank", - "helen", - "hera", - "jen", - "joe", - "joy", - "juan", - "kendra", - "kendrick", - "kenneth", - "kevin", - "kris", - "linda", - "madison", - "marge", - "marina", - "marissa", - "marta", - "maya", - "nicholas", - "nyles", - "phil", - "reba", - "rex", - "rick", - "ritu", - "rob", - "rodney", - "rohan", - "rosco", - "samantha", - "sandy", - "selena", - "seth", - "sharon", - "stan", - "tamra", - "tanya", - "tibur", - "tj", - "tyler", - "viv", - "yadira", - "marsh", - "bayou", - "creek", - "brook", - "flower", - "spore", - "glacier", - "gulch", - "alpine", - "cove", - "lagoon", - "tundra", - "steppe", - "mesa", - "grove", - "rainforest", - "moraine", - "wildflower", - "peak", - "boulder", - "gypsum", - "zest", - "luna", - "celeste", - "orion", - "ursa", - "astra", - "esther", - "estelle", - "andromeda" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "RimeAI Voice ID" - } - ] + "type": "string", + "description": "The ID of the particular voice you want to use." }, "model": { "type": "string", - "description": "This is the model that will be used. Defaults to 'arcana' when not specified.", + "description": "This is the model that will be used. This is optional and will default to the correct model for the voiceId.", "enum": [ - "arcana", - "mistv2", - "mist" + "sonic-3", + "sonic-2", + "sonic-english", + "sonic-multilingual", + "sonic-preview", + "sonic" ], - "example": "arcana" - }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "minimum": 0.1, - "example": null + "example": "sonic-english" }, - "pauseBetweenBrackets": { - "type": "boolean", - "description": "This is a flag that controls whether to add slight pauses using angle brackets. Example: \"Hi. <200> I'd love to have a conversation with you.\" adds a 200ms pause between the first and second sentences.", - "example": false + "language": { + "type": "string", + "description": "This is the language that will be used. This is optional and will default to the correct language for the voiceId.", + "enum": [ + "ar", + "bg", + "bn", + "cs", + "da", + "de", + "el", + "en", + "es", + "fi", + "fr", + "gu", + "he", + "hi", + "hr", + "hu", + "id", + "it", + "ja", + "ka", + "kn", + "ko", + "ml", + "mr", + "ms", + "nl", + "no", + "pa", + "pl", + "pt", + "ro", + "ru", + "sk", + "sv", + "ta", + "te", + "th", + "tl", + "tr", + "uk", + "vi", + "zh" + ], + "example": "en" }, - "phonemizeBetweenBrackets": { - "type": "boolean", - "description": "This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: \"{h'El.o} World\" will pronounce \"Hello\" as expected.", - "example": false + "experimentalControls": { + "description": "Experimental controls for Cartesia voice generation", + "allOf": [ + { + "$ref": "#/components/schemas/CartesiaExperimentalControls" + } + ] }, - "reduceLatency": { - "type": "boolean", - "description": "This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency", - "example": false + "generationConfig": { + "description": "Generation config for fine-grained control of sonic-3 voice output (speed, volume, and experimental controls). Only available for sonic-3 model.", + "allOf": [ + { + "$ref": "#/components/schemas/CartesiaGenerationConfig" + } + ] }, - "inlineSpeedAlpha": { + "pronunciationDictId": { "type": "string", - "description": "This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha", - "example": null + "description": "Pronunciation dictionary ID for sonic-3. Allows custom pronunciations for specific words. Only available for sonic-3 model.", + "example": "dict_abc123" }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21428,7 +23348,7 @@ "voiceId" ] }, - "FallbackSesameVoice": { + "FallbackCustomVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21439,21 +23359,17 @@ }, "provider": { "type": "string", - "description": "This is the voice provider that will be used.", + "description": "This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.", "enum": [ - "sesame" + "custom-voice" ] }, - "voiceId": { - "type": "string", - "description": "This is the provider-specific ID that will be used.", - "title": "Sesame Voice ID. This should be either a name (a built-in voice) or a UUID (a custom voice)." - }, - "model": { - "type": "string", - "description": "This is the model that will be used.", - "enum": [ - "csm-1b" + "server": { + "description": "This is where the voice request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"message\": {\n \"type\": \"voice-request\",\n \"text\": \"Hello, world!\",\n \"sampleRate\": 24000,\n ...other metadata about the call...\n }\n}\n\nResponse Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:\n```\nresponse.on('data', (chunk: Buffer) => {\n outputStream.write(chunk);\n});\n```", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] }, "chunkPlan": { @@ -21467,11 +23383,10 @@ }, "required": [ "provider", - "voiceId", - "model" + "server" ] }, - "FallbackSmallestAIVoice": { + "FallbackDeepgramVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21484,60 +23399,93 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "smallest-ai" + "deepgram" ] }, "voiceId": { + "type": "string", "description": "This is the provider-specific ID that will be used.", - "oneOf": [ - { - "type": "string", - "enum": [ - "emily", - "jasmine", - "arman", - "james", - "mithali", - "aravind", - "raj", - "diya", - "raman", - "ananya", - "isha", - "william", - "aarav", - "monika", - "niharika", - "deepika", - "raghav", - "kajal", - "radhika", - "mansi", - "nisha", - "saurabh", - "pooja", - "saina", - "sanya" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "Smallest AI Voice ID" - } - ] + "enum": [ + "asteria", + "luna", + "stella", + "athena", + "hera", + "orion", + "arcas", + "perseus", + "angus", + "orpheus", + "helios", + "zeus", + "thalia", + "andromeda", + "helena", + "apollo", + "arcas", + "aries", + "amalthea", + "asteria", + "athena", + "atlas", + "aurora", + "callista", + "cora", + "cordelia", + "delia", + "draco", + "electra", + "harmonia", + "hera", + "hermes", + "hyperion", + "iris", + "janus", + "juno", + "jupiter", + "luna", + "mars", + "minerva", + "neptune", + "odysseus", + "ophelia", + "orion", + "orpheus", + "pandora", + "phoebe", + "pluto", + "saturn", + "selene", + "theia", + "vesta", + "zeus", + "celeste", + "estrella", + "nestor", + "sirio", + "carina", + "alvaro", + "diana", + "aquila", + "selena", + "javier" + ], + "title": "This is the Deepgram Voice ID" }, "model": { "type": "string", - "description": "Smallest AI voice model to use. Defaults to 'lightning' when not specified.", + "description": "This is the model that will be used. Defaults to 'aura-2' when not specified.", "enum": [ - "lightning" - ] + "aura", + "aura-2" + ], + "example": "aura-2" }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.", - "example": null + "mipOptOut": { + "type": "boolean", + "description": "If set to true, this will add mip_opt_out=true as a query parameter of all API requests. See https://developers.deepgram.com/docs/the-deepgram-model-improvement-partnership-program#want-to-opt-out\n\nThis will only be used if you are using your own Deepgram API key.\n\n@default false", + "example": false, + "default": false }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21553,7 +23501,7 @@ "voiceId" ] }, - "FallbackTavusVoice": { + "FallbackElevenLabsVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21566,106 +23514,113 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "tavus" + "11labs" ] }, "voiceId": { - "description": "This is the provider-specific ID that will be used.", + "description": "This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library.", "oneOf": [ { "type": "string", "enum": [ - "r52da2535a" - ], - "title": "Preset Voice Options" - }, - { - "type": "string", - "title": "Tavus Voice ID" - } - ] - }, - "personaId": { - "type": "string", - "description": "This is the unique identifier for the persona that the replica will use in the conversation." + "burt", + "marissa", + "andrea", + "sarah", + "phillip", + "steve", + "joseph", + "myra", + "paula", + "ryan", + "drew", + "paul", + "mrb", + "matilda", + "mark" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "11Labs Voice ID" + } + ] }, - "callbackUrl": { - "type": "string", - "description": "This is the url that will receive webhooks with updates regarding the conversation state." + "stability": { + "type": "number", + "description": "Defines the stability for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0.5 }, - "conversationName": { - "type": "string", - "description": "This is the name for the conversation." + "similarityBoost": { + "type": "number", + "description": "Defines the similarity boost for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0.75 }, - "conversationalContext": { - "type": "string", - "description": "This is the context that will be appended to any context provided in the persona, if one is provided." + "style": { + "type": "number", + "description": "Defines the style for voice settings.", + "minimum": 0, + "maximum": 1, + "example": 0 }, - "customGreeting": { - "type": "string", - "description": "This is the custom greeting that the replica will give once a participant joines the conversation." + "useSpeakerBoost": { + "type": "boolean", + "description": "Defines the use speaker boost for voice settings.", + "example": false }, - "properties": { - "description": "These are optional properties used to customize the conversation.", - "allOf": [ - { - "$ref": "#/components/schemas/TavusConversationProperties" - } - ] + "speed": { + "type": "number", + "description": "Defines the speed for voice settings.", + "minimum": 0.7, + "maximum": 1.2, + "example": 0.9 }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ - { - "$ref": "#/components/schemas/ChunkPlan" - } - ] - } - }, - "required": [ - "provider", - "voiceId" - ] - }, - "FallbackVapiVoice": { - "type": "object", - "properties": { - "cachingEnabled": { + "optimizeStreamingLatency": { + "type": "number", + "description": "Defines the optimize streaming latency for voice settings. Defaults to 3.", + "minimum": 0, + "maximum": 4, + "example": 3 + }, + "enableSsmlParsing": { "type": "boolean", - "description": "This is the flag to toggle voice caching for the assistant.", - "example": true, - "default": true + "description": "This enables the use of https://elevenlabs.io/docs/speech-synthesis/prompting#pronunciation. Defaults to false to save latency.\n\n@default false", + "example": false }, - "provider": { + "autoMode": { + "type": "boolean", + "description": "Defines the auto mode for voice settings. Defaults to false.", + "example": false + }, + "model": { "type": "string", - "description": "This is the voice provider that will be used.", + "description": "This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified.", "enum": [ - "vapi" - ] + "eleven_multilingual_v2", + "eleven_turbo_v2", + "eleven_turbo_v2_5", + "eleven_flash_v2", + "eleven_flash_v2_5", + "eleven_monolingual_v1", + "eleven_v3" + ], + "example": "eleven_turbo_v2_5" }, - "voiceId": { + "language": { "type": "string", - "description": "The voices provided by Vapi", - "enum": [ - "Elliot", - "Kylie", - "Rohan", - "Lily", - "Savannah", - "Hana", - "Neha", - "Cole", - "Harry", - "Paige", - "Spencer" - ] + "description": "This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided." }, - "speed": { - "type": "number", - "description": "This is the speed multiplier that will be used.\n\n@default 1", - "minimum": 0.25, - "maximum": 2, - "default": 1 + "pronunciationDictionaryLocators": { + "description": "This is the pronunciation dictionary locators to use.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ElevenLabsPronunciationDictionaryLocator" + } }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21681,7 +23636,7 @@ "voiceId" ] }, - "FallbackInworldVoice": { + "FallbackHumeVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21694,93 +23649,30 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "inworld" + "hume" ] }, - "voiceId": { - "type": "string", - "description": "Available voices by language:\n• en: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Hades, Julia, Pixie, Mark, Olivia, Priya, Ronald, Sarah, Shaun, Theodore, Timothy, Wendy, Dominus\n• zh: Yichen, Xiaoyin, Xinyi, Jing\n• nl: Erik, Katrien, Lennart, Lore\n• fr: Alain, Hélène, Mathieu, Étienne\n• de: Johanna, Josef\n• it: Gianni, Orietta\n• ja: Asuka, Satoshi\n• ko: Hyunwoo, Minji, Seojun, Yoona\n• pl: Szymon, Wojciech\n• pt: Heitor, Maitê\n• es: Diego, Lupita, Miguel, Rafael", - "maxLength": 120, - "title": "Inworld Voice ID", - "enum": [ - "Alex", - "Ashley", - "Craig", - "Deborah", - "Dennis", - "Edward", - "Elizabeth", - "Hades", - "Julia", - "Pixie", - "Mark", - "Olivia", - "Priya", - "Ronald", - "Sarah", - "Shaun", - "Theodore", - "Timothy", - "Wendy", - "Dominus", - "Yichen", - "Xiaoyin", - "Xinyi", - "Jing", - "Erik", - "Katrien", - "Lennart", - "Lore", - "Alain", - "Hélène", - "Mathieu", - "Étienne", - "Johanna", - "Josef", - "Gianni", - "Orietta", - "Asuka", - "Satoshi", - "Hyunwoo", - "Minji", - "Seojun", - "Yoona", - "Szymon", - "Wojciech", - "Heitor", - "Maitê", - "Diego", - "Lupita", - "Miguel", - "Rafael" - ], - "example": "Alex" - }, "model": { "type": "string", "description": "This is the model that will be used.", "enum": [ - "inworld-tts-1" + "octave", + "octave2" ], - "default": "inworld-tts-1" + "example": "octave2" }, - "languageCode": { + "voiceId": { "type": "string", - "description": "Language code for Inworld TTS synthesis", - "default": "en", - "enum": [ - "en", - "zh", - "ko", - "nl", - "fr", - "es", - "ja", - "de", - "it", - "pl", - "pt" - ] + "description": "The ID of the particular voice you want to use." + }, + "isCustomHumeVoice": { + "type": "boolean", + "description": "Indicates whether the chosen voice is a preset Hume AI voice or a custom voice.", + "example": false + }, + "description": { + "type": "string", + "description": "Natural language instructions describing how the synthesized speech should sound, including but not limited to tone, intonation, pacing, and accent (e.g., 'a soft, gentle voice with a strong British accent').\n\nIf a Voice is specified in the request, this description serves as acting instructions.\nIf no Voice is specified, a new voice is generated based on this description." }, "chunkPlan": { "description": "This is the plan for chunking the model output before it is sent to the voice provider.", @@ -21796,7 +23688,7 @@ "voiceId" ] }, - "FallbackMinimaxVoice": { + "FallbackLMNTVoice": { "type": "object", "properties": { "cachingEnabled": { @@ -21809,1087 +23701,1423 @@ "type": "string", "description": "This is the voice provider that will be used.", "enum": [ - "minimax" + "lmnt" ] }, "voiceId": { - "type": "string", - "description": "This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID.", - "title": "This is the Minimax Voice ID" - }, - "model": { - "type": "string", - "description": "This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'.\nspeech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks.\nspeech-02-turbo is designed for real-time applications with low latency.\n\n@default \"speech-02-turbo\"", - "enum": [ - "speech-02-hd", - "speech-02-turbo" - ], - "example": "speech-02-turbo", - "default": "speech-02-turbo" - }, - "emotion": { - "type": "string", - "description": "The emotion to use for the voice. If not provided, will use auto-detect mode.\nOptions include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral'", - "example": "happy" - }, - "pitch": { - "type": "number", - "description": "Voice pitch adjustment. Range from -12 to 12 semitones.\n@default 0", - "minimum": -12, - "maximum": 12, - "example": 0, - "default": 0 - }, - "speed": { - "type": "number", - "description": "Voice speed adjustment. Range from 0.5 to 2.0.\n@default 1.0", - "minimum": 0.5, - "maximum": 2, - "example": 1, - "default": 1 - }, - "volume": { - "type": "number", - "description": "Voice volume adjustment. Range from 0.5 to 2.0.\n@default 1.0", - "minimum": 0.5, - "maximum": 2, - "example": 1, - "default": 1 - }, - "region": { - "type": "string", - "description": "The region for Minimax API. Defaults to \"worldwide\".", - "enum": [ - "worldwide", - "china" - ], - "default": "worldwide" - }, - "chunkPlan": { - "description": "This is the plan for chunking the model output before it is sent to the voice provider.", - "allOf": [ + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ { - "$ref": "#/components/schemas/ChunkPlan" + "type": "string", + "enum": [ + "amy", + "ansel", + "autumn", + "ava", + "brandon", + "caleb", + "cassian", + "chloe", + "dalton", + "daniel", + "dustin", + "elowen", + "evander", + "huxley", + "james", + "juniper", + "kennedy", + "lauren", + "leah", + "lily", + "lucas", + "magnus", + "miles", + "morgan", + "natalie", + "nathan", + "noah", + "nyssa", + "oliver", + "paige", + "ryan", + "sadie", + "sophie", + "stella", + "terrence", + "tyler", + "vesper", + "violet", + "warrick", + "zain", + "zeke", + "zoe" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "LMNT Voice ID" } ] - } - }, - "required": [ - "provider", - "voiceId" - ] - }, - "TransportConfigurationTwilio": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "twilio" - ] }, - "timeout": { + "speed": { "type": "number", - "description": "The integer number of seconds that we should allow the phone to ring before assuming there is no answer.\nThe default is `60` seconds and the maximum is `600` seconds.\nFor some call flows, we will add a 5-second buffer to the timeout value you provide.\nFor this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds.\nYou can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail.\n\n@default 60", - "minimum": 1, - "maximum": 600, - "example": 60 - }, - "record": { - "type": "boolean", - "description": "Whether to record the call.\nCan be `true` to record the phone call, or `false` to not.\nThe default is `false`.\n\n@default false", - "example": false - }, - "recordingChannels": { - "type": "string", - "description": "The number of channels in the final recording.\nCan be: `mono` or `dual`.\nThe default is `mono`.\n`mono` records both legs of the call in a single channel of the recording file.\n`dual` records each leg to a separate channel of the recording file.\nThe first channel of a dual-channel recording contains the parent call and the second channel contains the child call.\n\n@default 'mono'", - "enum": [ - "mono", - "dual" - ], - "example": "mono" - } - }, - "required": [ - "provider" - ] - }, - "CreateAnthropicCredentialDTO": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "anthropic" - ] - }, - "apiKey": { - "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateAnyscaleCredentialDTO": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "anyscale" - ] - }, - "apiKey": { - "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateAssemblyAICredentialDTO": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "assembly-ai" - ] - }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "AzureBlobStorageBucketPlan": { - "type": "object", - "properties": { - "connectionString": { - "type": "string", - "description": "This is the blob storage connection string for the Azure resource." - }, - "containerName": { - "type": "string", - "description": "This is the container name for the Azure blob storage." - }, - "path": { - "type": "string", - "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" - } - }, - "required": [ - "connectionString", - "containerName" - ] - }, - "CreateAzureCredentialDTO": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "azure" - ] + "description": "This is the speed multiplier that will be used.", + "minimum": 0.25, + "maximum": 2, + "example": null }, - "service": { - "type": "string", - "description": "This is the service being used in Azure.", + "language": { + "description": "Two letter ISO 639-1 language code. Use \"auto\" for auto-detection.", "enum": [ - "speech", - "blob_storage" - ], - "default": "speech" - }, - "region": { - "type": "string", - "description": "This is the region of the Azure resource.", - "enum": [ - "australia", - "canadaeast", - "canadacentral", - "eastus2", - "eastus", - "france", - "india", - "japaneast", - "japanwest", - "uaenorth", - "northcentralus", - "norway", - "southcentralus", - "swedencentral", - "switzerland", + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", "uk", - "westus", - "westus3" + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu", + "auto" + ], + "example": "en", + "oneOf": [ + { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bh", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yue", + "yo", + "za", + "zh", + "zu" + ], + "title": "ISO 639-1 Language Code" + }, + { + "type": "string", + "enum": [ + "auto" + ], + "title": "Auto-detect" + } ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API.", - "maxLength": 10000 - }, - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." - }, - "bucketPlan": { - "description": "This is the bucket plan that can be provided to store call artifacts in Azure Blob Storage.", + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ { - "$ref": "#/components/schemas/AzureBlobStorageBucketPlan" + "$ref": "#/components/schemas/ChunkPlan" } ] - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 } }, "required": [ "provider", - "service" + "voiceId" ] }, - "CreateAzureOpenAICredentialDTO": { + "FallbackNeuphonicVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "azure-openai" + "neuphonic" ] }, - "region": { - "type": "string", - "enum": [ - "australia", - "canadaeast", - "canadacentral", - "eastus2", - "eastus", - "france", - "india", - "japaneast", - "japanwest", - "uaenorth", - "northcentralus", - "norway", - "southcentralus", - "swedencentral", - "switzerland", - "uk", - "westus", - "westus3" + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "Neuphonic Voice ID" + } ] }, - "models": { - "type": "array", + "model": { + "type": "string", + "description": "This is the model that will be used. Defaults to 'neu_fast' if not specified.", "enum": [ - "gpt-5", - "gpt-5-mini", - "gpt-5-nano", - "gpt-4.1-2025-04-14", - "gpt-4.1-mini-2025-04-14", - "gpt-4.1-nano-2025-04-14", - "gpt-4o-2024-11-20", - "gpt-4o-2024-08-06", - "gpt-4o-2024-05-13", - "gpt-4o-mini-2024-07-18", - "gpt-4-turbo-2024-04-09", - "gpt-4-0125-preview", - "gpt-4-1106-preview", - "gpt-4-0613", - "gpt-35-turbo-0125", - "gpt-35-turbo-1106" - ], - "example": [ - "gpt-4-0125-preview", - "gpt-4-0613" + "neu_hq", + "neu_fast" ], - "items": { - "type": "string", - "enum": [ - "gpt-5", - "gpt-5-mini", - "gpt-5-nano", - "gpt-4.1-2025-04-14", - "gpt-4.1-mini-2025-04-14", - "gpt-4.1-nano-2025-04-14", - "gpt-4o-2024-11-20", - "gpt-4o-2024-08-06", - "gpt-4o-2024-05-13", - "gpt-4o-mini-2024-07-18", - "gpt-4-turbo-2024-04-09", - "gpt-4-0125-preview", - "gpt-4-1106-preview", - "gpt-4-0613", - "gpt-35-turbo-0125", - "gpt-35-turbo-1106" - ] - } - }, - "openAIKey": { - "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." + "example": "neu_fast" }, - "ocpApimSubscriptionKey": { - "type": "string", - "description": "This is not returned in the API." + "language": { + "type": "object", + "description": "This is the language (ISO 639-1) that is enforced for the model.", + "example": "en" }, - "openAIEndpoint": { - "type": "string", - "maxLength": 10000 + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.25, + "maximum": 2, + "example": null }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ "provider", - "region", - "models", - "openAIKey", - "openAIEndpoint" + "voiceId", + "language" ] }, - "SipTrunkGateway": { + "FallbackOpenAIVoice": { "type": "object", "properties": { - "ip": { - "type": "string", - "description": "This is the address of the gateway. It can be an IPv4 address like 1.1.1.1 or a fully qualified domain name like my-sip-trunk.pstn.twilio.com." - }, - "port": { - "type": "number", - "description": "This is the port number of the gateway. Default is 5060.\n\n@default 5060", - "minimum": 1, - "maximum": 65535 - }, - "netmask": { - "type": "number", - "description": "This is the netmask of the gateway. Defaults to 32.\n\n@default 32", - "minimum": 24, - "maximum": 32 - }, - "inboundEnabled": { - "type": "boolean", - "description": "This is whether inbound calls are allowed from this gateway. Default is true.\n\n@default true" - }, - "outboundEnabled": { + "cachingEnabled": { "type": "boolean", - "description": "This is whether outbound calls should be sent to this gateway. Default is true.\n\nNote, if netmask is less than 32, it doesn't affect the outbound IPs that are tried. 1 attempt is made to `ip:port`.\n\n@default true" + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true }, - "outboundProtocol": { + "provider": { "type": "string", - "description": "This is the protocol to use for SIP signaling outbound calls. Default is udp.\n\n@default udp", + "description": "This is the voice provider that will be used.", "enum": [ - "tls/srtp", - "tcp", - "tls", - "udp" + "openai" ] }, - "optionsPingEnabled": { - "type": "boolean", - "description": "This is whether to send options ping to the gateway. This can be used to check if the gateway is reachable. Default is false.\n\nThis is useful for high availability setups where you want to check if the gateway is reachable before routing calls to it. Note, if no gateway for a trunk is reachable, outbound calls will be rejected.\n\n@default false" - } - }, - "required": [ - "ip" - ] - }, - "SipTrunkOutboundSipRegisterPlan": { - "type": "object", - "properties": { - "domain": { - "type": "string" - }, - "username": { - "type": "string" - }, - "realm": { - "type": "string" - } - } - }, - "SipTrunkOutboundAuthenticationPlan": { - "type": "object", - "properties": { - "authPassword": { - "type": "string", - "description": "This is not returned in the API." - }, - "authUsername": { - "type": "string" - }, - "sipRegisterPlan": { - "description": "This can be used to configure if SIP register is required by the SIP trunk. If not provided, no SIP registration will be attempted.", - "allOf": [ + "voiceId": { + "description": "This is the provider-specific ID that will be used.\nPlease note that ash, ballad, coral, sage, and verse may only be used with realtime models.", + "oneOf": [ { - "$ref": "#/components/schemas/SipTrunkOutboundSipRegisterPlan" + "type": "string", + "enum": [ + "alloy", + "echo", + "fable", + "onyx", + "nova", + "shimmer", + "marin", + "cedar" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "OpenAI Voice ID" } ] - } - } - }, - "SbcConfiguration": { - "type": "object", - "properties": {} - }, - "CreateByoSipTrunkCredentialDTO": { - "type": "object", - "properties": { - "provider": { + }, + "model": { "type": "string", - "description": "This can be used to bring your own SIP trunks or to connect to a Carrier.", + "description": "This is the model that will be used for text-to-speech.", "enum": [ - "byo-sip-trunk" - ] - }, - "gateways": { - "description": "This is the list of SIP trunk's gateways.", - "type": "array", - "items": { - "$ref": "#/components/schemas/SipTrunkGateway" - } - }, - "outboundAuthenticationPlan": { - "description": "This can be used to configure the outbound authentication if required by the SIP trunk.", - "allOf": [ - { - "$ref": "#/components/schemas/SipTrunkOutboundAuthenticationPlan" - } + "tts-1", + "tts-1-hd", + "gpt-4o-mini-tts" ] }, - "outboundLeadingPlusEnabled": { - "type": "boolean", - "description": "This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior.\n\nUsage:\n- Vonage/Twilio requires leading plus for all outbound calls. Set this to true.\n\n@default false" - }, - "techPrefix": { + "instructions": { "type": "string", - "description": "This can be used to configure the tech prefix on outbound calls. This is an advanced property.", + "description": "This is a prompt that allows you to control the voice of your generated audio.\nDoes not work with 'tts-1' or 'tts-1-hd' models.", "maxLength": 10000 }, - "sipDiversionHeader": { - "type": "string", - "description": "This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property.", - "maxLength": 10000 + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.25, + "maximum": 4, + "example": null }, - "sbcConfiguration": { - "description": "This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi.", + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ { - "$ref": "#/components/schemas/SbcConfiguration" + "$ref": "#/components/schemas/ChunkPlan" } ] - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 } }, "required": [ - "gateways" + "provider", + "voiceId" ] }, - "CreateCartesiaCredentialDTO": { + "FallbackPlayHTVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "cartesia" + "playht" ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CloudflareR2BucketPlan": { - "type": "object", - "properties": { - "accessKeyId": { - "type": "string", - "description": "Cloudflare R2 Access key ID." - }, - "secretAccessKey": { - "type": "string", - "description": "Cloudflare R2 access key secret. This is not returned in the API." + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [ + "jennifer", + "melissa", + "will", + "chris", + "matt", + "jack", + "ruby", + "davis", + "donna", + "michael" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "PlayHT Voice ID" + } + ] }, - "url": { - "type": "string", - "description": "Cloudflare R2 base url." + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.1, + "maximum": 5, + "example": null }, - "name": { - "type": "string", - "description": "This is the name of the bucket." + "temperature": { + "type": "number", + "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.", + "minimum": 0.1, + "maximum": 2, + "example": null }, - "path": { - "type": "string", - "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" - } - }, - "required": [ - "name" - ] - }, - "CreateCloudflareCredentialDTO": { - "type": "object", - "properties": { - "provider": { + "emotion": { "type": "string", + "description": "An emotion to be applied to the speech.", "enum": [ - "cloudflare" + "female_happy", + "female_sad", + "female_angry", + "female_fearful", + "female_disgust", + "female_surprised", + "male_happy", + "male_sad", + "male_angry", + "male_fearful", + "male_disgust", + "male_surprised" ], - "description": "Credential provider. Only allowed value is cloudflare" - }, - "accountId": { - "type": "string", - "description": "Cloudflare Account Id." - }, - "apiKey": { - "type": "string", - "description": "Cloudflare API Key / Token." + "example": null }, - "accountEmail": { - "type": "string", - "description": "Cloudflare Account Email." + "voiceGuidance": { + "type": "number", + "description": "A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.", + "minimum": 1, + "maximum": 6, + "example": null }, - "fallbackIndex": { + "styleGuidance": { "type": "number", - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", - "minimum": 1 + "description": "A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.", + "minimum": 1, + "maximum": 30, + "example": null }, - "bucketPlan": { - "description": "This is the bucket plan that can be provided to store call artifacts in R2", - "allOf": [ - { - "$ref": "#/components/schemas/CloudflareR2BucketPlan" - } - ] + "textGuidance": { + "type": "number", + "description": "A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.", + "minimum": 1, + "maximum": 2, + "example": null }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider" - ] - }, - "OAuth2AuthenticationPlan": { - "type": "object", - "properties": { - "type": { + "model": { "type": "string", + "description": "Playht voice model/engine to use.", "enum": [ - "oauth2" + "PlayHT2.0", + "PlayHT2.0-turbo", + "Play3.0-mini", + "PlayDialog" ] }, - "url": { - "type": "string", - "description": "This is the OAuth2 URL." - }, - "clientId": { - "type": "string", - "description": "This is the OAuth2 client ID." - }, - "clientSecret": { - "type": "string", - "description": "This is the OAuth2 client secret." - }, - "scope": { - "type": "string", - "description": "This is the scope of the OAuth2 token.", - "maxLength": 1000 - } - }, - "required": [ - "type", - "url", - "clientId", - "clientSecret" - ] - }, - "CreateCustomLLMCredentialDTO": { - "type": "object", - "properties": { - "provider": { + "language": { "type": "string", + "description": "The language to use for the speech.", "enum": [ - "custom-llm" + "afrikaans", + "albanian", + "amharic", + "arabic", + "bengali", + "bulgarian", + "catalan", + "croatian", + "czech", + "danish", + "dutch", + "english", + "french", + "galician", + "german", + "greek", + "hebrew", + "hindi", + "hungarian", + "indonesian", + "italian", + "japanese", + "korean", + "malay", + "mandarin", + "polish", + "portuguese", + "russian", + "serbian", + "spanish", + "swedish", + "tagalog", + "thai", + "turkish", + "ukrainian", + "urdu", + "xhosa" ] }, - "apiKey": { - "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." - }, - "authenticationPlan": { - "description": "This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey", + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", "allOf": [ { - "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + "$ref": "#/components/schemas/ChunkPlan" } ] - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 } }, "required": [ "provider", - "apiKey" + "voiceId" ] }, - "CreateDeepgramCredentialDTO": { + "FallbackRimeAIVoice": { "type": "object", "properties": { - "provider": { - "type": "string", - "enum": [ - "deepgram" - ] - }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "apiUrl": { - "type": "string", - "description": "This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com." + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateDeepInfraCredentialDTO": { - "type": "object", - "properties": { "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "deepinfra" + "rime-ai" ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateDeepSeekCredentialDTO": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "enum": [ - "deep-seek" + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [ + "abbie", + "allison", + "ally", + "alona", + "amber", + "ana", + "antoine", + "armon", + "brenda", + "brittany", + "carol", + "colin", + "courtney", + "elena", + "elliot", + "eva", + "geoff", + "gerald", + "hank", + "helen", + "hera", + "jen", + "joe", + "joy", + "juan", + "kendra", + "kendrick", + "kenneth", + "kevin", + "kris", + "linda", + "madison", + "marge", + "marina", + "marissa", + "marta", + "maya", + "nicholas", + "nyles", + "phil", + "reba", + "rex", + "rick", + "ritu", + "rob", + "rodney", + "rohan", + "rosco", + "samantha", + "sandy", + "selena", + "seth", + "sharon", + "stan", + "tamra", + "tanya", + "tibur", + "tj", + "tyler", + "viv", + "yadira", + "marsh", + "bayou", + "creek", + "brook", + "flower", + "spore", + "glacier", + "gulch", + "alpine", + "cove", + "lagoon", + "tundra", + "steppe", + "mesa", + "grove", + "rainforest", + "moraine", + "wildflower", + "peak", + "boulder", + "gypsum", + "zest", + "luna", + "celeste", + "orion", + "ursa", + "astra", + "esther", + "estelle", + "andromeda" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "RimeAI Voice ID" + } ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateElevenLabsCredentialDTO": { - "type": "object", - "properties": { - "provider": { + "model": { "type": "string", + "description": "This is the model that will be used. Defaults to 'arcana' when not specified.", "enum": [ - "11labs" - ] - }, - "apiKey": { - "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "GcpKey": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of the key. Most likely, this is \"service_account\"." - }, - "projectId": { - "type": "string", - "description": "This is the ID of the Google Cloud project associated with this key." - }, - "privateKeyId": { - "type": "string", - "description": "This is the unique identifier for the private key." - }, - "privateKey": { - "type": "string", - "description": "This is the private key in PEM format.\n\nNote: This is not returned in the API." - }, - "clientEmail": { - "type": "string", - "description": "This is the email address associated with the service account." + "arcana", + "mistv2", + "mist" + ], + "example": "arcana" }, - "clientId": { - "type": "string", - "description": "This is the unique identifier for the client." + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "minimum": 0.1, + "example": null }, - "authUri": { - "type": "string", - "description": "This is the URI for the auth provider's authorization endpoint." + "pauseBetweenBrackets": { + "type": "boolean", + "description": "This is a flag that controls whether to add slight pauses using angle brackets. Example: \"Hi. <200> I'd love to have a conversation with you.\" adds a 200ms pause between the first and second sentences.", + "example": false }, - "tokenUri": { - "type": "string", - "description": "This is the URI for the auth provider's token endpoint." + "phonemizeBetweenBrackets": { + "type": "boolean", + "description": "This is a flag that controls whether text inside brackets should be phonemized (converted to phonetic pronunciation) - Example: \"{h'El.o} World\" will pronounce \"Hello\" as expected.", + "example": false }, - "authProviderX509CertUrl": { - "type": "string", - "description": "This is the URL of the public x509 certificate for the auth provider." + "reduceLatency": { + "type": "boolean", + "description": "This is a flag that controls whether to optimize for reduced latency in streaming. https://docs.rime.ai/api-reference/endpoint/websockets#param-reduce-latency", + "example": false }, - "clientX509CertUrl": { + "inlineSpeedAlpha": { "type": "string", - "description": "This is the URL of the public x509 certificate for the client." + "description": "This is a string that allows inline speed control using alpha notation. https://docs.rime.ai/api-reference/endpoint/websockets#param-inline-speed-alpha", + "example": null }, - "universeDomain": { - "type": "string", - "description": "This is the domain associated with the universe this service account belongs to." + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ - "type", - "projectId", - "privateKeyId", - "privateKey", - "clientEmail", - "clientId", - "authUri", - "tokenUri", - "authProviderX509CertUrl", - "clientX509CertUrl", - "universeDomain" + "provider", + "voiceId" ] }, - "BucketPlan": { + "FallbackSesameVoice": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "This is the name of the bucket." + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true }, - "region": { + "provider": { "type": "string", - "description": "This is the region of the bucket.\n\nUsage:\n- If `credential.type` is `aws`, then this is required.\n- If `credential.type` is `gcp`, then this is optional since GCP allows buckets to be accessed without a region but region is required for data residency requirements. Read here: https://cloud.google.com/storage/docs/request-endpoints\n\nThis overrides the `credential.region` field if it is provided." + "description": "This is the voice provider that will be used.", + "enum": [ + "sesame" + ] }, - "path": { + "voiceId": { "type": "string", - "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" + "description": "This is the provider-specific ID that will be used.", + "title": "Sesame Voice ID. This should be either a name (a built-in voice) or a UUID (a custom voice)." }, - "hmacAccessKey": { + "model": { "type": "string", - "description": "This is the HMAC access key offered by GCP for interoperability with S3 clients. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console\n\nUsage:\n- If `credential.type` is `gcp`, then this is required.\n- If `credential.type` is `aws`, then this is not required since credential.awsAccessKeyId is used instead." + "description": "This is the model that will be used.", + "enum": [ + "csm-1b" + ] }, - "hmacSecret": { - "type": "string", - "description": "This is the secret for the HMAC access key. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console\n\nUsage:\n- If `credential.type` is `gcp`, then this is required.\n- If `credential.type` is `aws`, then this is not required since credential.awsSecretAccessKey is used instead.\n\nNote: This is not returned in the API." + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ - "name" + "provider", + "voiceId", + "model" ] }, - "CreateGcpCredentialDTO": { + "FallbackSmallestAIVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "gcp" + "smallest-ai" ] }, - "fallbackIndex": { - "type": "number", - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", - "minimum": 1 - }, - "gcpKey": { - "description": "This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys.\n\nThe schema is identical to the JSON that GCP outputs.", - "allOf": [ + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ { - "$ref": "#/components/schemas/GcpKey" + "type": "string", + "enum": [ + "emily", + "jasmine", + "arman", + "james", + "mithali", + "aravind", + "raj", + "diya", + "raman", + "ananya", + "isha", + "william", + "aarav", + "monika", + "niharika", + "deepika", + "raghav", + "kajal", + "radhika", + "mansi", + "nisha", + "saurabh", + "pooja", + "saina", + "sanya" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "Smallest AI Voice ID" } ] }, - "region": { + "model": { "type": "string", - "description": "This is the region of the GCP resource.", - "maxLength": 40 + "description": "Smallest AI voice model to use. Defaults to 'lightning' when not specified.", + "enum": [ + "lightning" + ] }, - "bucketPlan": { - "$ref": "#/components/schemas/BucketPlan" + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.", + "example": null }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ "provider", - "gcpKey" + "voiceId" ] }, - "CreateGladiaCredentialDTO": { + "FallbackTavusVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "gladia" + "tavus" ] }, - "apiKey": { + "voiceId": { + "description": "This is the provider-specific ID that will be used.", + "oneOf": [ + { + "type": "string", + "enum": [ + "r52da2535a" + ], + "title": "Preset Voice Options" + }, + { + "type": "string", + "title": "Tavus Voice ID" + } + ] + }, + "personaId": { "type": "string", - "description": "This is not returned in the API." + "description": "This is the unique identifier for the persona that the replica will use in the conversation." }, - "name": { + "callbackUrl": { "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateGoHighLevelCredentialDTO": { - "type": "object", - "properties": { - "provider": { + "description": "This is the url that will receive webhooks with updates regarding the conversation state." + }, + "conversationName": { "type": "string", - "enum": [ - "gohighlevel" - ] + "description": "This is the name for the conversation." }, - "apiKey": { + "conversationalContext": { "type": "string", - "description": "This is not returned in the API." + "description": "This is the context that will be appended to any context provided in the persona, if one is provided." }, - "name": { + "customGreeting": { "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "description": "This is the custom greeting that the replica will give once a participant joines the conversation." + }, + "properties": { + "description": "These are optional properties used to customize the conversation.", + "allOf": [ + { + "$ref": "#/components/schemas/TavusConversationProperties" + } + ] + }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ "provider", - "apiKey" + "voiceId" ] }, - "CreateGroqCredentialDTO": { + "FallbackVapiVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "groq" + "vapi" ] }, - "apiKey": { + "voiceId": { "type": "string", - "description": "This is not returned in the API." + "description": "The voices provided by Vapi", + "enum": [ + "Elliot", + "Kylie", + "Rohan", + "Lily", + "Savannah", + "Hana", + "Neha", + "Cole", + "Harry", + "Paige", + "Spencer", + "Nico", + "Kai", + "Emma", + "Sagar", + "Neil", + "Leah", + "Tara", + "Jess", + "Leo", + "Dan", + "Mia", + "Zac", + "Zoe" + ] }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "speed": { + "type": "number", + "description": "This is the speed multiplier that will be used.\n\n@default 1", + "minimum": 0.25, + "maximum": 2, + "default": 1 + }, + "pronunciationDictionary": { + "description": "List of pronunciation dictionary locators for custom word pronunciations.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VapiPronunciationDictionaryLocator" + } + }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ "provider", - "apiKey" + "voiceId" ] }, - "CreateLangfuseCredentialDTO": { + "FallbackInworldVoice": { "type": "object", "properties": { + "cachingEnabled": { + "type": "boolean", + "description": "This is the flag to toggle voice caching for the assistant.", + "example": true, + "default": true + }, "provider": { "type": "string", + "description": "This is the voice provider that will be used.", "enum": [ - "langfuse" + "inworld" ] }, - "publicKey": { + "voiceId": { "type": "string", - "description": "The public key for Langfuse project. Eg: pk-lf-..." + "description": "Available voices by language:\n• en: Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Hades, Julia, Pixie, Mark, Olivia, Priya, Ronald, Sarah, Shaun, Theodore, Timothy, Wendy, Dominus, Hana, Clive, Carter, Blake, Luna\n• zh: Yichen, Xiaoyin, Xinyi, Jing\n• nl: Erik, Katrien, Lennart, Lore\n• fr: Alain, Hélène, Mathieu, Étienne\n• de: Johanna, Josef\n• it: Gianni, Orietta\n• ja: Asuka, Satoshi\n• ko: Hyunwoo, Minji, Seojun, Yoona\n• pl: Szymon, Wojciech\n• pt: Heitor, Maitê\n• es: Diego, Lupita, Miguel, Rafael\n• ru: Svetlana, Elena, Dmitry, Nikolai\n• hi: Riya, Manoj\n• he: Yael, Oren\n• ar: Nour, Omar", + "maxLength": 120, + "title": "Inworld Voice ID", + "enum": [ + "Alex", + "Ashley", + "Craig", + "Deborah", + "Dennis", + "Edward", + "Elizabeth", + "Hades", + "Julia", + "Pixie", + "Mark", + "Olivia", + "Priya", + "Ronald", + "Sarah", + "Shaun", + "Theodore", + "Timothy", + "Wendy", + "Dominus", + "Hana", + "Clive", + "Carter", + "Blake", + "Luna", + "Yichen", + "Xiaoyin", + "Xinyi", + "Jing", + "Erik", + "Katrien", + "Lennart", + "Lore", + "Alain", + "Hélène", + "Mathieu", + "Étienne", + "Johanna", + "Josef", + "Gianni", + "Orietta", + "Asuka", + "Satoshi", + "Hyunwoo", + "Minji", + "Seojun", + "Yoona", + "Szymon", + "Wojciech", + "Heitor", + "Maitê", + "Diego", + "Lupita", + "Miguel", + "Rafael", + "Svetlana", + "Elena", + "Dmitry", + "Nikolai", + "Riya", + "Manoj", + "Yael", + "Oren", + "Nour", + "Omar" + ], + "example": "Alex" }, - "apiKey": { + "model": { "type": "string", - "description": "The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API." + "description": "This is the model that will be used.", + "enum": [ + "inworld-tts-1" + ], + "default": "inworld-tts-1" }, - "apiUrl": { + "languageCode": { "type": "string", - "description": "The host URL for Langfuse project. Eg: https://cloud.langfuse.com" + "description": "Language code for Inworld TTS synthesis", + "default": "en", + "enum": [ + "en", + "zh", + "ko", + "nl", + "fr", + "es", + "ja", + "de", + "it", + "pl", + "pt", + "ru", + "hi", + "he", + "ar" + ] }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "temperature": { + "type": "number", + "description": "A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature of 1.1 will be used. The temperature parameter controls variance.\nHigher values will make the output more random and can lead to more expressive results. Lower values will make it more deterministic.\nSee https://docs.inworld.ai/docs/tts/capabilities/generating-audio#additional-configurations for more details.", + "minimum": 0.1, + "maximum": 2, + "default": 1.1, + "example": null + }, + "speakingRate": { + "type": "number", + "description": "A floating point number between 0.5, inclusive, and 1.5, inclusive. If equal to null or not provided, the model's default speaking speed of 1.0 will be used.\nValues above 0.8 are recommended for higher quality.\nSee https://docs.inworld.ai/docs/tts/capabilities/generating-audio#additional-configurations for more details.", + "minimum": 0.5, + "maximum": 1.5, + "default": 1, + "example": null + }, + "chunkPlan": { + "description": "This is the plan for chunking the model output before it is sent to the voice provider.", + "allOf": [ + { + "$ref": "#/components/schemas/ChunkPlan" + } + ] } }, "required": [ "provider", - "publicKey", - "apiKey", - "apiUrl" + "voiceId" ] }, - "CreateLmntCredentialDTO": { + "TransportConfigurationTwilio": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "lmnt" + "twilio" ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." + "timeout": { + "type": "number", + "description": "The integer number of seconds that we should allow the phone to ring before assuming there is no answer.\nThe default is `60` seconds and the maximum is `600` seconds.\nFor some call flows, we will add a 5-second buffer to the timeout value you provide.\nFor this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds.\nYou can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail.\n\n@default 60", + "minimum": 1, + "maximum": 600, + "example": 60 }, - "name": { + "record": { + "type": "boolean", + "description": "Whether to record the call.\nCan be `true` to record the phone call, or `false` to not.\nThe default is `false`.\n\n@default false", + "example": false + }, + "recordingChannels": { "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "description": "The number of channels in the final recording.\nCan be: `mono` or `dual`.\nThe default is `mono`.\n`mono` records both legs of the call in a single channel of the recording file.\n`dual` records each leg to a separate channel of the recording file.\nThe first channel of a dual-channel recording contains the parent call and the second channel contains the child call.\n\n@default 'mono'", + "enum": [ + "mono", + "dual" + ], + "example": "mono" } }, "required": [ - "provider", - "apiKey" + "provider" ] }, - "CreateMakeCredentialDTO": { + "CreateAnthropicCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "make" + "anthropic" ] }, - "teamId": { - "type": "string", - "description": "Team ID" - }, - "region": { - "type": "string", - "description": "Region of your application. For example: eu1, eu2, us1, us2" - }, "apiKey": { "type": "string", + "maxLength": 10000, "description": "This is not returned in the API." }, "name": { @@ -22901,23 +25129,40 @@ }, "required": [ "provider", - "teamId", - "region", "apiKey" ] }, - "CreateOpenAICredentialDTO": { + "CreateAnthropicBedrockCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "openai" + "anthropic-bedrock" ] }, - "apiKey": { + "region": { "type": "string", - "description": "This is not returned in the API." + "description": "AWS region where Bedrock is configured.", + "enum": [ + "us-east-1", + "us-west-2", + "eu-west-1", + "eu-west-3", + "ap-northeast-1", + "ap-southeast-2" + ] + }, + "authenticationPlan": { + "description": "Authentication method - either direct IAM credentials or cross-account role assumption.", + "oneOf": [ + { + "$ref": "#/components/schemas/AWSIAMCredentialsAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/AWSStsAuthenticationPlan" + } + ] }, "name": { "type": "string", @@ -22928,20 +25173,22 @@ }, "required": [ "provider", - "apiKey" + "region", + "authenticationPlan" ] }, - "CreateOpenRouterCredentialDTO": { + "CreateAnyscaleCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "openrouter" + "anyscale" ] }, "apiKey": { "type": "string", + "maxLength": 10000, "description": "This is not returned in the API." }, "name": { @@ -22956,13 +25203,13 @@ "apiKey" ] }, - "CreatePerplexityAICredentialDTO": { + "CreateAssemblyAICredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "perplexity-ai" + "assembly-ai" ] }, "apiKey": { @@ -22981,72 +25228,90 @@ "apiKey" ] }, - "CreatePlayHTCredentialDTO": { + "AzureBlobStorageBucketPlan": { "type": "object", "properties": { - "provider": { + "connectionString": { "type": "string", - "enum": [ - "playht" - ] + "description": "This is the blob storage connection string for the Azure resource." }, - "apiKey": { + "containerName": { "type": "string", - "description": "This is not returned in the API." - }, - "userId": { - "type": "string" + "description": "This is the container name for the Azure blob storage." }, - "name": { + "path": { "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" } }, "required": [ - "provider", - "apiKey", - "userId" + "connectionString", + "containerName" ] }, - "CreateRimeAICredentialDTO": { + "CreateAzureCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "rime-ai" + "azure" ] }, - "apiKey": { + "service": { "type": "string", - "description": "This is not returned in the API." + "description": "This is the service being used in Azure.", + "enum": [ + "speech", + "blob_storage" + ], + "default": "speech" }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] - }, - "CreateRunpodCredentialDTO": { - "type": "object", - "properties": { - "provider": { + "region": { "type": "string", + "description": "This is the region of the Azure resource.", "enum": [ - "runpod" + "australia", + "canadaeast", + "canadacentral", + "eastus2", + "eastus", + "france", + "germanywestcentral", + "india", + "japaneast", + "japanwest", + "northcentralus", + "norway", + "polandcentral", + "southcentralus", + "spaincentral", + "swedencentral", + "switzerland", + "uaenorth", + "uk", + "westeurope", + "westus", + "westus3" ] }, "apiKey": { "type": "string", - "description": "This is not returned in the API." + "description": "This is not returned in the API.", + "maxLength": 10000 + }, + "fallbackIndex": { + "type": "number", + "minimum": 1, + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + }, + "bucketPlan": { + "description": "This is the bucket plan that can be provided to store call artifacts in Azure Blob Storage.", + "allOf": [ + { + "$ref": "#/components/schemas/AzureBlobStorageBucketPlan" + } + ] }, "name": { "type": "string", @@ -23057,43 +25322,111 @@ }, "required": [ "provider", - "apiKey" + "service" ] }, - "CreateS3CredentialDTO": { + "CreateAzureOpenAICredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "s3" - ], - "description": "Credential provider. Only allowed value is s3" + "azure-openai" + ] }, - "awsAccessKeyId": { + "region": { "type": "string", - "description": "AWS access key ID." + "enum": [ + "australia", + "canadaeast", + "canadacentral", + "eastus2", + "eastus", + "france", + "germanywestcentral", + "india", + "japaneast", + "japanwest", + "northcentralus", + "norway", + "polandcentral", + "southcentralus", + "spaincentral", + "swedencentral", + "switzerland", + "uaenorth", + "uk", + "westeurope", + "westus", + "westus3" + ] }, - "awsSecretAccessKey": { - "type": "string", - "description": "AWS access key secret. This is not returned in the API." + "models": { + "type": "array", + "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "gpt-4o-2024-11-20", + "gpt-4o-2024-08-06", + "gpt-4o-2024-05-13", + "gpt-4o-mini-2024-07-18", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4-0613", + "gpt-35-turbo-0125", + "gpt-35-turbo-1106" + ], + "example": [ + "gpt-4-0125-preview", + "gpt-4-0613" + ], + "items": { + "type": "string", + "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "gpt-4o-2024-11-20", + "gpt-4o-2024-08-06", + "gpt-4o-2024-05-13", + "gpt-4o-mini-2024-07-18", + "gpt-4-turbo-2024-04-09", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4-0613", + "gpt-35-turbo-0125", + "gpt-35-turbo-1106" + ] + } }, - "region": { + "openAIKey": { "type": "string", - "description": "AWS region in which the S3 bucket is located." + "maxLength": 10000, + "description": "This is not returned in the API." }, - "s3BucketName": { + "ocpApimSubscriptionKey": { "type": "string", - "description": "AWS S3 bucket name." + "description": "This is not returned in the API." }, - "s3PathPrefix": { + "openAIEndpoint": { "type": "string", - "description": "The path prefix for the uploaded recording. Ex. \"recordings/\"" - }, - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + "maxLength": 10000 }, "name": { "type": "string", @@ -23104,133 +25437,142 @@ }, "required": [ "provider", - "awsAccessKeyId", - "awsSecretAccessKey", "region", - "s3BucketName", - "s3PathPrefix" + "models", + "openAIKey", + "openAIEndpoint" ] }, - "SupabaseBucketPlan": { + "SipTrunkGateway": { "type": "object", "properties": { - "region": { + "ip": { "type": "string", - "description": "This is the S3 Region. It should look like us-east-1\nIt should be one of the supabase regions defined in the SUPABASE_REGION enum\nCheck https://supabase.com/docs/guides/platform/regions for up to date regions", - "enum": [ - "us-west-1", - "us-east-1", - "us-east-2", - "ca-central-1", - "eu-west-1", - "eu-west-2", - "eu-west-3", - "eu-central-1", - "eu-central-2", - "eu-north-1", - "ap-south-1", - "ap-southeast-1", - "ap-northeast-1", - "ap-northeast-2", - "ap-southeast-2", - "sa-east-1" - ] + "description": "This is the address of the gateway. It can be an IPv4 address like 1.1.1.1 or a fully qualified domain name like my-sip-trunk.pstn.twilio.com." }, - "url": { - "type": "string", - "description": "This is the S3 compatible URL for Supabase S3\nThis should look like https://.supabase.co/storage/v1/s3" + "port": { + "type": "number", + "description": "This is the port number of the gateway. Default is 5060.\n\n@default 5060", + "minimum": 1, + "maximum": 65535 }, - "accessKeyId": { - "type": "string", - "description": "This is the Supabase S3 Access Key ID.\nThe user creates this in the Supabase project Storage settings" + "netmask": { + "type": "number", + "description": "This is the netmask of the gateway. Defaults to 32.\n\n@default 32", + "minimum": 24, + "maximum": 32 }, - "secretAccessKey": { - "type": "string", - "description": "This is the Supabase S3 Secret Access Key.\nThe user creates this in the Supabase project Storage settings along with the access key id" + "inboundEnabled": { + "type": "boolean", + "description": "This is whether inbound calls are allowed from this gateway. Default is true.\n\n@default true" }, - "name": { - "type": "string", - "description": "This is the Supabase S3 Bucket Name.\nThe user must create this in Supabase under Storage > Buckets\nA bucket that does not exist will not be checked now, but file uploads will fail" + "outboundEnabled": { + "type": "boolean", + "description": "This is whether outbound calls should be sent to this gateway. Default is true.\n\nNote, if netmask is less than 32, it doesn't affect the outbound IPs that are tried. 1 attempt is made to `ip:port`.\n\n@default true" }, - "path": { + "outboundProtocol": { "type": "string", - "description": "This is the Supabase S3 Bucket Folder Path.\nThe user can create this in Supabase under Storage > Buckets\nA path that does not exist will not be checked now, but file uploads will fail\nA Path is like a folder in the bucket\nEg. If the bucket is called \"my-bucket\" and the path is \"my-folder\", the full path is \"my-bucket/my-folder\"" + "description": "This is the protocol to use for SIP signaling outbound calls. Default is udp.\n\n@default udp", + "enum": [ + "tls/srtp", + "tcp", + "tls", + "udp" + ] + }, + "optionsPingEnabled": { + "type": "boolean", + "description": "This is whether to send options ping to the gateway. This can be used to check if the gateway is reachable. Default is false.\n\nThis is useful for high availability setups where you want to check if the gateway is reachable before routing calls to it. Note, if no gateway for a trunk is reachable, outbound calls will be rejected.\n\n@default false" } }, "required": [ - "region", - "url", - "accessKeyId", - "secretAccessKey", - "name" + "ip" ] }, - "CreateSupabaseCredentialDTO": { + "SipTrunkOutboundSipRegisterPlan": { "type": "object", "properties": { - "provider": { - "type": "string", - "enum": [ - "supabase" - ], - "description": "This is for supabase storage." - }, - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + "domain": { + "type": "string" }, - "bucketPlan": { - "$ref": "#/components/schemas/SupabaseBucketPlan" + "username": { + "type": "string" }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 + "realm": { + "type": "string" } - }, - "required": [ - "provider" - ] + } }, - "CreateSmallestAICredentialDTO": { + "SipTrunkOutboundAuthenticationPlan": { "type": "object", "properties": { - "provider": { - "type": "string", - "enum": [ - "smallest-ai" - ] - }, - "apiKey": { + "authPassword": { "type": "string", "description": "This is not returned in the API." }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - }, - "required": [ - "provider", - "apiKey" - ] + "authUsername": { + "type": "string" + }, + "sipRegisterPlan": { + "description": "This can be used to configure if SIP register is required by the SIP trunk. If not provided, no SIP registration will be attempted.", + "allOf": [ + { + "$ref": "#/components/schemas/SipTrunkOutboundSipRegisterPlan" + } + ] + } + } }, - "CreateTavusCredentialDTO": { + "SbcConfiguration": { + "type": "object", + "properties": {} + }, + "CreateByoSipTrunkCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", + "description": "This can be used to bring your own SIP trunks or to connect to a Carrier.", "enum": [ - "tavus" + "byo-sip-trunk" ] }, - "apiKey": { + "gateways": { + "description": "This is the list of SIP trunk's gateways.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SipTrunkGateway" + } + }, + "outboundAuthenticationPlan": { + "description": "This can be used to configure the outbound authentication if required by the SIP trunk.", + "allOf": [ + { + "$ref": "#/components/schemas/SipTrunkOutboundAuthenticationPlan" + } + ] + }, + "outboundLeadingPlusEnabled": { + "type": "boolean", + "description": "This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior.\n\nUsage:\n- Vonage/Twilio requires leading plus for all outbound calls. Set this to true.\n\n@default false" + }, + "techPrefix": { "type": "string", - "description": "This is not returned in the API." + "description": "This can be used to configure the tech prefix on outbound calls. This is an advanced property.", + "maxLength": 10000 + }, + "sipDiversionHeader": { + "type": "string", + "description": "This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property.", + "maxLength": 10000 + }, + "sbcConfiguration": { + "description": "This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi.", + "allOf": [ + { + "$ref": "#/components/schemas/SbcConfiguration" + } + ] }, "name": { "type": "string", @@ -23240,17 +25582,16 @@ } }, "required": [ - "provider", - "apiKey" + "gateways" ] }, - "CreateTogetherAICredentialDTO": { + "CreateCartesiaCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "together-ai" + "cartesia" ] }, "apiKey": { @@ -23269,29 +25610,68 @@ "apiKey" ] }, - "CreateTwilioCredentialDTO": { + "CloudflareR2BucketPlan": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string", + "description": "Cloudflare R2 Access key ID." + }, + "secretAccessKey": { + "type": "string", + "description": "Cloudflare R2 access key secret. This is not returned in the API." + }, + "url": { + "type": "string", + "description": "Cloudflare R2 base url." + }, + "name": { + "type": "string", + "description": "This is the name of the bucket." + }, + "path": { + "type": "string", + "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" + } + }, + "required": [ + "name" + ] + }, + "CreateCloudflareCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "twilio" - ] + "cloudflare" + ], + "description": "Credential provider. Only allowed value is cloudflare" }, - "authToken": { + "accountId": { "type": "string", - "description": "This is not returned in the API." + "description": "Cloudflare Account Id." }, "apiKey": { "type": "string", - "description": "This is not returned in the API." + "description": "Cloudflare API Key / Token." }, - "apiSecret": { + "accountEmail": { "type": "string", - "description": "This is not returned in the API." + "description": "Cloudflare Account Email." }, - "accountSid": { - "type": "string" + "fallbackIndex": { + "type": "number", + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", + "minimum": 1 + }, + "bucketPlan": { + "description": "This is the bucket plan that can be provided to store call artifacts in R2", + "allOf": [ + { + "$ref": "#/components/schemas/CloudflareR2BucketPlan" + } + ] }, "name": { "type": "string", @@ -23301,25 +25681,64 @@ } }, "required": [ - "provider", - "accountSid" + "provider" ] }, - "CreateVonageCredentialDTO": { + "OAuth2AuthenticationPlan": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "url": { + "type": "string", + "description": "This is the OAuth2 URL." + }, + "clientId": { + "type": "string", + "description": "This is the OAuth2 client ID." + }, + "clientSecret": { + "type": "string", + "description": "This is the OAuth2 client secret." + }, + "scope": { + "type": "string", + "description": "This is the scope of the OAuth2 token.", + "maxLength": 1000 + } + }, + "required": [ + "type", + "url", + "clientId", + "clientSecret" + ] + }, + "CreateCustomLLMCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "vonage" + "custom-llm" ] }, - "apiSecret": { + "apiKey": { "type": "string", + "maxLength": 10000, "description": "This is not returned in the API." }, - "apiKey": { - "type": "string" + "authenticationPlan": { + "description": "This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey", + "allOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + } + ] }, "name": { "type": "string", @@ -23330,36 +25749,25 @@ }, "required": [ "provider", - "apiSecret", "apiKey" ] }, - "CreateWebhookCredentialDTO": { + "CreateDeepgramCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "webhook" + "deepgram" ] }, - "authenticationPlan": { - "description": "This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing.", - "oneOf": [ - { - "$ref": "#/components/schemas/OAuth2AuthenticationPlan" - }, - { - "$ref": "#/components/schemas/HMACAuthenticationPlan" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", - "hmac": "#/components/schemas/HMACAuthenticationPlan" - } - } + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "apiUrl": { + "type": "string", + "description": "This can be used to point to an onprem Deepgram instance. Defaults to api.deepgram.com." }, "name": { "type": "string", @@ -23370,22 +25778,20 @@ }, "required": [ "provider", - "authenticationPlan" + "apiKey" ] }, - "CreateXAiCredentialDTO": { + "CreateDeepInfraCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai", "enum": [ - "xai" + "deepinfra" ] }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "name": { @@ -23400,15 +25806,19 @@ "apiKey" ] }, - "CreateGoogleCalendarOAuth2ClientCredentialDTO": { + "CreateDeepSeekCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.calendar.oauth2-client" + "deep-seek" ] }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -23417,21 +25827,23 @@ } }, "required": [ - "provider" + "provider", + "apiKey" ] }, - "CreateGoogleCalendarOAuth2AuthorizationCredentialDTO": { + "CreateElevenLabsCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.calendar.oauth2-authorization" + "11labs" ] }, - "authorizationId": { + "apiKey": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "maxLength": 10000, + "description": "This is not returned in the API." }, "name": { "type": "string", @@ -23442,21 +25854,128 @@ }, "required": [ "provider", - "authorizationId" + "apiKey" ] }, - "CreateGoogleSheetsOAuth2AuthorizationCredentialDTO": { + "GcpKey": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of the key. Most likely, this is \"service_account\"." + }, + "projectId": { + "type": "string", + "description": "This is the ID of the Google Cloud project associated with this key." + }, + "privateKeyId": { + "type": "string", + "description": "This is the unique identifier for the private key." + }, + "privateKey": { + "type": "string", + "description": "This is the private key in PEM format.\n\nNote: This is not returned in the API." + }, + "clientEmail": { + "type": "string", + "description": "This is the email address associated with the service account." + }, + "clientId": { + "type": "string", + "description": "This is the unique identifier for the client." + }, + "authUri": { + "type": "string", + "description": "This is the URI for the auth provider's authorization endpoint." + }, + "tokenUri": { + "type": "string", + "description": "This is the URI for the auth provider's token endpoint." + }, + "authProviderX509CertUrl": { + "type": "string", + "description": "This is the URL of the public x509 certificate for the auth provider." + }, + "clientX509CertUrl": { + "type": "string", + "description": "This is the URL of the public x509 certificate for the client." + }, + "universeDomain": { + "type": "string", + "description": "This is the domain associated with the universe this service account belongs to." + } + }, + "required": [ + "type", + "projectId", + "privateKeyId", + "privateKey", + "clientEmail", + "clientId", + "authUri", + "tokenUri", + "authProviderX509CertUrl", + "clientX509CertUrl", + "universeDomain" + ] + }, + "BucketPlan": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the bucket." + }, + "region": { + "type": "string", + "description": "This is the region of the bucket.\n\nUsage:\n- If `credential.type` is `aws`, then this is required.\n- If `credential.type` is `gcp`, then this is optional since GCP allows buckets to be accessed without a region but region is required for data residency requirements. Read here: https://cloud.google.com/storage/docs/request-endpoints\n\nThis overrides the `credential.region` field if it is provided." + }, + "path": { + "type": "string", + "description": "This is the path where call artifacts will be stored.\n\nUsage:\n- To store call artifacts in a specific folder, set this to the full path. Eg. \"/folder-name1/folder-name2\".\n- To store call artifacts in the root of the bucket, leave this blank.\n\n@default \"/\"" + }, + "hmacAccessKey": { + "type": "string", + "description": "This is the HMAC access key offered by GCP for interoperability with S3 clients. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console\n\nUsage:\n- If `credential.type` is `gcp`, then this is required.\n- If `credential.type` is `aws`, then this is not required since credential.awsAccessKeyId is used instead." + }, + "hmacSecret": { + "type": "string", + "description": "This is the secret for the HMAC access key. Here is the guide on how to create: https://cloud.google.com/storage/docs/authentication/managing-hmackeys#console\n\nUsage:\n- If `credential.type` is `gcp`, then this is required.\n- If `credential.type` is `aws`, then this is not required since credential.awsSecretAccessKey is used instead.\n\nNote: This is not returned in the API." + } + }, + "required": [ + "name" + ] + }, + "CreateGcpCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.sheets.oauth2-authorization" + "gcp" ] }, - "authorizationId": { + "fallbackIndex": { + "type": "number", + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", + "minimum": 1 + }, + "gcpKey": { + "description": "This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys.\n\nThe schema is identical to the JSON that GCP outputs.", + "allOf": [ + { + "$ref": "#/components/schemas/GcpKey" + } + ] + }, + "region": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "description": "This is the region of the GCP resource.", + "maxLength": 40 + }, + "bucketPlan": { + "$ref": "#/components/schemas/BucketPlan" }, "name": { "type": "string", @@ -23467,21 +25986,21 @@ }, "required": [ "provider", - "authorizationId" + "gcpKey" ] }, - "CreateSlackOAuth2AuthorizationCredentialDTO": { + "CreateGladiaCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "slack.oauth2-authorization" + "gladia" ] }, - "authorizationId": { + "apiKey": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "description": "This is not returned in the API." }, "name": { "type": "string", @@ -23492,26 +26011,22 @@ }, "required": [ "provider", - "authorizationId" + "apiKey" ] }, - "CreateMinimaxCredentialDTO": { + "CreateGoHighLevelCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "minimax" + "gohighlevel" ] }, "apiKey": { "type": "string", "description": "This is not returned in the API." }, - "groupId": { - "type": "string", - "description": "This is the Minimax Group ID." - }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -23521,683 +26036,809 @@ }, "required": [ "provider", - "apiKey", - "groupId" + "apiKey" ] }, - "TransferHookAction": { + "CreateGroqCredentialDTO": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of action - must be \"transfer\"", "enum": [ - "transfer" + "groq" ] }, - "destination": { - "description": "This is the destination details for the transfer - can be a phone number or SIP URI", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "type" + "provider", + "apiKey" ] }, - "FunctionCallHookAction": { + "CreateLangfuseCredentialDTO": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { + "provider": { "type": "string", "enum": [ - "function" - ], - "description": "The type of tool. \"function\" for Function tool." + "langfuse" + ] }, - "async": { - "type": "boolean", - "example": false, - "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + "publicKey": { + "type": "string", + "description": "The public key for Langfuse project. Eg: pk-lf-..." }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "apiKey": { + "type": "string", + "description": "The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "apiUrl": { + "type": "string", + "description": "The host URL for Langfuse project. Eg: https://cloud.langfuse.com" }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunction" - } + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "publicKey", + "apiKey", + "apiUrl" + ] + }, + "CreateLmntCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "lmnt" ] + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "type" + "provider", + "apiKey" ] }, - "SayHookAction": { + "CreateMakeCredentialDTO": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of action - must be \"say\"", "enum": [ - "say" + "make" ] }, - "prompt": { - "description": "This is the prompt for the assistant to generate a response based on existing conversation.\nCan be a string or an array of chat messages.", - "oneOf": [ - { - "type": "string", - "title": "String" - }, - { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" - } - ], - "examples": [ - "Ask the user if they're still in the call", - [ - { - "role": "system", - "content": "You are a helpful assistant, and would like to know if the user is still in the call based on the conversation history in {{transcript}}" - } - ] - ] + "teamId": { + "type": "string", + "description": "Team ID" }, - "exact": { - "type": "object", - "description": "This is the message to say" + "region": { + "type": "string", + "description": "Region of your application. For example: eu1, eu2, us1, us2" + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "type" + "provider", + "teamId", + "region", + "apiKey" ] }, - "CallHookFilter": { + "CreateOpenAICredentialDTO": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of filter - currently only \"oneOf\" is supported", "enum": [ - "oneOf" - ], - "maxLength": 1000 + "openai" + ] }, - "key": { + "apiKey": { "type": "string", - "description": "This is the key to filter on (e.g. \"call.endedReason\")", - "maxLength": 1000 + "description": "This is not returned in the API." }, - "oneOf": { - "description": "This is the array of possible values to match against", - "type": "array", - "items": { - "type": "string", - "maxLength": 1000 - } + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "type", - "key", - "oneOf" + "provider", + "apiKey" ] }, - "CallHookCallEnding": { + "CreateOpenRouterCredentialDTO": { "type": "object", "properties": { - "on": { + "provider": { "type": "string", - "description": "This is the event that triggers this hook", "enum": [ - "call.ending" - ], - "maxLength": 1000 + "openrouter" + ] }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } + "apiKey": { + "type": "string", + "description": "This is not returned in the API." }, - "filters": { - "description": "This is the set of filters that must match for the hook to trigger", - "type": "array", - "items": { - "$ref": "#/components/schemas/CallHookFilter" - } + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "on", - "do" + "provider", + "apiKey" ] }, - "CallHookAssistantSpeechInterrupted": { + "CreatePerplexityAICredentialDTO": { "type": "object", "properties": { - "on": { + "provider": { "type": "string", - "description": "This is the event that triggers this hook", "enum": [ - "assistant.speech.interrupted" - ], - "maxLength": 1000 + "perplexity-ai" + ] }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "on", - "do" + "provider", + "apiKey" ] }, - "CallHookCustomerSpeechInterrupted": { + "CreatePlayHTCredentialDTO": { "type": "object", "properties": { - "on": { + "provider": { "type": "string", - "description": "This is the event that triggers this hook", "enum": [ - "customer.speech.interrupted" - ], - "maxLength": 1000 + "playht" + ] }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "userId": { + "type": "string" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "on", - "do" + "provider", + "apiKey", + "userId" ] }, - "ToolCallHookAction": { + "CreateRimeAICredentialDTO": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of action - must be \"tool\"", "enum": [ - "tool" + "rime-ai" ] }, - "tool": { - "description": "This is the tool to call. To use an existing tool, send `toolId` instead.", - "oneOf": [ - { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - } - ] + "apiKey": { + "type": "string", + "description": "This is not returned in the API." }, - "toolId": { + "name": { "type": "string", - "description": "This is the tool to call. To use a transient tool, send `tool` instead." + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "type" + "provider", + "apiKey" ] }, - "CustomerSpeechTimeoutOptions": { + "CreateRunpodCredentialDTO": { "type": "object", "properties": { - "timeoutSeconds": { - "type": "number", - "description": "This is the timeout in seconds before action is triggered.\nThe clock starts when the assistant finishes speaking and remains active until the user speaks.\n\n@default 7.5", - "minimum": 1, - "maximum": 1000 + "provider": { + "type": "string", + "enum": [ + "runpod" + ] }, - "triggerMaxCount": { - "type": "number", - "description": "This is the maximum number of times the hook will trigger in a call.\n\n@default 3", - "minimum": 1, - "maximum": 10 + "apiKey": { + "type": "string", + "description": "This is not returned in the API." }, - "triggerResetMode": { - "type": "object", - "description": "This is whether the counter for hook trigger resets the user speaks.\n\n@default never" + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "timeoutSeconds" + "provider", + "apiKey" ] }, - "CallHookCustomerSpeechTimeout": { + "CreateS3CredentialDTO": { "type": "object", "properties": { - "on": { + "provider": { "type": "string", - "description": "Must be either \"customer.speech.timeout\" or match the pattern \"customer.speech.timeout[property=value]\"", - "maxLength": 1000 + "enum": [ + "s3" + ], + "description": "Credential provider. Only allowed value is s3" }, - "do": { - "type": "array", - "description": "This is the set of actions to perform when the hook triggers", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SayHookAction", - "title": "SayHookAction" - }, - { - "$ref": "#/components/schemas/ToolCallHookAction", - "title": "ToolCallHookAction" - } - ] - } + "awsAccessKeyId": { + "type": "string", + "description": "AWS access key ID." }, - "options": { - "description": "This is the set of filters that must match for the hook to trigger", - "allOf": [ - { - "$ref": "#/components/schemas/CustomerSpeechTimeoutOptions" - } - ] + "awsSecretAccessKey": { + "type": "string", + "description": "AWS access key secret. This is not returned in the API." + }, + "region": { + "type": "string", + "description": "AWS region in which the S3 bucket is located." + }, + "s3BucketName": { + "type": "string", + "description": "AWS S3 bucket name." + }, + "s3PathPrefix": { + "type": "string", + "description": "The path prefix for the uploaded recording. Ex. \"recordings/\"" + }, + "fallbackIndex": { + "type": "number", + "minimum": 1, + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." }, "name": { "type": "string", - "description": "This is the name of the hook, it can be set by the user to identify the hook.\nIf no name is provided, the hook will be auto generated as UUID.\n\n@default UUID", - "maxLength": 1000 + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "on", - "do" + "provider", + "awsAccessKeyId", + "awsSecretAccessKey", + "region", + "s3BucketName", + "s3PathPrefix" ] }, - "VoicemailDetectionBackoffPlan": { + "SupabaseBucketPlan": { "type": "object", "properties": { - "startAtSeconds": { - "type": "number", - "description": "This is the number of seconds to wait before starting the first retry attempt.", - "minimum": 0, - "default": 5 + "region": { + "type": "string", + "description": "This is the S3 Region. It should look like us-east-1\nIt should be one of the supabase regions defined in the SUPABASE_REGION enum\nCheck https://supabase.com/docs/guides/platform/regions for up to date regions", + "enum": [ + "us-west-1", + "us-east-1", + "us-east-2", + "ca-central-1", + "eu-west-1", + "eu-west-2", + "eu-west-3", + "eu-central-1", + "eu-central-2", + "eu-north-1", + "ap-south-1", + "ap-southeast-1", + "ap-northeast-1", + "ap-northeast-2", + "ap-southeast-2", + "sa-east-1" + ] }, - "frequencySeconds": { - "type": "number", - "description": "This is the interval in seconds between retry attempts.", - "minimum": 2.5, - "default": 5 + "url": { + "type": "string", + "description": "This is the S3 compatible URL for Supabase S3\nThis should look like https://.supabase.co/storage/v1/s3" }, - "maxRetries": { - "type": "number", - "description": "This is the maximum number of retry attempts before giving up.", - "minimum": 1, - "maximum": 10, - "default": 6 - } - } - }, - "GoogleVoicemailDetectionPlan": { - "type": "object", - "properties": { - "beepMaxAwaitSeconds": { - "type": "number", - "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", - "minimum": 0, - "maximum": 30, - "default": 30 + "accessKeyId": { + "type": "string", + "description": "This is the Supabase S3 Access Key ID.\nThe user creates this in the Supabase project Storage settings" }, - "provider": { + "secretAccessKey": { "type": "string", - "description": "This is the provider to use for voicemail detection.", - "enum": [ - "google" - ] + "description": "This is the Supabase S3 Secret Access Key.\nThe user creates this in the Supabase project Storage settings along with the access key id" }, - "backoffPlan": { - "description": "This is the backoff plan for the voicemail detection.", - "allOf": [ - { - "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" - } - ] + "name": { + "type": "string", + "description": "This is the Supabase S3 Bucket Name.\nThe user must create this in Supabase under Storage > Buckets\nA bucket that does not exist will not be checked now, but file uploads will fail" }, - "type": { + "path": { "type": "string", - "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", - "enum": [ - "audio", - "transcript" - ] + "description": "This is the Supabase S3 Bucket Folder Path.\nThe user can create this in Supabase under Storage > Buckets\nA path that does not exist will not be checked now, but file uploads will fail\nA Path is like a folder in the bucket\nEg. If the bucket is called \"my-bucket\" and the path is \"my-folder\", the full path is \"my-bucket/my-folder\"" } }, "required": [ - "provider" + "region", + "url", + "accessKeyId", + "secretAccessKey", + "name" ] }, - "OpenAIVoicemailDetectionPlan": { + "CreateSupabaseCredentialDTO": { "type": "object", "properties": { - "beepMaxAwaitSeconds": { + "provider": { + "type": "string", + "enum": [ + "supabase" + ], + "description": "This is for supabase storage." + }, + "fallbackIndex": { "type": "number", - "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", - "minimum": 0, - "maximum": 30, - "default": 30 + "minimum": 1, + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + }, + "bucketPlan": { + "$ref": "#/components/schemas/SupabaseBucketPlan" }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider" + ] + }, + "CreateSmallestAICredentialDTO": { + "type": "object", + "properties": { "provider": { "type": "string", - "description": "This is the provider to use for voicemail detection.", "enum": [ - "openai" + "smallest-ai" ] }, - "backoffPlan": { - "description": "This is the backoff plan for the voicemail detection.", - "allOf": [ - { - "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" - } + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey" + ] + }, + "CreateTavusCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "tavus" ] }, - "type": { + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey" + ] + }, + "CreateTogetherAICredentialDTO": { + "type": "object", + "properties": { + "provider": { "type": "string", - "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", "enum": [ - "audio", - "transcript" + "together-ai" ] + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ - "provider" + "provider", + "apiKey" ] }, - "TwilioVoicemailDetectionPlan": { + "CreateTwilioCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the provider to use for voicemail detection.", "enum": [ "twilio" ] }, - "voicemailDetectionTypes": { - "type": "array", - "description": "These are the AMD messages from Twilio that are considered as voicemail. Default is ['machine_end_beep', 'machine_end_silence'].\n\n@default {Array} ['machine_end_beep', 'machine_end_silence']", + "authToken": { + "type": "string", + "description": "This is not returned in the API." + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "apiSecret": { + "type": "string", + "description": "This is not returned in the API." + }, + "accountSid": { + "type": "string" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "accountSid" + ] + }, + "CreateVonageCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", "enum": [ - "machine_start", - "human", - "fax", - "unknown", - "machine_end_beep", - "machine_end_silence", - "machine_end_other" - ], - "example": [ - "machine_end_beep", - "machine_end_silence" + "vonage" + ] + }, + "apiSecret": { + "type": "string", + "description": "This is not returned in the API." + }, + "apiKey": { + "type": "string" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiSecret", + "apiKey" + ] + }, + "CreateWebhookCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "webhook" + ] + }, + "authenticationPlan": { + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", + "oneOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + }, + { + "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" + } ], - "items": { - "type": "string", - "enum": [ - "machine_start", - "human", - "fax", - "unknown", - "machine_end_beep", - "machine_end_silence", - "machine_end_other" - ] + "discriminator": { + "propertyName": "type", + "mapping": { + "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" + } } }, - "enabled": { - "type": "boolean", - "description": "This sets whether the assistant should detect voicemail. Defaults to true.\n\n@default true" - }, - "machineDetectionTimeout": { - "type": "number", - "description": "The number of seconds that Twilio should attempt to perform answering machine detection before timing out and returning AnsweredBy as unknown. Default is 30 seconds.\n\nIncreasing this value will provide the engine more time to make a determination. This can be useful when DetectMessageEnd is provided in the MachineDetection parameter and there is an expectation of long answering machine greetings that can exceed 30 seconds.\n\nDecreasing this value will reduce the amount of time the engine has to make a determination. This can be particularly useful when the Enable option is provided in the MachineDetection parameter and you want to limit the time for initial detection.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 30", - "minimum": 3, - "maximum": 59 + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authenticationPlan" + ] + }, + "CreateXAiCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai", + "enum": [ + "xai" + ] }, - "machineDetectionSpeechThreshold": { - "type": "number", - "description": "The number of milliseconds that is used as the measuring stick for the length of the speech activity. Durations lower than this value will be interpreted as a human, longer as a machine. Default is 2400 milliseconds.\n\nIncreasing this value will reduce the chance of a False Machine (detected machine, actually human) for a long human greeting (e.g., a business greeting) but increase the time it takes to detect a machine.\n\nDecreasing this value will reduce the chances of a False Human (detected human, actually machine) for short voicemail greetings. The value of this parameter may need to be reduced by more than 1000ms to detect very short voicemail greetings. A reduction of that significance can result in increased False Machine detections. Adjusting the MachineDetectionSpeechEndThreshold is likely the better approach for short voicemails. Decreasing MachineDetectionSpeechThreshold will also reduce the time it takes to detect a machine.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 2400", - "minimum": 1000, - "maximum": 6000 + "apiKey": { + "type": "string", + "maxLength": 10000, + "description": "This is not returned in the API." }, - "machineDetectionSpeechEndThreshold": { - "type": "number", - "description": "The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Default is 1200 milliseconds.\n\nIncreasing this value will typically be used to better address the short voicemail greeting scenarios. For short voicemails, there is typically 1000-2000ms of audio followed by 1200-2400ms of silence and then additional audio before the beep. Increasing the MachineDetectionSpeechEndThreshold to ~2500ms will treat the 1200-2400ms of silence as a gap in the greeting but not the end of the greeting and will result in a machine detection. The downsides of such a change include:\n- Increasing the delay for human detection by the amount you increase this parameter, e.g., a change of 1200ms to 2500ms increases human detection delay by 1300ms.\n- Cases where a human has two utterances separated by a period of silence (e.g. a \"Hello\", then 2000ms of silence, and another \"Hello\") may be interpreted as a machine.\n\nDecreasing this value will result in faster human detection. The consequence is that it can lead to increased False Human (detected human, actually machine) detections because a silence gap in a voicemail greeting (not necessarily just in short voicemail scenarios) can be incorrectly interpreted as the end of speech.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 1200", - "minimum": 500, - "maximum": 5000 + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey" + ] + }, + "CreateGoogleCalendarOAuth2ClientCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "google.calendar.oauth2-client" + ] }, - "machineDetectionSilenceTimeout": { - "type": "number", - "description": "The number of milliseconds of initial silence after which an unknown AnsweredBy result will be returned. Default is 5000 milliseconds.\n\nIncreasing this value will result in waiting for a longer period of initial silence before returning an 'unknown' AMD result.\n\nDecreasing this value will result in waiting for a shorter period of initial silence before returning an 'unknown' AMD result.\n\nCheck the [Twilio docs](https://www.twilio.com/docs/voice/answering-machine-detection#optional-api-tuning-parameters) for more info.\n\n@default 5000", - "minimum": 2000, - "maximum": 10000 + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ "provider" ] }, - "VapiVoicemailDetectionPlan": { + "CreateGoogleCalendarOAuth2AuthorizationCredentialDTO": { "type": "object", "properties": { - "beepMaxAwaitSeconds": { - "type": "number", - "description": "This is the maximum duration from the start of the call that we will wait for a voicemail beep, before speaking our message\n\n- If we detect a voicemail beep before this, we will speak the message at that point.\n\n- Setting too low a value means that the bot will start speaking its voicemail message too early. If it does so before the actual beep, it will get cut off. You should definitely tune this to your use case.\n\n@default 30\n@min 0\n@max 60", - "minimum": 0, - "maximum": 30, - "default": 30 + "provider": { + "type": "string", + "enum": [ + "google.calendar.oauth2-authorization" + ] }, + "authorizationId": { + "type": "string", + "description": "The authorization ID for the OAuth2 authorization" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authorizationId" + ] + }, + "CreateGoogleSheetsOAuth2AuthorizationCredentialDTO": { + "type": "object", + "properties": { "provider": { "type": "string", - "description": "This is the provider to use for voicemail detection.", "enum": [ - "vapi" + "google.sheets.oauth2-authorization" ] }, - "backoffPlan": { - "description": "This is the backoff plan for the voicemail detection.", - "allOf": [ - { - "$ref": "#/components/schemas/VoicemailDetectionBackoffPlan" - } + "authorizationId": { + "type": "string", + "description": "The authorization ID for the OAuth2 authorization" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authorizationId" + ] + }, + "CreateSlackOAuth2AuthorizationCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "slack.oauth2-authorization" ] }, - "type": { + "authorizationId": { + "type": "string", + "description": "The authorization ID for the OAuth2 authorization" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authorizationId" + ] + }, + "CreateMinimaxCredentialDTO": { + "type": "object", + "properties": { + "provider": { "type": "string", - "description": "This is the detection type to use for voicemail detection.\n- 'audio': Uses native audio models (default)\n- 'transcript': Uses ASR/transcript-based detection\n@default 'audio' (audio detection)", "enum": [ - "audio", - "transcript" + "minimax" + ] + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "groupId": { + "type": "string", + "description": "This is the Minimax Group ID." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey", + "groupId" + ] + }, + "EndpointedSpeechLowConfidenceOptions": { + "type": "object", + "properties": { + "confidenceMin": { + "type": "number", + "description": "This is the minimum confidence threshold.\nTranscripts with confidence below this value will be discarded.\n\n@default confidenceMax - 0.2", + "minimum": 0, + "maximum": 1 + }, + "confidenceMax": { + "type": "number", + "description": "This is the maximum confidence threshold.\nTranscripts with confidence at or above this value will be processed normally.\n\n@default transcriber's confidenceThreshold", + "minimum": 0, + "maximum": 1 + } + } + }, + "CallHookTranscriberEndpointedSpeechLowConfidence": { + "type": "object", + "properties": { + "do": { + "type": "array", + "description": "This is the set of actions to perform when the hook triggers", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SayHookAction", + "title": "SayHookAction" + }, + { + "$ref": "#/components/schemas/ToolCallHookAction", + "title": "ToolCallHookAction" + }, + { + "$ref": "#/components/schemas/MessageAddHookAction", + "title": "MessageAddHookAction" + } + ] + } + }, + "on": { + "type": "string", + "description": "This is the event that triggers this hook", + "maxLength": 1000 + }, + "options": { + "description": "This is the options for the hook including confidence thresholds", + "allOf": [ + { + "$ref": "#/components/schemas/EndpointedSpeechLowConfidenceOptions" + } ] } }, "required": [ - "provider" + "do", + "on" ] }, "SQLInjectionSecurityFilter": { @@ -24296,7 +26937,7 @@ "regex" ] }, - "CreateAssistantDTO": { + "AssistantOverrides": { "type": "object", "properties": { "transcriber": { @@ -24345,6 +26986,10 @@ { "$ref": "#/components/schemas/CartesiaTranscriber", "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" } ] }, @@ -24355,6 +27000,10 @@ "$ref": "#/components/schemas/AnthropicModel", "title": "Anthropic" }, + { + "$ref": "#/components/schemas/AnthropicBedrockModel", + "title": "AnthropicBedrock" + }, { "$ref": "#/components/schemas/AnyscaleModel", "title": "Anyscale" @@ -24452,6 +27101,10 @@ "$ref": "#/components/schemas/PlayHTVoice", "title": "PlayHTVoice" }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, { "$ref": "#/components/schemas/RimeAIVoice", "title": "RimeAIVoice" @@ -24502,8 +27155,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -24541,7 +27200,8 @@ "transfer-update", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ], "example": [ "conversation-update", @@ -24555,9 +27215,10 @@ "tool-calls", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ], - "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema.", + "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started,assistant.started. You can check the shape of the messages in ClientMessage schema.", "items": { "type": "string", "enum": [ @@ -24577,13 +27238,15 @@ "transfer-update", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ] } }, "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -24606,7 +27269,9 @@ "chat.deleted", "session.created", "session.updated", - "session.deleted" + "session.deleted", + "call.deleted", + "call.delete.failed" ], "example": [ "conversation-update", @@ -24618,12 +27283,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -24646,7 +27313,9 @@ "chat.deleted", "session.created", "session.updated", - "session.deleted" + "session.deleted", + "call.deleted", + "call.delete.failed" ] } }, @@ -24661,7 +27330,7 @@ "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", "oneOf": [ { - "type": "enum", + "type": "string", "enum": [ "off", "office" @@ -24677,7 +27346,7 @@ }, "modelOutputInMessagesEnabled": { "type": "boolean", - "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\nDefault `false` while in beta.\n\n@default false", + "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\n@default false", "example": false }, "transportConfigurations": { @@ -24715,6 +27384,10 @@ "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", "title": "AnthropicCredential" }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, { "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", "title": "AnyscaleCredential" @@ -24851,6 +27524,10 @@ "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", "title": "SpeechmaticsCredential" }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, { "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", "title": "SupabaseCredential" @@ -24879,6 +27556,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -24906,6 +27587,22 @@ { "$ref": "#/components/schemas/CreateInworldCredentialDTO", "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" } ], "discriminator": { @@ -24913,6 +27610,7 @@ "mapping": { "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", @@ -24948,11 +27646,13 @@ "twilio": "#/components/schemas/CreateTwilioCredentialDTO", "vonage": "#/components/schemas/CreateVonageCredentialDTO", "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", "xai": "#/components/schemas/CreateXAiCredentialDTO", "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", "hume": "#/components/schemas/CreateHumeCredentialDTO", "mistral": "#/components/schemas/CreateMistralCredentialDTO", "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", "trieve": "#/components/schemas/CreateTrieveCredentialDTO", "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", @@ -24960,7 +27660,10 @@ "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" } } } @@ -24989,50 +27692,153 @@ ] } }, - "name": { - "type": "string", - "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", - "maxLength": 40 - }, - "voicemailMessage": { - "type": "string", - "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", - "maxLength": 1000 - }, - "endCallMessage": { - "type": "string", - "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", - "maxLength": 1000 - }, - "endCallPhrases": { - "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", + "tools:append": { "type": "array", "items": { - "type": "string", - "maxLength": 140, - "minLength": 2 - } - }, - "compliancePlan": { - "$ref": "#/components/schemas/CompliancePlan" - }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the assistant." - }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", - "allOf": [ - { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" - } - ] - }, - "analysisPlan": { - "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" + } + ] + } + }, + "variableValues": { + "type": "object", + "description": "These are values that will be used to replace the template variables in the assistant messages and other text-based fields.\nThis uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html\n\nSo for example, `{{ name }}` will be replaced with the value of `name` in `variableValues`.\n`{{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}` will be replaced with the current date and time in New York.\n Some VAPI reserved defaults:\n - *customer* - the customer object" + }, + "name": { + "type": "string", + "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", + "maxLength": 40 + }, + "voicemailMessage": { + "type": "string", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 + }, + "endCallMessage": { + "type": "string", + "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", + "maxLength": 1000 + }, + "endCallPhrases": { + "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", + "type": "array", + "items": { + "type": "string", + "maxLength": 140, + "minLength": 2 + } + }, + "compliancePlan": { + "$ref": "#/components/schemas/CompliancePlan" + }, + "metadata": { + "type": "object", + "description": "This is for metadata you want to store on the assistant." + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "analysisPlan": { + "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" } ] }, @@ -25061,7 +27867,7 @@ ] }, "monitorPlan": { - "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.", + "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.\n- To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids.", "allOf": [ { "$ref": "#/components/schemas/MonitorPlan" @@ -25088,7 +27894,7 @@ } } }, - "AssistantOverrides": { + "CreateAssistantDTO": { "type": "object", "properties": { "transcriber": { @@ -25137,6 +27943,10 @@ { "$ref": "#/components/schemas/CartesiaTranscriber", "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" } ] }, @@ -25147,6 +27957,10 @@ "$ref": "#/components/schemas/AnthropicModel", "title": "Anthropic" }, + { + "$ref": "#/components/schemas/AnthropicBedrockModel", + "title": "AnthropicBedrock" + }, { "$ref": "#/components/schemas/AnyscaleModel", "title": "Anyscale" @@ -25244,6 +28058,10 @@ "$ref": "#/components/schemas/PlayHTVoice", "title": "PlayHTVoice" }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, { "$ref": "#/components/schemas/RimeAIVoice", "title": "RimeAIVoice" @@ -25294,8 +28112,14 @@ "example": "assistant-speaks-first" }, "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, { "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", "title": "Google" @@ -25333,7 +28157,8 @@ "transfer-update", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ], "example": [ "conversation-update", @@ -25347,9 +28172,10 @@ "tool-calls", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ], - "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema.", + "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started,assistant.started. You can check the shape of the messages in ClientMessage schema.", "items": { "type": "string", "enum": [ @@ -25369,13 +28195,15 @@ "transfer-update", "user-interrupted", "voice-input", - "workflow.node.started" + "workflow.node.started", + "assistant.started" ] } }, "serverMessages": { "type": "array", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -25398,7 +28226,9 @@ "chat.deleted", "session.created", "session.updated", - "session.deleted" + "session.deleted", + "call.deleted", + "call.delete.failed" ], "example": [ "conversation-update", @@ -25410,12 +28240,14 @@ "tool-calls", "transfer-destination-request", "handoff-destination-request", - "user-interrupted" + "user-interrupted", + "assistant.started" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { "type": "string", "enum": [ + "assistant.started", "conversation-update", "end-of-call-report", "function-call", @@ -25438,7 +28270,9 @@ "chat.deleted", "session.created", "session.updated", - "session.deleted" + "session.deleted", + "call.deleted", + "call.delete.failed" ] } }, @@ -25453,7 +28287,7 @@ "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", "oneOf": [ { - "type": "enum", + "type": "string", "enum": [ "off", "office" @@ -25469,7 +28303,7 @@ }, "modelOutputInMessagesEnabled": { "type": "boolean", - "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\nDefault `false` while in beta.\n\n@default false", + "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\n@default false", "example": false }, "transportConfigurations": { @@ -25507,6 +28341,10 @@ "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", "title": "AnthropicCredential" }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, { "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", "title": "AnyscaleCredential" @@ -25643,6 +28481,10 @@ "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", "title": "SpeechmaticsCredential" }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, { "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", "title": "SupabaseCredential" @@ -25671,6 +28513,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -25698,6 +28544,22 @@ { "$ref": "#/components/schemas/CreateInworldCredentialDTO", "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" } ], "discriminator": { @@ -25705,6 +28567,7 @@ "mapping": { "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", @@ -25740,11 +28603,13 @@ "twilio": "#/components/schemas/CreateTwilioCredentialDTO", "vonage": "#/components/schemas/CreateVonageCredentialDTO", "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", "xai": "#/components/schemas/CreateXAiCredentialDTO", "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", "hume": "#/components/schemas/CreateHumeCredentialDTO", "mistral": "#/components/schemas/CreateMistralCredentialDTO", "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", "trieve": "#/components/schemas/CreateTrieveCredentialDTO", "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", @@ -25752,7 +28617,10 @@ "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" } } } @@ -25781,10 +28649,6 @@ ] } }, - "variableValues": { - "type": "object", - "description": "These are values that will be used to replace the template variables in the assistant messages and other text-based fields.\nThis uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html\n\nSo for example, `{{ name }}` will be replaced with the value of `name` in `variableValues`.\n`{{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}` will be replaced with the current date and time in New York.\n Some VAPI reserved defaults:\n - *customer* - the customer object" - }, "name": { "type": "string", "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", @@ -25857,7 +28721,7 @@ ] }, "monitorPlan": { - "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.", + "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.\n- To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids.", "allOf": [ { "$ref": "#/components/schemas/MonitorPlan" @@ -25884,107 +28748,11 @@ } } }, - "SquadMemberDTO": { - "type": "object", - "properties": { - "assistantId": { - "type": "string", - "nullable": true, - "description": "This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead." - }, - "assistant": { - "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "assistantOverrides": { - "description": "This can be used to override the assistant's settings and provide values for it's template variables.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } - ] - }, - "assistantDestinations": { - "description": "These are the others assistants that this assistant can transfer to.\n\nIf the assistant already has transfer call tool, these destinations are just appended to existing ones.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferDestinationAssistant" - } - } - } - }, - "CreateSquadDTO": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the squad." - }, - "members": { - "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", - "type": "array", - "items": { - "$ref": "#/components/schemas/SquadMemberDTO" - } - }, - "membersOverrides": { - "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } - ] - } - }, - "required": [ - "members" - ] - }, - "CreateWorkflowDTO": { + "Assistant": { "type": "object", "properties": { - "nodes": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ConversationNode", - "title": "ConversationNode" - }, - { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" - } - ] - } - }, - "model": { - "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", - "oneOf": [ - { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, - { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, - { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, - { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, "transcriber": { - "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", + "description": "These are the options for the assistant's transcriber.", "oneOf": [ { "$ref": "#/components/schemas/AssemblyAITranscriber", @@ -26029,11 +28797,80 @@ { "$ref": "#/components/schemas/CartesiaTranscriber", "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "model": { + "description": "These are the options for the assistant's LLM.", + "oneOf": [ + { + "$ref": "#/components/schemas/AnthropicModel", + "title": "Anthropic" + }, + { + "$ref": "#/components/schemas/AnthropicBedrockModel", + "title": "AnthropicBedrock" + }, + { + "$ref": "#/components/schemas/AnyscaleModel", + "title": "Anyscale" + }, + { + "$ref": "#/components/schemas/CerebrasModel", + "title": "Cerebras" + }, + { + "$ref": "#/components/schemas/CustomLLMModel", + "title": "CustomLLM" + }, + { + "$ref": "#/components/schemas/DeepInfraModel", + "title": "DeepInfra" + }, + { + "$ref": "#/components/schemas/DeepSeekModel", + "title": "DeepSeek" + }, + { + "$ref": "#/components/schemas/GoogleModel", + "title": "Google" + }, + { + "$ref": "#/components/schemas/GroqModel", + "title": "Groq" + }, + { + "$ref": "#/components/schemas/InflectionAIModel", + "title": "InflectionAI" + }, + { + "$ref": "#/components/schemas/OpenAIModel", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/OpenRouterModel", + "title": "OpenRouter" + }, + { + "$ref": "#/components/schemas/PerplexityAIModel", + "title": "PerplexityAI" + }, + { + "$ref": "#/components/schemas/TogetherAIModel", + "title": "Together" + }, + { + "$ref": "#/components/schemas/XaiModel", + "title": "XAI" } ] }, "voice": { - "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "description": "These are the options for the assistant's voice.", "oneOf": [ { "$ref": "#/components/schemas/AzureVoice", @@ -26075,6 +28912,10 @@ "$ref": "#/components/schemas/PlayHTVoice", "title": "PlayHTVoice" }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, { "$ref": "#/components/schemas/RimeAIVoice", "title": "RimeAIVoice" @@ -26105,25 +28946,202 @@ } ] }, - "observabilityPlan": { - "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", + "firstMessage": { + "type": "string", + "description": "This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", + "example": "Hello! How can I help you today?" + }, + "firstMessageInterruptionsEnabled": { + "type": "boolean", + "default": false + }, + "firstMessageMode": { + "type": "string", + "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points).\n\n@default 'assistant-speaks-first'", + "enum": [ + "assistant-speaks-first", + "assistant-speaks-first-with-model-generated-message", + "assistant-waits-for-user" + ], + "example": "assistant-speaks-first" + }, + "voicemailDetection": { + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", "oneOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" - } - ], - "allOf": [ + "type": "string", + "enum": [ + "off" + ] + }, { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" } ] }, + "clientMessages": { + "type": "array", + "enum": [ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "tool.completed", + "transfer-update", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" + ], + "example": [ + "conversation-update", + "function-call", + "hang", + "model-output", + "speech-update", + "status-update", + "transfer-update", + "transcript", + "tool-calls", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" + ], + "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started,assistant.started. You can check the shape of the messages in ClientMessage schema.", + "items": { + "type": "string", + "enum": [ + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "tool.completed", + "transfer-update", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" + ] + } + }, + "serverMessages": { + "type": "array", + "enum": [ + "assistant.started", + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "language-change-detected", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "transcript[transcriptType=\"final\"]", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + "chat.created", + "chat.deleted", + "session.created", + "session.updated", + "session.deleted", + "call.deleted", + "call.delete.failed" + ], + "example": [ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "speech-update", + "status-update", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "user-interrupted", + "assistant.started" + ], + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", + "items": { + "type": "string", + "enum": [ + "assistant.started", + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "language-change-detected", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "transcript[transcriptType=\"final\"]", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + "chat.created", + "chat.deleted", + "session.created", + "session.updated", + "session.deleted", + "call.deleted", + "call.delete.failed" + ] + } + }, + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.\n\n@default 600 (10 minutes)", + "minimum": 10, + "maximum": 43200, + "example": 600 + }, "backgroundSound": { "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", "oneOf": [ { - "type": "enum", + "type": "string", "enum": [ "off", "office" @@ -26137,39 +29155,50 @@ } ] }, - "hooks": { + "modelOutputInMessagesEnabled": { + "type": "boolean", + "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\n@default false", + "example": false + }, + "transportConfigurations": { "type": "array", - "description": "This is a set of actions that will be performed on certain events.", + "description": "These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" - }, - { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" - }, - { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" - }, - { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" + "$ref": "#/components/schemas/TransportConfigurationTwilio", + "title": "Twilio" } ] } }, + "observabilityPlan": { + "description": "This is the plan for observability of assistant's calls.\n\nCurrently, only Langfuse is supported.", + "oneOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan" + } + ] + }, "credentials": { "type": "array", - "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "description": "These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", "items": { "oneOf": [ { "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", "title": "AnthropicCredential" }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, { "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", "title": "AnyscaleCredential" @@ -26306,6 +29335,10 @@ "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", "title": "SpeechmaticsCredential" }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, { "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", "title": "SupabaseCredential" @@ -26334,6 +29367,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -26361,6 +29398,22 @@ { "$ref": "#/components/schemas/CreateInworldCredentialDTO", "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" } ], "discriminator": { @@ -26368,6 +29421,7 @@ "mapping": { "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", @@ -26403,11 +29457,13 @@ "twilio": "#/components/schemas/CreateTwilioCredentialDTO", "vonage": "#/components/schemas/CreateVonageCredentialDTO", "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", "xai": "#/components/schemas/CreateXAiCredentialDTO", "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", "hume": "#/components/schemas/CreateHumeCredentialDTO", "mistral": "#/components/schemas/CreateMistralCredentialDTO", "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", "trieve": "#/components/schemas/CreateTrieveCredentialDTO", "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", @@ -26415,43 +29471,79 @@ "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" } } } }, + "hooks": { + "type": "array", + "description": "This is a set of actions that will be performed on certain events.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + } + ] + } + }, "name": { "type": "string", - "maxLength": 80 + "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", + "maxLength": 40 }, - "edges": { + "voicemailMessage": { + "type": "string", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 + }, + "endCallMessage": { + "type": "string", + "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", + "maxLength": 1000 + }, + "endCallPhrases": { + "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", "type": "array", "items": { - "$ref": "#/components/schemas/Edge" + "type": "string", + "maxLength": 140, + "minLength": 2 } }, - "globalPrompt": { - "type": "string", - "maxLength": 5000 + "compliancePlan": { + "$ref": "#/components/schemas/CompliancePlan" }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "metadata": { + "type": "object", + "description": "This is for metadata you want to store on the assistant." }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", "allOf": [ { - "$ref": "#/components/schemas/CompliancePlan" + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" } ] }, "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", "allOf": [ { "$ref": "#/components/schemas/AnalysisPlan" @@ -26459,7 +29551,7 @@ ] }, "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", "allOf": [ { "$ref": "#/components/schemas/ArtifactPlan" @@ -26467,7 +29559,7 @@ ] }, "startSpeakingPlan": { - "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "description": "This is the plan for when the assistant should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", "allOf": [ { "$ref": "#/components/schemas/StartSpeakingPlan" @@ -26475,7 +29567,7 @@ ] }, "stopSpeakingPlan": { - "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "description": "This is the plan for when assistant should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", "allOf": [ { "$ref": "#/components/schemas/StopSpeakingPlan" @@ -26483,896 +29575,4492 @@ ] }, "monitorPlan": { - "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.\n- To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids.", "allOf": [ { "$ref": "#/components/schemas/MonitorPlan" } ] }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", - "allOf": [ - { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" - } - ] - }, "credentialIds": { - "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "description": "These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", "type": "array", "items": { "type": "string" } }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server.url\n2. phoneNumber.serverUrl\n3. org.serverUrl", "allOf": [ { - "$ref": "#/components/schemas/KeypadInputPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "keypadInputPlan": { + "$ref": "#/components/schemas/KeypadInputPlan" + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the assistant." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this assistant belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." } }, "required": [ - "nodes", - "name", - "edges" + "id", + "orgId", + "createdAt", + "updatedAt" ] }, - "WorkflowOverrides": { + "PaginationMeta": { "type": "object", "properties": { - "variableValues": { - "type": "object", - "description": "These are values that will be used to replace the template variables in the workflow messages and other text-based fields.\nThis uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html\n\nSo for example, `{{ name }}` will be replaced with the value of `name` in `variableValues`.\n`{{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}` will be replaced with the current date and time in New York.\n Some VAPI reserved defaults:\n - *customer* - the customer object" + "itemsPerPage": { + "type": "number" + }, + "totalItems": { + "type": "number" + }, + "currentPage": { + "type": "number" + }, + "itemsBeyondRetention": { + "type": "boolean" + }, + "createdAtLe": { + "format": "date-time", + "type": "string" + }, + "createdAtGe": { + "format": "date-time", + "type": "string" } - } + }, + "required": [ + "itemsPerPage", + "totalItems", + "currentPage" + ] }, - "TransferPhoneNumberHookAction": { + "AssistantPaginatedResponse": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"transfer\"", - "enum": [ - "transfer" - ] + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Assistant" + } }, - "destination": { - "description": "This is the destination details for the transfer - can be a phone number or SIP URI", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "type" + "results", + "metadata" ] }, - "SayPhoneNumberHookAction": { + "AssistantVersionPaginatedResponse": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"say\"", - "enum": [ - "say" - ] + "results": { + "type": "array" }, - "exact": { - "type": "string", - "description": "This is the message to say", - "maxLength": 4000 + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + }, + "nextPageState": { + "type": "string" } }, "required": [ - "type", - "exact" + "results", + "metadata" ] }, - "PhoneNumberHookCallRinging": { + "UpdateAssistantDTO": { "type": "object", "properties": { - "on": { - "type": "string", - "description": "This is the event to trigger the hook on", - "enum": [ - "call.ringing" - ], - "maxLength": 1000 - }, - "do": { - "type": "array", - "description": "Only the first action will be executed. Additional actions will be ignored.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransferPhoneNumberHookAction", - "title": "TransferPhoneNumberHookAction" - }, - { - "$ref": "#/components/schemas/SayPhoneNumberHookAction", - "title": "SayPhoneNumberHookAction" - } - ] - } - } - }, - "required": [ - "on", - "do" - ] - }, - "PhoneNumberCallEndingHookFilter": { - "type": "object", - "properties": { - "type": { + "transcriber": { + "description": "These are the options for the assistant's transcriber.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "model": { + "description": "These are the options for the assistant's LLM.", + "oneOf": [ + { + "$ref": "#/components/schemas/AnthropicModel", + "title": "Anthropic" + }, + { + "$ref": "#/components/schemas/AnthropicBedrockModel", + "title": "AnthropicBedrock" + }, + { + "$ref": "#/components/schemas/AnyscaleModel", + "title": "Anyscale" + }, + { + "$ref": "#/components/schemas/CerebrasModel", + "title": "Cerebras" + }, + { + "$ref": "#/components/schemas/CustomLLMModel", + "title": "CustomLLM" + }, + { + "$ref": "#/components/schemas/DeepInfraModel", + "title": "DeepInfra" + }, + { + "$ref": "#/components/schemas/DeepSeekModel", + "title": "DeepSeek" + }, + { + "$ref": "#/components/schemas/GoogleModel", + "title": "Google" + }, + { + "$ref": "#/components/schemas/GroqModel", + "title": "Groq" + }, + { + "$ref": "#/components/schemas/InflectionAIModel", + "title": "InflectionAI" + }, + { + "$ref": "#/components/schemas/OpenAIModel", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/OpenRouterModel", + "title": "OpenRouter" + }, + { + "$ref": "#/components/schemas/PerplexityAIModel", + "title": "PerplexityAI" + }, + { + "$ref": "#/components/schemas/TogetherAIModel", + "title": "Together" + }, + { + "$ref": "#/components/schemas/XaiModel", + "title": "XAI" + } + ] + }, + "voice": { + "description": "These are the options for the assistant's voice.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "firstMessage": { "type": "string", - "description": "This is the type of filter - currently only \"oneOf\" is supported", - "enum": [ - "oneOf" - ], - "maxLength": 1000 + "description": "This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", + "example": "Hello! How can I help you today?" }, - "key": { + "firstMessageInterruptionsEnabled": { + "type": "boolean", + "default": false + }, + "firstMessageMode": { "type": "string", - "description": "This is the key to filter on - only \"call.endedReason\" is allowed for phone number call ending hooks", + "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points).\n\n@default 'assistant-speaks-first'", "enum": [ - "call.endedReason" + "assistant-speaks-first", + "assistant-speaks-first-with-model-generated-message", + "assistant-waits-for-user" ], - "maxLength": 1000 + "example": "assistant-speaks-first" }, - "oneOf": { + "voicemailDetection": { + "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nBy default, voicemail detection is disabled.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, + { + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" + } + ] + }, + "clientMessages": { "type": "array", - "description": "This is the array of assistant-request related ended reasons to match against", "enum": [ - "assistant-request-failed", - "assistant-request-returned-error", - "assistant-request-returned-unspeakable-error", - "assistant-request-returned-invalid-assistant", - "assistant-request-returned-no-assistant", - "assistant-request-returned-forwarding-phone-number" + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "tool.completed", + "transfer-update", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" + ], + "example": [ + "conversation-update", + "function-call", + "hang", + "model-output", + "speech-update", + "status-update", + "transfer-update", + "transcript", + "tool-calls", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" ], + "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started,assistant.started. You can check the shape of the messages in ClientMessage schema.", "items": { "type": "string", "enum": [ - "assistant-request-failed", - "assistant-request-returned-error", - "assistant-request-returned-unspeakable-error", - "assistant-request-returned-invalid-assistant", - "assistant-request-returned-no-assistant", - "assistant-request-returned-forwarding-phone-number" + "conversation-update", + "function-call", + "function-call-result", + "hang", + "language-changed", + "metadata", + "model-output", + "speech-update", + "status-update", + "transcript", + "tool-calls", + "tool-calls-result", + "tool.completed", + "transfer-update", + "user-interrupted", + "voice-input", + "workflow.node.started", + "assistant.started" ] } - } - }, - "required": [ - "type", - "key", - "oneOf" - ] - }, - "PhoneNumberHookCallEnding": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "This is the event to trigger the hook on", - "enum": [ - "call.ending" - ], - "maxLength": 1000 }, - "filters": { + "serverMessages": { "type": "array", - "description": "Optional filters to decide when to trigger - restricted to assistant-request related ended reasons", + "enum": [ + "assistant.started", + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "language-change-detected", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "transcript[transcriptType=\"final\"]", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + "chat.created", + "chat.deleted", + "session.created", + "session.updated", + "session.deleted", + "call.deleted", + "call.delete.failed" + ], + "example": [ + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "speech-update", + "status-update", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "user-interrupted", + "assistant.started" + ], + "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted,assistant.started. You can check the shape of the messages in ServerMessage schema.", "items": { - "$ref": "#/components/schemas/PhoneNumberCallEndingHookFilter" + "type": "string", + "enum": [ + "assistant.started", + "conversation-update", + "end-of-call-report", + "function-call", + "hang", + "language-changed", + "language-change-detected", + "model-output", + "phone-call-control", + "speech-update", + "status-update", + "transcript", + "transcript[transcriptType=\"final\"]", + "tool-calls", + "transfer-destination-request", + "handoff-destination-request", + "transfer-update", + "user-interrupted", + "voice-input", + "chat.created", + "chat.deleted", + "session.created", + "session.updated", + "session.deleted", + "call.deleted", + "call.delete.failed" + ] } }, - "do": { - "description": "This is the action to perform when the hook triggers", + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.\n\n@default 600 (10 minutes)", + "minimum": 10, + "maximum": 43200, + "example": 600 + }, + "backgroundSound": { + "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", "oneOf": [ { - "$ref": "#/components/schemas/TransferPhoneNumberHookAction", - "title": "TransferPhoneNumberHookAction" + "type": "string", + "enum": [ + "off", + "office" + ], + "example": "office" }, { - "$ref": "#/components/schemas/SayPhoneNumberHookAction", - "title": "SayPhoneNumberHookAction" + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" } ] - } - }, - "required": [ - "on" - ] - }, - "ImportTwilioPhoneNumberDTO": { - "type": "object", - "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + }, + "modelOutputInMessagesEnabled": { + "type": "boolean", + "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\n@default false", + "example": false + }, + "transportConfigurations": { + "type": "array", + "description": "These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransportConfigurationTwilio", + "title": "Twilio" + } + ] + } + }, + "observabilityPlan": { + "description": "This is the plan for observability of assistant's calls.\n\nCurrently, only Langfuse is supported.", "oneOf": [ { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/LangfuseObservabilityPlan" } ] }, - "hooks": { + "credentials": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" - } - ] - } - }, - "smsEnabled": { - "type": "boolean", - "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", - "default": true - }, - "twilioPhoneNumber": { - "type": "string", - "description": "These are the digits of the phone number you own on your Twilio.", - "deprecated": true - }, - "twilioAccountSid": { - "type": "string", - "description": "This is your Twilio Account SID that will be used to handle this phone number." - }, - "twilioAuthToken": { - "type": "string", - "description": "This is the Twilio Auth Token that will be used to handle this phone number." - }, - "twilioApiKey": { - "type": "string", - "description": "This is the Twilio API Key that will be used to handle this phone number. If AuthToken is provided, this will be ignored." - }, - "twilioApiSecret": { - "type": "string", - "description": "This is the Twilio API Secret that will be used to handle this phone number. If AuthToken is provided, this will be ignored." - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, + { + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" + }, + { + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" + }, + { + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" + }, + { + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" + }, + { + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" + }, + { + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" + }, + { + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", + "title": "DeepSeekCredential" + }, + { + "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", + "title": "ElevenLabsCredential" + }, + { + "$ref": "#/components/schemas/CreateGcpCredentialDTO", + "title": "GcpCredential" + }, + { + "$ref": "#/components/schemas/CreateGladiaCredentialDTO", + "title": "GladiaCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "title": "GhlCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCredentialDTO", + "title": "GoogleCredential" + }, + { + "$ref": "#/components/schemas/CreateGroqCredentialDTO", + "title": "GroqCredential" + }, + { + "$ref": "#/components/schemas/CreateHumeCredentialDTO", + "title": "HumeCredential" + }, + { + "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", + "title": "InflectionAICredential" + }, + { + "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", + "title": "LangfuseCredential" + }, + { + "$ref": "#/components/schemas/CreateLmntCredentialDTO", + "title": "LmntCredential" + }, + { + "$ref": "#/components/schemas/CreateMakeCredentialDTO", + "title": "MakeCredential" + }, + { + "$ref": "#/components/schemas/CreateMistralCredentialDTO", + "title": "MistralCredential" + }, + { + "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", + "title": "NeuphonicCredential" + }, + { + "$ref": "#/components/schemas/CreateOpenAICredentialDTO", + "title": "OpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", + "title": "OpenRouterCredential" + }, + { + "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", + "title": "PerplexityAICredential" + }, + { + "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", + "title": "PlayHTCredential" + }, + { + "$ref": "#/components/schemas/CreateRimeAICredentialDTO", + "title": "RimeAICredential" + }, + { + "$ref": "#/components/schemas/CreateRunpodCredentialDTO", + "title": "RunpodCredential" + }, + { + "$ref": "#/components/schemas/CreateS3CredentialDTO", + "title": "S3Credential" + }, + { + "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", + "title": "SmallestAICredential" + }, + { + "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "title": "SpeechmaticsCredential" + }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, + { + "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", + "title": "SupabaseCredential" + }, + { + "$ref": "#/components/schemas/CreateTavusCredentialDTO", + "title": "TavusCredential" + }, + { + "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", + "title": "TogetherAICredential" + }, + { + "$ref": "#/components/schemas/CreateTrieveCredentialDTO", + "title": "TrieveCredential" + }, + { + "$ref": "#/components/schemas/CreateTwilioCredentialDTO", + "title": "TwilioCredential" + }, + { + "$ref": "#/components/schemas/CreateVonageCredentialDTO", + "title": "VonageCredential" + }, + { + "$ref": "#/components/schemas/CreateWebhookCredentialDTO", + "title": "WebhookCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, + { + "$ref": "#/components/schemas/CreateXAiCredentialDTO", + "title": "XAiCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "title": "GoogleCalendarOAuth2ClientCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "title": "GoogleCalendarOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "title": "GoogleSheetsOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "title": "SlackOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "title": "GoHighLevelMCPCredential" + }, + { + "$ref": "#/components/schemas/CreateInworldCredentialDTO", + "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", + "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", + "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", + "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "azure": "#/components/schemas/CreateAzureCredentialDTO", + "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", + "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", + "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", + "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", + "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", + "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", + "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", + "gcp": "#/components/schemas/CreateGcpCredentialDTO", + "gladia": "#/components/schemas/CreateGladiaCredentialDTO", + "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "google": "#/components/schemas/CreateGoogleCredentialDTO", + "groq": "#/components/schemas/CreateGroqCredentialDTO", + "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", + "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", + "lmnt": "#/components/schemas/CreateLmntCredentialDTO", + "make": "#/components/schemas/CreateMakeCredentialDTO", + "openai": "#/components/schemas/CreateOpenAICredentialDTO", + "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", + "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", + "playht": "#/components/schemas/CreatePlayHTCredentialDTO", + "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", + "runpod": "#/components/schemas/CreateRunpodCredentialDTO", + "s3": "#/components/schemas/CreateS3CredentialDTO", + "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", + "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", + "tavus": "#/components/schemas/CreateTavusCredentialDTO", + "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", + "twilio": "#/components/schemas/CreateTwilioCredentialDTO", + "vonage": "#/components/schemas/CreateVonageCredentialDTO", + "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", + "xai": "#/components/schemas/CreateXAiCredentialDTO", + "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", + "hume": "#/components/schemas/CreateHumeCredentialDTO", + "mistral": "#/components/schemas/CreateMistralCredentialDTO", + "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", + "trieve": "#/components/schemas/CreateTrieveCredentialDTO", + "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "inworld": "#/components/schemas/CreateInworldCredentialDTO", + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" + } + } + } }, - "assistantId": { + "hooks": { + "type": "array", + "description": "This is a set of actions that will be performed on certain events.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + } + ] + } + }, + "name": { "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", + "maxLength": 40 }, - "workflowId": { + "voicemailMessage": { "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 }, - "squadId": { + "endCallMessage": { "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", + "maxLength": 1000 + }, + "endCallPhrases": { + "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", + "type": "array", + "items": { + "type": "string", + "maxLength": 140, + "minLength": 2 + } + }, + "compliancePlan": { + "$ref": "#/components/schemas/CompliancePlan" + }, + "metadata": { + "type": "object", + "description": "This is for metadata you want to store on the assistant." + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "analysisPlan": { + "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } + ] + }, + "artifactPlan": { + "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] + }, + "startSpeakingPlan": { + "description": "This is the plan for when the assistant should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/StartSpeakingPlan" + } + ] + }, + "stopSpeakingPlan": { + "description": "This is the plan for when assistant should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "allOf": [ + { + "$ref": "#/components/schemas/StopSpeakingPlan" + } + ] + }, + "monitorPlan": { + "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.\n- To attach monitors to the assistant, set `monitorPlan.monitorIds` to the set of monitor ids.", + "allOf": [ + { + "$ref": "#/components/schemas/MonitorPlan" + } + ] + }, + "credentialIds": { + "description": "These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "type": "array", + "items": { + "type": "string" + } }, "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server.url\n2. phoneNumber.serverUrl\n3. org.serverUrl", "allOf": [ { "$ref": "#/components/schemas/Server" } ] + }, + "keypadInputPlan": { + "$ref": "#/components/schemas/KeypadInputPlan" } - }, - "required": [ - "twilioPhoneNumber", - "twilioAccountSid" - ] + } }, - "CreateCustomerDTO": { + "Squad": { "type": "object", "properties": { - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true - }, - "extension": { + "name": { "type": "string", - "description": "This is the extension that will be dialed after the call is answered.", - "maxLength": 10, - "example": null + "description": "This is the name of the squad." }, - "assistantOverrides": { - "description": "These are the overrides for the assistant's settings and template variables specific to this customer.\nThis allows customization of the assistant's behavior for individual customers in batch calls.", + "members": { + "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SquadMemberDTO" + } + }, + "membersOverrides": { + "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", "allOf": [ { "$ref": "#/components/schemas/AssistantOverrides" } ] }, - "number": { - "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 - }, - "sipUri": { + "id": { "type": "string", - "description": "This is the SIP URI of the customer." + "description": "This is the unique identifier for the squad." }, - "name": { + "orgId": { "type": "string", - "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", - "maxLength": 40 + "description": "This is the unique identifier for the org that this squad belongs to." }, - "email": { + "createdAt": { + "format": "date-time", "type": "string", - "description": "This is the email of the customer.", - "maxLength": 40 + "description": "This is the ISO 8601 date-time string of when the squad was created." }, - "externalId": { + "updatedAt": { + "format": "date-time", "type": "string", - "description": "This is the external ID of the customer.", - "maxLength": 40 + "description": "This is the ISO 8601 date-time string of when the squad was last updated." } - } + }, + "required": [ + "members", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "SchedulePlan": { + "UpdateSquadDTO": { "type": "object", "properties": { - "earliestAt": { - "format": "date-time", + "name": { "type": "string", - "description": "This is the ISO 8601 date-time string of the earliest time the call can be scheduled." + "description": "This is the name of the squad." }, - "latestAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of the latest time the call can be scheduled." + "members": { + "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SquadMemberDTO" + } + }, + "membersOverrides": { + "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] } }, "required": [ - "earliestAt" + "members" ] }, - "Call": { + "Workflow": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "This is the type of call.", - "enum": [ - "inboundPhoneCall", - "outboundPhoneCall", - "webCall", - "vapi.websocketCall" - ] - }, - "costs": { + "nodes": { "type": "array", - "description": "These are the costs of individual components of the call in USD.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TransportCost", - "title": "TransportCost" - }, - { - "$ref": "#/components/schemas/TranscriberCost", - "title": "TranscriberCost" - }, - { - "$ref": "#/components/schemas/ModelCost", - "title": "ModelCost" - }, - { - "$ref": "#/components/schemas/VoiceCost", - "title": "VoiceCost" - }, - { - "$ref": "#/components/schemas/VapiCost", - "title": "VapiCost" - }, - { - "$ref": "#/components/schemas/VoicemailDetectionCost", - "title": "VoicemailDetectionCost" - }, - { - "$ref": "#/components/schemas/AnalysisCost", - "title": "AnalysisCost" + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" }, { - "$ref": "#/components/schemas/KnowledgeBaseCost", - "title": "KnowledgeBaseCost" + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" } ] } }, - "messages": { + "model": { + "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] + }, + "transcriber": { + "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "voice": { + "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "observabilityPlan": { + "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", + "oneOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan" + } + ] + }, + "backgroundSound": { + "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } + ] + }, + "hooks": { "type": "array", + "description": "This is a set of actions that will be performed on certain events.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" }, { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" }, { - "$ref": "#/components/schemas/BotMessage", - "title": "BotMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" }, { - "$ref": "#/components/schemas/ToolCallMessage", - "title": "ToolCallMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" }, { - "$ref": "#/components/schemas/ToolCallResultMessage", - "title": "ToolCallResultMessage" + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" } ] } }, - "phoneCallProvider": { - "type": "string", - "description": "This is the provider of the call.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "deprecated": true, - "enum": [ - "twilio", - "vonage", - "vapi", - "telnyx" + "credentials": { + "type": "array", + "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" + }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, + { + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" + }, + { + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" + }, + { + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" + }, + { + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" + }, + { + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" + }, + { + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" + }, + { + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", + "title": "DeepSeekCredential" + }, + { + "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", + "title": "ElevenLabsCredential" + }, + { + "$ref": "#/components/schemas/CreateGcpCredentialDTO", + "title": "GcpCredential" + }, + { + "$ref": "#/components/schemas/CreateGladiaCredentialDTO", + "title": "GladiaCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "title": "GhlCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCredentialDTO", + "title": "GoogleCredential" + }, + { + "$ref": "#/components/schemas/CreateGroqCredentialDTO", + "title": "GroqCredential" + }, + { + "$ref": "#/components/schemas/CreateHumeCredentialDTO", + "title": "HumeCredential" + }, + { + "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", + "title": "InflectionAICredential" + }, + { + "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", + "title": "LangfuseCredential" + }, + { + "$ref": "#/components/schemas/CreateLmntCredentialDTO", + "title": "LmntCredential" + }, + { + "$ref": "#/components/schemas/CreateMakeCredentialDTO", + "title": "MakeCredential" + }, + { + "$ref": "#/components/schemas/CreateMistralCredentialDTO", + "title": "MistralCredential" + }, + { + "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", + "title": "NeuphonicCredential" + }, + { + "$ref": "#/components/schemas/CreateOpenAICredentialDTO", + "title": "OpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", + "title": "OpenRouterCredential" + }, + { + "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", + "title": "PerplexityAICredential" + }, + { + "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", + "title": "PlayHTCredential" + }, + { + "$ref": "#/components/schemas/CreateRimeAICredentialDTO", + "title": "RimeAICredential" + }, + { + "$ref": "#/components/schemas/CreateRunpodCredentialDTO", + "title": "RunpodCredential" + }, + { + "$ref": "#/components/schemas/CreateS3CredentialDTO", + "title": "S3Credential" + }, + { + "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", + "title": "SmallestAICredential" + }, + { + "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "title": "SpeechmaticsCredential" + }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, + { + "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", + "title": "SupabaseCredential" + }, + { + "$ref": "#/components/schemas/CreateTavusCredentialDTO", + "title": "TavusCredential" + }, + { + "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", + "title": "TogetherAICredential" + }, + { + "$ref": "#/components/schemas/CreateTrieveCredentialDTO", + "title": "TrieveCredential" + }, + { + "$ref": "#/components/schemas/CreateTwilioCredentialDTO", + "title": "TwilioCredential" + }, + { + "$ref": "#/components/schemas/CreateVonageCredentialDTO", + "title": "VonageCredential" + }, + { + "$ref": "#/components/schemas/CreateWebhookCredentialDTO", + "title": "WebhookCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, + { + "$ref": "#/components/schemas/CreateXAiCredentialDTO", + "title": "XAiCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "title": "GoogleCalendarOAuth2ClientCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "title": "GoogleCalendarOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "title": "GoogleSheetsOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "title": "SlackOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "title": "GoHighLevelMCPCredential" + }, + { + "$ref": "#/components/schemas/CreateInworldCredentialDTO", + "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", + "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", + "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", + "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "azure": "#/components/schemas/CreateAzureCredentialDTO", + "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", + "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", + "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", + "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", + "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", + "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", + "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", + "gcp": "#/components/schemas/CreateGcpCredentialDTO", + "gladia": "#/components/schemas/CreateGladiaCredentialDTO", + "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "google": "#/components/schemas/CreateGoogleCredentialDTO", + "groq": "#/components/schemas/CreateGroqCredentialDTO", + "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", + "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", + "lmnt": "#/components/schemas/CreateLmntCredentialDTO", + "make": "#/components/schemas/CreateMakeCredentialDTO", + "openai": "#/components/schemas/CreateOpenAICredentialDTO", + "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", + "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", + "playht": "#/components/schemas/CreatePlayHTCredentialDTO", + "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", + "runpod": "#/components/schemas/CreateRunpodCredentialDTO", + "s3": "#/components/schemas/CreateS3CredentialDTO", + "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", + "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", + "tavus": "#/components/schemas/CreateTavusCredentialDTO", + "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", + "twilio": "#/components/schemas/CreateTwilioCredentialDTO", + "vonage": "#/components/schemas/CreateVonageCredentialDTO", + "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", + "xai": "#/components/schemas/CreateXAiCredentialDTO", + "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", + "hume": "#/components/schemas/CreateHumeCredentialDTO", + "mistral": "#/components/schemas/CreateMistralCredentialDTO", + "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", + "trieve": "#/components/schemas/CreateTrieveCredentialDTO", + "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "inworld": "#/components/schemas/CreateInworldCredentialDTO", + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" + } + } + } + }, + "voicemailDetection": { + "description": "This is the voicemail detection plan for the workflow.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, + { + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" + } ] }, - "phoneCallTransport": { - "type": "string", - "description": "This is the transport of the phone call.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "enum": [ - "sip", - "pstn" - ] + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum duration of the call in seconds.\n\nAfter this duration, the call will automatically end.\n\nDefault is 1800 (30 minutes), max is 43200 (12 hours), and min is 10 seconds.", + "minimum": 10, + "maximum": 43200, + "example": 600 }, - "status": { + "id": { + "type": "string" + }, + "orgId": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + }, + "name": { "type": "string", - "description": "This is the status of the call.", - "enum": [ - "scheduled", - "queued", - "ringing", - "in-progress", - "forwarding", - "ended" + "maxLength": 80 + }, + "edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } + }, + "globalPrompt": { + "type": "string", + "maxLength": 5000 + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] }, - "endedReason": { + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "allOf": [ + { + "$ref": "#/components/schemas/CompliancePlan" + } + ] + }, + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } + ] + }, + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] + }, + "startSpeakingPlan": { + "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/StartSpeakingPlan" + } + ] + }, + "stopSpeakingPlan": { + "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "allOf": [ + { + "$ref": "#/components/schemas/StopSpeakingPlan" + } + ] + }, + "monitorPlan": { + "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/MonitorPlan" + } + ] + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "credentialIds": { + "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "type": "array", + "items": { + "type": "string" + } + }, + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", + "allOf": [ + { + "$ref": "#/components/schemas/KeypadInputPlan" + } + ] + }, + "voicemailMessage": { "type": "string", - "description": "This is the explanation for how the call ended.", - "enum": [ - "call-start-error-neither-assistant-nor-server-set", - "assistant-request-failed", - "assistant-request-returned-error", - "assistant-request-returned-unspeakable-error", - "assistant-request-returned-invalid-assistant", - "assistant-request-returned-no-assistant", - "assistant-request-returned-forwarding-phone-number", - "scheduled-call-deleted", - "call.start.error-vapifault-get-org", - "call.start.error-vapifault-get-subscription", - "call.start.error-get-assistant", - "call.start.error-get-phone-number", - "call.start.error-get-customer", - "call.start.error-get-resources-validation", - "call.start.error-vapi-number-international", - "call.start.error-vapi-number-outbound-daily-limit", - "call.start.error-get-transport", - "call.start.error-subscription-wallet-does-not-exist", - "call.start.error-subscription-frozen", - "call.start.error-subscription-insufficient-credits", - "call.start.error-subscription-upgrade-failed", - "call.start.error-subscription-concurrency-limit-reached", - "assistant-not-valid", - "database-error", - "assistant-not-found", - "pipeline-error-openai-voice-failed", - "pipeline-error-cartesia-voice-failed", - "pipeline-error-deepgram-voice-failed", - "pipeline-error-eleven-labs-voice-failed", - "pipeline-error-playht-voice-failed", - "pipeline-error-lmnt-voice-failed", - "pipeline-error-azure-voice-failed", - "pipeline-error-rime-ai-voice-failed", - "pipeline-error-smallest-ai-voice-failed", - "pipeline-error-neuphonic-voice-failed", - "pipeline-error-hume-voice-failed", - "pipeline-error-sesame-voice-failed", - "pipeline-error-inworld-voice-failed", - "pipeline-error-minimax-voice-failed", - "pipeline-error-tavus-video-failed", - "call.in-progress.error-vapifault-openai-voice-failed", - "call.in-progress.error-vapifault-cartesia-voice-failed", - "call.in-progress.error-vapifault-deepgram-voice-failed", - "call.in-progress.error-vapifault-eleven-labs-voice-failed", - "call.in-progress.error-vapifault-playht-voice-failed", - "call.in-progress.error-vapifault-lmnt-voice-failed", - "call.in-progress.error-vapifault-azure-voice-failed", - "call.in-progress.error-vapifault-rime-ai-voice-failed", - "call.in-progress.error-vapifault-smallest-ai-voice-failed", - "call.in-progress.error-vapifault-neuphonic-voice-failed", - "call.in-progress.error-vapifault-hume-voice-failed", - "call.in-progress.error-vapifault-sesame-voice-failed", - "call.in-progress.error-vapifault-inworld-voice-failed", - "call.in-progress.error-vapifault-minimax-voice-failed", - "call.in-progress.error-vapifault-tavus-video-failed", - "pipeline-error-vapi-llm-failed", - "pipeline-error-vapi-400-bad-request-validation-failed", - "pipeline-error-vapi-401-unauthorized", - "pipeline-error-vapi-403-model-access-denied", - "pipeline-error-vapi-429-exceeded-quota", - "pipeline-error-vapi-500-server-error", - "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", - "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-vapi-401-unauthorized", - "call.in-progress.error-vapifault-vapi-403-model-access-denied", - "call.in-progress.error-vapifault-vapi-429-exceeded-quota", - "call.in-progress.error-providerfault-vapi-500-server-error", - "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", - "pipeline-error-deepgram-transcriber-failed", - "call.in-progress.error-vapifault-deepgram-transcriber-failed", - "pipeline-error-gladia-transcriber-failed", - "call.in-progress.error-vapifault-gladia-transcriber-failed", - "pipeline-error-speechmatics-transcriber-failed", - "call.in-progress.error-vapifault-speechmatics-transcriber-failed", - "pipeline-error-assembly-ai-transcriber-failed", - "pipeline-error-assembly-ai-returning-400-insufficent-funds", - "pipeline-error-assembly-ai-returning-400-paid-only-feature", - "pipeline-error-assembly-ai-returning-401-invalid-credentials", - "pipeline-error-assembly-ai-returning-500-invalid-schema", - "pipeline-error-assembly-ai-returning-500-word-boost-parsing-failed", - "call.in-progress.error-vapifault-assembly-ai-transcriber-failed", - "call.in-progress.error-vapifault-assembly-ai-returning-400-insufficent-funds", - "call.in-progress.error-vapifault-assembly-ai-returning-400-paid-only-feature", - "call.in-progress.error-vapifault-assembly-ai-returning-401-invalid-credentials", - "call.in-progress.error-vapifault-assembly-ai-returning-500-invalid-schema", - "call.in-progress.error-vapifault-assembly-ai-returning-500-word-boost-parsing-failed", - "pipeline-error-talkscriber-transcriber-failed", - "call.in-progress.error-vapifault-talkscriber-transcriber-failed", - "pipeline-error-azure-speech-transcriber-failed", - "call.in-progress.error-vapifault-azure-speech-transcriber-failed", - "call.in-progress.error-pipeline-no-available-llm-model", - "worker-shutdown", - "vonage-disconnected", - "vonage-failed-to-connect-call", - "vonage-completed", - "phone-call-provider-bypass-enabled-but-no-call-received", - "call.in-progress.error-providerfault-transport-never-connected", - "call.in-progress.error-vapifault-worker-not-available", - "call.in-progress.error-vapifault-transport-never-connected", - "call.in-progress.error-vapifault-transport-connected-but-call-not-active", - "call.in-progress.error-vapifault-call-started-but-connection-to-transport-missing", - "call.in-progress.error-vapifault-worker-died", - "call.in-progress.twilio-completed-call", - "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", - "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", - "pipeline-error-openai-400-bad-request-validation-failed", - "pipeline-error-openai-401-unauthorized", - "pipeline-error-openai-401-incorrect-api-key", - "pipeline-error-openai-401-account-not-in-organization", - "pipeline-error-openai-403-model-access-denied", - "pipeline-error-openai-429-exceeded-quota", - "pipeline-error-openai-429-rate-limit-reached", - "pipeline-error-openai-500-server-error", - "pipeline-error-openai-503-server-overloaded-error", - "pipeline-error-openai-llm-failed", - "call.in-progress.error-vapifault-openai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-openai-401-unauthorized", - "call.in-progress.error-vapifault-openai-401-incorrect-api-key", - "call.in-progress.error-vapifault-openai-401-account-not-in-organization", - "call.in-progress.error-vapifault-openai-403-model-access-denied", - "call.in-progress.error-vapifault-openai-429-exceeded-quota", - "call.in-progress.error-vapifault-openai-429-rate-limit-reached", - "call.in-progress.error-providerfault-openai-500-server-error", - "call.in-progress.error-providerfault-openai-503-server-overloaded-error", - "pipeline-error-azure-openai-400-bad-request-validation-failed", - "pipeline-error-azure-openai-401-unauthorized", - "pipeline-error-azure-openai-403-model-access-denied", - "pipeline-error-azure-openai-429-exceeded-quota", - "pipeline-error-azure-openai-500-server-error", - "pipeline-error-azure-openai-503-server-overloaded-error", - "pipeline-error-azure-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-azure-openai-401-unauthorized", - "call.in-progress.error-vapifault-azure-openai-403-model-access-denied", - "call.in-progress.error-vapifault-azure-openai-429-exceeded-quota", - "call.in-progress.error-providerfault-azure-openai-500-server-error", - "call.in-progress.error-providerfault-azure-openai-503-server-overloaded-error", - "pipeline-error-google-400-bad-request-validation-failed", - "pipeline-error-google-401-unauthorized", - "pipeline-error-google-403-model-access-denied", - "pipeline-error-google-429-exceeded-quota", - "pipeline-error-google-500-server-error", - "pipeline-error-google-503-server-overloaded-error", - "pipeline-error-google-llm-failed", - "call.in-progress.error-vapifault-google-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-google-401-unauthorized", - "call.in-progress.error-vapifault-google-403-model-access-denied", - "call.in-progress.error-vapifault-google-429-exceeded-quota", - "call.in-progress.error-providerfault-google-500-server-error", - "call.in-progress.error-providerfault-google-503-server-overloaded-error", - "pipeline-error-xai-400-bad-request-validation-failed", - "pipeline-error-xai-401-unauthorized", - "pipeline-error-xai-403-model-access-denied", - "pipeline-error-xai-429-exceeded-quota", - "pipeline-error-xai-500-server-error", - "pipeline-error-xai-503-server-overloaded-error", - "pipeline-error-xai-llm-failed", - "call.in-progress.error-vapifault-xai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-xai-401-unauthorized", - "call.in-progress.error-vapifault-xai-403-model-access-denied", - "call.in-progress.error-vapifault-xai-429-exceeded-quota", - "call.in-progress.error-providerfault-xai-500-server-error", - "call.in-progress.error-providerfault-xai-503-server-overloaded-error", - "pipeline-error-mistral-400-bad-request-validation-failed", - "pipeline-error-mistral-401-unauthorized", - "pipeline-error-mistral-403-model-access-denied", - "pipeline-error-mistral-429-exceeded-quota", - "pipeline-error-mistral-500-server-error", - "pipeline-error-mistral-503-server-overloaded-error", - "pipeline-error-mistral-llm-failed", - "call.in-progress.error-vapifault-mistral-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-mistral-401-unauthorized", - "call.in-progress.error-vapifault-mistral-403-model-access-denied", - "call.in-progress.error-vapifault-mistral-429-exceeded-quota", - "call.in-progress.error-providerfault-mistral-500-server-error", - "call.in-progress.error-providerfault-mistral-503-server-overloaded-error", - "pipeline-error-inflection-ai-400-bad-request-validation-failed", - "pipeline-error-inflection-ai-401-unauthorized", - "pipeline-error-inflection-ai-403-model-access-denied", - "pipeline-error-inflection-ai-429-exceeded-quota", - "pipeline-error-inflection-ai-500-server-error", - "pipeline-error-inflection-ai-503-server-overloaded-error", - "pipeline-error-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-inflection-ai-401-unauthorized", - "call.in-progress.error-vapifault-inflection-ai-403-model-access-denied", - "call.in-progress.error-vapifault-inflection-ai-429-exceeded-quota", - "call.in-progress.error-providerfault-inflection-ai-500-server-error", - "call.in-progress.error-providerfault-inflection-ai-503-server-overloaded-error", - "pipeline-error-deep-seek-400-bad-request-validation-failed", - "pipeline-error-deep-seek-401-unauthorized", - "pipeline-error-deep-seek-403-model-access-denied", - "pipeline-error-deep-seek-429-exceeded-quota", - "pipeline-error-deep-seek-500-server-error", - "pipeline-error-deep-seek-503-server-overloaded-error", - "pipeline-error-deep-seek-llm-failed", - "call.in-progress.error-vapifault-deep-seek-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-deep-seek-401-unauthorized", - "call.in-progress.error-vapifault-deep-seek-403-model-access-denied", - "call.in-progress.error-vapifault-deep-seek-429-exceeded-quota", - "call.in-progress.error-providerfault-deep-seek-500-server-error", - "call.in-progress.error-providerfault-deep-seek-503-server-overloaded-error", - "pipeline-error-groq-400-bad-request-validation-failed", - "pipeline-error-groq-401-unauthorized", - "pipeline-error-groq-403-model-access-denied", - "pipeline-error-groq-429-exceeded-quota", - "pipeline-error-groq-500-server-error", - "pipeline-error-groq-503-server-overloaded-error", - "pipeline-error-groq-llm-failed", - "call.in-progress.error-vapifault-groq-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-groq-401-unauthorized", - "call.in-progress.error-vapifault-groq-403-model-access-denied", - "call.in-progress.error-vapifault-groq-429-exceeded-quota", - "call.in-progress.error-providerfault-groq-500-server-error", - "call.in-progress.error-providerfault-groq-503-server-overloaded-error", - "pipeline-error-cerebras-400-bad-request-validation-failed", - "pipeline-error-cerebras-401-unauthorized", - "pipeline-error-cerebras-403-model-access-denied", - "pipeline-error-cerebras-429-exceeded-quota", - "pipeline-error-cerebras-500-server-error", - "pipeline-error-cerebras-503-server-overloaded-error", - "pipeline-error-cerebras-llm-failed", - "call.in-progress.error-vapifault-cerebras-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-cerebras-401-unauthorized", - "call.in-progress.error-vapifault-cerebras-403-model-access-denied", - "call.in-progress.error-vapifault-cerebras-429-exceeded-quota", - "call.in-progress.error-providerfault-cerebras-500-server-error", - "call.in-progress.error-providerfault-cerebras-503-server-overloaded-error", - "pipeline-error-anthropic-400-bad-request-validation-failed", - "pipeline-error-anthropic-401-unauthorized", - "pipeline-error-anthropic-403-model-access-denied", - "pipeline-error-anthropic-429-exceeded-quota", - "pipeline-error-anthropic-500-server-error", - "pipeline-error-anthropic-503-server-overloaded-error", - "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-anthropic-401-unauthorized", - "call.in-progress.error-vapifault-anthropic-403-model-access-denied", - "call.in-progress.error-vapifault-anthropic-429-exceeded-quota", - "call.in-progress.error-providerfault-anthropic-500-server-error", - "call.in-progress.error-providerfault-anthropic-503-server-overloaded-error", - "pipeline-error-anthropic-bedrock-400-bad-request-validation-failed", - "pipeline-error-anthropic-bedrock-401-unauthorized", - "pipeline-error-anthropic-bedrock-403-model-access-denied", - "pipeline-error-anthropic-bedrock-429-exceeded-quota", - "pipeline-error-anthropic-bedrock-500-server-error", - "pipeline-error-anthropic-bedrock-503-server-overloaded-error", - "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", - "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", - "call.in-progress.error-vapifault-anthropic-bedrock-429-exceeded-quota", - "call.in-progress.error-providerfault-anthropic-bedrock-500-server-error", - "call.in-progress.error-providerfault-anthropic-bedrock-503-server-overloaded-error", - "pipeline-error-anthropic-vertex-400-bad-request-validation-failed", - "pipeline-error-anthropic-vertex-401-unauthorized", - "pipeline-error-anthropic-vertex-403-model-access-denied", - "pipeline-error-anthropic-vertex-429-exceeded-quota", - "pipeline-error-anthropic-vertex-500-server-error", - "pipeline-error-anthropic-vertex-503-server-overloaded-error", - "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", - "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", - "call.in-progress.error-vapifault-anthropic-vertex-429-exceeded-quota", - "call.in-progress.error-providerfault-anthropic-vertex-500-server-error", - "call.in-progress.error-providerfault-anthropic-vertex-503-server-overloaded-error", - "pipeline-error-together-ai-400-bad-request-validation-failed", - "pipeline-error-together-ai-401-unauthorized", - "pipeline-error-together-ai-403-model-access-denied", - "pipeline-error-together-ai-429-exceeded-quota", - "pipeline-error-together-ai-500-server-error", - "pipeline-error-together-ai-503-server-overloaded-error", - "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-together-ai-401-unauthorized", - "call.in-progress.error-vapifault-together-ai-403-model-access-denied", - "call.in-progress.error-vapifault-together-ai-429-exceeded-quota", - "call.in-progress.error-providerfault-together-ai-500-server-error", - "call.in-progress.error-providerfault-together-ai-503-server-overloaded-error", - "pipeline-error-anyscale-400-bad-request-validation-failed", - "pipeline-error-anyscale-401-unauthorized", - "pipeline-error-anyscale-403-model-access-denied", - "pipeline-error-anyscale-429-exceeded-quota", - "pipeline-error-anyscale-500-server-error", - "pipeline-error-anyscale-503-server-overloaded-error", - "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-anyscale-401-unauthorized", - "call.in-progress.error-vapifault-anyscale-403-model-access-denied", - "call.in-progress.error-vapifault-anyscale-429-exceeded-quota", - "call.in-progress.error-providerfault-anyscale-500-server-error", - "call.in-progress.error-providerfault-anyscale-503-server-overloaded-error", - "pipeline-error-openrouter-400-bad-request-validation-failed", - "pipeline-error-openrouter-401-unauthorized", - "pipeline-error-openrouter-403-model-access-denied", - "pipeline-error-openrouter-429-exceeded-quota", - "pipeline-error-openrouter-500-server-error", - "pipeline-error-openrouter-503-server-overloaded-error", - "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-openrouter-401-unauthorized", - "call.in-progress.error-vapifault-openrouter-403-model-access-denied", - "call.in-progress.error-vapifault-openrouter-429-exceeded-quota", - "call.in-progress.error-providerfault-openrouter-500-server-error", - "call.in-progress.error-providerfault-openrouter-503-server-overloaded-error", - "pipeline-error-perplexity-ai-400-bad-request-validation-failed", - "pipeline-error-perplexity-ai-401-unauthorized", - "pipeline-error-perplexity-ai-403-model-access-denied", - "pipeline-error-perplexity-ai-429-exceeded-quota", - "pipeline-error-perplexity-ai-500-server-error", - "pipeline-error-perplexity-ai-503-server-overloaded-error", - "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", - "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", - "call.in-progress.error-vapifault-perplexity-ai-429-exceeded-quota", - "call.in-progress.error-providerfault-perplexity-ai-500-server-error", - "call.in-progress.error-providerfault-perplexity-ai-503-server-overloaded-error", - "pipeline-error-deepinfra-400-bad-request-validation-failed", - "pipeline-error-deepinfra-401-unauthorized", - "pipeline-error-deepinfra-403-model-access-denied", - "pipeline-error-deepinfra-429-exceeded-quota", - "pipeline-error-deepinfra-500-server-error", - "pipeline-error-deepinfra-503-server-overloaded-error", - "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-deepinfra-401-unauthorized", - "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", - "call.in-progress.error-vapifault-deepinfra-429-exceeded-quota", - "call.in-progress.error-providerfault-deepinfra-500-server-error", - "call.in-progress.error-providerfault-deepinfra-503-server-overloaded-error", - "pipeline-error-runpod-400-bad-request-validation-failed", - "pipeline-error-runpod-401-unauthorized", - "pipeline-error-runpod-403-model-access-denied", - "pipeline-error-runpod-429-exceeded-quota", - "pipeline-error-runpod-500-server-error", - "pipeline-error-runpod-503-server-overloaded-error", - "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-runpod-401-unauthorized", - "call.in-progress.error-vapifault-runpod-403-model-access-denied", - "call.in-progress.error-vapifault-runpod-429-exceeded-quota", - "call.in-progress.error-providerfault-runpod-500-server-error", - "call.in-progress.error-providerfault-runpod-503-server-overloaded-error", - "pipeline-error-custom-llm-400-bad-request-validation-failed", - "pipeline-error-custom-llm-401-unauthorized", - "pipeline-error-custom-llm-403-model-access-denied", - "pipeline-error-custom-llm-429-exceeded-quota", - "pipeline-error-custom-llm-500-server-error", - "pipeline-error-custom-llm-503-server-overloaded-error", - "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", - "call.in-progress.error-vapifault-custom-llm-401-unauthorized", - "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", - "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota", - "call.in-progress.error-providerfault-custom-llm-500-server-error", - "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error", - "pipeline-error-custom-voice-failed", - "pipeline-error-cartesia-socket-hang-up", - "pipeline-error-cartesia-requested-payment", - "pipeline-error-cartesia-500-server-error", - "pipeline-error-cartesia-502-server-error", - "pipeline-error-cartesia-503-server-error", - "pipeline-error-cartesia-522-server-error", - "call.in-progress.error-vapifault-cartesia-socket-hang-up", - "call.in-progress.error-vapifault-cartesia-requested-payment", - "call.in-progress.error-providerfault-cartesia-500-server-error", - "call.in-progress.error-providerfault-cartesia-503-server-error", - "call.in-progress.error-providerfault-cartesia-522-server-error", - "pipeline-error-eleven-labs-voice-not-found", - "pipeline-error-eleven-labs-quota-exceeded", - "pipeline-error-eleven-labs-unauthorized-access", - "pipeline-error-eleven-labs-unauthorized-to-access-model", - "pipeline-error-eleven-labs-professional-voices-only-for-creator-plus", - "pipeline-error-eleven-labs-blocked-free-plan-and-requested-upgrade", - "pipeline-error-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", - "pipeline-error-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", - "pipeline-error-eleven-labs-system-busy-and-requested-upgrade", - "pipeline-error-eleven-labs-voice-not-fine-tuned", - "pipeline-error-eleven-labs-invalid-api-key", - "pipeline-error-eleven-labs-invalid-voice-samples", - "pipeline-error-eleven-labs-voice-disabled-by-owner", - "pipeline-error-eleven-labs-vapi-voice-disabled-by-owner", - "pipeline-error-eleven-labs-blocked-account-in-probation", - "pipeline-error-eleven-labs-blocked-content-against-their-policy", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 + } + }, + "required": [ + "nodes", + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "edges" + ] + }, + "CreateWorkflowDTO": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" + }, + { + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" + } + ] + } + }, + "model": { + "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] + }, + "transcriber": { + "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "voice": { + "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "observabilityPlan": { + "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", + "oneOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan" + } + ] + }, + "backgroundSound": { + "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } + ] + }, + "hooks": { + "type": "array", + "description": "This is a set of actions that will be performed on certain events.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" + } + ] + } + }, + "credentials": { + "type": "array", + "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" + }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, + { + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" + }, + { + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" + }, + { + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" + }, + { + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" + }, + { + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" + }, + { + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" + }, + { + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", + "title": "DeepSeekCredential" + }, + { + "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", + "title": "ElevenLabsCredential" + }, + { + "$ref": "#/components/schemas/CreateGcpCredentialDTO", + "title": "GcpCredential" + }, + { + "$ref": "#/components/schemas/CreateGladiaCredentialDTO", + "title": "GladiaCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "title": "GhlCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCredentialDTO", + "title": "GoogleCredential" + }, + { + "$ref": "#/components/schemas/CreateGroqCredentialDTO", + "title": "GroqCredential" + }, + { + "$ref": "#/components/schemas/CreateHumeCredentialDTO", + "title": "HumeCredential" + }, + { + "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", + "title": "InflectionAICredential" + }, + { + "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", + "title": "LangfuseCredential" + }, + { + "$ref": "#/components/schemas/CreateLmntCredentialDTO", + "title": "LmntCredential" + }, + { + "$ref": "#/components/schemas/CreateMakeCredentialDTO", + "title": "MakeCredential" + }, + { + "$ref": "#/components/schemas/CreateMistralCredentialDTO", + "title": "MistralCredential" + }, + { + "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", + "title": "NeuphonicCredential" + }, + { + "$ref": "#/components/schemas/CreateOpenAICredentialDTO", + "title": "OpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", + "title": "OpenRouterCredential" + }, + { + "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", + "title": "PerplexityAICredential" + }, + { + "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", + "title": "PlayHTCredential" + }, + { + "$ref": "#/components/schemas/CreateRimeAICredentialDTO", + "title": "RimeAICredential" + }, + { + "$ref": "#/components/schemas/CreateRunpodCredentialDTO", + "title": "RunpodCredential" + }, + { + "$ref": "#/components/schemas/CreateS3CredentialDTO", + "title": "S3Credential" + }, + { + "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", + "title": "SmallestAICredential" + }, + { + "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "title": "SpeechmaticsCredential" + }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, + { + "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", + "title": "SupabaseCredential" + }, + { + "$ref": "#/components/schemas/CreateTavusCredentialDTO", + "title": "TavusCredential" + }, + { + "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", + "title": "TogetherAICredential" + }, + { + "$ref": "#/components/schemas/CreateTrieveCredentialDTO", + "title": "TrieveCredential" + }, + { + "$ref": "#/components/schemas/CreateTwilioCredentialDTO", + "title": "TwilioCredential" + }, + { + "$ref": "#/components/schemas/CreateVonageCredentialDTO", + "title": "VonageCredential" + }, + { + "$ref": "#/components/schemas/CreateWebhookCredentialDTO", + "title": "WebhookCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, + { + "$ref": "#/components/schemas/CreateXAiCredentialDTO", + "title": "XAiCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "title": "GoogleCalendarOAuth2ClientCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "title": "GoogleCalendarOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "title": "GoogleSheetsOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "title": "SlackOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "title": "GoHighLevelMCPCredential" + }, + { + "$ref": "#/components/schemas/CreateInworldCredentialDTO", + "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", + "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", + "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", + "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "azure": "#/components/schemas/CreateAzureCredentialDTO", + "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", + "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", + "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", + "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", + "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", + "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", + "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", + "gcp": "#/components/schemas/CreateGcpCredentialDTO", + "gladia": "#/components/schemas/CreateGladiaCredentialDTO", + "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "google": "#/components/schemas/CreateGoogleCredentialDTO", + "groq": "#/components/schemas/CreateGroqCredentialDTO", + "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", + "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", + "lmnt": "#/components/schemas/CreateLmntCredentialDTO", + "make": "#/components/schemas/CreateMakeCredentialDTO", + "openai": "#/components/schemas/CreateOpenAICredentialDTO", + "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", + "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", + "playht": "#/components/schemas/CreatePlayHTCredentialDTO", + "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", + "runpod": "#/components/schemas/CreateRunpodCredentialDTO", + "s3": "#/components/schemas/CreateS3CredentialDTO", + "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", + "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", + "tavus": "#/components/schemas/CreateTavusCredentialDTO", + "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", + "twilio": "#/components/schemas/CreateTwilioCredentialDTO", + "vonage": "#/components/schemas/CreateVonageCredentialDTO", + "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", + "xai": "#/components/schemas/CreateXAiCredentialDTO", + "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", + "hume": "#/components/schemas/CreateHumeCredentialDTO", + "mistral": "#/components/schemas/CreateMistralCredentialDTO", + "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", + "trieve": "#/components/schemas/CreateTrieveCredentialDTO", + "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "inworld": "#/components/schemas/CreateInworldCredentialDTO", + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" + } + } + } + }, + "voicemailDetection": { + "description": "This is the voicemail detection plan for the workflow.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, + { + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" + } + ] + }, + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum duration of the call in seconds.\n\nAfter this duration, the call will automatically end.\n\nDefault is 1800 (30 minutes), max is 43200 (12 hours), and min is 10 seconds.", + "minimum": 10, + "maximum": 43200, + "example": 600 + }, + "name": { + "type": "string", + "maxLength": 80 + }, + "edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } + }, + "globalPrompt": { + "type": "string", + "maxLength": 5000 + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "allOf": [ + { + "$ref": "#/components/schemas/CompliancePlan" + } + ] + }, + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } + ] + }, + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] + }, + "startSpeakingPlan": { + "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/StartSpeakingPlan" + } + ] + }, + "stopSpeakingPlan": { + "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "allOf": [ + { + "$ref": "#/components/schemas/StopSpeakingPlan" + } + ] + }, + "monitorPlan": { + "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/MonitorPlan" + } + ] + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "credentialIds": { + "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "type": "array", + "items": { + "type": "string" + } + }, + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", + "allOf": [ + { + "$ref": "#/components/schemas/KeypadInputPlan" + } + ] + }, + "voicemailMessage": { + "type": "string", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 + } + }, + "required": [ + "nodes", + "name", + "edges" + ] + }, + "UpdateWorkflowDTO": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" + }, + { + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" + } + ] + } + }, + "model": { + "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] + }, + "transcriber": { + "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" + }, + { + "$ref": "#/components/schemas/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, + { + "$ref": "#/components/schemas/CustomTranscriber", + "title": "CustomTranscriber" + }, + { + "$ref": "#/components/schemas/DeepgramTranscriber", + "title": "DeepgramTranscriber" + }, + { + "$ref": "#/components/schemas/ElevenLabsTranscriber", + "title": "ElevenLabsTranscriber" + }, + { + "$ref": "#/components/schemas/GladiaTranscriber", + "title": "GladiaTranscriber" + }, + { + "$ref": "#/components/schemas/GoogleTranscriber", + "title": "GoogleTranscriber" + }, + { + "$ref": "#/components/schemas/SpeechmaticsTranscriber", + "title": "SpeechmaticsTranscriber" + }, + { + "$ref": "#/components/schemas/TalkscriberTranscriber", + "title": "TalkscriberTranscriber" + }, + { + "$ref": "#/components/schemas/OpenAITranscriber", + "title": "OpenAITranscriber" + }, + { + "$ref": "#/components/schemas/CartesiaTranscriber", + "title": "CartesiaTranscriber" + }, + { + "$ref": "#/components/schemas/SonioxTranscriber", + "title": "SonioxTranscriber" + } + ] + }, + "voice": { + "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", + "oneOf": [ + { + "$ref": "#/components/schemas/AzureVoice", + "title": "AzureVoice" + }, + { + "$ref": "#/components/schemas/CartesiaVoice", + "title": "CartesiaVoice" + }, + { + "$ref": "#/components/schemas/CustomVoice", + "title": "CustomVoice" + }, + { + "$ref": "#/components/schemas/DeepgramVoice", + "title": "DeepgramVoice" + }, + { + "$ref": "#/components/schemas/ElevenLabsVoice", + "title": "ElevenLabsVoice" + }, + { + "$ref": "#/components/schemas/HumeVoice", + "title": "HumeVoice" + }, + { + "$ref": "#/components/schemas/LMNTVoice", + "title": "LMNTVoice" + }, + { + "$ref": "#/components/schemas/NeuphonicVoice", + "title": "NeuphonicVoice" + }, + { + "$ref": "#/components/schemas/OpenAIVoice", + "title": "OpenAIVoice" + }, + { + "$ref": "#/components/schemas/PlayHTVoice", + "title": "PlayHTVoice" + }, + { + "$ref": "#/components/schemas/WellSaidVoice", + "title": "WellSaidVoice" + }, + { + "$ref": "#/components/schemas/RimeAIVoice", + "title": "RimeAIVoice" + }, + { + "$ref": "#/components/schemas/SmallestAIVoice", + "title": "SmallestAIVoice" + }, + { + "$ref": "#/components/schemas/TavusVoice", + "title": "TavusVoice" + }, + { + "$ref": "#/components/schemas/VapiVoice", + "title": "VapiVoice" + }, + { + "$ref": "#/components/schemas/SesameVoice", + "title": "SesameVoice" + }, + { + "$ref": "#/components/schemas/InworldVoice", + "title": "InworldVoice" + }, + { + "$ref": "#/components/schemas/MinimaxVoice", + "title": "MinimaxVoice" + } + ] + }, + "observabilityPlan": { + "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", + "oneOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/LangfuseObservabilityPlan" + } + ] + }, + "backgroundSound": { + "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", + "oneOf": [ + { + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + } + ] + }, + "hooks": { + "type": "array", + "description": "This is a set of actions that will be performed on certain events.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + }, + { + "$ref": "#/components/schemas/CallHookModelResponseTimeout", + "title": "CallHookModelResponseTimeout" + } + ] + } + }, + "credentials": { + "type": "array", + "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" + }, + { + "$ref": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "title": "AnthropicBedrockCredential" + }, + { + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" + }, + { + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" + }, + { + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" + }, + { + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" + }, + { + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" + }, + { + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" + }, + { + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" + }, + { + "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", + "title": "DeepSeekCredential" + }, + { + "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", + "title": "ElevenLabsCredential" + }, + { + "$ref": "#/components/schemas/CreateGcpCredentialDTO", + "title": "GcpCredential" + }, + { + "$ref": "#/components/schemas/CreateGladiaCredentialDTO", + "title": "GladiaCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "title": "GhlCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCredentialDTO", + "title": "GoogleCredential" + }, + { + "$ref": "#/components/schemas/CreateGroqCredentialDTO", + "title": "GroqCredential" + }, + { + "$ref": "#/components/schemas/CreateHumeCredentialDTO", + "title": "HumeCredential" + }, + { + "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", + "title": "InflectionAICredential" + }, + { + "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", + "title": "LangfuseCredential" + }, + { + "$ref": "#/components/schemas/CreateLmntCredentialDTO", + "title": "LmntCredential" + }, + { + "$ref": "#/components/schemas/CreateMakeCredentialDTO", + "title": "MakeCredential" + }, + { + "$ref": "#/components/schemas/CreateMistralCredentialDTO", + "title": "MistralCredential" + }, + { + "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", + "title": "NeuphonicCredential" + }, + { + "$ref": "#/components/schemas/CreateOpenAICredentialDTO", + "title": "OpenAICredential" + }, + { + "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", + "title": "OpenRouterCredential" + }, + { + "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", + "title": "PerplexityAICredential" + }, + { + "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", + "title": "PlayHTCredential" + }, + { + "$ref": "#/components/schemas/CreateRimeAICredentialDTO", + "title": "RimeAICredential" + }, + { + "$ref": "#/components/schemas/CreateRunpodCredentialDTO", + "title": "RunpodCredential" + }, + { + "$ref": "#/components/schemas/CreateS3CredentialDTO", + "title": "S3Credential" + }, + { + "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", + "title": "SmallestAICredential" + }, + { + "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "title": "SpeechmaticsCredential" + }, + { + "$ref": "#/components/schemas/CreateSonioxCredentialDTO", + "title": "SonioxCredential" + }, + { + "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", + "title": "SupabaseCredential" + }, + { + "$ref": "#/components/schemas/CreateTavusCredentialDTO", + "title": "TavusCredential" + }, + { + "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", + "title": "TogetherAICredential" + }, + { + "$ref": "#/components/schemas/CreateTrieveCredentialDTO", + "title": "TrieveCredential" + }, + { + "$ref": "#/components/schemas/CreateTwilioCredentialDTO", + "title": "TwilioCredential" + }, + { + "$ref": "#/components/schemas/CreateVonageCredentialDTO", + "title": "VonageCredential" + }, + { + "$ref": "#/components/schemas/CreateWebhookCredentialDTO", + "title": "WebhookCredential" + }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, + { + "$ref": "#/components/schemas/CreateXAiCredentialDTO", + "title": "XAiCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "title": "GoogleCalendarOAuth2ClientCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "title": "GoogleCalendarOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "title": "GoogleSheetsOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "title": "SlackOAuth2AuthorizationCredential" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "title": "GoHighLevelMCPCredential" + }, + { + "$ref": "#/components/schemas/CreateInworldCredentialDTO", + "title": "InworldCredential" + }, + { + "$ref": "#/components/schemas/CreateMinimaxCredentialDTO", + "title": "MinimaxCredential" + }, + { + "$ref": "#/components/schemas/CreateWellSaidCredentialDTO", + "title": "WellSaidCredential" + }, + { + "$ref": "#/components/schemas/CreateEmailCredentialDTO", + "title": "EmailCredential" + }, + { + "$ref": "#/components/schemas/CreateSlackWebhookCredentialDTO", + "title": "SlackWebhookCredential" + } + ], + "discriminator": { + "propertyName": "provider", + "mapping": { + "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", + "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", + "anthropic-bedrock": "#/components/schemas/CreateAnthropicBedrockCredentialDTO", + "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", + "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", + "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "azure": "#/components/schemas/CreateAzureCredentialDTO", + "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", + "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", + "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", + "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", + "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", + "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", + "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", + "gcp": "#/components/schemas/CreateGcpCredentialDTO", + "gladia": "#/components/schemas/CreateGladiaCredentialDTO", + "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", + "google": "#/components/schemas/CreateGoogleCredentialDTO", + "groq": "#/components/schemas/CreateGroqCredentialDTO", + "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", + "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", + "lmnt": "#/components/schemas/CreateLmntCredentialDTO", + "make": "#/components/schemas/CreateMakeCredentialDTO", + "openai": "#/components/schemas/CreateOpenAICredentialDTO", + "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", + "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", + "playht": "#/components/schemas/CreatePlayHTCredentialDTO", + "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", + "runpod": "#/components/schemas/CreateRunpodCredentialDTO", + "s3": "#/components/schemas/CreateS3CredentialDTO", + "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", + "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", + "tavus": "#/components/schemas/CreateTavusCredentialDTO", + "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", + "twilio": "#/components/schemas/CreateTwilioCredentialDTO", + "vonage": "#/components/schemas/CreateVonageCredentialDTO", + "webhook": "#/components/schemas/CreateWebhookCredentialDTO", + "custom-credential": "#/components/schemas/CreateCustomCredentialDTO", + "xai": "#/components/schemas/CreateXAiCredentialDTO", + "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", + "hume": "#/components/schemas/CreateHumeCredentialDTO", + "mistral": "#/components/schemas/CreateMistralCredentialDTO", + "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", + "soniox": "#/components/schemas/CreateSonioxCredentialDTO", + "trieve": "#/components/schemas/CreateTrieveCredentialDTO", + "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", + "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", + "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", + "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", + "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", + "inworld": "#/components/schemas/CreateInworldCredentialDTO", + "minimax": "#/components/schemas/CreateMinimaxCredentialDTO", + "wellsaid": "#/components/schemas/CreateWellSaidCredentialDTO", + "email": "#/components/schemas/CreateEmailCredentialDTO", + "slack-webhook": "#/components/schemas/CreateSlackWebhookCredentialDTO" + } + } + } + }, + "voicemailDetection": { + "description": "This is the voicemail detection plan for the workflow.", + "oneOf": [ + { + "type": "string", + "enum": [ + "off" + ] + }, + { + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, + { + "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" + }, + { + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" + } + ] + }, + "maxDurationSeconds": { + "type": "number", + "description": "This is the maximum duration of the call in seconds.\n\nAfter this duration, the call will automatically end.\n\nDefault is 1800 (30 minutes), max is 43200 (12 hours), and min is 10 seconds.", + "minimum": 10, + "maximum": 43200, + "example": 600 + }, + "name": { + "type": "string", + "maxLength": 80 + }, + "edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Edge" + } + }, + "globalPrompt": { + "type": "string", + "maxLength": 5000 + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "allOf": [ + { + "$ref": "#/components/schemas/CompliancePlan" + } + ] + }, + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } + ] + }, + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] + }, + "startSpeakingPlan": { + "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/StartSpeakingPlan" + } + ] + }, + "stopSpeakingPlan": { + "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "allOf": [ + { + "$ref": "#/components/schemas/StopSpeakingPlan" + } + ] + }, + "monitorPlan": { + "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "allOf": [ + { + "$ref": "#/components/schemas/MonitorPlan" + } + ] + }, + "backgroundSpeechDenoisingPlan": { + "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", + "allOf": [ + { + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + } + ] + }, + "credentialIds": { + "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "type": "array", + "items": { + "type": "string" + } + }, + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", + "allOf": [ + { + "$ref": "#/components/schemas/KeypadInputPlan" + } + ] + }, + "voicemailMessage": { + "type": "string", + "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", + "maxLength": 1000 + } + } + }, + "SubscriptionLimits": { + "type": "object", + "properties": { + "concurrencyBlocked": { + "type": "boolean", + "description": "True if this call was blocked by the Call Concurrency limit", + "default": false + }, + "concurrencyLimit": { + "type": "number", + "description": "Account Call Concurrency limit" + }, + "remainingConcurrentCalls": { + "type": "number", + "description": "Incremental number of concurrent calls that will be allowed, including this call" + } + } + }, + "AnalysisCostBreakdown": { + "type": "object", + "properties": { + "summary": { + "type": "number", + "description": "This is the cost to summarize the call." + }, + "summaryPromptTokens": { + "type": "number", + "description": "This is the number of prompt tokens used to summarize the call." + }, + "summaryCompletionTokens": { + "type": "number", + "description": "This is the number of completion tokens used to summarize the call." + }, + "summaryCachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used to summarize the call." + }, + "structuredData": { + "type": "number", + "description": "This is the cost to extract structured data from the call." + }, + "structuredDataPromptTokens": { + "type": "number", + "description": "This is the number of prompt tokens used to extract structured data from the call." + }, + "structuredDataCompletionTokens": { + "type": "number", + "description": "This is the number of completion tokens used to extract structured data from the call." + }, + "structuredDataCachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used to extract structured data from the call." + }, + "successEvaluation": { + "type": "number", + "description": "This is the cost to evaluate if the call was successful." + }, + "successEvaluationPromptTokens": { + "type": "number", + "description": "This is the number of prompt tokens used to evaluate if the call was successful." + }, + "successEvaluationCompletionTokens": { + "type": "number", + "description": "This is the number of completion tokens used to evaluate if the call was successful." + }, + "successEvaluationCachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used to evaluate if the call was successful." + }, + "structuredOutput": { + "type": "number", + "description": "This is the cost to evaluate structuredOutputs from the call." + }, + "structuredOutputPromptTokens": { + "type": "number", + "description": "This is the number of prompt tokens used to evaluate structuredOutputs from the call." + }, + "structuredOutputCompletionTokens": { + "type": "number", + "description": "This is the number of completion tokens used to evaluate structuredOutputs from the call." + }, + "structuredOutputCachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used to evaluate structuredOutputs from the call." + } + } + }, + "CostBreakdown": { + "type": "object", + "properties": { + "transport": { + "type": "number", + "description": "This is the cost of the transport provider, like Twilio or Vonage." + }, + "stt": { + "type": "number", + "description": "This is the cost of the speech-to-text service." + }, + "llm": { + "type": "number", + "description": "This is the cost of the language model." + }, + "tts": { + "type": "number", + "description": "This is the cost of the text-to-speech service." + }, + "vapi": { + "type": "number", + "description": "This is the cost of Vapi." + }, + "chat": { + "type": "number", + "description": "This is the cost of chat interactions." + }, + "total": { + "type": "number", + "description": "This is the total cost of the call." + }, + "llmPromptTokens": { + "type": "number", + "description": "This is the LLM prompt tokens used for the call." + }, + "llmCompletionTokens": { + "type": "number", + "description": "This is the LLM completion tokens used for the call." + }, + "llmCachedPromptTokens": { + "type": "number", + "description": "This is the LLM cached prompt tokens used for the call." + }, + "ttsCharacters": { + "type": "number", + "description": "This is the TTS characters used for the call." + }, + "analysisCostBreakdown": { + "description": "This is the cost of the analysis.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisCostBreakdown" + } + ] + } + } + }, + "Analysis": { + "type": "object", + "properties": { + "summary": { + "type": "string", + "description": "This is the summary of the call. Customize by setting `assistant.analysisPlan.summaryPrompt`." + }, + "structuredData": { + "type": "object", + "description": "This is the structured data extracted from the call. Customize by setting `assistant.analysisPlan.structuredDataPrompt` and/or `assistant.analysisPlan.structuredDataSchema`." + }, + "structuredDataMulti": { + "description": "This is the structured data catalog of the call. Customize by setting `assistant.analysisPlan.structuredDataMultiPlan`.", + "type": "array", + "items": { + "type": "object" + } + }, + "successEvaluation": { + "type": "string", + "description": "This is the evaluation of the call. Customize by setting `assistant.analysisPlan.successEvaluationPrompt` and/or `assistant.analysisPlan.successEvaluationRubric`." + } + } + }, + "MonitorResult": { + "type": "object", + "properties": { + "monitorId": { + "type": "string" + }, + "filterPassed": { + "type": "boolean" + } + }, + "required": [ + "monitorId", + "filterPassed" + ] + }, + "Monitor": { + "type": "object", + "properties": { + "monitors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MonitorResult" + } + }, + "listenUrl": { + "type": "string", + "description": "This is the URL where the assistant's calls can be listened to in real-time. To enable, set `assistant.monitorPlan.listenEnabled` to `true`." + }, + "controlUrl": { + "type": "string", + "description": "This is the URL where the assistant's calls can be controlled in real-time. To enable, set `assistant.monitorPlan.controlEnabled` to `true`." + } + } + }, + "Mono": { + "type": "object", + "properties": { + "combinedUrl": { + "type": "string", + "description": "This is the combined recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." + }, + "assistantUrl": { + "type": "string", + "description": "This is the mono recording url for the assistant. To enable, set `assistant.artifactPlan.recordingEnabled`." + }, + "customerUrl": { + "type": "string", + "description": "This is the mono recording url for the customer. To enable, set `assistant.artifactPlan.recordingEnabled`." + } + } + }, + "Recording": { + "type": "object", + "properties": { + "stereoUrl": { + "type": "string", + "description": "This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." + }, + "videoUrl": { + "type": "string", + "description": "This is the video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`." + }, + "videoRecordingStartDelaySeconds": { + "type": "number", + "description": "This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps." + }, + "mono": { + "description": "This is the mono recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", + "allOf": [ + { + "$ref": "#/components/schemas/Mono" + } + ] + } + } + }, + "NodeArtifact": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that were spoken during the node.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/BotMessage", + "title": "BotMessage" + }, + { + "$ref": "#/components/schemas/ToolCallMessage", + "title": "ToolCallMessage" + }, + { + "$ref": "#/components/schemas/ToolCallResultMessage", + "title": "ToolCallResultMessage" + } + ] + } + }, + "nodeName": { + "type": "string", + "description": "This is the node name." + }, + "variableValues": { + "type": "object", + "description": "These are the variable values that were extracted from the node." + } + } + }, + "TurnLatency": { + "type": "object", + "properties": { + "modelLatency": { + "type": "number", + "description": "This is the model latency for the first token." + }, + "voiceLatency": { + "type": "number", + "description": "This is the voice latency from the model output." + }, + "transcriberLatency": { + "type": "number", + "description": "This is the transcriber latency from the user speech." + }, + "endpointingLatency": { + "type": "number", + "description": "This is the endpointing latency." + }, + "turnLatency": { + "type": "number", + "description": "This is the latency for the whole turn." + } + } + }, + "PerformanceMetrics": { + "type": "object", + "properties": { + "turnLatencies": { + "description": "These are the individual latencies for each turn.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TurnLatency" + } + }, + "modelLatencyAverage": { + "type": "number", + "description": "This is the average latency for the model to output the first token." + }, + "voiceLatencyAverage": { + "type": "number", + "description": "This is the average latency for the text to speech." + }, + "transcriberLatencyAverage": { + "type": "number", + "description": "This is the average latency for the transcriber." + }, + "endpointingLatencyAverage": { + "type": "number", + "description": "This is the average latency for the endpointing." + }, + "turnLatencyAverage": { + "type": "number", + "description": "This is the average latency for complete turns." + }, + "fromTransportLatencyAverage": { + "type": "number", + "description": "This is the average latency for packets received from the transport provider in milliseconds." + }, + "toTransportLatencyAverage": { + "type": "number", + "description": "This is the average latency for packets sent to the transport provider in milliseconds." + }, + "numUserInterrupted": { + "type": "number", + "description": "This is the number of times the user was interrupted by the assistant during the call." + }, + "numAssistantInterrupted": { + "type": "number", + "description": "This is the number of times the assistant was interrupted by the user during the call." + } + } + }, + "Artifact": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that were spoken during the call.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/BotMessage", + "title": "BotMessage" + }, + { + "$ref": "#/components/schemas/ToolCallMessage", + "title": "ToolCallMessage" + }, + { + "$ref": "#/components/schemas/ToolCallResultMessage", + "title": "ToolCallResultMessage" + } + ] + } + }, + "messagesOpenAIFormatted": { + "description": "These are the messages that were spoken during the call, formatted for OpenAI.", + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIMessage" + } + }, + "recordingUrl": { + "type": "string", + "description": "This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", + "deprecated": true + }, + "stereoRecordingUrl": { + "type": "string", + "description": "This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", + "deprecated": true + }, + "videoRecordingUrl": { + "type": "string", + "description": "This is video recording url for the call. To enable, set `assistant.artifactPlan.videoRecordingEnabled`.", + "deprecated": true + }, + "videoRecordingStartDelaySeconds": { + "type": "number", + "description": "This is video recording start delay in ms. To enable, set `assistant.artifactPlan.videoRecordingEnabled`. This can be used to align the playback of the recording with artifact.messages timestamps.", + "deprecated": true + }, + "recording": { + "description": "This is the recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", + "allOf": [ + { + "$ref": "#/components/schemas/Recording" + } + ] + }, + "transcript": { + "type": "string", + "description": "This is the transcript of the call. This is derived from `artifact.messages` but provided for convenience." + }, + "pcapUrl": { + "type": "string", + "description": "This is the packet capture url for the call. This is only available for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`." + }, + "logUrl": { + "type": "string", + "description": "This is the url for the call logs. This includes all logging output during the call for debugging purposes." + }, + "nodes": { + "description": "This is the history of workflow nodes that were executed during the call.", + "type": "array", + "items": { + "$ref": "#/components/schemas/NodeArtifact" + } + }, + "variableValues": { + "type": "object", + "description": "These are the variable values at the end of the workflow execution." + }, + "performanceMetrics": { + "description": "This is the performance metrics for the call. It contains the turn latency, broken down by component.", + "allOf": [ + { + "$ref": "#/components/schemas/PerformanceMetrics" + } + ] + }, + "structuredOutputs": { + "type": "object", + "description": "These are the structured outputs that will be extracted from the call.\nTo enable, set `assistant.artifactPlan.structuredOutputIds` with the IDs of the structured outputs you want to extract." + }, + "scorecards": { + "type": "object", + "description": "These are the scorecards that have been evaluated based on the structured outputs extracted during the call.\nTo enable, set `assistant.artifactPlan.scorecardIds` or `assistant.artifactPlan.scorecards` with the IDs or objects of the scorecards you want to evaluate." + }, + "transfers": { + "description": "These are the transfer records from warm transfers, including destinations, transcripts, and status.", + "type": "array", + "items": { + "type": "string" + } + }, + "structuredOutputsLastUpdatedAt": { + "format": "date-time", + "type": "string", + "description": "This is when the structured outputs were last updated" + } + } + }, + "RecordingConsent": { + "type": "object", + "properties": { + "type": { + "type": "object", + "description": "This is the type of recording consent." + }, + "grantedAt": { + "format": "date-time", + "type": "string", + "description": "This is the date and time the recording consent was granted.\nIf not specified, it means the recording consent was not granted." + } + }, + "required": [ + "type" + ] + }, + "Compliance": { + "type": "object", + "properties": { + "recordingConsent": { + "description": "This is the recording consent of the call. Configure in `assistant.compliancePlan.recordingConsentPlan`.", + "allOf": [ + { + "$ref": "#/components/schemas/RecordingConsent" + } + ] + } + } + }, + "WorkflowOverrides": { + "type": "object", + "properties": { + "variableValues": { + "type": "object", + "description": "These are values that will be used to replace the template variables in the workflow messages and other text-based fields.\nThis uses LiquidJS syntax. https://liquidjs.com/tutorials/intro-to-liquid.html\n\nSo for example, `{{ name }}` will be replaced with the value of `name` in `variableValues`.\n`{{\"now\" | date: \"%b %d, %Y, %I:%M %p\", \"America/New_York\"}}` will be replaced with the current date and time in New York.\n Some VAPI reserved defaults:\n - *customer* - the customer object" + } + } + }, + "TransferPhoneNumberHookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of action - must be \"transfer\"", + "enum": [ + "transfer" + ] + }, + "destination": { + "description": "This is the destination details for the transfer - can be a phone number or SIP URI", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + } + }, + "required": [ + "type" + ] + }, + "SayPhoneNumberHookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of action - must be \"say\"", + "enum": [ + "say" + ] + }, + "exact": { + "type": "string", + "description": "This is the message to say", + "maxLength": 4000 + } + }, + "required": [ + "type", + "exact" + ] + }, + "PhoneNumberCallRingingHookFilter": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of filter - matches when the specified field starts with any of the given prefixes", + "enum": [ + "startsWith" + ], + "maxLength": 1000 + }, + "key": { + "type": "string", + "description": "The field to check. Currently only \"number\" (the caller's phone number) is supported.", + "enum": [ + "number" + ], + "maxLength": 1000 + }, + "startsWith": { + "type": "array", + "description": "Array of prefixes to match. Do not include the + prefix. Inbound calls from numbers starting with any of these prefixes will trigger the hook actions.", + "maxLength": 20, + "items": { + "type": "string", + "maxLength": 20 + }, + "example": [ + "91", + "86", + "7" + ] + } + }, + "required": [ + "type", + "key", + "startsWith" + ] + }, + "PhoneNumberHookCallRinging": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event to trigger the hook on", + "enum": [ + "call.ringing" + ], + "maxLength": 1000 + }, + "filters": { + "type": "array", + "description": "Optional filters to decide when to trigger the hook. Currently supports filtering by caller country code.", + "items": { + "$ref": "#/components/schemas/PhoneNumberCallRingingHookFilter" + } + }, + "do": { + "type": "array", + "description": "Only the first action will be executed. Additional actions will be ignored.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransferPhoneNumberHookAction", + "title": "TransferPhoneNumberHookAction" + }, + { + "$ref": "#/components/schemas/SayPhoneNumberHookAction", + "title": "SayPhoneNumberHookAction" + } + ] + } + } + }, + "required": [ + "on", + "do" + ] + }, + "PhoneNumberCallEndingHookFilter": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of filter - currently only \"oneOf\" is supported", + "enum": [ + "oneOf" + ], + "maxLength": 1000 + }, + "key": { + "type": "string", + "description": "This is the key to filter on - only \"call.endedReason\" is allowed for phone number call ending hooks", + "enum": [ + "call.endedReason" + ], + "maxLength": 1000 + }, + "oneOf": { + "type": "array", + "description": "This is the array of assistant-request related ended reasons to match against", + "enum": [ + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number" + ], + "items": { + "type": "string", + "enum": [ + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number" + ] + } + } + }, + "required": [ + "type", + "key", + "oneOf" + ] + }, + "PhoneNumberHookCallEnding": { + "type": "object", + "properties": { + "on": { + "type": "string", + "description": "This is the event to trigger the hook on", + "enum": [ + "call.ending" + ], + "maxLength": 1000 + }, + "filters": { + "type": "array", + "description": "Optional filters to decide when to trigger - restricted to assistant-request related ended reasons", + "items": { + "$ref": "#/components/schemas/PhoneNumberCallEndingHookFilter" + } + }, + "do": { + "description": "This is the action to perform when the hook triggers", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferPhoneNumberHookAction", + "title": "TransferPhoneNumberHookAction" + }, + { + "$ref": "#/components/schemas/SayPhoneNumberHookAction", + "title": "SayPhoneNumberHookAction" + } + ] + } + }, + "required": [ + "on" + ] + }, + "ImportTwilioPhoneNumberDTO": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } + }, + "smsEnabled": { + "type": "boolean", + "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", + "default": true + }, + "twilioPhoneNumber": { + "type": "string", + "description": "These are the digits of the phone number you own on your Twilio.", + "deprecated": true + }, + "twilioAccountSid": { + "type": "string", + "description": "This is your Twilio Account SID that will be used to handle this phone number." + }, + "twilioAuthToken": { + "type": "string", + "description": "This is the Twilio Auth Token that will be used to handle this phone number." + }, + "twilioApiKey": { + "type": "string", + "description": "This is the Twilio API Key that will be used to handle this phone number. If AuthToken is provided, this will be ignored." + }, + "twilioApiSecret": { + "type": "string", + "description": "This is the Twilio API Secret that will be used to handle this phone number. If AuthToken is provided, this will be ignored." + }, + "name": { + "type": "string", + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + } + }, + "required": [ + "twilioPhoneNumber", + "twilioAccountSid" + ] + }, + "CreateCustomerDTO": { + "type": "object", + "properties": { + "numberE164CheckEnabled": { + "type": "boolean", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "default": true + }, + "extension": { + "type": "string", + "description": "This is the extension that will be dialed after the call is answered.", + "maxLength": 10, + "example": null + }, + "assistantOverrides": { + "description": "These are the overrides for the assistant's settings and template variables specific to this customer.\nThis allows customization of the assistant's behavior for individual customers in batch calls.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "number": { + "type": "string", + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 + }, + "sipUri": { + "type": "string", + "description": "This is the SIP URI of the customer." + }, + "name": { + "type": "string", + "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", + "maxLength": 40 + }, + "email": { + "type": "string", + "description": "This is the email of the customer.", + "maxLength": 40 + }, + "externalId": { + "type": "string", + "description": "This is the external ID of the customer.", + "maxLength": 40 + } + } + }, + "SchedulePlan": { + "type": "object", + "properties": { + "earliestAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of the earliest time the call can be scheduled." + }, + "latestAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of the latest time the call can be scheduled." + } + }, + "required": [ + "earliestAt" + ] + }, + "Call": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of call.", + "enum": [ + "inboundPhoneCall", + "outboundPhoneCall", + "webCall", + "vapi.websocketCall" + ] + }, + "costs": { + "type": "array", + "description": "These are the costs of individual components of the call in USD.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransportCost", + "title": "TransportCost" + }, + { + "$ref": "#/components/schemas/TranscriberCost", + "title": "TranscriberCost" + }, + { + "$ref": "#/components/schemas/ModelCost", + "title": "ModelCost" + }, + { + "$ref": "#/components/schemas/VoiceCost", + "title": "VoiceCost" + }, + { + "$ref": "#/components/schemas/VapiCost", + "title": "VapiCost" + }, + { + "$ref": "#/components/schemas/VoicemailDetectionCost", + "title": "VoicemailDetectionCost" + }, + { + "$ref": "#/components/schemas/AnalysisCost", + "title": "AnalysisCost" + }, + { + "$ref": "#/components/schemas/KnowledgeBaseCost", + "title": "KnowledgeBaseCost" + } + ] + } + }, + "messages": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/BotMessage", + "title": "BotMessage" + }, + { + "$ref": "#/components/schemas/ToolCallMessage", + "title": "ToolCallMessage" + }, + { + "$ref": "#/components/schemas/ToolCallResultMessage", + "title": "ToolCallResultMessage" + } + ] + } + }, + "phoneCallProvider": { + "type": "string", + "description": "This is the provider of the call.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "deprecated": true, + "enum": [ + "twilio", + "vonage", + "vapi", + "telnyx" + ] + }, + "phoneCallTransport": { + "type": "string", + "description": "This is the transport of the phone call.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "enum": [ + "sip", + "pstn" + ] + }, + "status": { + "type": "string", + "description": "This is the status of the call.", + "enum": [ + "scheduled", + "queued", + "ringing", + "in-progress", + "forwarding", + "ended", + "not-found", + "deletion-failed" + ] + }, + "endedReason": { + "type": "string", + "description": "This is the explanation for how the call ended.", + "enum": [ + "call-start-error-neither-assistant-nor-server-set", + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number", + "scheduled-call-deleted", + "call.start.error-vapifault-get-org", + "call.start.error-vapifault-get-subscription", + "call.start.error-get-assistant", + "call.start.error-get-phone-number", + "call.start.error-get-customer", + "call.start.error-get-resources-validation", + "call.start.error-vapi-number-international", + "call.start.error-vapi-number-outbound-daily-limit", + "call.start.error-get-transport", + "call.start.error-subscription-wallet-does-not-exist", + "call.start.error-fraud-check-failed", + "call.start.error-subscription-frozen", + "call.start.error-subscription-insufficient-credits", + "call.start.error-subscription-upgrade-failed", + "call.start.error-subscription-concurrency-limit-reached", + "call.start.error-enterprise-feature-not-available-recording-consent", + "assistant-not-valid", + "call.start.error-vapifault-database-error", + "assistant-not-found", + "pipeline-error-openai-voice-failed", + "pipeline-error-cartesia-voice-failed", + "pipeline-error-deepgram-voice-failed", + "pipeline-error-eleven-labs-voice-failed", + "pipeline-error-playht-voice-failed", + "pipeline-error-lmnt-voice-failed", + "pipeline-error-azure-voice-failed", + "pipeline-error-rime-ai-voice-failed", + "pipeline-error-smallest-ai-voice-failed", + "pipeline-error-vapi-voice-failed", + "pipeline-error-neuphonic-voice-failed", + "pipeline-error-hume-voice-failed", + "pipeline-error-sesame-voice-failed", + "pipeline-error-inworld-voice-failed", + "pipeline-error-minimax-voice-failed", + "pipeline-error-wellsaid-voice-failed", + "pipeline-error-tavus-video-failed", + "call.in-progress.error-vapifault-openai-voice-failed", + "call.in-progress.error-vapifault-cartesia-voice-failed", + "call.in-progress.error-vapifault-deepgram-voice-failed", + "call.in-progress.error-vapifault-eleven-labs-voice-failed", + "call.in-progress.error-vapifault-playht-voice-failed", + "call.in-progress.error-vapifault-lmnt-voice-failed", + "call.in-progress.error-vapifault-azure-voice-failed", + "call.in-progress.error-vapifault-rime-ai-voice-failed", + "call.in-progress.error-vapifault-smallest-ai-voice-failed", + "call.in-progress.error-vapifault-vapi-voice-failed", + "call.in-progress.error-vapifault-neuphonic-voice-failed", + "call.in-progress.error-vapifault-hume-voice-failed", + "call.in-progress.error-vapifault-sesame-voice-failed", + "call.in-progress.error-vapifault-inworld-voice-failed", + "call.in-progress.error-vapifault-minimax-voice-failed", + "call.in-progress.error-vapifault-wellsaid-voice-failed", + "call.in-progress.error-vapifault-tavus-video-failed", + "pipeline-error-vapi-llm-failed", + "pipeline-error-vapi-400-bad-request-validation-failed", + "pipeline-error-vapi-401-unauthorized", + "pipeline-error-vapi-403-model-access-denied", + "pipeline-error-vapi-429-exceeded-quota", + "pipeline-error-vapi-500-server-error", + "pipeline-error-vapi-503-server-overloaded-error", + "call.in-progress.error-providerfault-vapi-llm-failed", + "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-vapi-401-unauthorized", + "call.in-progress.error-vapifault-vapi-403-model-access-denied", + "call.in-progress.error-vapifault-vapi-429-exceeded-quota", + "call.in-progress.error-providerfault-vapi-500-server-error", + "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", + "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-transcriber-api-key-missing", + "call.in-progress.error-vapifault-deepgram-transcriber-failed", + "pipeline-error-gladia-transcriber-failed", + "call.in-progress.error-vapifault-gladia-transcriber-failed", + "pipeline-error-speechmatics-transcriber-failed", + "call.in-progress.error-vapifault-speechmatics-transcriber-failed", + "pipeline-error-assembly-ai-transcriber-failed", + "pipeline-error-assembly-ai-returning-400-insufficent-funds", + "pipeline-error-assembly-ai-returning-400-paid-only-feature", + "pipeline-error-assembly-ai-returning-401-invalid-credentials", + "pipeline-error-assembly-ai-returning-500-invalid-schema", + "pipeline-error-assembly-ai-returning-500-word-boost-parsing-failed", + "call.in-progress.error-vapifault-assembly-ai-transcriber-failed", + "call.in-progress.error-vapifault-assembly-ai-returning-400-insufficent-funds", + "call.in-progress.error-vapifault-assembly-ai-returning-400-paid-only-feature", + "call.in-progress.error-vapifault-assembly-ai-returning-401-invalid-credentials", + "call.in-progress.error-vapifault-assembly-ai-returning-500-invalid-schema", + "call.in-progress.error-vapifault-assembly-ai-returning-500-word-boost-parsing-failed", + "pipeline-error-talkscriber-transcriber-failed", + "call.in-progress.error-vapifault-talkscriber-transcriber-failed", + "pipeline-error-azure-speech-transcriber-failed", + "call.in-progress.error-vapifault-azure-speech-transcriber-failed", + "call.in-progress.error-pipeline-no-available-llm-model", + "worker-shutdown", + "vonage-disconnected", + "vonage-failed-to-connect-call", + "vonage-completed", + "phone-call-provider-bypass-enabled-but-no-call-received", + "call.in-progress.error-providerfault-transport-never-connected", + "call.in-progress.error-vapifault-worker-not-available", + "call.in-progress.error-vapifault-transport-never-connected", + "call.in-progress.error-vapifault-transport-connected-but-call-not-active", + "call.in-progress.error-vapifault-call-started-but-connection-to-transport-missing", + "call.in-progress.error-vapifault-worker-died", + "call.in-progress.twilio-completed-call", + "call.in-progress.sip-completed-call", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-baseten-llm-failed", + "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", + "pipeline-error-openai-400-bad-request-validation-failed", + "pipeline-error-openai-401-unauthorized", + "pipeline-error-openai-401-incorrect-api-key", + "pipeline-error-openai-401-account-not-in-organization", + "pipeline-error-openai-403-model-access-denied", + "pipeline-error-openai-429-exceeded-quota", + "pipeline-error-openai-429-rate-limit-reached", + "pipeline-error-openai-500-server-error", + "pipeline-error-openai-503-server-overloaded-error", + "pipeline-error-openai-llm-failed", + "call.in-progress.error-vapifault-openai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-openai-401-unauthorized", + "call.in-progress.error-vapifault-openai-401-incorrect-api-key", + "call.in-progress.error-vapifault-openai-401-account-not-in-organization", + "call.in-progress.error-vapifault-openai-403-model-access-denied", + "call.in-progress.error-vapifault-openai-429-exceeded-quota", + "call.in-progress.error-vapifault-openai-429-rate-limit-reached", + "call.in-progress.error-providerfault-openai-500-server-error", + "call.in-progress.error-providerfault-openai-503-server-overloaded-error", + "pipeline-error-azure-openai-400-bad-request-validation-failed", + "pipeline-error-azure-openai-401-unauthorized", + "pipeline-error-azure-openai-403-model-access-denied", + "pipeline-error-azure-openai-429-exceeded-quota", + "pipeline-error-azure-openai-500-server-error", + "pipeline-error-azure-openai-503-server-overloaded-error", + "pipeline-error-azure-openai-llm-failed", + "call.in-progress.error-vapifault-azure-openai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-azure-openai-401-unauthorized", + "call.in-progress.error-vapifault-azure-openai-403-model-access-denied", + "call.in-progress.error-vapifault-azure-openai-429-exceeded-quota", + "call.in-progress.error-providerfault-azure-openai-500-server-error", + "call.in-progress.error-providerfault-azure-openai-503-server-overloaded-error", + "pipeline-error-google-400-bad-request-validation-failed", + "pipeline-error-google-401-unauthorized", + "pipeline-error-google-403-model-access-denied", + "pipeline-error-google-429-exceeded-quota", + "pipeline-error-google-500-server-error", + "pipeline-error-google-503-server-overloaded-error", + "pipeline-error-google-llm-failed", + "call.in-progress.error-vapifault-google-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-google-401-unauthorized", + "call.in-progress.error-vapifault-google-403-model-access-denied", + "call.in-progress.error-vapifault-google-429-exceeded-quota", + "call.in-progress.error-providerfault-google-500-server-error", + "call.in-progress.error-providerfault-google-503-server-overloaded-error", + "pipeline-error-xai-400-bad-request-validation-failed", + "pipeline-error-xai-401-unauthorized", + "pipeline-error-xai-403-model-access-denied", + "pipeline-error-xai-429-exceeded-quota", + "pipeline-error-xai-500-server-error", + "pipeline-error-xai-503-server-overloaded-error", + "pipeline-error-xai-llm-failed", + "call.in-progress.error-vapifault-xai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-xai-401-unauthorized", + "call.in-progress.error-vapifault-xai-403-model-access-denied", + "call.in-progress.error-vapifault-xai-429-exceeded-quota", + "call.in-progress.error-providerfault-xai-500-server-error", + "call.in-progress.error-providerfault-xai-503-server-overloaded-error", + "pipeline-error-baseten-400-bad-request-validation-failed", + "pipeline-error-baseten-401-unauthorized", + "pipeline-error-baseten-403-model-access-denied", + "pipeline-error-baseten-429-exceeded-quota", + "pipeline-error-baseten-500-server-error", + "pipeline-error-baseten-503-server-overloaded-error", + "pipeline-error-baseten-llm-failed", + "call.in-progress.error-vapifault-baseten-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-baseten-401-unauthorized", + "call.in-progress.error-vapifault-baseten-403-model-access-denied", + "call.in-progress.error-vapifault-baseten-429-exceeded-quota", + "call.in-progress.error-providerfault-baseten-500-server-error", + "call.in-progress.error-providerfault-baseten-503-server-overloaded-error", + "pipeline-error-mistral-400-bad-request-validation-failed", + "pipeline-error-mistral-401-unauthorized", + "pipeline-error-mistral-403-model-access-denied", + "pipeline-error-mistral-429-exceeded-quota", + "pipeline-error-mistral-500-server-error", + "pipeline-error-mistral-503-server-overloaded-error", + "pipeline-error-mistral-llm-failed", + "call.in-progress.error-vapifault-mistral-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-mistral-401-unauthorized", + "call.in-progress.error-vapifault-mistral-403-model-access-denied", + "call.in-progress.error-vapifault-mistral-429-exceeded-quota", + "call.in-progress.error-providerfault-mistral-500-server-error", + "call.in-progress.error-providerfault-mistral-503-server-overloaded-error", + "pipeline-error-inflection-ai-400-bad-request-validation-failed", + "pipeline-error-inflection-ai-401-unauthorized", + "pipeline-error-inflection-ai-403-model-access-denied", + "pipeline-error-inflection-ai-429-exceeded-quota", + "pipeline-error-inflection-ai-500-server-error", + "pipeline-error-inflection-ai-503-server-overloaded-error", + "pipeline-error-inflection-ai-llm-failed", + "call.in-progress.error-vapifault-inflection-ai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-inflection-ai-401-unauthorized", + "call.in-progress.error-vapifault-inflection-ai-403-model-access-denied", + "call.in-progress.error-vapifault-inflection-ai-429-exceeded-quota", + "call.in-progress.error-providerfault-inflection-ai-500-server-error", + "call.in-progress.error-providerfault-inflection-ai-503-server-overloaded-error", + "pipeline-error-deep-seek-400-bad-request-validation-failed", + "pipeline-error-deep-seek-401-unauthorized", + "pipeline-error-deep-seek-403-model-access-denied", + "pipeline-error-deep-seek-429-exceeded-quota", + "pipeline-error-deep-seek-500-server-error", + "pipeline-error-deep-seek-503-server-overloaded-error", + "pipeline-error-deep-seek-llm-failed", + "call.in-progress.error-vapifault-deep-seek-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-deep-seek-401-unauthorized", + "call.in-progress.error-vapifault-deep-seek-403-model-access-denied", + "call.in-progress.error-vapifault-deep-seek-429-exceeded-quota", + "call.in-progress.error-providerfault-deep-seek-500-server-error", + "call.in-progress.error-providerfault-deep-seek-503-server-overloaded-error", + "pipeline-error-groq-400-bad-request-validation-failed", + "pipeline-error-groq-401-unauthorized", + "pipeline-error-groq-403-model-access-denied", + "pipeline-error-groq-429-exceeded-quota", + "pipeline-error-groq-500-server-error", + "pipeline-error-groq-503-server-overloaded-error", + "pipeline-error-groq-llm-failed", + "call.in-progress.error-vapifault-groq-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-groq-401-unauthorized", + "call.in-progress.error-vapifault-groq-403-model-access-denied", + "call.in-progress.error-vapifault-groq-429-exceeded-quota", + "call.in-progress.error-providerfault-groq-500-server-error", + "call.in-progress.error-providerfault-groq-503-server-overloaded-error", + "pipeline-error-cerebras-400-bad-request-validation-failed", + "pipeline-error-cerebras-401-unauthorized", + "pipeline-error-cerebras-403-model-access-denied", + "pipeline-error-cerebras-429-exceeded-quota", + "pipeline-error-cerebras-500-server-error", + "pipeline-error-cerebras-503-server-overloaded-error", + "pipeline-error-cerebras-llm-failed", + "call.in-progress.error-vapifault-cerebras-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-cerebras-401-unauthorized", + "call.in-progress.error-vapifault-cerebras-403-model-access-denied", + "call.in-progress.error-vapifault-cerebras-429-exceeded-quota", + "call.in-progress.error-providerfault-cerebras-500-server-error", + "call.in-progress.error-providerfault-cerebras-503-server-overloaded-error", + "pipeline-error-anthropic-400-bad-request-validation-failed", + "pipeline-error-anthropic-401-unauthorized", + "pipeline-error-anthropic-403-model-access-denied", + "pipeline-error-anthropic-429-exceeded-quota", + "pipeline-error-anthropic-500-server-error", + "pipeline-error-anthropic-503-server-overloaded-error", + "pipeline-error-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", + "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-anthropic-401-unauthorized", + "call.in-progress.error-vapifault-anthropic-403-model-access-denied", + "call.in-progress.error-vapifault-anthropic-429-exceeded-quota", + "call.in-progress.error-providerfault-anthropic-500-server-error", + "call.in-progress.error-providerfault-anthropic-503-server-overloaded-error", + "pipeline-error-anthropic-bedrock-400-bad-request-validation-failed", + "pipeline-error-anthropic-bedrock-401-unauthorized", + "pipeline-error-anthropic-bedrock-403-model-access-denied", + "pipeline-error-anthropic-bedrock-429-exceeded-quota", + "pipeline-error-anthropic-bedrock-500-server-error", + "pipeline-error-anthropic-bedrock-503-server-overloaded-error", + "pipeline-error-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", + "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", + "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", + "call.in-progress.error-vapifault-anthropic-bedrock-429-exceeded-quota", + "call.in-progress.error-providerfault-anthropic-bedrock-500-server-error", + "call.in-progress.error-providerfault-anthropic-bedrock-503-server-overloaded-error", + "pipeline-error-anthropic-vertex-400-bad-request-validation-failed", + "pipeline-error-anthropic-vertex-401-unauthorized", + "pipeline-error-anthropic-vertex-403-model-access-denied", + "pipeline-error-anthropic-vertex-429-exceeded-quota", + "pipeline-error-anthropic-vertex-500-server-error", + "pipeline-error-anthropic-vertex-503-server-overloaded-error", + "pipeline-error-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", + "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", + "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", + "call.in-progress.error-vapifault-anthropic-vertex-429-exceeded-quota", + "call.in-progress.error-providerfault-anthropic-vertex-500-server-error", + "call.in-progress.error-providerfault-anthropic-vertex-503-server-overloaded-error", + "pipeline-error-together-ai-400-bad-request-validation-failed", + "pipeline-error-together-ai-401-unauthorized", + "pipeline-error-together-ai-403-model-access-denied", + "pipeline-error-together-ai-429-exceeded-quota", + "pipeline-error-together-ai-500-server-error", + "pipeline-error-together-ai-503-server-overloaded-error", + "pipeline-error-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", + "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-together-ai-401-unauthorized", + "call.in-progress.error-vapifault-together-ai-403-model-access-denied", + "call.in-progress.error-vapifault-together-ai-429-exceeded-quota", + "call.in-progress.error-providerfault-together-ai-500-server-error", + "call.in-progress.error-providerfault-together-ai-503-server-overloaded-error", + "pipeline-error-anyscale-400-bad-request-validation-failed", + "pipeline-error-anyscale-401-unauthorized", + "pipeline-error-anyscale-403-model-access-denied", + "pipeline-error-anyscale-429-exceeded-quota", + "pipeline-error-anyscale-500-server-error", + "pipeline-error-anyscale-503-server-overloaded-error", + "pipeline-error-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", + "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-anyscale-401-unauthorized", + "call.in-progress.error-vapifault-anyscale-403-model-access-denied", + "call.in-progress.error-vapifault-anyscale-429-exceeded-quota", + "call.in-progress.error-providerfault-anyscale-500-server-error", + "call.in-progress.error-providerfault-anyscale-503-server-overloaded-error", + "pipeline-error-openrouter-400-bad-request-validation-failed", + "pipeline-error-openrouter-401-unauthorized", + "pipeline-error-openrouter-403-model-access-denied", + "pipeline-error-openrouter-429-exceeded-quota", + "pipeline-error-openrouter-500-server-error", + "pipeline-error-openrouter-503-server-overloaded-error", + "pipeline-error-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", + "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-openrouter-401-unauthorized", + "call.in-progress.error-vapifault-openrouter-403-model-access-denied", + "call.in-progress.error-vapifault-openrouter-429-exceeded-quota", + "call.in-progress.error-providerfault-openrouter-500-server-error", + "call.in-progress.error-providerfault-openrouter-503-server-overloaded-error", + "pipeline-error-perplexity-ai-400-bad-request-validation-failed", + "pipeline-error-perplexity-ai-401-unauthorized", + "pipeline-error-perplexity-ai-403-model-access-denied", + "pipeline-error-perplexity-ai-429-exceeded-quota", + "pipeline-error-perplexity-ai-500-server-error", + "pipeline-error-perplexity-ai-503-server-overloaded-error", + "pipeline-error-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", + "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", + "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", + "call.in-progress.error-vapifault-perplexity-ai-429-exceeded-quota", + "call.in-progress.error-providerfault-perplexity-ai-500-server-error", + "call.in-progress.error-providerfault-perplexity-ai-503-server-overloaded-error", + "pipeline-error-deepinfra-400-bad-request-validation-failed", + "pipeline-error-deepinfra-401-unauthorized", + "pipeline-error-deepinfra-403-model-access-denied", + "pipeline-error-deepinfra-429-exceeded-quota", + "pipeline-error-deepinfra-500-server-error", + "pipeline-error-deepinfra-503-server-overloaded-error", + "pipeline-error-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", + "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-deepinfra-401-unauthorized", + "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", + "call.in-progress.error-vapifault-deepinfra-429-exceeded-quota", + "call.in-progress.error-providerfault-deepinfra-500-server-error", + "call.in-progress.error-providerfault-deepinfra-503-server-overloaded-error", + "pipeline-error-runpod-400-bad-request-validation-failed", + "pipeline-error-runpod-401-unauthorized", + "pipeline-error-runpod-403-model-access-denied", + "pipeline-error-runpod-429-exceeded-quota", + "pipeline-error-runpod-500-server-error", + "pipeline-error-runpod-503-server-overloaded-error", + "pipeline-error-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", + "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-runpod-401-unauthorized", + "call.in-progress.error-vapifault-runpod-403-model-access-denied", + "call.in-progress.error-vapifault-runpod-429-exceeded-quota", + "call.in-progress.error-providerfault-runpod-500-server-error", + "call.in-progress.error-providerfault-runpod-503-server-overloaded-error", + "pipeline-error-custom-llm-400-bad-request-validation-failed", + "pipeline-error-custom-llm-401-unauthorized", + "pipeline-error-custom-llm-403-model-access-denied", + "pipeline-error-custom-llm-429-exceeded-quota", + "pipeline-error-custom-llm-500-server-error", + "pipeline-error-custom-llm-503-server-overloaded-error", + "pipeline-error-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", + "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-custom-llm-401-unauthorized", + "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", + "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota", + "call.in-progress.error-providerfault-custom-llm-500-server-error", + "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error", + "call.in-progress.error-pipeline-ws-model-connection-failed", + "pipeline-error-custom-voice-failed", + "pipeline-error-cartesia-socket-hang-up", + "pipeline-error-cartesia-requested-payment", + "pipeline-error-cartesia-500-server-error", + "pipeline-error-cartesia-502-server-error", + "pipeline-error-cartesia-503-server-error", + "pipeline-error-cartesia-522-server-error", + "call.in-progress.error-vapifault-cartesia-socket-hang-up", + "call.in-progress.error-vapifault-cartesia-requested-payment", + "call.in-progress.error-providerfault-cartesia-500-server-error", + "call.in-progress.error-providerfault-cartesia-503-server-error", + "call.in-progress.error-providerfault-cartesia-522-server-error", + "pipeline-error-eleven-labs-voice-not-found", + "pipeline-error-eleven-labs-quota-exceeded", + "pipeline-error-eleven-labs-unauthorized-access", + "pipeline-error-eleven-labs-unauthorized-to-access-model", + "pipeline-error-eleven-labs-professional-voices-only-for-creator-plus", + "pipeline-error-eleven-labs-blocked-free-plan-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", + "pipeline-error-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", + "pipeline-error-eleven-labs-system-busy-and-requested-upgrade", + "pipeline-error-eleven-labs-voice-not-fine-tuned", + "pipeline-error-eleven-labs-invalid-api-key", + "pipeline-error-eleven-labs-invalid-voice-samples", + "pipeline-error-eleven-labs-voice-disabled-by-owner", + "pipeline-error-eleven-labs-vapi-voice-disabled-by-owner", + "pipeline-error-eleven-labs-blocked-account-in-probation", + "pipeline-error-eleven-labs-blocked-content-against-their-policy", "pipeline-error-eleven-labs-missing-samples-for-voice-clone", "pipeline-error-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", "pipeline-error-eleven-labs-voice-not-allowed-for-free-users", @@ -27400,6 +34088,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out", @@ -27449,12 +34138,20 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "pipeline-error-soniox-transcriber-auth-failed", + "pipeline-error-soniox-transcriber-rate-limited", + "pipeline-error-soniox-transcriber-invalid-config", + "pipeline-error-soniox-transcriber-server-error", + "pipeline-error-soniox-transcriber-failed", + "call.in-progress.error-vapifault-soniox-transcriber-auth-failed", + "call.in-progress.error-vapifault-soniox-transcriber-rate-limited", + "call.in-progress.error-vapifault-soniox-transcriber-invalid-config", + "call.in-progress.error-vapifault-soniox-transcriber-server-error", + "call.in-progress.error-vapifault-soniox-transcriber-failed", "call.in-progress.error-warm-transfer-max-duration", "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -27465,7 +34162,9 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-before-warm-transfer", "customer-ended-call-after-warm-transfer-attempt", + "customer-ended-call-during-transfer", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -27488,420 +34187,2726 @@ "twilio-failed-to-connect-call", "twilio-reported-customer-misdialed", "vonage-rejected", - "voicemail" + "voicemail", + "call-deleted" + ] + }, + "endedMessage": { + "type": "string", + "description": "This is the message that adds more context to the ended reason. It can be used to provide potential error messages or warnings." + }, + "destination": { + "description": "This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the call." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this call belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was last updated." + }, + "startedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was started." + }, + "endedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was ended." + }, + "cost": { + "type": "number", + "description": "This is the cost of the call in USD." + }, + "costBreakdown": { + "description": "This is the cost of the call in USD.", + "allOf": [ + { + "$ref": "#/components/schemas/CostBreakdown" + } + ] + }, + "artifactPlan": { + "description": "This is a copy of assistant artifact plan. This isn't actually stored on the call but rather just returned in POST /call/web to enable artifact creation client side.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] + }, + "analysis": { + "description": "This is the analysis of the call. Configure in `assistant.analysisPlan`.", + "allOf": [ + { + "$ref": "#/components/schemas/Analysis" + } + ] + }, + "monitor": { + "description": "This is to real-time monitor the call. Configure in `assistant.monitorPlan`.", + "allOf": [ + { + "$ref": "#/components/schemas/Monitor" + } + ] + }, + "artifact": { + "description": "These are the artifacts created from the call. Configure in `assistant.artifactPlan`.", + "allOf": [ + { + "$ref": "#/components/schemas/Artifact" + } + ] + }, + "compliance": { + "description": "This is the compliance of the call. Configure in `assistant.compliancePlan`.", + "allOf": [ + { + "$ref": "#/components/schemas/Compliance" + } + ] + }, + "phoneCallProviderId": { + "type": "string", + "description": "The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. callControlId in Telnyx.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "deprecated": true + }, + "campaignId": { + "type": "string", + "description": "This is the campaign ID that the call belongs to." + }, + "assistantId": { + "type": "string", + "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + }, + "assistant": { + "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "squad": { + "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "squadOverrides": { + "description": "These are the overrides for the `squad` or `squadId`'s member settings and template variables.\nThis will apply to all members of the squad.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "workflow": { + "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWorkflowDTO" + } + ] + }, + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] + }, + "phoneNumberId": { + "type": "string", + "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "phoneNumber": { + "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + } + ] + }, + "customerId": { + "type": "string", + "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "customer": { + "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of the call. This is just for your own reference.", + "maxLength": 40 + }, + "schedulePlan": { + "description": "This is the schedule plan of the call.", + "allOf": [ + { + "$ref": "#/components/schemas/SchedulePlan" + } + ] + }, + "transport": { + "type": "object", + "description": "This is the transport of the call." + } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "CallBatchError": { + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/CreateCustomerDTO" + }, + "error": { + "type": "string" + } + }, + "required": [ + "customer", + "error" + ] + }, + "CallBatchResponse": { + "type": "object", + "properties": { + "subscriptionLimits": { + "description": "Subscription limits at the end of this batch", + "allOf": [ + { + "$ref": "#/components/schemas/SubscriptionLimits" + } + ] + }, + "results": { + "description": "This is the list of calls that were created.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Call" + } + }, + "errors": { + "description": "This is the list of calls that failed to be created.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CallBatchError" + } + } + }, + "required": [ + "results", + "errors" + ] + }, + "CreateCallDTO": { + "type": "object", + "properties": { + "customers": { + "description": "This is used to issue batch calls to multiple customers.\n\nOnly relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + }, + "name": { + "type": "string", + "description": "This is the name of the call. This is just for your own reference.", + "maxLength": 40 + }, + "schedulePlan": { + "description": "This is the schedule plan of the call.", + "allOf": [ + { + "$ref": "#/components/schemas/SchedulePlan" + } + ] + }, + "transport": { + "type": "object", + "description": "This is the transport of the call." + }, + "assistantId": { + "type": "string", + "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + }, + "assistant": { + "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "squad": { + "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "squadOverrides": { + "description": "These are the overrides for the `squad` or `squadId`'s member settings and template variables.\nThis will apply to all members of the squad.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "workflow": { + "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWorkflowDTO" + } + ] + }, + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] + }, + "phoneNumberId": { + "type": "string", + "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "phoneNumber": { + "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + } + ] + }, + "customerId": { + "type": "string", + "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "customer": { + "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + } + } + }, + "StructuredOutputFilterDTO": { + "type": "object", + "properties": { + "eq": { + "type": "string", + "description": "Equal to" + }, + "neq": { + "type": "string", + "description": "Not equal to" + }, + "gt": { + "type": "string", + "description": "Greater than" + }, + "gte": { + "type": "string", + "description": "Greater than or equal to" + }, + "lt": { + "type": "string", + "description": "Less than" + }, + "lte": { + "type": "string", + "description": "Less than or equal to" + }, + "contains": { + "type": "string", + "description": "Contains" + }, + "notContains": { + "type": "string", + "description": "Not contains" + } + } + }, + "CallPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Call" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateOutboundCallDTO": { + "type": "object", + "properties": { + "customers": { + "description": "This is used to issue batch calls to multiple customers.\n\nOnly relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + }, + "name": { + "type": "string", + "description": "This is the name of the call. This is just for your own reference.", + "maxLength": 40 + }, + "schedulePlan": { + "description": "This is the schedule plan of the call.", + "allOf": [ + { + "$ref": "#/components/schemas/SchedulePlan" + } + ] + }, + "transport": { + "type": "object", + "description": "This is the transport of the call." + }, + "assistantId": { + "type": "string", + "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + }, + "assistant": { + "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "squad": { + "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "squadOverrides": { + "description": "These are the overrides for the `squad` or `squadId`'s member settings and template variables.\nThis will apply to all members of the squad.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "workflow": { + "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWorkflowDTO" + } + ] + }, + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] + }, + "phoneNumberId": { + "type": "string", + "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "phoneNumber": { + "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + } + ] + }, + "customerId": { + "type": "string", + "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + }, + "customer": { + "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + } + } + }, + "CreateWebCallDTO": { + "type": "object", + "properties": { + "roomDeleteOnUserLeaveEnabled": { + "type": "boolean", + "default": true + }, + "assistantId": { + "type": "string", + "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + }, + "assistant": { + "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "squad": { + "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "squadOverrides": { + "description": "These are the overrides for the `squad` or `squadId`'s member settings and template variables.\nThis will apply to all members of the squad.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + }, + "workflow": { + "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWorkflowDTO" + } + ] + }, + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] + } + } + }, + "UpdateCallDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the call. This is just for your own reference.", + "maxLength": 40 + } + } + }, + "DeleteCallDTO": { + "type": "object", + "properties": { + "ids": { + "description": "These are the Call IDs to be bulk deleted.\nIf provided, the call ID if any in the request query will be ignored\nWhen requesting a bulk delete, updates when a call is deleted will be sent as a webhook to the server URL configured in the Org settings.\nIt may take up to a few hours to complete the bulk delete, and will be asynchronous.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "DeveloperMessage": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "This is the role of the message author", + "default": "developer", + "enum": [ + "developer" + ] + }, + "content": { + "type": "string", + "description": "This is the content of the developer message", + "maxLength": 10000 + }, + "name": { + "type": "string", + "description": "This is an optional name for the participant", + "maxLength": 40 + }, + "metadata": { + "type": "object", + "description": "This is an optional metadata for the message" + } + }, + "required": [ + "role", + "content" + ] + }, + "SystemMessage": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "The role of the system in the conversation." + }, + "message": { + "type": "string", + "description": "The message content from the system." + }, + "time": { + "type": "number", + "description": "The timestamp when the message was sent." + }, + "secondsFromStart": { + "type": "number", + "description": "The number of seconds from the start of the conversation." + } + }, + "required": [ + "role", + "message", + "time", + "secondsFromStart" + ] + }, + "UserMessage": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "The role of the user in the conversation." + }, + "message": { + "type": "string", + "description": "The message content from the user." + }, + "time": { + "type": "number", + "description": "The timestamp when the message was sent." + }, + "endTime": { + "type": "number", + "description": "The timestamp when the message ended." + }, + "secondsFromStart": { + "type": "number", + "description": "The number of seconds from the start of the conversation." + }, + "duration": { + "type": "number", + "description": "The duration of the message in seconds." + }, + "isFiltered": { + "type": "boolean", + "description": "Indicates if the message was filtered for security reasons." + }, + "detectedThreats": { + "description": "List of detected security threats if the message was filtered.", + "type": "array", + "items": { + "type": "string" + } + }, + "originalMessage": { + "type": "string", + "description": "The original message before filtering (only included if content was filtered)." + }, + "metadata": { + "type": "object", + "description": "The metadata associated with the message. Currently used to store the transcriber's word level confidence." + }, + "speakerLabel": { + "type": "string", + "description": "Stable speaker label for diarized user speakers (e.g., \"Speaker 1\")." + } + }, + "required": [ + "role", + "message", + "time", + "endTime", + "secondsFromStart" + ] + }, + "ToolCallFunction": { + "type": "object", + "properties": { + "arguments": { + "type": "string", + "description": "This is the arguments to call the function with" + }, + "name": { + "type": "string", + "description": "This is the name of the function to call", + "maxLength": 80 + } + }, + "required": [ + "arguments", + "name" + ] + }, + "ToolCall": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "This is the ID of the tool call" + }, + "type": { + "type": "string", + "description": "This is the type of tool" + }, + "function": { + "description": "This is the function that was called", + "allOf": [ + { + "$ref": "#/components/schemas/ToolCallFunction" + } + ] + } + }, + "required": [ + "id", + "type", + "function" + ] + }, + "AssistantMessage": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "This is the role of the message author", + "default": "assistant", + "enum": [ + "assistant" + ] + }, + "content": { + "type": "string", + "description": "This is the content of the assistant message", + "maxLength": 10000 + }, + "refusal": { + "type": "string", + "description": "This is the refusal message generated by the model", + "maxLength": 10000 + }, + "tool_calls": { + "description": "This is the tool calls generated by the model", + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolCall" + } + }, + "name": { + "type": "string", + "description": "This is an optional name for the participant", + "maxLength": 40 + }, + "metadata": { + "type": "object", + "description": "This is an optional metadata for the message" + } + }, + "required": [ + "role" + ] + }, + "ToolMessage": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "This is the role of the message author", + "default": "tool", + "enum": [ + "tool" + ] + }, + "content": { + "type": "string", + "description": "This is the content of the tool message", + "maxLength": 10000 + }, + "tool_call_id": { + "type": "string", + "description": "This is the ID of the tool call this message is responding to" + }, + "name": { + "type": "string", + "description": "This is an optional name for the participant", + "maxLength": 40 + }, + "metadata": { + "type": "object", + "description": "This is an optional metadata for the message" + } + }, + "required": [ + "role", + "content", + "tool_call_id" + ] + }, + "FunctionCall": { + "type": "object", + "properties": { + "arguments": { + "type": "string", + "description": "This is the arguments to call the function with" + }, + "name": { + "type": "string", + "description": "This is the name of the function to call", + "maxLength": 40 + } + }, + "required": [ + "arguments", + "name" + ] + }, + "Chat": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." + }, + "assistant": { + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the chat. To use a transient squad, use `squad` instead." + }, + "squad": { + "description": "This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of the chat. This is just for your own reference.", + "maxLength": 40 + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." + }, + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Hello, how can you help me?", + [ + { + "role": "user", + "content": "Hello, how can you help me?" + } + ] + ] + }, + "stream": { + "type": "boolean", + "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", + "default": false + }, + "previousChatId": { + "type": "string", + "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the chat." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this chat belongs to." + }, + "messages": { + "type": "array", + "description": "This is an array of messages used as context for the chat.\nUsed to provide message history for multi-turn conversations.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } + }, + "output": { + "type": "array", + "description": "This is the output messages generated by the system in response to the input.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the chat was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the chat was last updated." + }, + "costs": { + "type": "array", + "description": "These are the costs of individual components of the chat in USD.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCost", + "title": "ModelCost" + }, + { + "$ref": "#/components/schemas/ChatCost", + "title": "ChatCost" + } + ] + } + }, + "cost": { + "type": "number", + "description": "This is the cost of the chat in USD." + } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "TwilioSMSChatTransport": { + "type": "object", + "properties": { + "conversationType": { + "type": "string", + "description": "This is the conversation type of the call (ie, voice or chat).", + "default": "chat", + "enum": [ + "chat" + ] + }, + "phoneNumberId": { + "type": "string", + "description": "This is the phone number that will be used to send the SMS.\nIf provided, will create a new session. If not provided, uses existing session's phoneNumberId.\nThe phone number must have SMS enabled and belong to your organization." + }, + "customer": { + "description": "This is the customer who will receive the SMS.\nIf provided, will create a new session. If not provided, uses existing session's customer.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "customerId": { + "type": "string", + "description": "This is the customerId of the customer who will receive the SMS." + }, + "useLLMGeneratedMessageForOutbound": { + "type": "boolean", + "description": "Whether to use LLM-generated messages for outbound SMS.\nWhen true (default), input is processed by the assistant for a response.\nWhen false, the input text is forwarded directly as the SMS message without LLM processing.\nUseful for sending pre-defined messages or notifications.", + "default": true + }, + "type": { + "type": "string", + "description": "The type of transport to use for sending the chat response.\nCurrently supports 'twilio.sms' for SMS delivery via Twilio.", + "enum": [ + "twilio.sms" + ] + } + }, + "required": [ + "type" + ] + }, + "CreateChatDTO": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." + }, + "assistant": { + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the chat. To use a transient squad, use `squad` instead." + }, + "squad": { + "description": "This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of the chat. This is just for your own reference.", + "maxLength": 40 + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." + }, + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.\nThis field is REQUIRED for chat creation.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Hello, how can you help me?", + [ + { + "role": "user", + "content": "Hello, how can you help me?" + } + ] + ] + }, + "stream": { + "type": "boolean", + "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", + "default": false + }, + "previousChatId": { + "type": "string", + "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." + }, + "transport": { + "description": "This is used to send the chat through a transport like SMS.\nIf transport.phoneNumberId and transport.customer are provided, creates a new session.\nIf sessionId is provided without transport fields, uses existing session data.\nCannot specify both sessionId and transport fields (phoneNumberId/customer) together.", + "allOf": [ + { + "$ref": "#/components/schemas/TwilioSMSChatTransport" + } + ] + } + }, + "required": [ + "input" + ] + }, + "GetChatPaginatedDTO": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "This is the unique identifier for the chat to filter by." + }, + "assistantId": { + "type": "string", + "description": "This is the unique identifier for the assistant that will be used for the chat." + }, + "assistantIdAny": { + "type": "string", + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "example": "assistant-1,assistant-2,assistant-3" + }, + "squadId": { + "type": "string", + "description": "This is the unique identifier for the squad that will be used for the chat." + }, + "sessionId": { + "type": "string", + "description": "This is the unique identifier for the session that will be used for the chat." + }, + "previousChatId": { + "type": "string", + "description": "This is the unique identifier for the previous chat to filter by." + }, + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 + }, + "sortOrder": { + "type": "string", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "enum": [ + "ASC", + "DESC" + ] + }, + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 + }, + "createdAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than the specified value." + }, + "createdAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than the specified value." + }, + "createdAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than or equal to the specified value." + }, + "createdAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than or equal to the specified value." + }, + "updatedAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than the specified value." + }, + "updatedAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than the specified value." + }, + "updatedAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than or equal to the specified value." + }, + "updatedAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than or equal to the specified value." + } + } + }, + "ChatPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Chat" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateChatStreamResponse": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "This is the unique identifier for the streaming response." + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nHelps track conversation context across multiple messages." + }, + "path": { + "type": "string", + "description": "This is the path to the content being updated.\nFormat: `chat.output[{contentIndex}].content` where contentIndex identifies the specific content item.", + "example": "chat.output[0].content" + }, + "delta": { + "type": "string", + "description": "This is the incremental content chunk being streamed." + } + }, + "required": [ + "id", + "path", + "delta" + ] + }, + "OpenAIResponsesRequest": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." + }, + "assistant": { + "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for the chat. To use a transient squad, use `squad` instead." + }, + "squad": { + "description": "This is the squad that will be used for the chat. To use an existing squad, use `squadId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of the chat. This is just for your own reference.", + "maxLength": 40 + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." + }, + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.\nThis field is REQUIRED for chat creation.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Hello, how can you help me?", + [ + { + "role": "user", + "content": "Hello, how can you help me?" + } + ] + ] + }, + "stream": { + "type": "boolean", + "description": "Whether to stream the response or not.", + "default": true + }, + "previousChatId": { + "type": "string", + "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." + }, + "transport": { + "description": "This is used to send the chat through a transport like SMS.\nIf transport.phoneNumberId and transport.customer are provided, creates a new session.\nIf sessionId is provided without transport fields, uses existing session data.\nCannot specify both sessionId and transport fields (phoneNumberId/customer) together.", + "allOf": [ + { + "$ref": "#/components/schemas/TwilioSMSChatTransport" + } + ] + } + }, + "required": [ + "input" + ] + }, + "ChatAssistantOverrides": { + "type": "object", + "properties": { + "variableValues": { + "type": "object", + "description": "Variable values for template substitution", + "example": { + "name": "John", + "company": "ACME Corp" + } + } + } + }, + "CreateWebCustomerDTO": { + "type": "object", + "properties": { + "numberE164CheckEnabled": { + "type": "boolean", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "default": true + }, + "extension": { + "type": "string", + "description": "This is the extension that will be dialed after the call is answered.", + "maxLength": 10, + "example": null + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/ChatAssistantOverrides" + } + ] + }, + "number": { + "type": "string", + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 + }, + "sipUri": { + "type": "string", + "description": "This is the SIP URI of the customer." + }, + "name": { + "type": "string", + "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", + "maxLength": 40 + }, + "email": { + "type": "string", + "description": "This is the email of the customer.", + "maxLength": 40 + }, + "externalId": { + "type": "string", + "description": "This is the external ID of the customer.", + "maxLength": 40 + } + } + }, + "CreateWebChatDTO": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "This is the assistant ID to use for this chat. To use a transient assistant, use `assistant` instead." + }, + "assistant": { + "description": "This is the transient assistant configuration for this chat. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." + }, + "sessionExpirationSeconds": { + "type": "number", + "description": "This is the expiration time for the session. This can ONLY be set if starting a new chat and therefore a new session is created.\nIf session already exists, this will be ignored and NOT be updated for the existing session. Use PATCH /session/:id to update the session expiration time.", + "minimum": 60, + "maximum": 2592000 + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/ChatAssistantOverrides" + } + ] + }, + "customer": { + "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWebCustomerDTO" + } + ] + }, + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "oneOf": [ + { + "type": "string", + "title": "String" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" + } + ], + "examples": [ + "Hello, how can you help me?", + [ + { + "role": "user", + "content": "Hello, how can you help me?" + } + ] + ] + }, + "stream": { + "type": "boolean", + "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", + "default": false + }, + "sessionEnd": { + "type": "boolean", + "description": "This is a flag to indicate end of session. When true, the session will be marked as completed and the chat will be ended.\nUsed to end session to send End-of-session report to the customer.\nWhen flag is set to true, any messages sent will not be processed and session will directly be marked as completed.", + "default": false + } + }, + "required": [ + "input" + ] + }, + "WebChat": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "This is the unique identifier for the chat." + }, + "sessionId": { + "type": "string", + "description": "This is the ID of the session for the chat. Send it in the next chat request to continue the conversation." + }, + "output": { + "type": "array", + "description": "This is the output messages generated by the system in response to the input.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } + } + }, + "required": [ + "id", + "output" + ] + }, + "OpenAIWebChatRequest": { + "type": "object", + "properties": { + "assistantId": { + "type": "string", + "description": "This is the assistant ID to use for this chat. To use a transient assistant, use `assistant` instead." + }, + "assistant": { + "description": "This is the transient assistant configuration for this chat. To use an existing assistant, use `assistantId` instead.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } ] }, - "destination": { - "description": "This is the destination where the call ended up being transferred to. If the call was not transferred, this will be empty.", + "sessionId": { + "type": "string", + "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." + }, + "sessionExpirationSeconds": { + "type": "number", + "description": "This is the expiration time for the session. This can ONLY be set if starting a new chat and therefore a new session is created.\nIf session already exists, this will be ignored and NOT be updated for the existing session. Use PATCH /session/:id to update the session expiration time.", + "minimum": 60, + "maximum": 2592000 + }, + "assistantOverrides": { + "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", + "allOf": [ + { + "$ref": "#/components/schemas/ChatAssistantOverrides" + } + ] + }, + "customer": { + "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateWebCustomerDTO" + } + ] + }, + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", "oneOf": [ { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" + "type": "string", + "title": "String" }, { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + }, + "title": "MessageArray" } + ], + "examples": [ + "Hello, how can you help me?", + [ + { + "role": "user", + "content": "Hello, how can you help me?" + } + ] ] }, + "stream": { + "type": "boolean", + "description": "Whether to stream the response or not.", + "default": true + }, + "sessionEnd": { + "type": "boolean", + "description": "This is a flag to indicate end of session. When true, the session will be marked as completed and the chat will be ended.\nUsed to end session to send End-of-session report to the customer.\nWhen flag is set to true, any messages sent will not be processed and session will directly be marked as completed.", + "default": false + } + }, + "required": [ + "input" + ] + }, + "ExportChatDTO": { + "type": "object", + "properties": { "id": { "type": "string", - "description": "This is the unique identifier for the call." + "description": "This is the unique identifier for the chat to filter by." }, - "orgId": { + "assistantId": { + "type": "string", + "description": "This is the unique identifier for the assistant that will be used for the chat." + }, + "assistantIdAny": { + "type": "string", + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "example": "assistant-1,assistant-2,assistant-3" + }, + "squadId": { + "type": "string", + "description": "This is the unique identifier for the squad that will be used for the chat." + }, + "sessionId": { + "type": "string", + "description": "This is the unique identifier for the session that will be used for the chat." + }, + "previousChatId": { + "type": "string", + "description": "This is the unique identifier for the previous chat to filter by." + }, + "columns": { + "type": "string", + "description": "Columns to include in the CSV export", + "enum": [ + "id", + "assistantId", + "squadId", + "sessionId", + "previousChatId", + "cost", + "messages", + "output", + "createdAt", + "updatedAt" + ], + "default": [ + "id", + "assistantId", + "squadId", + "sessionId", + "previousChatId", + "cost", + "messages", + "output", + "createdAt", + "updatedAt" + ] + }, + "email": { + "type": "string", + "description": "This is the email address to send the export to.\nRequired if userId is not available in the request context." + }, + "format": { + "type": "string", + "description": "This is the format of the export.\n\n@default csv", + "enum": [ + "csv", + "json" + ], + "default": "csv" + }, + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 + }, + "sortOrder": { + "type": "string", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "enum": [ + "ASC", + "DESC" + ] + }, + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 + }, + "createdAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than the specified value." + }, + "createdAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than the specified value." + }, + "createdAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than or equal to the specified value." + }, + "createdAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than or equal to the specified value." + }, + "updatedAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than the specified value." + }, + "updatedAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than the specified value." + }, + "updatedAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than or equal to the specified value." + }, + "updatedAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than or equal to the specified value." + } + } + }, + "ResponseOutputText": { + "type": "object", + "properties": { + "annotations": { + "default": [], + "description": "Annotations in the text output", + "type": "array", + "items": { + "type": "object" + } + }, + "text": { + "type": "string", + "description": "The text output from the model" + }, + "type": { + "type": "string", + "default": "output_text", + "description": "The type of the output text", + "enum": [ + "output_text" + ] + } + }, + "required": [ + "annotations", + "text", + "type" + ] + }, + "ResponseOutputMessage": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the output message" + }, + "content": { + "description": "Content of the output message", + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseOutputText" + } + }, + "role": { + "type": "string", + "default": "assistant", + "description": "The role of the output message", + "enum": [ + "assistant" + ] + }, + "status": { + "type": "string", + "description": "The status of the message", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] + }, + "type": { + "type": "string", + "default": "message", + "description": "The type of the output message", + "enum": [ + "message" + ] + } + }, + "required": [ + "id", + "content", + "role", + "status", + "type" + ] + }, + "ResponseObject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this Response" + }, + "object": { + "type": "string", + "default": "response", + "description": "The object type", + "enum": [ + "response" + ] + }, + "created_at": { + "type": "number", + "description": "Unix timestamp (in seconds) of when this Response was created" + }, + "status": { + "type": "string", + "description": "Status of the response", + "enum": [ + "completed", + "failed", + "in_progress", + "incomplete" + ] + }, + "error": { + "type": "string", + "nullable": true, + "default": null, + "description": "Error message if the response failed" + }, + "output": { + "description": "Output messages from the model", + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseOutputMessage" + } + } + }, + "required": [ + "id", + "object", + "created_at", + "status", + "output" + ] + }, + "ResponseTextDeltaEvent": { + "type": "object", + "properties": { + "content_index": { + "type": "number", + "description": "Index of the content part" + }, + "delta": { + "type": "string", + "description": "Text delta being added" + }, + "item_id": { + "type": "string", + "description": "ID of the output item" + }, + "output_index": { + "type": "number", + "description": "Index of the output item" + }, + "type": { + "type": "string", + "default": "response.output_text.delta", + "description": "Event type", + "enum": [ + "response.output_text.delta" + ] + } + }, + "required": [ + "content_index", + "delta", + "item_id", + "output_index", + "type" + ] + }, + "ResponseTextDoneEvent": { + "type": "object", + "properties": { + "content_index": { + "type": "number", + "description": "Index of the content part" + }, + "item_id": { + "type": "string", + "description": "ID of the output item" + }, + "output_index": { + "type": "number", + "description": "Index of the output item" + }, + "text": { + "type": "string", + "description": "Complete text content" + }, + "type": { + "type": "string", + "default": "response.output_text.done", + "description": "Event type", + "enum": [ + "response.output_text.done" + ] + } + }, + "required": [ + "content_index", + "item_id", + "output_index", + "text", + "type" + ] + }, + "ResponseCompletedEvent": { + "type": "object", + "properties": { + "response": { + "description": "The completed response", + "allOf": [ + { + "$ref": "#/components/schemas/ResponseObject" + } + ] + }, + "type": { + "type": "string", + "default": "response.completed", + "description": "Event type", + "enum": [ + "response.completed" + ] + } + }, + "required": [ + "response", + "type" + ] + }, + "ResponseErrorEvent": { + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "error", + "description": "Event type", + "enum": [ + "error" + ] + }, + "code": { + "type": "string", + "description": "Error code", + "example": "ERR_SOMETHING" + }, + "message": { + "type": "string", + "description": "Error message", + "example": "Something went wrong" + }, + "param": { + "type": "string", + "nullable": true, + "description": "Parameter that caused the error" + }, + "sequence_number": { + "type": "number", + "description": "Sequence number of the event", + "example": 1 + } + }, + "required": [ + "type", + "code", + "message", + "sequence_number" + ] + }, + "DialPlanEntry": { + "type": "object", + "properties": { + "phoneNumberId": { + "type": "string", + "description": "The phone number ID to use for calling the customers in this entry." + }, + "customers": { + "description": "The list of customers to call using this phone number.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + } + }, + "required": [ + "phoneNumberId", + "customers" + ] + }, + "CreateCampaignDTO": { + "type": "object", + "properties": { + "name": { "type": "string", - "description": "This is the unique identifier for the org that this call belongs to." + "description": "This is the name of the campaign. This is just for your own reference.", + "example": "Q2 Sales Campaign" }, - "createdAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the call was created." + "description": "This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "updatedAt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the call was last updated." + "description": "This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "startedAt": { - "format": "date-time", + "squadId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the call was started." + "description": "This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "endedAt": { - "format": "date-time", + "phoneNumberId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the call was ended." + "description": "This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive." }, - "cost": { - "type": "number", - "description": "This is the cost of the call in USD." + "dialPlan": { + "description": "This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive.", + "type": "array", + "items": { + "$ref": "#/components/schemas/DialPlanEntry" + } }, - "costBreakdown": { - "description": "This is the cost of the call in USD.", + "schedulePlan": { + "description": "This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried.", "allOf": [ { - "$ref": "#/components/schemas/CostBreakdown" + "$ref": "#/components/schemas/SchedulePlan" } ] }, - "artifactPlan": { - "description": "This is a copy of assistant artifact plan. This isn't actually stored on the call but rather just returned in POST /call/web to enable artifact creation client side.", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactPlan" - } + "customers": { + "description": "These are the customers that will be called in the campaign. Required if dialPlan is not provided.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + } + }, + "required": [ + "name" + ] + }, + "Campaign": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "This is the status of the campaign.", + "enum": [ + "scheduled", + "in-progress", + "ended" ] }, - "analysis": { - "description": "This is the analysis of the call. Configure in `assistant.analysisPlan`.", - "allOf": [ - { - "$ref": "#/components/schemas/Analysis" - } + "endedReason": { + "type": "string", + "description": "This is the explanation for how the campaign ended.", + "enum": [ + "campaign.scheduled.ended-by-user", + "campaign.in-progress.ended-by-user", + "campaign.ended.success" ] }, - "monitor": { - "description": "This is to real-time monitor the call. Configure in `assistant.monitorPlan`.", - "allOf": [ - { - "$ref": "#/components/schemas/Monitor" - } - ] + "name": { + "type": "string", + "description": "This is the name of the campaign. This is just for your own reference.", + "example": "Q2 Sales Campaign" }, - "artifact": { - "description": "These are the artifacts created from the call. Configure in `assistant.artifactPlan`.", - "allOf": [ - { - "$ref": "#/components/schemas/Artifact" - } - ] + "assistantId": { + "type": "string", + "description": "This is the assistant ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "phoneCallProviderId": { + "workflowId": { "type": "string", - "description": "The ID of the call as provided by the phone number service. callSid in Twilio. conversationUuid in Vonage. callControlId in Telnyx.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "deprecated": true + "description": "This is the workflow ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "campaignId": { + "squadId": { "type": "string", - "description": "This is the campaign ID that the call belongs to." + "description": "This is the squad ID that will be used for the campaign calls. Note: Only one of assistantId, workflowId, or squadId can be used." }, - "assistantId": { + "phoneNumberId": { "type": "string", - "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + "description": "This is the phone number ID that will be used for the campaign calls. Required if dialPlan is not provided. Note: phoneNumberId and dialPlan are mutually exclusive." }, - "assistant": { - "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] + "dialPlan": { + "description": "This is a list of dial entries, each specifying a phone number and the customers to call using that number. Use this when you want different phone numbers to call different sets of customers. Note: phoneNumberId and dialPlan are mutually exclusive.", + "type": "array", + "items": { + "$ref": "#/components/schemas/DialPlanEntry" + } }, - "assistantOverrides": { - "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "schedulePlan": { + "description": "This is the schedule plan for the campaign. Calls will start at startedAt and continue until your organization’s concurrency limit is reached. Any remaining calls will be retried for up to one hour as capacity becomes available. After that hour or after latestAt, whichever comes first, any calls that couldn’t be placed won’t be retried.", "allOf": [ { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/SchedulePlan" } ] }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" - }, - "squad": { - "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", - "allOf": [ - { - "$ref": "#/components/schemas/CreateSquadDTO" - } - ] + "customers": { + "description": "These are the customers that will be called in the campaign. Required if dialPlan is not provided.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } }, - "workflowId": { + "id": { "type": "string", - "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "description": "This is the unique identifier for the campaign." }, - "workflow": { - "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", - "allOf": [ - { - "$ref": "#/components/schemas/CreateWorkflowDTO" - } - ] + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this campaign belongs to." }, - "workflowOverrides": { - "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", - "allOf": [ - { - "$ref": "#/components/schemas/WorkflowOverrides" - } - ] + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the campaign was created." }, - "phoneNumberId": { + "updatedAt": { + "format": "date-time", "type": "string", - "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + "description": "This is the ISO 8601 date-time string of when the campaign was last updated." }, - "phoneNumber": { - "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "allOf": [ - { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" - } - ] + "calls": { + "type": "object", + "description": "This is a map of call IDs to campaign call details." }, - "customerId": { - "type": "string", - "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + "callsCounterScheduled": { + "type": "number", + "description": "This is the number of calls that have been scheduled." }, - "customer": { - "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateCustomerDTO" - } - ] + "callsCounterQueued": { + "type": "number", + "description": "This is the number of calls that have been queued." }, - "name": { - "type": "string", - "description": "This is the name of the call. This is just for your own reference.", - "maxLength": 40 + "callsCounterInProgress": { + "type": "number", + "description": "This is the number of calls that have been in progress." }, - "schedulePlan": { - "description": "This is the schedule plan of the call.", - "allOf": [ - { - "$ref": "#/components/schemas/SchedulePlan" - } - ] + "callsCounterEndedVoicemail": { + "type": "number", + "description": "This is the number of calls whose ended reason is 'voicemail'." }, - "transport": { - "type": "object", - "description": "This is the transport of the call." + "callsCounterEnded": { + "type": "number", + "description": "This is the number of calls that have ended." } }, "required": [ + "status", + "name", "id", "orgId", "createdAt", - "updatedAt" - ] - }, - "CallBatchError": { - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/CreateCustomerDTO" - }, - "error": { - "type": "string" - } - }, - "required": [ - "customer", - "error" + "updatedAt", + "calls", + "callsCounterScheduled", + "callsCounterQueued", + "callsCounterInProgress", + "callsCounterEndedVoicemail", + "callsCounterEnded" ] }, - "CallBatchResponse": { + "CampaignPaginatedResponse": { "type": "object", "properties": { "results": { - "description": "This is the list of calls that were created.", "type": "array", "items": { - "$ref": "#/components/schemas/Call" + "$ref": "#/components/schemas/Campaign" } }, - "errors": { - "description": "This is the list of calls that failed to be created.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CallBatchError" - } + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ "results", - "errors" + "metadata" ] }, - "CreateCallDTO": { + "UpdateCampaignDTO": { "type": "object", "properties": { - "customers": { - "description": "This is used to issue batch calls to multiple customers.\n\nOnly relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" - } - }, "name": { "type": "string", - "description": "This is the name of the call. This is just for your own reference.", - "maxLength": 40 - }, - "schedulePlan": { - "description": "This is the schedule plan of the call.", - "allOf": [ - { - "$ref": "#/components/schemas/SchedulePlan" - } - ] - }, - "transport": { - "type": "object", - "description": "This is the transport of the call." + "description": "This is the name of the campaign. This is just for your own reference." }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" - }, - "assistant": { - "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] + "description": "This is the assistant ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." }, - "assistantOverrides": { - "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } - ] + "workflowId": { + "type": "string", + "description": "This is the workflow ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." }, "squadId": { "type": "string", - "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" - }, - "squad": { - "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", - "allOf": [ - { - "$ref": "#/components/schemas/CreateSquadDTO" - } - ] + "description": "This is the squad ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." }, - "workflowId": { + "phoneNumberId": { "type": "string", - "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "description": "This is the phone number ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended.\nNote: `phoneNumberId` and `dialPlan` are mutually exclusive." }, - "workflow": { - "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "dialPlan": { + "description": "This is a list of dial entries, each specifying a phone number and the customers to call using that number. Can only be updated if campaign is not in progress or has ended. Note: phoneNumberId and dialPlan are mutually exclusive.", + "type": "array", + "items": { + "$ref": "#/components/schemas/DialPlanEntry" + } + }, + "schedulePlan": { + "description": "This is the schedule plan for the campaign.\nCan only be updated if campaign is not in progress or has ended.", "allOf": [ { - "$ref": "#/components/schemas/CreateWorkflowDTO" + "$ref": "#/components/schemas/SchedulePlan" } ] }, - "workflowOverrides": { - "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", - "allOf": [ - { - "$ref": "#/components/schemas/WorkflowOverrides" - } + "status": { + "type": "string", + "description": "This is the status of the campaign.\nCan only be updated to 'ended' if you want to end the campaign.\nWhen set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete.", + "enum": [ + "ended" ] + } + } + }, + "RelayTargetAssistant": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "The type of relay target" }, - "phoneNumberId": { + "assistantId": { "type": "string", - "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + "description": "The unique identifier of the assistant" }, - "phoneNumber": { - "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "allOf": [ - { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" - } - ] + "assistantName": { + "type": "string", + "description": "The name of the assistant" + } + }, + "required": [ + "type" + ] + }, + "RelayTargetSquad": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "squad" + ], + "description": "The type of relay target" }, - "customerId": { + "squadId": { "type": "string", - "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + "description": "The unique identifier of the squad" }, - "customer": { - "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateCustomerDTO" - } + "squadName": { + "type": "string", + "description": "The name of the squad" + } + }, + "required": [ + "type" + ] + }, + "RelayTargetOptions": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "assistant", + "squad" ] } - } + }, + "required": [ + "type" + ] }, - "PaginationMeta": { + "RelayCommandSay": { "type": "object", "properties": { - "itemsPerPage": { - "type": "number" - }, - "totalItems": { - "type": "number" + "type": { + "type": "string", + "enum": [ + "say" + ], + "description": "The type of relay command" }, - "currentPage": { - "type": "number" + "content": { + "type": "string", + "description": "The content for the assistant to speak" + } + }, + "required": [ + "type", + "content" + ] + }, + "RelayCommandNote": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "message.add" + ], + "description": "The type of relay command" }, - "itemsBeyondRetention": { - "type": "boolean" + "content": { + "type": "string", + "description": "The note content to add to the conversation" } }, "required": [ - "itemsPerPage", - "totalItems", - "currentPage" + "type", + "content" ] }, - "CallPaginatedResponse": { + "RelayCommandOptions": { "type": "object", "properties": { - "results": { + "type": { + "type": "string", + "enum": [ + "say", + "message.add" + ] + } + }, + "required": [ + "type" + ] + }, + "RelayRequest": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "The source identifier of the relay request" + }, + "target": { + "oneOf": [ + { + "$ref": "#/components/schemas/RelayTargetAssistant" + }, + { + "$ref": "#/components/schemas/RelayTargetSquad" + } + ], + "description": "The target assistant or squad to relay the commands to" + }, + "customerId": { + "type": "string", + "description": "The unique identifier of the customer" + }, + "commands": { "type": "array", "items": { - "$ref": "#/components/schemas/Call" - } + "oneOf": [ + { + "$ref": "#/components/schemas/RelayCommandSay" + }, + { + "$ref": "#/components/schemas/RelayCommandNote" + } + ] + }, + "description": "The list of commands to relay to the target" + } + }, + "required": [ + "source", + "target", + "customerId", + "commands" + ] + }, + "RelayResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "deliveredLive", + "deliveredHeadless", + "failed" + ], + "description": "The status of the relay request" }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" + "callId": { + "type": "string", + "description": "The unique identifier of the call, if delivered to a live call" + }, + "sessionId": { + "type": "string", + "description": "The unique identifier of the session, if delivered to a headless session" + }, + "chatId": { + "type": "string" } }, "required": [ - "results", - "metadata" + "status" ] }, - "CreateOutboundCallDTO": { + "Session": { "type": "object", "properties": { - "customers": { - "description": "This is used to issue batch calls to multiple customers.\n\nOnly relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.", + "id": { + "type": "string", + "description": "This is the unique identifier for the session." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that owns this session." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 timestamp indicating when the session was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 timestamp indicating when the session was last updated." + }, + "cost": { + "type": "number", + "description": "This is the cost of the session in USD." + }, + "costs": { "type": "array", + "description": "These are the costs of individual components of the session in USD.", "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCost", + "title": "ModelCost" + }, + { + "$ref": "#/components/schemas/AnalysisCost", + "title": "AnalysisCost" + }, + { + "$ref": "#/components/schemas/SessionCost", + "title": "SessionCost" + } + ] } }, "name": { "type": "string", - "description": "This is the name of the call. This is just for your own reference.", + "description": "This is a user-defined name for the session. Maximum length is 40 characters.", "maxLength": 40 }, - "schedulePlan": { - "description": "This is the schedule plan of the call.", - "allOf": [ - { - "$ref": "#/components/schemas/SchedulePlan" - } + "status": { + "type": "string", + "description": "This is the current status of the session. Can be either 'active' or 'completed'.", + "enum": [ + "active", + "completed" ] }, - "transport": { - "type": "object", - "description": "This is the transport of the call." + "expirationSeconds": { + "type": "number", + "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", + "minimum": 60, + "maximum": 2592000, + "example": 86400 }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + "description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant." }, "assistant": { - "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "description": "This is the assistant configuration for this session. Use this when creating a new assistant configuration.\nIf assistantId is provided, this will be ignored.", "allOf": [ { "$ref": "#/components/schemas/CreateAssistantDTO" @@ -27909,7 +36914,7 @@ ] }, "assistantOverrides": { - "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "description": "These are the overrides for the assistant configuration.\nUse this to provide variable values and other overrides when using assistantId.\nVariable substitution will be applied to the assistant's messages and other text-based fields.", "allOf": [ { "$ref": "#/components/schemas/AssistantOverrides" @@ -27918,71 +36923,113 @@ }, "squadId": { "type": "string", - "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "description": "This is the squad ID associated with this session. Use this when referencing an existing squad." }, "squad": { - "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "description": "This is the squad configuration for this session. Use this when creating a new squad configuration.\nIf squadId is provided, this will be ignored.", "allOf": [ { "$ref": "#/components/schemas/CreateSquadDTO" } ] }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "messages": { + "type": "array", + "description": "This is an array of chat messages in the session.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } }, - "workflow": { - "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "customer": { + "description": "This is the customer information associated with this session.", "allOf": [ { - "$ref": "#/components/schemas/CreateWorkflowDTO" + "$ref": "#/components/schemas/CreateCustomerDTO" } ] }, - "workflowOverrides": { - "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", - "allOf": [ - { - "$ref": "#/components/schemas/WorkflowOverrides" - } - ] + "customerId": { + "type": "string", + "description": "This is the customerId of the customer associated with this session." }, "phoneNumberId": { "type": "string", - "description": "This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." + "description": "This is the ID of the phone number associated with this session." }, "phoneNumber": { - "description": "This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "description": "This is the phone number configuration for this session.", "allOf": [ { "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" } ] }, - "customerId": { - "type": "string", - "description": "This is the customer that will be called. To call a transient customer , use `customer` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type." - }, - "customer": { - "description": "This is the customer that will be called. To call an existing customer, use `customerId` instead.\n\nOnly relevant for `outboundPhoneCall` and `inboundPhoneCall` type.", + "artifact": { + "description": "These are the artifacts that were extracted from the session messages.\nThey are only available after the session has completed.\nThe artifact plan from the assistant or active assistant of squad is used to generate the artifact.\nCurrently the only supported fields of assistant artifact plan are:\n- structuredOutputIds", "allOf": [ { - "$ref": "#/components/schemas/CreateCustomerDTO" + "$ref": "#/components/schemas/Artifact" } ] } - } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "CreateWebCallDTO": { + "CreateSessionDTO": { "type": "object", "properties": { + "name": { + "type": "string", + "description": "This is a user-defined name for the session. Maximum length is 40 characters.", + "maxLength": 40 + }, + "status": { + "type": "string", + "description": "This is the current status of the session. Can be either 'active' or 'completed'.", + "enum": [ + "active", + "completed" + ] + }, + "expirationSeconds": { + "type": "number", + "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", + "minimum": 60, + "maximum": 2592000, + "example": 86400 + }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead.\n\nTo start a call with:\n- Assistant, use `assistantId` or `assistant`\n- Squad, use `squadId` or `squad`\n- Workflow, use `workflowId` or `workflow`" + "description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant." }, "assistant": { - "description": "This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nTo start a call with:\n- Assistant, use `assistant`\n- Squad, use `squad`\n- Workflow, use `workflow`", + "description": "This is the assistant configuration for this session. Use this when creating a new assistant configuration.\nIf assistantId is provided, this will be ignored.", "allOf": [ { "$ref": "#/components/schemas/CreateAssistantDTO" @@ -27990,7 +37037,7 @@ ] }, "assistantOverrides": { - "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "description": "These are the overrides for the assistant configuration.\nUse this to provide variable values and other overrides when using assistantId.\nVariable substitution will be applied to the assistant's messages and other text-based fields.", "allOf": [ { "$ref": "#/components/schemas/AssistantOverrides" @@ -27999,5037 +37046,5138 @@ }, "squadId": { "type": "string", - "description": "This is the squad that will be used for the call. To use a transient squad, use `squad` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "description": "This is the squad ID associated with this session. Use this when referencing an existing squad." }, "squad": { - "description": "This is a squad that will be used for the call. To use an existing squad, use `squadId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "description": "This is the squad configuration for this session. Use this when creating a new squad configuration.\nIf squadId is provided, this will be ignored.", "allOf": [ { "$ref": "#/components/schemas/CreateSquadDTO" } ] }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" + "messages": { + "type": "array", + "description": "This is an array of chat messages in the session.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } }, - "workflow": { - "description": "This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`", + "customer": { + "description": "This is the customer information associated with this session.", "allOf": [ { - "$ref": "#/components/schemas/CreateWorkflowDTO" + "$ref": "#/components/schemas/CreateCustomerDTO" } ] }, - "workflowOverrides": { - "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "customerId": { + "type": "string", + "description": "This is the customerId of the customer associated with this session." + }, + "phoneNumberId": { + "type": "string", + "description": "This is the ID of the phone number associated with this session." + }, + "phoneNumber": { + "description": "This is the phone number configuration for this session.", "allOf": [ { - "$ref": "#/components/schemas/WorkflowOverrides" + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" } ] } } }, - "UpdateCallDTO": { + "UpdateSessionDTO": { "type": "object", "properties": { "name": { "type": "string", - "description": "This is the name of the call. This is just for your own reference.", + "description": "This is the new name for the session. Maximum length is 40 characters.", "maxLength": 40 + }, + "status": { + "type": "string", + "description": "This is the new status for the session.", + "enum": [ + "active", + "completed" + ] + }, + "expirationSeconds": { + "type": "number", + "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", + "minimum": 60, + "maximum": 2592000, + "example": 86400 + }, + "messages": { + "type": "array", + "description": "This is the updated array of chat messages.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" + }, + { + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" + }, + { + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" + }, + { + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" + } + ] + } } } }, - "DeveloperMessage": { + "GetSessionPaginatedDTO": { "type": "object", "properties": { - "role": { + "id": { "type": "string", - "description": "This is the role of the message author", - "default": "developer", + "description": "This is the unique identifier for the session to filter by." + }, + "name": { + "type": "string", + "description": "This is the name of the session to filter by." + }, + "assistantId": { + "type": "string", + "description": "This is the ID of the assistant to filter sessions by." + }, + "assistantIdAny": { + "type": "string", + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "example": "assistant-1,assistant-2,assistant-3" + }, + "squadId": { + "type": "string", + "description": "This is the ID of the squad to filter sessions by." + }, + "workflowId": { + "type": "string", + "description": "This is the ID of the workflow to filter sessions by." + }, + "customer": { + "description": "This is the customer information to filter by.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "customerNumberAny": { + "type": "string", + "description": "Filter by any of the specified customer phone numbers (comma-separated).", + "example": "+1234567890,+0987654321" + }, + "phoneNumberId": { + "type": "string", + "description": "This will return sessions with the specified phoneNumberId." + }, + "phoneNumberIdAny": { + "description": "This will return sessions with any of the specified phoneNumberIds.", + "type": "array", + "items": { + "type": "string" + } + }, + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 + }, + "sortOrder": { + "type": "string", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", "enum": [ - "developer" + "ASC", + "DESC" ] }, - "content": { + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 + }, + "createdAtGt": { + "format": "date-time", "type": "string", - "description": "This is the content of the developer message", - "maxLength": 10000 + "description": "This will return items where the createdAt is greater than the specified value." }, - "name": { + "createdAtLt": { + "format": "date-time", "type": "string", - "description": "This is an optional name for the participant", - "maxLength": 40 + "description": "This will return items where the createdAt is less than the specified value." + }, + "createdAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than or equal to the specified value." + }, + "createdAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than or equal to the specified value." + }, + "updatedAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than the specified value." + }, + "updatedAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than the specified value." + }, + "updatedAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than or equal to the specified value." + }, + "updatedAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than or equal to the specified value." + } + } + }, + "SessionPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Session" + } }, "metadata": { - "type": "object", - "description": "This is an optional metadata for the message" + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "role", - "content" + "results", + "metadata" ] }, - "SystemMessage": { + "ExportSessionDTO": { "type": "object", "properties": { - "role": { + "id": { "type": "string", - "description": "The role of the system in the conversation." + "description": "This is the unique identifier for the session to filter by." }, - "message": { + "name": { "type": "string", - "description": "The message content from the system." + "description": "This is the name of the session to filter by." }, - "time": { - "type": "number", - "description": "The timestamp when the message was sent." + "assistantId": { + "type": "string", + "description": "This is the ID of the assistant to filter sessions by." }, - "secondsFromStart": { - "type": "number", - "description": "The number of seconds from the start of the conversation." - } - }, - "required": [ - "role", - "message", - "time", - "secondsFromStart" - ] - }, - "UserMessage": { - "type": "object", - "properties": { - "role": { + "assistantIdAny": { "type": "string", - "description": "The role of the user in the conversation." + "description": "Filter by multiple assistant IDs. Provide as comma-separated values.", + "example": "assistant-1,assistant-2,assistant-3" }, - "message": { + "squadId": { "type": "string", - "description": "The message content from the user." + "description": "This is the ID of the squad to filter sessions by." }, - "time": { - "type": "number", - "description": "The timestamp when the message was sent." + "workflowId": { + "type": "string", + "description": "This is the ID of the workflow to filter sessions by." }, - "endTime": { - "type": "number", - "description": "The timestamp when the message ended." + "customer": { + "description": "This is the customer information to filter by.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] }, - "secondsFromStart": { - "type": "number", - "description": "The number of seconds from the start of the conversation." + "customerNumberAny": { + "type": "string", + "description": "Filter by any of the specified customer phone numbers (comma-separated).", + "example": "+1234567890,+0987654321" }, - "duration": { - "type": "number", - "description": "The duration of the message in seconds." + "columns": { + "type": "string", + "description": "Columns to include in the CSV export", + "enum": [ + "id", + "name", + "status", + "assistantId", + "squadId", + "customerName", + "customerNumber", + "phoneNumberId", + "cost", + "messages", + "createdAt", + "updatedAt" + ], + "default": [ + "id", + "name", + "status", + "assistantId", + "squadId", + "customerName", + "customerNumber", + "phoneNumberId", + "cost", + "messages", + "createdAt", + "updatedAt" + ] }, - "isFiltered": { - "type": "boolean", - "description": "Indicates if the message was filtered for security reasons." + "email": { + "type": "string", + "description": "This is the email address to send the export to.\nRequired if userId is not available in the request context." }, - "detectedThreats": { - "description": "List of detected security threats if the message was filtered.", + "format": { + "type": "string", + "description": "This is the format of the export.\n\n@default csv", + "enum": [ + "csv", + "json" + ], + "default": "csv" + }, + "phoneNumberId": { + "type": "string", + "description": "This will return sessions with the specified phoneNumberId." + }, + "phoneNumberIdAny": { + "description": "This will return sessions with any of the specified phoneNumberIds.", "type": "array", "items": { "type": "string" } }, - "originalMessage": { + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 + }, + "sortOrder": { "type": "string", - "description": "The original message before filtering (only included if content was filtered)." - } - }, - "required": [ - "role", - "message", - "time", - "endTime", - "secondsFromStart" - ] - }, - "ToolCallFunction": { - "type": "object", - "properties": { - "arguments": { + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "enum": [ + "ASC", + "DESC" + ] + }, + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 + }, + "createdAtGt": { + "format": "date-time", "type": "string", - "description": "This is the arguments to call the function with" + "description": "This will return items where the createdAt is greater than the specified value." }, - "name": { + "createdAtLt": { + "format": "date-time", "type": "string", - "description": "This is the name of the function to call", - "maxLength": 40 - } - }, - "required": [ - "arguments", - "name" - ] - }, - "ToolCall": { - "type": "object", - "properties": { - "id": { + "description": "This will return items where the createdAt is less than the specified value." + }, + "createdAtGe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is greater than or equal to the specified value." + }, + "createdAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the createdAt is less than or equal to the specified value." + }, + "updatedAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than the specified value." + }, + "updatedAtLt": { + "format": "date-time", "type": "string", - "description": "This is the ID of the tool call" + "description": "This will return items where the updatedAt is less than the specified value." }, - "type": { + "updatedAtGe": { + "format": "date-time", "type": "string", - "description": "This is the type of tool" + "description": "This will return items where the updatedAt is greater than or equal to the specified value." }, - "function": { - "description": "This is the function that was called", - "allOf": [ - { - "$ref": "#/components/schemas/ToolCallFunction" - } - ] + "updatedAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than or equal to the specified value." } - }, - "required": [ - "id", - "type", - "function" - ] + } }, - "AssistantMessage": { + "ByoPhoneNumber": { "type": "object", "properties": { - "role": { - "type": "string", - "description": "This is the role of the message author", - "default": "assistant", - "enum": [ - "assistant" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } ] }, - "content": { - "type": "string", - "description": "This is the content of the assistant message", - "maxLength": 10000 - }, - "refusal": { - "type": "string", - "description": "This is the refusal message generated by the model", - "maxLength": 10000 - }, - "tool_calls": { - "description": "This is the tool calls generated by the model", + "hooks": { "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { - "$ref": "#/components/schemas/ToolCall" + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] } }, - "name": { - "type": "string", - "description": "This is an optional name for the participant", - "maxLength": 40 - }, - "metadata": { - "type": "object", - "description": "This is an optional metadata for the message" - } - }, - "required": [ - "role" - ] - }, - "ToolMessage": { - "type": "object", - "properties": { - "role": { + "provider": { "type": "string", - "description": "This is the role of the message author", - "default": "tool", + "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ - "tool" + "byo-phone-number" ] }, - "content": { + "numberE164CheckEnabled": { + "type": "boolean", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "default": true + }, + "id": { "type": "string", - "description": "This is the content of the tool message", - "maxLength": 10000 + "description": "This is the unique identifier for the phone number." }, - "tool_call_id": { + "orgId": { "type": "string", - "description": "This is the ID of the tool call this message is responding to" + "description": "This is the unique identifier for the org that this phone number belongs to." }, - "name": { + "createdAt": { + "format": "date-time", "type": "string", - "description": "This is an optional name for the participant", - "maxLength": 40 + "description": "This is the ISO 8601 date-time string of when the phone number was created." }, - "metadata": { - "type": "object", - "description": "This is an optional metadata for the message" - } - }, - "required": [ - "role", - "content", - "tool_call_id" - ] - }, - "FunctionCall": { - "type": "object", - "properties": { - "arguments": { + "updatedAt": { + "format": "date-time", "type": "string", - "description": "This is the arguments to call the function with" + "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + }, + "status": { + "type": "string", + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" + ] }, "name": { "type": "string", - "description": "This is the name of the function to call", + "description": "This is the name of the phone number. This is just for your own reference.", "maxLength": 40 - } - }, - "required": [ - "arguments", - "name" - ] - }, - "Chat": { - "type": "object", - "properties": { + }, "assistantId": { "type": "string", - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "assistant": { - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/Server" } ] }, - "name": { + "number": { "type": "string", - "description": "This is the name of the chat. This is just for your own reference.", + "description": "This is the number of the customer.", + "minLength": 3, "maxLength": 40 }, - "sessionId": { + "credentialId": { "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." - }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." + } + }, + "required": [ + "provider", + "id", + "orgId", + "createdAt", + "updatedAt", + "credentialId" + ] + }, + "TwilioPhoneNumber": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", "oneOf": [ { - "type": "string", - "title": "String" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" }, { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } - ], - "examples": [ - "Hello, how can you help me?", - [ - { - "role": "user", - "content": "Hello, how can you help me?" - } - ] ] }, - "stream": { - "type": "boolean", - "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", - "default": false - }, - "previousChatId": { - "type": "string", - "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the chat." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this chat belongs to." - }, - "messages": { + "hooks": { "type": "array", - "description": "This is an array of messages used as context for the chat.\nUsed to provide message history for multi-turn conversations.", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "output": { - "type": "array", - "description": "This is the output messages generated by the system in response to the input.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - } + "provider": { + "type": "string", + "description": "This is to use numbers bought on Twilio.", + "enum": [ + "twilio" + ] + }, + "smsEnabled": { + "type": "boolean", + "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", + "default": true + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the phone number." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this phone number belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the chat was created." + "description": "This is the ISO 8601 date-time string of when the phone number was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the chat was last updated." + "description": "This is the ISO 8601 date-time string of when the phone number was last updated." }, - "costs": { - "type": "array", - "description": "These are the costs of individual components of the chat in USD.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ModelCost", - "title": "ModelCost" - }, - { - "$ref": "#/components/schemas/ChatCost", - "title": "ChatCost" - } - ] - } + "status": { + "type": "string", + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" + ] }, - "cost": { - "type": "number", - "description": "This is the cost of the chat in USD." - } - }, - "required": [ - "id", - "orgId", - "createdAt", - "updatedAt" - ] - }, - "CreateChatDTO": { - "type": "object", - "properties": { - "assistantId": { + "twilioAuthToken": { "type": "string", - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." + "description": "This is the Twilio Auth Token for the phone number." }, - "assistant": { - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] + "twilioApiKey": { + "type": "string", + "description": "This is the Twilio API Key for the phone number." }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } - ] + "twilioApiSecret": { + "type": "string", + "description": "This is the Twilio API Secret for the phone number." }, "name": { "type": "string", - "description": "This is the name of the chat. This is just for your own reference.", + "description": "This is the name of the phone number. This is just for your own reference.", "maxLength": 40 }, - "sessionId": { + "assistantId": { "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.\nThis field is REQUIRED for chat creation.", - "oneOf": [ - { - "type": "string", - "title": "String" - }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" + "$ref": "#/components/schemas/Server" } - ], - "examples": [ - "Hello, how can you help me?", - [ - { - "role": "user", - "content": "Hello, how can you help me?" - } - ] ] }, - "stream": { - "type": "boolean", - "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", - "default": false + "number": { + "type": "string", + "description": "These are the digits of the phone number you own on your Twilio." }, - "previousChatId": { + "twilioAccountSid": { "type": "string", - "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." + "description": "This is the Twilio Account SID for the phone number." } }, "required": [ - "input" + "provider", + "id", + "orgId", + "createdAt", + "updatedAt", + "number", + "twilioAccountSid" ] }, - "GetChatPaginatedDTO": { + "VonagePhoneNumber": { "type": "object", "properties": { - "assistantId": { - "type": "string", - "description": "This is the unique identifier for the assistant that will be used for the chat." + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } }, - "workflowId": { + "provider": { "type": "string", - "description": "This is the unique identifier for the workflow that will be used for the chat." + "description": "This is to use numbers bought on Vonage.", + "enum": [ + "vonage" + ] }, - "sessionId": { + "id": { "type": "string", - "description": "This is the unique identifier for the session that will be used for the chat." - }, - "page": { - "type": "number", - "description": "This is the page number to return. Defaults to 1.", - "minimum": 1 + "description": "This is the unique identifier for the phone number." }, - "sortOrder": { + "orgId": { "type": "string", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "enum": [ - "ASC", - "DESC" - ] - }, - "limit": { - "type": "number", - "description": "This is the maximum number of items to return. Defaults to 100.", - "minimum": 0, - "maximum": 1000 + "description": "This is the unique identifier for the org that this phone number belongs to." }, - "createdAtGt": { + "createdAt": { "format": "date-time", "type": "string", - "description": "This will return items where the createdAt is greater than the specified value." + "description": "This is the ISO 8601 date-time string of when the phone number was created." }, - "createdAtLt": { + "updatedAt": { "format": "date-time", "type": "string", - "description": "This will return items where the createdAt is less than the specified value." + "description": "This is the ISO 8601 date-time string of when the phone number was last updated." }, - "createdAtGe": { - "format": "date-time", + "status": { "type": "string", - "description": "This will return items where the createdAt is greater than or equal to the specified value." + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" + ] }, - "createdAtLe": { - "format": "date-time", + "name": { "type": "string", - "description": "This will return items where the createdAt is less than or equal to the specified value." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAtGt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This will return items where the updatedAt is greater than the specified value." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "updatedAtLt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This will return items where the updatedAt is less than the specified value." + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "updatedAtGe": { - "format": "date-time", + "squadId": { "type": "string", - "description": "This will return items where the updatedAt is greater than or equal to the specified value." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "updatedAtLe": { - "format": "date-time", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "number": { "type": "string", - "description": "This will return items where the updatedAt is less than or equal to the specified value." - } - } - }, - "ChatPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Chat" - } + "description": "These are the digits of the phone number you own on your Vonage." }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." } }, "required": [ - "results", - "metadata" + "provider", + "id", + "orgId", + "createdAt", + "updatedAt", + "number", + "credentialId" ] }, - "CreateChatStreamResponse": { + "SipAuthentication": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "This is the unique identifier for the streaming response." - }, - "sessionId": { + "realm": { "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nHelps track conversation context across multiple messages." + "description": "This will be expected in the `realm` field of the `authorization` header of the SIP INVITE. Defaults to sip.vapi.ai." }, - "path": { + "username": { "type": "string", - "description": "This is the path to the content being updated.\nFormat: `chat.output[{contentIndex}].content` where contentIndex identifies the specific content item.", - "example": "chat.output[0].content" + "description": "This will be expected in the `username` field of the `authorization` header of the SIP INVITE.", + "minLength": 20, + "maxLength": 40 }, - "delta": { + "password": { "type": "string", - "description": "This is the incremental content chunk being streamed." + "description": "This will be expected to generate the `response` field of the `authorization` header of the SIP INVITE, through digest authentication.", + "minLength": 20, + "maxLength": 40 } }, "required": [ - "id", - "path", - "delta" + "username", + "password" ] }, - "OpenAIResponsesRequest": { + "VapiPhoneNumber": { "type": "object", "properties": { - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." - }, - "assistant": { - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", - "allOf": [ + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in chat contexts - other assistant properties cannot be overridden.", - "allOf": [ + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } ] }, - "name": { - "type": "string", - "description": "This is the name of the chat. This is just for your own reference.", - "maxLength": 40 - }, - "sessionId": { - "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." - }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.\nThis field is REQUIRED for chat creation.", - "oneOf": [ - { - "type": "string", - "title": "String" - }, - { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, - "title": "MessageArray" - } - ], - "examples": [ - "Hello, how can you help me?", - [ { - "role": "user", - "content": "Hello, how can you help me?" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] + } + }, + "provider": { + "type": "string", + "description": "This is to create free SIP phone numbers on Vapi.", + "enum": [ + "vapi" ] }, - "stream": { - "type": "boolean", - "description": "Whether to stream the response or not.", - "default": true + "id": { + "type": "string", + "description": "This is the unique identifier for the phone number." }, - "previousChatId": { + "orgId": { "type": "string", - "description": "This is the ID of the chat that will be used as context for the new chat.\nThe messages from the previous chat will be used as context.\nMutually exclusive with sessionId." - } - }, - "required": [ - "input" - ] - }, - "ChatAssistantOverrides": { - "type": "object", - "properties": { - "variableValues": { - "type": "object", - "description": "Variable values for template substitution", - "example": { - "name": "John", - "company": "ACME Corp" - } - } - } - }, - "CreateWebCustomerDTO": { - "type": "object", - "properties": { - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true + "description": "This is the unique identifier for the org that this phone number belongs to." }, - "extension": { + "createdAt": { + "format": "date-time", "type": "string", - "description": "This is the extension that will be dialed after the call is answered.", - "maxLength": 10, - "example": null + "description": "This is the ISO 8601 date-time string of when the phone number was created." }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", - "allOf": [ - { - "$ref": "#/components/schemas/ChatAssistantOverrides" - } - ] + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the phone number was last updated." }, - "number": { + "status": { "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" + ] }, - "sipUri": { + "number": { "type": "string", - "description": "This is the SIP URI of the customer." + "description": "These are the digits of the phone number you purchased from Vapi." }, "name": { "type": "string", - "description": "This is the name of the customer. This is just for your own reference.\n\nFor SIP inbound calls, this is extracted from the `From` SIP header with format `\"Display Name\" `.", + "description": "This is the name of the phone number. This is just for your own reference.", "maxLength": 40 }, - "email": { + "assistantId": { "type": "string", - "description": "This is the email of the customer.", - "maxLength": 40 + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "externalId": { - "type": "string", - "description": "This is the external ID of the customer.", - "maxLength": 40 - } - } - }, - "CreateWebChatDTO": { - "type": "object", - "properties": { - "assistantId": { + "workflowId": { "type": "string", - "description": "The assistant ID to use for this chat" + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "sessionId": { + "squadId": { "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/ChatAssistantOverrides" + "$ref": "#/components/schemas/Server" } ] }, - "customer": { - "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateWebCustomerDTO" - } - ] + "numberDesiredAreaCode": { + "type": "string", + "description": "This is the area code of the phone number to purchase.", + "minLength": 3, + "maxLength": 3 }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", - "oneOf": [ - { - "type": "string", - "title": "String" - }, + "sipUri": { + "type": "string", + "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." + }, + "authentication": { + "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", + "allOf": [ { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" + "$ref": "#/components/schemas/SipAuthentication" } - ], - "examples": [ - "Hello, how can you help me?", - [ - { - "role": "user", - "content": "Hello, how can you help me?" - } - ] ] - }, - "stream": { - "type": "boolean", - "description": "This is a flag that determines whether the response should be streamed.\nWhen true, the response will be sent as chunks of text.", - "default": false } }, "required": [ - "assistantId", - "input" + "provider", + "id", + "orgId", + "createdAt", + "updatedAt" ] }, - "WebChat": { + "TelnyxPhoneNumber": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "This is the unique identifier for the chat." - }, - "sessionId": { - "type": "string", - "description": "This is the ID of the session for the chat. Send it in the next chat request to continue the conversation." + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] }, - "output": { + "hooks": { "type": "array", - "description": "This is the output messages generated by the system in response to the input.", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } - } - }, - "required": [ - "id", - "output" - ] - }, - "OpenAIWebChatRequest": { - "type": "object", - "properties": { - "assistantId": { + }, + "provider": { "type": "string", - "description": "The assistant ID to use for this chat" + "description": "This is to use numbers bought on Telnyx.", + "enum": [ + "telnyx" + ] }, - "sessionId": { + "id": { "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." + "description": "This is the unique identifier for the phone number." }, - "assistantOverrides": { - "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", - "allOf": [ - { - "$ref": "#/components/schemas/ChatAssistantOverrides" - } + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this phone number belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the phone number was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + }, + "status": { + "type": "string", + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" ] }, - "customer": { - "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", + "name": { + "type": "string", + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/CreateWebCustomerDTO" + "$ref": "#/components/schemas/Server" } ] }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "number": { + "type": "string", + "description": "These are the digits of the phone number you own on your Telnyx." + }, + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." + } + }, + "required": [ + "provider", + "id", + "orgId", + "createdAt", + "updatedAt", + "number", + "credentialId" + ] + }, + "CreateByoPhoneNumberDTO": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", "oneOf": [ { - "type": "string", - "title": "String" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" }, { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" - }, - { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" - } - ] - }, - "title": "MessageArray" + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } - ], - "examples": [ - "Hello, how can you help me?", - [ + ] + }, + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ { - "role": "user", - "content": "Hello, how can you help me?" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] + } + }, + "provider": { + "type": "string", + "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", + "enum": [ + "byo-phone-number" ] }, - "stream": { + "numberE164CheckEnabled": { "type": "boolean", - "description": "Whether to stream the response or not.", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", "default": true - } - }, - "required": [ - "assistantId", - "input" - ] - }, - "ResponseOutputText": { - "type": "object", - "properties": { - "annotations": { - "default": [], - "description": "Annotations in the text output", - "type": "array", - "items": { - "type": "object" - } }, - "text": { + "number": { "type": "string", - "description": "The text output from the model" + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 }, - "type": { + "credentialId": { "type": "string", - "default": "output_text", - "description": "The type of the output text", - "enum": [ - "output_text" + "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." + }, + "name": { + "type": "string", + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] } }, "required": [ - "annotations", - "text", - "type" + "provider", + "credentialId" ] }, - "ResponseOutputMessage": { + "CreateTwilioPhoneNumberDTO": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "The unique ID of the output message" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] }, - "content": { - "description": "Content of the output message", + "hooks": { "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { - "$ref": "#/components/schemas/ResponseOutputText" + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] } }, - "role": { + "provider": { "type": "string", - "default": "assistant", - "description": "The role of the output message", + "description": "This is to use numbers bought on Twilio.", "enum": [ - "assistant" + "twilio" ] }, - "status": { + "smsEnabled": { + "type": "boolean", + "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", + "default": true + }, + "number": { "type": "string", - "description": "The status of the message", - "enum": [ - "in_progress", - "completed", - "incomplete" - ] + "description": "These are the digits of the phone number you own on your Twilio." }, - "type": { + "twilioAccountSid": { "type": "string", - "default": "message", - "description": "The type of the output message", - "enum": [ - "message" + "description": "This is the Twilio Account SID for the phone number." + }, + "twilioAuthToken": { + "type": "string", + "description": "This is the Twilio Auth Token for the phone number." + }, + "twilioApiKey": { + "type": "string", + "description": "This is the Twilio API Key for the phone number." + }, + "twilioApiSecret": { + "type": "string", + "description": "This is the Twilio API Secret for the phone number." + }, + "name": { + "type": "string", + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] } }, "required": [ - "id", - "content", - "role", - "status", - "type" + "provider", + "number", + "twilioAccountSid" ] }, - "ResponseObject": { + "CreateVonagePhoneNumberDTO": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique identifier for this Response" - }, - "object": { - "type": "string", - "default": "response", - "description": "The object type", - "enum": [ - "response" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } ] }, - "created_at": { - "type": "number", - "description": "Unix timestamp (in seconds) of when this Response was created" + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } }, - "status": { + "provider": { "type": "string", - "description": "Status of the response", + "description": "This is to use numbers bought on Vonage.", "enum": [ - "completed", - "failed", - "in_progress", - "incomplete" + "vonage" ] }, - "error": { + "number": { "type": "string", - "nullable": true, - "default": null, - "description": "Error message if the response failed" + "description": "These are the digits of the phone number you own on your Vonage." }, - "output": { - "description": "Output messages from the model", - "type": "array", - "items": { - "$ref": "#/components/schemas/ResponseOutputMessage" - } - } - }, - "required": [ - "id", - "object", - "created_at", - "status", - "output" - ] - }, - "ResponseTextDeltaEvent": { - "type": "object", - "properties": { - "content_index": { - "type": "number", - "description": "Index of the content part" + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." }, - "delta": { + "name": { "type": "string", - "description": "Text delta being added" + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "item_id": { + "assistantId": { "type": "string", - "description": "ID of the output item" + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "output_index": { - "type": "number", - "description": "Index of the output item" + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "type": { + "squadId": { "type": "string", - "default": "response.output_text.delta", - "description": "Event type", - "enum": [ - "response.output_text.delta" + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] } }, "required": [ - "content_index", - "delta", - "item_id", - "output_index", - "type" + "provider", + "number", + "credentialId" ] }, - "ResponseTextDoneEvent": { + "CreateVapiPhoneNumberDTO": { "type": "object", "properties": { - "content_index": { - "type": "number", - "description": "Index of the content part" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] }, - "item_id": { - "type": "string", - "description": "ID of the output item" + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } }, - "output_index": { - "type": "number", - "description": "Index of the output item" + "provider": { + "type": "string", + "description": "This is to create free SIP phone numbers on Vapi.", + "enum": [ + "vapi" + ] }, - "text": { + "numberDesiredAreaCode": { "type": "string", - "description": "Complete text content" + "description": "This is the area code of the phone number to purchase.", + "minLength": 3, + "maxLength": 3 }, - "type": { + "sipUri": { "type": "string", - "default": "response.output_text.done", - "description": "Event type", - "enum": [ - "response.output_text.done" - ] - } - }, - "required": [ - "content_index", - "item_id", - "output_index", - "text", - "type" - ] - }, - "ResponseCompletedEvent": { - "type": "object", - "properties": { - "response": { - "description": "The completed response", + "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." + }, + "authentication": { + "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", "allOf": [ { - "$ref": "#/components/schemas/ResponseObject" + "$ref": "#/components/schemas/SipAuthentication" } ] }, - "type": { + "name": { "type": "string", - "default": "response.completed", - "description": "Event type", - "enum": [ - "response.completed" + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } ] } }, "required": [ - "response", - "type" + "provider" ] }, - "ResponseErrorEvent": { + "CreateTelnyxPhoneNumberDTO": { "type": "object", "properties": { - "type": { - "type": "string", - "default": "error", - "description": "Event type", - "enum": [ - "error" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } ] }, - "code": { + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } + }, + "provider": { "type": "string", - "description": "Error code", - "example": "ERR_SOMETHING" + "description": "This is to use numbers bought on Telnyx.", + "enum": [ + "telnyx" + ] }, - "message": { + "number": { "type": "string", - "description": "Error message", - "example": "Something went wrong" + "description": "These are the digits of the phone number you own on your Telnyx." }, - "param": { + "credentialId": { "type": "string", - "nullable": true, - "description": "Parameter that caused the error" + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." }, - "sequence_number": { - "type": "number", - "description": "Sequence number of the event", - "example": 1 - } - }, - "required": [ - "type", - "code", - "message", - "sequence_number" - ] - }, - "CreateCampaignDTO": { - "type": "object", - "properties": { "name": { "type": "string", - "description": "This is the name of the campaign. This is just for your own reference.", - "example": "Q2 Sales Campaign" + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, "workflowId": { "type": "string", - "description": "This is the workflow ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both." + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "phoneNumberId": { + "squadId": { "type": "string", - "description": "This is the phone number ID that will be used for the campaign calls." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/SchedulePlan" + "$ref": "#/components/schemas/Server" } ] - }, - "customers": { - "description": "These are the customers that will be called in the campaign.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" - } } }, "required": [ - "name", - "phoneNumberId", - "customers" + "provider", + "number", + "credentialId" ] }, - "Campaign": { + "UpdateByoPhoneNumberDTO": { "type": "object", "properties": { - "status": { - "type": "string", - "description": "This is the status of the campaign.", - "enum": [ - "scheduled", - "in-progress", - "ended" + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } ] }, - "endedReason": { - "type": "string", - "description": "This is the explanation for how the campaign ended.", - "enum": [ - "campaign.scheduled.ended-by-user", - "campaign.in-progress.ended-by-user", - "campaign.ended.success" - ] + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } + }, + "numberE164CheckEnabled": { + "type": "boolean", + "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", + "default": true }, "name": { "type": "string", - "description": "This is the name of the campaign. This is just for your own reference.", - "example": "Q2 Sales Campaign" + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, "workflowId": { "type": "string", - "description": "This is the workflow ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both." + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "phoneNumberId": { + "squadId": { "type": "string", - "description": "This is the phone number ID that will be used for the campaign calls." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/SchedulePlan" + "$ref": "#/components/schemas/Server" } ] }, - "customers": { - "description": "These are the customers that will be called in the campaign.", + "number": { + "type": "string", + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 + }, + "credentialId": { + "type": "string", + "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." + } + } + }, + "UpdateTwilioPhoneNumberDTO": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "hooks": { "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] } }, - "id": { + "smsEnabled": { + "type": "boolean", + "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", + "default": true + }, + "name": { "type": "string", - "description": "This is the unique identifier for the campaign." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "orgId": { + "assistantId": { "type": "string", - "description": "This is the unique identifier for the org that this campaign belongs to." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "createdAt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the campaign was created." + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "updatedAt": { - "format": "date-time", + "squadId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the campaign was last updated." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "calls": { - "type": "object", - "description": "This is a map of call IDs to campaign call details." + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, - "callsCounterScheduled": { - "type": "number", - "description": "This is the number of calls that have been scheduled." + "number": { + "type": "string", + "description": "These are the digits of the phone number you own on your Twilio." }, - "callsCounterQueued": { - "type": "number", - "description": "This is the number of calls that have been queued." + "twilioAccountSid": { + "type": "string", + "description": "This is the Twilio Account SID for the phone number." }, - "callsCounterInProgress": { - "type": "number", - "description": "This is the number of calls that have been in progress." + "twilioAuthToken": { + "type": "string", + "description": "This is the Twilio Auth Token for the phone number." }, - "callsCounterEndedVoicemail": { - "type": "number", - "description": "This is the number of calls whose ended reason is 'voicemail'." + "twilioApiKey": { + "type": "string", + "description": "This is the Twilio API Key for the phone number." }, - "callsCounterEnded": { - "type": "number", - "description": "This is the number of calls that have ended." + "twilioApiSecret": { + "type": "string", + "description": "This is the Twilio API Secret for the phone number." } - }, - "required": [ - "status", - "name", - "phoneNumberId", - "customers", - "id", - "orgId", - "createdAt", - "updatedAt", - "calls", - "callsCounterScheduled", - "callsCounterQueued", - "callsCounterInProgress", - "callsCounterEndedVoicemail", - "callsCounterEnded" - ] + } }, - "CampaignPaginatedResponse": { + "UpdateVonagePhoneNumberDTO": { "type": "object", "properties": { - "results": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "hooks": { "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { - "$ref": "#/components/schemas/Campaign" + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] } }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "UpdateCampaignDTO": { - "type": "object", - "properties": { "name": { "type": "string", - "description": "This is the name of the campaign. This is just for your own reference." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, "assistantId": { "type": "string", - "description": "This is the assistant ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, "workflowId": { "type": "string", - "description": "This is the workflow ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "phoneNumberId": { + "squadId": { "type": "string", - "description": "This is the phone number ID that will be used for the campaign calls.\nCan only be updated if campaign is not in progress or has ended." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.\nCan only be updated if campaign is not in progress or has ended.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/SchedulePlan" + "$ref": "#/components/schemas/Server" } ] }, - "status": { + "number": { "type": "string", - "description": "This is the status of the campaign.\nCan only be updated to 'ended' if you want to end the campaign.\nWhen set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete.", - "enum": [ - "ended" - ] + "description": "These are the digits of the phone number you own on your Vonage." + }, + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." } } }, - "Session": { + "UpdateVapiPhoneNumberDTO": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "This is the unique identifier for the session." + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that owns this session." + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } }, - "createdAt": { - "format": "date-time", + "name": { "type": "string", - "description": "This is the ISO 8601 timestamp indicating when the session was created." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 timestamp indicating when the session was last updated." + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "name": { + "workflowId": { "type": "string", - "description": "This is a user-defined name for the session. Maximum length is 40 characters.", - "maxLength": 40 + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "status": { + "squadId": { "type": "string", - "description": "This is the current status of the session. Can be either 'active' or 'completed'.", - "enum": [ - "active", - "completed" - ] + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "expirationSeconds": { - "type": "number", - "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", - "minimum": 60, - "maximum": 2592000, - "example": 86400 + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, - "assistantId": { + "sipUri": { "type": "string", - "description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant." + "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." }, - "assistant": { - "description": "This is the assistant configuration for this session. Use this when creating a new assistant configuration.\nIf assistantId is provided, this will be ignored.", + "authentication": { + "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", "allOf": [ { - "$ref": "#/components/schemas/CreateAssistantDTO" + "$ref": "#/components/schemas/SipAuthentication" + } + ] + } + } + }, + "UpdateTelnyxPhoneNumberDTO": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } ] }, - "messages": { + "hooks": { "type": "array", - "description": "This is an array of chat messages in the session.", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" - }, - { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" - }, - { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "customer": { - "description": "This is the customer information associated with this session.", + "name": { + "type": "string", + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 + }, + "assistantId": { + "type": "string", + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "squadId": { + "type": "string", + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + }, + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/CreateCustomerDTO" + "$ref": "#/components/schemas/Server" } ] }, - "phoneNumberId": { + "number": { "type": "string", - "description": "This is the ID of the phone number associated with this session." + "description": "These are the digits of the phone number you own on your Telnyx." + }, + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." + } + } + }, + "ImportVonagePhoneNumberDTO": { + "type": "object", + "properties": { + "fallbackDestination": { + "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" + } + ] + }, + "hooks": { + "type": "array", + "description": "This is the hooks that will be used for incoming calls to this phone number.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } + ] + } + }, + "vonagePhoneNumber": { + "type": "string", + "description": "These are the digits of the phone number you own on your Vonage.", + "deprecated": true + }, + "credentialId": { + "type": "string", + "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." }, - "phoneNumber": { - "description": "This is the phone number configuration for this session.", - "allOf": [ - { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" - } - ] - } - }, - "required": [ - "id", - "orgId", - "createdAt", - "updatedAt" - ] - }, - "CreateSessionDTO": { - "type": "object", - "properties": { "name": { "type": "string", - "description": "This is a user-defined name for the session. Maximum length is 40 characters.", + "description": "This is the name of the phone number. This is just for your own reference.", "maxLength": 40 }, - "status": { + "assistantId": { "type": "string", - "description": "This is the current status of the session. Can be either 'active' or 'completed'.", - "enum": [ - "active", - "completed" - ] + "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "expirationSeconds": { - "type": "number", - "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", - "minimum": 60, - "maximum": 2592000, - "example": 86400 + "workflowId": { + "type": "string", + "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "assistantId": { + "squadId": { "type": "string", - "description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant." + "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." }, - "assistant": { - "description": "This is the assistant configuration for this session. Use this when creating a new assistant configuration.\nIf assistantId is provided, this will be ignored.", + "server": { + "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", "allOf": [ { - "$ref": "#/components/schemas/CreateAssistantDTO" + "$ref": "#/components/schemas/Server" } ] - }, - "messages": { + } + }, + "required": [ + "vonagePhoneNumber", + "credentialId" + ] + }, + "PhoneNumberPaginatedResponse": { + "type": "object", + "properties": { + "results": { "type": "array", - "description": "This is an array of chat messages in the session.", + "description": "A list of phone numbers, which can be of any provider type.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" + "$ref": "#/components/schemas/ByoPhoneNumber" }, { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" + "$ref": "#/components/schemas/VonagePhoneNumber" }, { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/VapiPhoneNumber" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/TelnyxPhoneNumber" } ] } }, - "customer": { - "description": "This is the customer information associated with this session.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateCustomerDTO" - } - ] - }, - "phoneNumberId": { - "type": "string", - "description": "This is the ID of the phone number associated with this session." - }, - "phoneNumber": { - "description": "This is the phone number configuration for this session.", + "metadata": { + "description": "Metadata about the pagination.", "allOf": [ { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + "$ref": "#/components/schemas/PaginationMeta" } ] } - } + }, + "required": [ + "results", + "metadata" + ] }, - "UpdateSessionDTO": { + "ApiRequestTool": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "This is the new name for the session. Maximum length is 40 characters.", - "maxLength": 40 - }, - "status": { - "type": "string", - "description": "This is the new status for the session.", - "enum": [ - "active", - "completed" - ] - }, - "expirationSeconds": { - "type": "number", - "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", - "minimum": 60, - "maximum": 2592000, - "example": 86400 - }, "messages": { "type": "array", - "description": "This is the updated array of chat messages.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } - } - } - }, - "GetSessionPaginatedDTO": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the session to filter by." - }, - "assistantId": { - "type": "string", - "description": "This is the ID of the assistant to filter sessions by." }, - "workflowId": { + "type": { "type": "string", - "description": "This is the ID of the workflow to filter sessions by." - }, - "page": { - "type": "number", - "description": "This is the page number to return. Defaults to 1.", - "minimum": 1 + "enum": [ + "apiRequest" + ], + "description": "The type of tool. \"apiRequest\" for API request tool." }, - "sortOrder": { + "method": { "type": "string", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", "enum": [ - "ASC", - "DESC" + "POST", + "GET", + "PUT", + "PATCH", + "DELETE" ] }, - "limit": { + "timeoutSeconds": { "type": "number", - "description": "This is the maximum number of items to return. Defaults to 100.", - "minimum": 0, - "maximum": 1000 + "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", + "minimum": 1, + "maximum": 300, + "example": 20 }, - "createdAtGt": { - "format": "date-time", + "credentialId": { "type": "string", - "description": "This will return items where the createdAt is greater than the specified value." + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "createdAtLt": { - "format": "date-time", + "encryptedPaths": { + "type": "array", + "description": "This is the paths to encrypt in the request body if credentialId and encryptionPlan are defined.", + "items": { + "type": "string" + } + }, + "id": { "type": "string", - "description": "This will return items where the createdAt is less than the specified value." + "description": "This is the unique identifier for the tool." }, - "createdAtGe": { - "format": "date-time", + "orgId": { "type": "string", - "description": "This will return items where the createdAt is greater than or equal to the specified value." + "description": "This is the unique identifier for the organization that this tool belongs to." }, - "createdAtLe": { + "createdAt": { "format": "date-time", "type": "string", - "description": "This will return items where the createdAt is less than or equal to the specified value." + "description": "This is the ISO 8601 date-time string of when the tool was created." }, - "updatedAtGt": { + "updatedAt": { "format": "date-time", "type": "string", - "description": "This will return items where the updatedAt is greater than the specified value." + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "updatedAtLt": { - "format": "date-time", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + }, + "name": { "type": "string", - "description": "This will return items where the updatedAt is less than the specified value." + "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", + "maxLength": 40, + "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" }, - "updatedAtGe": { - "format": "date-time", + "description": { "type": "string", - "description": "This will return items where the updatedAt is greater than or equal to the specified value." + "description": "This is the description of the tool. This will be passed to the model." }, - "updatedAtLe": { - "format": "date-time", + "url": { "type": "string", - "description": "This will return items where the updatedAt is less than or equal to the specified value." - } - } - }, - "SessionPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session" - } + "description": "This is where the request will be sent." }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "Assistant": { - "type": "object", - "properties": { - "transcriber": { - "description": "These are the options for the assistant's transcriber.", - "oneOf": [ - { - "$ref": "#/components/schemas/AssemblyAITranscriber", - "title": "AssemblyAITranscriber" - }, - { - "$ref": "#/components/schemas/AzureSpeechTranscriber", - "title": "AzureSpeechTranscriber" - }, - { - "$ref": "#/components/schemas/CustomTranscriber", - "title": "CustomTranscriber" - }, - { - "$ref": "#/components/schemas/DeepgramTranscriber", - "title": "DeepgramTranscriber" - }, - { - "$ref": "#/components/schemas/ElevenLabsTranscriber", - "title": "ElevenLabsTranscriber" - }, - { - "$ref": "#/components/schemas/GladiaTranscriber", - "title": "GladiaTranscriber" - }, - { - "$ref": "#/components/schemas/GoogleTranscriber", - "title": "GoogleTranscriber" - }, - { - "$ref": "#/components/schemas/SpeechmaticsTranscriber", - "title": "SpeechmaticsTranscriber" - }, - { - "$ref": "#/components/schemas/TalkscriberTranscriber", - "title": "TalkscriberTranscriber" - }, - { - "$ref": "#/components/schemas/OpenAITranscriber", - "title": "OpenAITranscriber" - }, + "body": { + "description": "This is the body of the request.", + "allOf": [ { - "$ref": "#/components/schemas/CartesiaTranscriber", - "title": "CartesiaTranscriber" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "model": { - "description": "These are the options for the assistant's LLM.", - "oneOf": [ - { - "$ref": "#/components/schemas/AnthropicModel", - "title": "Anthropic" - }, - { - "$ref": "#/components/schemas/AnyscaleModel", - "title": "Anyscale" - }, - { - "$ref": "#/components/schemas/CerebrasModel", - "title": "Cerebras" - }, - { - "$ref": "#/components/schemas/CustomLLMModel", - "title": "CustomLLM" - }, - { - "$ref": "#/components/schemas/DeepInfraModel", - "title": "DeepInfra" - }, - { - "$ref": "#/components/schemas/DeepSeekModel", - "title": "DeepSeek" - }, - { - "$ref": "#/components/schemas/GoogleModel", - "title": "Google" - }, - { - "$ref": "#/components/schemas/GroqModel", - "title": "Groq" - }, - { - "$ref": "#/components/schemas/InflectionAIModel", - "title": "InflectionAI" - }, - { - "$ref": "#/components/schemas/OpenAIModel", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/OpenRouterModel", - "title": "OpenRouter" - }, - { - "$ref": "#/components/schemas/PerplexityAIModel", - "title": "PerplexityAI" - }, - { - "$ref": "#/components/schemas/TogetherAIModel", - "title": "Together" - }, + "headers": { + "description": "These are the headers to send with the request.", + "allOf": [ { - "$ref": "#/components/schemas/XaiModel", - "title": "XAI" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "voice": { - "description": "These are the options for the assistant's voice.", - "oneOf": [ - { - "$ref": "#/components/schemas/AzureVoice", - "title": "AzureVoice" - }, - { - "$ref": "#/components/schemas/CartesiaVoice", - "title": "CartesiaVoice" - }, - { - "$ref": "#/components/schemas/CustomVoice", - "title": "CustomVoice" - }, - { - "$ref": "#/components/schemas/DeepgramVoice", - "title": "DeepgramVoice" - }, - { - "$ref": "#/components/schemas/ElevenLabsVoice", - "title": "ElevenLabsVoice" - }, - { - "$ref": "#/components/schemas/HumeVoice", - "title": "HumeVoice" - }, - { - "$ref": "#/components/schemas/LMNTVoice", - "title": "LMNTVoice" - }, - { - "$ref": "#/components/schemas/NeuphonicVoice", - "title": "NeuphonicVoice" - }, - { - "$ref": "#/components/schemas/OpenAIVoice", - "title": "OpenAIVoice" - }, - { - "$ref": "#/components/schemas/PlayHTVoice", - "title": "PlayHTVoice" - }, - { - "$ref": "#/components/schemas/RimeAIVoice", - "title": "RimeAIVoice" - }, - { - "$ref": "#/components/schemas/SmallestAIVoice", - "title": "SmallestAIVoice" - }, - { - "$ref": "#/components/schemas/TavusVoice", - "title": "TavusVoice" - }, - { - "$ref": "#/components/schemas/VapiVoice", - "title": "VapiVoice" - }, - { - "$ref": "#/components/schemas/SesameVoice", - "title": "SesameVoice" - }, - { - "$ref": "#/components/schemas/InworldVoice", - "title": "InworldVoice" - }, + "backoffPlan": { + "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", + "allOf": [ { - "$ref": "#/components/schemas/MinimaxVoice", - "title": "MinimaxVoice" + "$ref": "#/components/schemas/BackoffPlan" } ] }, - "firstMessage": { + "variableExtractionPlan": { + "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + } + }, + "required": [ + "type", + "method", + "id", + "orgId", + "createdAt", + "updatedAt", + "url" + ] + }, + "CodeToolEnvironmentVariable": { + "type": "object", + "properties": { + "name": { "type": "string", - "description": "This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", - "example": "Hello! How can I help you today?" + "description": "Name of the environment variable", + "maxLength": 64, + "pattern": "/^[A-Z][A-Z0-9_]*$/", + "example": "API_KEY" }, - "firstMessageInterruptionsEnabled": { - "type": "boolean", - "default": false + "value": { + "type": "string", + "description": "Value of the environment variable. Supports Liquid templates.", + "maxLength": 10000, + "example": "{{apiKey}}" + } + }, + "required": [ + "name", + "value" + ] + }, + "CodeTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } }, - "firstMessageMode": { + "type": { "type": "string", - "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points).\n\n@default 'assistant-speaks-first'", "enum": [ - "assistant-speaks-first", - "assistant-speaks-first-with-model-generated-message", - "assistant-waits-for-user" + "code" ], - "example": "assistant-speaks-first" + "description": "The type of tool. \"code\" for Code tool." }, - "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", - "oneOf": [ - { - "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", - "title": "Google" - }, - { - "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", - "title": "Twilio" - }, + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ { - "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", - "title": "Vapi" + "$ref": "#/components/schemas/Server" } ] }, - "clientMessages": { - "type": "array", - "enum": [ - "conversation-update", - "function-call", - "function-call-result", - "hang", - "language-changed", - "metadata", - "model-output", - "speech-update", - "status-update", - "transcript", - "tool-calls", - "tool-calls-result", - "tool.completed", - "transfer-update", - "user-interrupted", - "voice-input", - "workflow.node.started" - ], - "example": [ - "conversation-update", - "function-call", - "hang", - "model-output", - "speech-update", - "status-update", - "transfer-update", - "transcript", - "tool-calls", - "user-interrupted", - "voice-input", - "workflow.node.started" - ], - "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema.", - "items": { - "type": "string", - "enum": [ - "conversation-update", - "function-call", - "function-call-result", - "hang", - "language-changed", - "metadata", - "model-output", - "speech-update", - "status-update", - "transcript", - "tool-calls", - "tool-calls-result", - "tool.completed", - "transfer-update", - "user-interrupted", - "voice-input", - "workflow.node.started" - ] - } + "code": { + "type": "string", + "description": "TypeScript code to execute when the tool is called", + "maxLength": 50000 }, - "serverMessages": { + "environmentVariables": { + "description": "Environment variables available in code via `env` object", "type": "array", - "enum": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "language-changed", - "language-change-detected", - "model-output", - "phone-call-control", - "speech-update", - "status-update", - "transcript", - "transcript[transcriptType=\"final\"]", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "transfer-update", - "user-interrupted", - "voice-input", - "chat.created", - "chat.deleted", - "session.created", - "session.updated", - "session.deleted" - ], - "example": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "speech-update", - "status-update", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "user-interrupted" - ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", "items": { - "type": "string", - "enum": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "language-changed", - "language-change-detected", - "model-output", - "phone-call-control", - "speech-update", - "status-update", - "transcript", - "transcript[transcriptType=\"final\"]", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "transfer-update", - "user-interrupted", - "voice-input", - "chat.created", - "chat.deleted", - "session.created", - "session.updated", - "session.deleted" - ] + "$ref": "#/components/schemas/CodeToolEnvironmentVariable" } }, - "maxDurationSeconds": { + "timeoutSeconds": { "type": "number", - "description": "This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.\n\n@default 600 (10 minutes)", - "minimum": 10, - "maximum": 43200, - "example": 600 + "description": "This is the timeout in seconds for the code execution. Defaults to 10 seconds.\nMaximum is 30 seconds to prevent abuse.\n\n@default 10", + "minimum": 1, + "maximum": 30, + "example": 10 }, - "backgroundSound": { - "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", - "oneOf": [ - { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" - }, + "credentialId": { + "type": "string", + "description": "Credential ID containing the Val Town API key", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "variableExtractionPlan": { + "description": "Plan to extract variables from the tool response", + "allOf": [ { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + "$ref": "#/components/schemas/VariableExtractionPlan" } ] }, - "modelOutputInMessagesEnabled": { - "type": "boolean", - "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\nDefault `false` while in beta.\n\n@default false", - "example": false + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." }, - "transportConfigurations": { - "type": "array", - "description": "These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransportConfigurationTwilio", - "title": "Twilio" - } - ] - } + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." }, - "observabilityPlan": { - "description": "This is the plan for observability of assistant's calls.\n\nCurrently, only Langfuse is supported.", - "oneOf": [ + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" + "$ref": "#/components/schemas/ToolRejectionPlan" } - ], + ] + }, + "function": { + "description": "This is the function definition of the tool.\n\nFor the Code tool, this defines the name, description, and parameters that the model\nwill use to understand when and how to call this tool.", "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$ref": "#/components/schemas/OpenAIFunction" } ] - }, - "credentials": { + } + }, + "required": [ + "type", + "code", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "DtmfTool": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", - "title": "AnthropicCredential" - }, - { - "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", - "title": "AnyscaleCredential" - }, - { - "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", - "title": "AssemblyAICredential" - }, - { - "$ref": "#/components/schemas/CreateAzureCredentialDTO", - "title": "AzureCredential" - }, - { - "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "title": "AzureOpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "title": "ByoSipTrunkCredential" - }, - { - "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", - "title": "CartesiaCredential" - }, - { - "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", - "title": "CerebrasCredential" - }, - { - "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", - "title": "CloudflareCredential" - }, - { - "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", - "title": "CustomLLMCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" - }, - { - "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" - }, - { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" - }, - { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCredentialDTO", - "title": "GoogleCredential" - }, - { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "dtmf" + ], + "description": "The type of tool. \"dtmf\" for DTMF tool." + }, + "sipInfoDtmfEnabled": { + "type": "boolean", + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", + "default": false + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "EndCallTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "endCall" + ], + "description": "The type of tool. \"endCall\" for End Call tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "FunctionTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", - "title": "PlayHTCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool. \"function\" for Function tool." + }, + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + }, + "function": { + "description": "This is the function definition of the tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GhlTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateRimeAICredentialDTO", - "title": "RimeAICredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateRunpodCredentialDTO", - "title": "RunpodCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateS3CredentialDTO", - "title": "S3Credential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", - "title": "SmallestAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "ghl" + ], + "description": "The type of tool. \"ghl\" for GHL tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + }, + "metadata": { + "$ref": "#/components/schemas/GhlToolMetadata" + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt", + "metadata" + ] + }, + "MakeTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "title": "SpeechmaticsCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", - "title": "SupabaseCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateTavusCredentialDTO", - "title": "TavusCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "make" + ], + "description": "The type of tool. \"make\" for Make tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + }, + "metadata": { + "$ref": "#/components/schemas/MakeToolMetadata" + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt", + "metadata" + ] + }, + "TransferCallTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateTwilioCredentialDTO", - "title": "TwilioCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "transferCall" + ] + }, + "destinations": { + "type": "array", + "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" - }, + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "Sip" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "HandoffTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "title": "SlackOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "title": "GoHighLevelMCPCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateInworldCredentialDTO", - "title": "InworldCredential" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", - "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", - "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", - "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", - "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "azure": "#/components/schemas/CreateAzureCredentialDTO", - "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", - "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", - "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", - "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", - "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", - "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", - "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", - "gcp": "#/components/schemas/CreateGcpCredentialDTO", - "gladia": "#/components/schemas/CreateGladiaCredentialDTO", - "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "google": "#/components/schemas/CreateGoogleCredentialDTO", - "groq": "#/components/schemas/CreateGroqCredentialDTO", - "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", - "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", - "lmnt": "#/components/schemas/CreateLmntCredentialDTO", - "make": "#/components/schemas/CreateMakeCredentialDTO", - "openai": "#/components/schemas/CreateOpenAICredentialDTO", - "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", - "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", - "playht": "#/components/schemas/CreatePlayHTCredentialDTO", - "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", - "runpod": "#/components/schemas/CreateRunpodCredentialDTO", - "s3": "#/components/schemas/CreateS3CredentialDTO", - "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", - "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", - "tavus": "#/components/schemas/CreateTavusCredentialDTO", - "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", - "twilio": "#/components/schemas/CreateTwilioCredentialDTO", - "vonage": "#/components/schemas/CreateVonageCredentialDTO", - "webhook": "#/components/schemas/CreateWebhookCredentialDTO", - "xai": "#/components/schemas/CreateXAiCredentialDTO", - "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", - "hume": "#/components/schemas/CreateHumeCredentialDTO", - "mistral": "#/components/schemas/CreateMistralCredentialDTO", - "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "trieve": "#/components/schemas/CreateTrieveCredentialDTO", - "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } - } + ] } }, - "hooks": { + "type": { + "type": "string", + "description": "This is the type of the tool.\nWhen you're using handoff tool, we recommend adding this to your system prompt\n---\n# System context\n\nYou are part of a multi-agent system designed to make agent coordination and execution easy. Agents uses two primary abstraction: **Agents** and **Handoffs**. An agent encompasses instructions and tools and can hand off a conversation to another agent when appropriate. Handoffs are achieved by calling a handoff function, generally named `handoff_to_`. Handoffs between agents are handled seamlessly in the background; do not mention or draw attention to these handoffs in your conversation with the user.\n\n# Agent context\n\n{put your agent system prompt here}\n---", + "enum": [ + "handoff" + ] + }, + "destinations": { "type": "array", - "description": "This is a set of actions that will be performed on certain events.", + "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" - }, - { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Assistant" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" + "$ref": "#/components/schemas/HandoffDestinationDynamic", + "title": "Dynamic" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" + "$ref": "#/components/schemas/HandoffDestinationSquad", + "title": "Squad" } ] } }, - "name": { + "id": { "type": "string", - "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", - "maxLength": 40 + "description": "This is the unique identifier for the tool." }, - "voicemailMessage": { + "orgId": { "type": "string", - "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", - "maxLength": 1000 + "description": "This is the unique identifier for the organization that this tool belongs to." }, - "endCallMessage": { + "createdAt": { + "format": "date-time", "type": "string", - "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", - "maxLength": 1000 - }, - "endCallPhrases": { - "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", - "type": "array", - "items": { - "type": "string", - "maxLength": 140, - "minLength": 2 - } - }, - "compliancePlan": { - "$ref": "#/components/schemas/CompliancePlan" - }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the assistant." - }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", - "allOf": [ - { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" - } - ] - }, - "analysisPlan": { - "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" - } - ] - }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactPlan" - } - ] + "description": "This is the ISO 8601 date-time string of when the tool was created." }, - "startSpeakingPlan": { - "description": "This is the plan for when the assistant should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", - "allOf": [ - { - "$ref": "#/components/schemas/StartSpeakingPlan" - } - ] + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "stopSpeakingPlan": { - "description": "This is the plan for when assistant should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/StopSpeakingPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "monitorPlan": { - "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.", + "function": { + "description": "This is the optional function definition that will be passed to the LLM.\nIf this is not defined, we will construct this based on the other properties.\n\nFor example, given the following tools definition:\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\nWe will construct the following function definition:\n```json\n{\n \"function\": {\n \"name\": \"handoff_to_assistant-123\",\n \"description\": \"\n Use this function to handoff the call to the next assistant.\n Only use it when instructions explicitly ask you to use the handoff_to_assistant function.\n DO NOT call this function unless you are instructed to do so.\n Here are the destinations you can handoff the call to:\n 1. assistant-123. When: customer wants to be handed off to assistant-123\n 2. assistant-456. When: customer wants to be handed off to assistant-456\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Options: assistant-123 (customer wants to be handed off to assistant-123), assistant-456 (customer wants to be handed off to assistant-456)\",\n \"enum\": [\"assistant-123\", \"assistant-456\"]\n },\n },\n \"required\": [\"destination\"]\n }\n }\n}\n```\n\nTo override this function, please provide an OpenAI function definition and refer to it in the system prompt.\nYou may override parts of the function definition (i.e. you may only want to change the function name for your prompt).\nIf you choose to override the function parameters, it must include `destination` as a required parameter, and it must evaluate to either an assistantId, assistantName, or a the string literal `dynamic`.\n\nTo pass custom parameters to the server in a dynamic handoff, you can use the function parameters, with `dynamic` as the destination.\n```json\n{\n \"function\": {\n \"name\": \"dynamic_handoff\",\n \"description\": \"\n Call this function when the customer is ready to be handed off to the next assistant\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n },\n \"required\": [\"destination\", \"customerAreaCode\", \"customerIntent\", \"customerSentiment\"]\n }\n }\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/MonitorPlan" + "$ref": "#/components/schemas/OpenAIFunction" } ] - }, - "credentialIds": { - "description": "These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "OutputTool": { + "type": "object", + "properties": { + "messages": { "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] } }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server.url\n2. phoneNumber.serverUrl\n3. org.serverUrl", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "keypadInputPlan": { - "$ref": "#/components/schemas/KeypadInputPlan" + "type": { + "type": "string", + "enum": [ + "output" + ], + "description": "The type of tool. \"output\" for Output tool." }, "id": { "type": "string", - "description": "This is the unique identifier for the assistant." + "description": "This is the unique identifier for the tool." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this assistant belongs to." + "description": "This is the unique identifier for the organization that this tool belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the assistant was created." + "description": "This is the ISO 8601 date-time string of when the tool was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] } }, "required": [ + "type", "id", "orgId", "createdAt", "updatedAt" ] }, - "AssistantPaginatedResponse": { + "BashTool": { "type": "object", "properties": { - "results": { + "messages": { "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "$ref": "#/components/schemas/Assistant" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] } }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "AssistantVersionPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array" - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" + "type": { + "type": "string", + "enum": [ + "bash" + ], + "description": "The type of tool. \"bash\" for Bash tool." }, - "nextPageState": { - "type": "string" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "UpdateAssistantDTO": { - "type": "object", - "properties": { - "transcriber": { - "description": "These are the options for the assistant's transcriber.", - "oneOf": [ - { - "$ref": "#/components/schemas/AssemblyAITranscriber", - "title": "AssemblyAITranscriber" - }, - { - "$ref": "#/components/schemas/AzureSpeechTranscriber", - "title": "AzureSpeechTranscriber" - }, - { - "$ref": "#/components/schemas/CustomTranscriber", - "title": "CustomTranscriber" - }, - { - "$ref": "#/components/schemas/DeepgramTranscriber", - "title": "DeepgramTranscriber" - }, - { - "$ref": "#/components/schemas/ElevenLabsTranscriber", - "title": "ElevenLabsTranscriber" - }, - { - "$ref": "#/components/schemas/GladiaTranscriber", - "title": "GladiaTranscriber" - }, - { - "$ref": "#/components/schemas/GoogleTranscriber", - "title": "GoogleTranscriber" - }, - { - "$ref": "#/components/schemas/SpeechmaticsTranscriber", - "title": "SpeechmaticsTranscriber" - }, - { - "$ref": "#/components/schemas/TalkscriberTranscriber", - "title": "TalkscriberTranscriber" - }, - { - "$ref": "#/components/schemas/OpenAITranscriber", - "title": "OpenAITranscriber" - }, - { - "$ref": "#/components/schemas/CartesiaTranscriber", - "title": "CartesiaTranscriber" - } - ] + "subType": { + "type": "string", + "enum": [ + "bash_20241022" + ], + "description": "The sub type of tool." }, - "model": { - "description": "These are the options for the assistant's LLM.", - "oneOf": [ - { - "$ref": "#/components/schemas/AnthropicModel", - "title": "Anthropic" - }, - { - "$ref": "#/components/schemas/AnyscaleModel", - "title": "Anyscale" - }, - { - "$ref": "#/components/schemas/CerebrasModel", - "title": "Cerebras" - }, - { - "$ref": "#/components/schemas/CustomLLMModel", - "title": "CustomLLM" - }, - { - "$ref": "#/components/schemas/DeepInfraModel", - "title": "DeepInfra" - }, - { - "$ref": "#/components/schemas/DeepSeekModel", - "title": "DeepSeek" - }, - { - "$ref": "#/components/schemas/GoogleModel", - "title": "Google" - }, - { - "$ref": "#/components/schemas/GroqModel", - "title": "Groq" - }, - { - "$ref": "#/components/schemas/InflectionAIModel", - "title": "InflectionAI" - }, - { - "$ref": "#/components/schemas/OpenAIModel", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/OpenRouterModel", - "title": "OpenRouter" - }, - { - "$ref": "#/components/schemas/PerplexityAIModel", - "title": "PerplexityAI" - }, - { - "$ref": "#/components/schemas/TogetherAIModel", - "title": "Together" - }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ { - "$ref": "#/components/schemas/XaiModel", - "title": "XAI" + "$ref": "#/components/schemas/Server" } ] }, - "voice": { - "description": "These are the options for the assistant's voice.", - "oneOf": [ - { - "$ref": "#/components/schemas/AzureVoice", - "title": "AzureVoice" - }, - { - "$ref": "#/components/schemas/CartesiaVoice", - "title": "CartesiaVoice" - }, - { - "$ref": "#/components/schemas/CustomVoice", - "title": "CustomVoice" - }, - { - "$ref": "#/components/schemas/DeepgramVoice", - "title": "DeepgramVoice" - }, - { - "$ref": "#/components/schemas/ElevenLabsVoice", - "title": "ElevenLabsVoice" - }, - { - "$ref": "#/components/schemas/HumeVoice", - "title": "HumeVoice" - }, - { - "$ref": "#/components/schemas/LMNTVoice", - "title": "LMNTVoice" - }, - { - "$ref": "#/components/schemas/NeuphonicVoice", - "title": "NeuphonicVoice" - }, - { - "$ref": "#/components/schemas/OpenAIVoice", - "title": "OpenAIVoice" - }, - { - "$ref": "#/components/schemas/PlayHTVoice", - "title": "PlayHTVoice" - }, - { - "$ref": "#/components/schemas/RimeAIVoice", - "title": "RimeAIVoice" - }, - { - "$ref": "#/components/schemas/SmallestAIVoice", - "title": "SmallestAIVoice" - }, - { - "$ref": "#/components/schemas/TavusVoice", - "title": "TavusVoice" - }, - { - "$ref": "#/components/schemas/VapiVoice", - "title": "VapiVoice" - }, - { - "$ref": "#/components/schemas/SesameVoice", - "title": "SesameVoice" - }, - { - "$ref": "#/components/schemas/InworldVoice", - "title": "InworldVoice" - }, - { - "$ref": "#/components/schemas/MinimaxVoice", - "title": "MinimaxVoice" - } - ] + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." }, - "firstMessage": { + "orgId": { "type": "string", - "description": "This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).\n\nIf unspecified, assistant will wait for user to speak and use the model to respond once they speak.", - "example": "Hello! How can I help you today?" + "description": "This is the unique identifier for the organization that this tool belongs to." }, - "firstMessageInterruptionsEnabled": { - "type": "boolean", - "default": false + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." }, - "firstMessageMode": { + "updatedAt": { + "format": "date-time", "type": "string", - "description": "This is the mode for the first message. Default is 'assistant-speaks-first'.\n\nUse:\n- 'assistant-speaks-first' to have the assistant speak first.\n- 'assistant-waits-for-user' to have the assistant wait for the user to speak first.\n- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points).\n\n@default 'assistant-speaks-first'", - "enum": [ - "assistant-speaks-first", - "assistant-speaks-first-with-model-generated-message", - "assistant-waits-for-user" - ], - "example": "assistant-speaks-first" + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "voicemailDetection": { - "description": "These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool].\nThis uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached.\nYou can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.", - "oneOf": [ - { - "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", - "title": "Google" - }, - { - "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", - "title": "Twilio" - }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", - "title": "Vapi" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "clientMessages": { - "type": "array", + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'bash'", + "default": "bash", "enum": [ - "conversation-update", - "function-call", - "function-call-result", - "hang", - "language-changed", - "metadata", - "model-output", - "speech-update", - "status-update", - "transcript", - "tool-calls", - "tool-calls-result", - "tool.completed", - "transfer-update", - "user-interrupted", - "voice-input", - "workflow.node.started" - ], - "example": [ - "conversation-update", - "function-call", - "hang", - "model-output", - "speech-update", - "status-update", - "transfer-update", - "transcript", - "tool-calls", - "user-interrupted", - "voice-input", - "workflow.node.started" - ], - "description": "These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema.", + "bash" + ] + } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name" + ] + }, + "ComputerTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "type": "string", - "enum": [ - "conversation-update", - "function-call", - "function-call-result", - "hang", - "language-changed", - "metadata", - "model-output", - "speech-update", - "status-update", - "transcript", - "tool-calls", - "tool-calls-result", - "tool.completed", - "transfer-update", - "user-interrupted", - "voice-input", - "workflow.node.started" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } ] } }, - "serverMessages": { - "type": "array", + "type": { + "type": "string", "enum": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "language-changed", - "language-change-detected", - "model-output", - "phone-call-control", - "speech-update", - "status-update", - "transcript", - "transcript[transcriptType=\"final\"]", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "transfer-update", - "user-interrupted", - "voice-input", - "chat.created", - "chat.deleted", - "session.created", - "session.updated", - "session.deleted" - ], - "example": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "speech-update", - "status-update", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "user-interrupted" + "computer" ], - "description": "These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.", - "items": { - "type": "string", - "enum": [ - "conversation-update", - "end-of-call-report", - "function-call", - "hang", - "language-changed", - "language-change-detected", - "model-output", - "phone-call-control", - "speech-update", - "status-update", - "transcript", - "transcript[transcriptType=\"final\"]", - "tool-calls", - "transfer-destination-request", - "handoff-destination-request", - "transfer-update", - "user-interrupted", - "voice-input", - "chat.created", - "chat.deleted", - "session.created", - "session.updated", - "session.deleted" - ] - } + "description": "The type of tool. \"computer\" for Computer tool." }, - "maxDurationSeconds": { - "type": "number", - "description": "This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.\n\n@default 600 (10 minutes)", - "minimum": 10, - "maximum": 43200, - "example": 600 + "subType": { + "type": "string", + "enum": [ + "computer_20241022" + ], + "description": "The sub type of tool." }, - "backgroundSound": { - "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", - "oneOf": [ + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" - }, + "$ref": "#/components/schemas/Server" + } + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "modelOutputInMessagesEnabled": { - "type": "boolean", - "description": "This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech.\n\nDefault `false` while in beta.\n\n@default false", - "example": false + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'computer'", + "default": "computer", + "enum": [ + "computer" + ] }, - "transportConfigurations": { + "displayWidthPx": { + "type": "number", + "description": "The display width in pixels" + }, + "displayHeightPx": { + "type": "number", + "description": "The display height in pixels" + }, + "displayNumber": { + "type": "number", + "description": "Optional display number" + } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "displayWidthPx", + "displayHeightPx" + ] + }, + "TextEditorTool": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TransportConfigurationTwilio", - "title": "Twilio" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "observabilityPlan": { - "description": "This is the plan for observability of assistant's calls.\n\nCurrently, only Langfuse is supported.", - "oneOf": [ + "type": { + "type": "string", + "enum": [ + "textEditor" + ], + "description": "The type of tool. \"textEditor\" for Text Editor tool." + }, + "subType": { + "type": "string", + "enum": [ + "text_editor_20241022" + ], + "description": "The sub type of tool." + }, + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" + "$ref": "#/components/schemas/Server" } - ], + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "credentials": { + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'str_replace_editor'", + "default": "str_replace_editor", + "enum": [ + "str_replace_editor" + ] + } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name" + ] + }, + "QueryTool": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", - "title": "AnthropicCredential" - }, - { - "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", - "title": "AnyscaleCredential" - }, - { - "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", - "title": "AssemblyAICredential" - }, - { - "$ref": "#/components/schemas/CreateAzureCredentialDTO", - "title": "AzureCredential" - }, - { - "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "title": "AzureOpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "title": "ByoSipTrunkCredential" - }, - { - "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", - "title": "CartesiaCredential" - }, - { - "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", - "title": "CerebrasCredential" - }, - { - "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", - "title": "CloudflareCredential" - }, - { - "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", - "title": "CustomLLMCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" - }, - { - "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" - }, - { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" - }, - { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCredentialDTO", - "title": "GoogleCredential" - }, - { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" - }, - { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" - }, - { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" - }, - { - "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" - }, - { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" - }, - { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" - }, - { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, - { - "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" - }, - { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" - }, - { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" - }, - { - "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", - "title": "PlayHTCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateRimeAICredentialDTO", - "title": "RimeAICredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateRunpodCredentialDTO", - "title": "RunpodCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateS3CredentialDTO", - "title": "S3Credential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "query" + ], + "description": "The type of tool. \"query\" for Query tool." + }, + "knowledgeBases": { + "description": "The knowledge bases to query", + "type": "array", + "items": { + "$ref": "#/components/schemas/KnowledgeBase" + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoogleCalendarCreateEventTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", - "title": "SmallestAICredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "title": "SpeechmaticsCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", - "title": "SupabaseCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateTavusCredentialDTO", - "title": "TavusCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "google.calendar.event.create" + ], + "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoogleSheetsRowAppendTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateTwilioCredentialDTO", - "title": "TwilioCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "google.sheets.row.append" + ], + "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoogleCalendarCheckAvailabilityTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "google.calendar.availability.check" + ], + "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "SlackSendMessageTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "title": "SlackOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "title": "GoHighLevelMCPCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateInworldCredentialDTO", - "title": "InworldCredential" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", - "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", - "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", - "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", - "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "azure": "#/components/schemas/CreateAzureCredentialDTO", - "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", - "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", - "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", - "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", - "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", - "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", - "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", - "gcp": "#/components/schemas/CreateGcpCredentialDTO", - "gladia": "#/components/schemas/CreateGladiaCredentialDTO", - "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "google": "#/components/schemas/CreateGoogleCredentialDTO", - "groq": "#/components/schemas/CreateGroqCredentialDTO", - "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", - "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", - "lmnt": "#/components/schemas/CreateLmntCredentialDTO", - "make": "#/components/schemas/CreateMakeCredentialDTO", - "openai": "#/components/schemas/CreateOpenAICredentialDTO", - "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", - "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", - "playht": "#/components/schemas/CreatePlayHTCredentialDTO", - "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", - "runpod": "#/components/schemas/CreateRunpodCredentialDTO", - "s3": "#/components/schemas/CreateS3CredentialDTO", - "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", - "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", - "tavus": "#/components/schemas/CreateTavusCredentialDTO", - "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", - "twilio": "#/components/schemas/CreateTwilioCredentialDTO", - "vonage": "#/components/schemas/CreateVonageCredentialDTO", - "webhook": "#/components/schemas/CreateWebhookCredentialDTO", - "xai": "#/components/schemas/CreateXAiCredentialDTO", - "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", - "hume": "#/components/schemas/CreateHumeCredentialDTO", - "mistral": "#/components/schemas/CreateMistralCredentialDTO", - "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "trieve": "#/components/schemas/CreateTrieveCredentialDTO", - "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } - } + ] } }, - "hooks": { + "type": { + "type": "string", + "enum": [ + "slack.message.send" + ], + "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "SmsTool": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "This is a set of actions that will be performed on certain events.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "name": { + "type": { "type": "string", - "description": "This is the name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", - "maxLength": 40 + "enum": [ + "sms" + ], + "description": "The type of tool. \"sms\" for Twilio SMS sending tool." }, - "voicemailMessage": { + "id": { "type": "string", - "description": "This is the message that the assistant will say if the call is forwarded to voicemail.\n\nIf unspecified, it will hang up.", - "maxLength": 1000 + "description": "This is the unique identifier for the tool." }, - "endCallMessage": { + "orgId": { "type": "string", - "description": "This is the message that the assistant will say if it ends the call.\n\nIf unspecified, it will hang up without saying anything.", - "maxLength": 1000 - }, - "endCallPhrases": { - "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", - "type": "array", - "items": { - "type": "string", - "maxLength": 140, - "minLength": 2 - } + "description": "This is the unique identifier for the organization that this tool belongs to." }, - "compliancePlan": { - "$ref": "#/components/schemas/CompliancePlan" + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the assistant." + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nSmart denoising can be combined with or used independently of Fourier denoising.\n\nOrder of precedence:\n- Smart denoising\n- Fourier denoising", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "McpTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } }, - "analysisPlan": { - "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" - } - ] + "type": { + "type": "string", + "enum": [ + "mcp" + ], + "description": "The type of tool. \"mcp\" for MCP tool." }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ { - "$ref": "#/components/schemas/ArtifactPlan" + "$ref": "#/components/schemas/Server" } ] }, - "startSpeakingPlan": { - "description": "This is the plan for when the assistant should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", - "allOf": [ - { - "$ref": "#/components/schemas/StartSpeakingPlan" - } - ] + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." }, - "stopSpeakingPlan": { - "description": "This is the plan for when assistant should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/StopSpeakingPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "monitorPlan": { - "description": "This is the plan for real-time monitoring of the assistant's calls.\n\nUsage:\n- To enable live listening of the assistant's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the assistant's calls, set `monitorPlan.controlEnabled` to `true`.", + "metadata": { + "$ref": "#/components/schemas/McpToolMetadata" + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoHighLevelCalendarAvailabilityTool": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.calendar.availability.check" + ], + "description": "The type of tool. \"gohighlevel.calendar.availability.check\" for GoHighLevel Calendar Availability Check tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/MonitorPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "credentialIds": { - "description": "These are the credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoHighLevelCalendarEventCreateTool": { + "type": "object", + "properties": { + "messages": { "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] } }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server.url\n2. phoneNumber.serverUrl\n3. org.serverUrl", + "type": { + "type": "string", + "enum": [ + "gohighlevel.calendar.event.create" + ], + "description": "The type of tool. \"gohighlevel.calendar.event.create\" for GoHighLevel Calendar Event Create tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "keypadInputPlan": { - "$ref": "#/components/schemas/KeypadInputPlan" } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "ByoPhoneNumber": { + "GoHighLevelContactCreateTool": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "type": { + "type": "string", + "enum": [ + "gohighlevel.contact.create" + ], + "description": "The type of tool. \"gohighlevel.contact.create\" for GoHighLevel Contact Create tool." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the tool." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization that this tool belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the tool was last updated." + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "hooks": { + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoHighLevelContactGetTool": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ - "byo-phone-number" - ] - }, - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true + "gohighlevel.contact.get" + ], + "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." }, "id": { "type": "string", - "description": "This is the unique identifier for the phone number." + "description": "This is the unique identifier for the tool." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "description": "This is the unique identifier for the organization that this tool belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "description": "This is the ISO 8601 date-time string of when the tool was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." - }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" - ] - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "number": { - "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 - }, - "credentialId": { - "type": "string", - "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." } }, "required": [ - "provider", + "type", "id", "orgId", "createdAt", - "updatedAt", - "credentialId" + "updatedAt" ] }, - "TwilioPhoneNumber": { + "SipRequestTool": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to use numbers bought on Twilio.", "enum": [ - "twilio" + "sipRequest" + ], + "description": "The type of tool. \"sipRequest\" for SIP request tool." + }, + "verb": { + "type": "string", + "enum": [ + "INFO", + "MESSAGE", + "NOTIFY" + ], + "description": "The SIP method to send." + }, + "headers": { + "description": "JSON schema for headers the model should populate when sending the SIP request.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } ] }, - "smsEnabled": { - "type": "boolean", - "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", - "default": true + "body": { + "description": "Body to include in the SIP request. Either a literal string body, or a JSON schema describing a structured body that the model should populate.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonSchema" + } + ] }, "id": { "type": "string", - "description": "This is the unique identifier for the phone number." + "description": "This is the unique identifier for the tool." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "description": "This is the unique identifier for the organization that this tool belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "description": "This is the ISO 8601 date-time string of when the tool was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." - }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" - ] - }, - "twilioAuthToken": { - "type": "string", - "description": "This is the Twilio Auth Token for the phone number." - }, - "twilioApiKey": { - "type": "string", - "description": "This is the Twilio API Key for the phone number." - }, - "twilioApiSecret": { - "type": "string", - "description": "This is the Twilio API Secret for the phone number." - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Twilio." - }, - "twilioAccountSid": { - "type": "string", - "description": "This is the Twilio Account SID for the phone number." } }, "required": [ - "provider", + "type", + "verb", "id", "orgId", "createdAt", - "updatedAt", - "number", - "twilioAccountSid" + "updatedAt" ] }, - "VonagePhoneNumber": { + "VoicemailTool": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to use numbers bought on Vonage.", + "description": "The type of tool. \"voicemail\" for Voicemail tool.", "enum": [ - "vonage" + "voicemail" ] }, + "beepDetectionEnabled": { + "type": "boolean", + "description": "This is the flag that enables beep detection for voicemail detection and applies only for twilio based calls.\n\n@default false", + "default": false, + "example": false + }, "id": { "type": "string", - "description": "This is the unique identifier for the phone number." + "description": "This is the unique identifier for the tool." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "description": "This is the unique identifier for the organization that this tool belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "description": "This is the ISO 8601 date-time string of when the tool was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." - }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" - ] - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the ISO 8601 date-time string of when the tool was last updated." }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." - }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." } }, "required": [ - "provider", + "type", "id", "orgId", "createdAt", - "updatedAt", - "number", - "credentialId" - ] - }, - "SipAuthentication": { - "type": "object", - "properties": { - "realm": { - "type": "string", - "description": "This will be expected in the `realm` field of the `authorization` header of the SIP INVITE. Defaults to sip.vapi.ai." - }, - "username": { - "type": "string", - "description": "This will be expected in the `username` field of the `authorization` header of the SIP INVITE.", - "minLength": 20, - "maxLength": 40 - }, - "password": { - "type": "string", - "description": "This will be expected to generate the `response` field of the `authorization` header of the SIP INVITE, through digest authentication.", - "minLength": 20, - "maxLength": 40 - } - }, - "required": [ - "username", - "password" + "updatedAt" ] }, - "VapiPhoneNumber": { + "CreateApiRequestToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to create free SIP phone numbers on Vapi.", "enum": [ - "vapi" + "apiRequest" + ], + "description": "The type of tool. \"apiRequest\" for API request tool." + }, + "method": { + "type": "string", + "enum": [ + "POST", + "GET", + "PUT", + "PATCH", + "DELETE" ] }, - "id": { + "timeoutSeconds": { + "type": "number", + "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", + "minimum": 1, + "maximum": 300, + "example": 20 + }, + "credentialId": { "type": "string", - "description": "This is the unique identifier for the phone number." + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "orgId": { + "encryptedPaths": { + "type": "array", + "description": "This is the paths to encrypt in the request body if credentialId and encryptionPlan are defined.", + "items": { + "type": "string" + } + }, + "name": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", + "maxLength": 40, + "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" }, - "createdAt": { - "format": "date-time", + "description": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "description": "This is the description of the tool. This will be passed to the model." }, - "updatedAt": { - "format": "date-time", + "url": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "description": "This is where the request will be sent." + }, + "body": { + "description": "This is the body of the request.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } + ] + }, + "headers": { + "description": "These are the headers to send with the request.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } + ] + }, + "backoffPlan": { + "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", + "allOf": [ + { + "$ref": "#/components/schemas/BackoffPlan" + } + ] + }, + "variableExtractionPlan": { + "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + }, + "required": [ + "type", + "method", + "url" + ] + }, + "CreateCodeToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } }, - "status": { + "type": { "type": "string", - "description": "This is the status of the phone number.", "enum": [ - "active", - "activating", - "blocked" - ] + "code" + ], + "description": "The type of tool. \"code\" for Code tool." }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you purchased from Vapi." + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, - "assistantId": { + "code": { "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "TypeScript code to execute when the tool is called", + "maxLength": 50000 }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "environmentVariables": { + "description": "Environment variables available in code via `env` object", + "type": "array", + "items": { + "$ref": "#/components/schemas/CodeToolEnvironmentVariable" + } }, - "squadId": { + "timeoutSeconds": { + "type": "number", + "description": "This is the timeout in seconds for the code execution. Defaults to 10 seconds.\nMaximum is 30 seconds to prevent abuse.\n\n@default 10", + "minimum": 1, + "maximum": 30, + "example": 10 + }, + "credentialId": { "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "Credential ID containing the Val Town API key", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "variableExtractionPlan": { + "description": "Plan to extract variables from the tool response", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/VariableExtractionPlan" } ] }, - "numberDesiredAreaCode": { - "type": "string", - "description": "This is the area code of the phone number to purchase.", - "minLength": 3, - "maxLength": 3 - }, - "sipUri": { - "type": "string", - "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." + "function": { + "description": "This is the function definition of the tool.\n\nFor the Code tool, this defines the name, description, and parameters that the model\nwill use to understand when and how to call this tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] }, - "authentication": { - "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/SipAuthentication" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt" + "type", + "code" ] }, - "TelnyxPhoneNumber": { + "CreateOutputToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to use numbers bought on Telnyx.", "enum": [ - "telnyx" - ] - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the phone number." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "output" + ], + "description": "The type of tool. \"output\" for Output tool." }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } ] + } + }, + "required": [ + "type" + ] + }, + "CreateBashToolDTO": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { + "type": { "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "enum": [ + "bash" + ], + "description": "The type of tool. \"bash\" for Bash tool." }, - "squadId": { + "subType": { "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "enum": [ + "bash_20241022" + ], + "description": "The sub type of tool." }, "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ { "$ref": "#/components/schemas/Server" } ] }, - "number": { + "name": { "type": "string", - "description": "These are the digits of the phone number you own on your Telnyx." + "description": "The name of the tool, fixed to 'bash'", + "default": "bash", + "enum": [ + "bash" + ] }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] } }, "required": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt", - "number", - "credentialId" + "type", + "subType", + "name" ] }, - "CreateByoPhoneNumberDTO": { + "CreateComputerToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ - "byo-phone-number" - ] - }, - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true + "computer" + ], + "description": "The type of tool. \"computer\" for Computer tool." }, - "number": { + "subType": { "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 + "enum": [ + "computer_20241022" + ], + "description": "The sub type of tool." }, - "credentialId": { - "type": "string", - "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "description": "The name of the tool, fixed to 'computer'", + "default": "computer", + "enum": [ + "computer" + ] }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "displayWidthPx": { + "type": "number", + "description": "The display width in pixels" }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "displayHeightPx": { + "type": "number", + "description": "The display height in pixels" }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "displayNumber": { + "type": "number", + "description": "Optional display number" }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider", - "credentialId" + "type", + "subType", + "name", + "displayWidthPx", + "displayHeightPx" ] }, - "CreateTwilioPhoneNumberDTO": { + "CreateTextEditorToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to use numbers bought on Twilio.", "enum": [ - "twilio" - ] - }, - "smsEnabled": { - "type": "boolean", - "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", - "default": true - }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Twilio." - }, - "twilioAccountSid": { - "type": "string", - "description": "This is the Twilio Account SID for the phone number." - }, - "twilioAuthToken": { - "type": "string", - "description": "This is the Twilio Auth Token for the phone number." + "textEditor" + ], + "description": "The type of tool. \"textEditor\" for Text Editor tool." }, - "twilioApiKey": { + "subType": { "type": "string", - "description": "This is the Twilio API Key for the phone number." + "enum": [ + "text_editor_20241022" + ], + "description": "The sub type of tool." }, - "twilioApiSecret": { - "type": "string", - "description": "This is the Twilio API Secret for the phone number." + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "The name of the tool, fixed to 'str_replace_editor'", + "default": "str_replace_editor", + "enum": [ + "str_replace_editor" + ] }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider", - "number", - "twilioAccountSid" + "type", + "subType", + "name" ] }, - "CreateVonagePhoneNumberDTO": { + "CreateSmsToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { - "type": "string", - "description": "This is to use numbers bought on Vonage.", - "enum": [ - "vonage" - ] - }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." - }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { + "type": { "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "enum": [ + "sms" + ], + "description": "The type of tool. \"sms\" for Twilio SMS sending tool." }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider", - "number", - "credentialId" + "type" ] }, - "CreateVapiPhoneNumberDTO": { + "CreateSipRequestToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "type": { "type": "string", - "description": "This is to create free SIP phone numbers on Vapi.", "enum": [ - "vapi" - ] - }, - "numberDesiredAreaCode": { - "type": "string", - "description": "This is the area code of the phone number to purchase.", - "minLength": 3, - "maxLength": 3 + "sipRequest" + ], + "description": "The type of tool. \"sipRequest\" for SIP request tool." }, - "sipUri": { + "verb": { "type": "string", - "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." + "enum": [ + "INFO", + "MESSAGE", + "NOTIFY" + ], + "description": "The SIP method to send." }, - "authentication": { - "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", + "headers": { + "description": "JSON schema for headers the model should populate when sending the SIP request.", "allOf": [ { - "$ref": "#/components/schemas/SipAuthentication" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "body": { + "description": "Body to include in the SIP request. Either a literal string body, or a JSON schema describing a structured body that the model should populate.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonSchema" + } + ] }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider" + "type", + "verb" ] }, - "CreateTelnyxPhoneNumberDTO": { + "UpdateApiRequestToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "provider": { + "method": { "type": "string", - "description": "This is to use numbers bought on Telnyx.", "enum": [ - "telnyx" + "POST", + "GET", + "PUT", + "PATCH", + "DELETE" ] }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Telnyx." + "timeoutSeconds": { + "type": "number", + "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", + "minimum": 1, + "maximum": 300, + "example": 20 }, "credentialId": { "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "encryptedPaths": { + "type": "array", + "description": "This is the paths to encrypt in the request body if credentialId and encryptionPlan are defined.", + "items": { + "type": "string" + } }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" - } - ] - } - }, - "required": [ - "provider", - "number", - "credentialId" - ] - }, - "UpdateByoPhoneNumberDTO": { - "type": "object", - "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "hooks": { - "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" - }, - { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" - } - ] - } - }, - "numberE164CheckEnabled": { - "type": "boolean", - "description": "This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.\n\nUse cases:\n- `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks.\n- `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls.\n\nIf `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`).\n\n@default true (E164 check is enabled)", - "default": true - }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", + "maxLength": 40, + "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" }, - "assistantId": { + "description": { "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is the description of the tool. This will be passed to the model." }, - "workflowId": { + "url": { "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "description": "This is where the request will be sent." }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "body": { + "description": "This is the body of the request.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } + ] }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "headers": { + "description": "These are the headers to send with the request.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "number": { - "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 + "backoffPlan": { + "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", + "allOf": [ + { + "$ref": "#/components/schemas/BackoffPlan" + } + ] }, - "credentialId": { - "type": "string", - "description": "This is the credential of your own SIP trunk or Carrier (type `byo-sip-trunk`) which can be used to make calls to this phone number.\n\nYou can add the SIP trunk or Carrier credential in the Provider Credentials page on the Dashboard to get the credentialId." + "variableExtractionPlan": { + "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] } } }, - "UpdateTwilioPhoneNumberDTO": { + "UpdateCodeToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "smsEnabled": { + "async": { "type": "boolean", - "description": "Controls whether Vapi sets the messaging webhook URL on the Twilio number during import.\n\nIf set to `false`, Vapi will not update the Twilio messaging URL, leaving it as is.\nIf `true` or omitted (default), Vapi will configure both the voice and messaging URLs.\n\n@default true", - "default": true - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." }, "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ { "$ref": "#/components/schemas/Server" } ] }, - "number": { + "code": { "type": "string", - "description": "These are the digits of the phone number you own on your Twilio." + "description": "TypeScript code to execute when the tool is called", + "maxLength": 50000 }, - "twilioAccountSid": { - "type": "string", - "description": "This is the Twilio Account SID for the phone number." + "environmentVariables": { + "description": "Environment variables available in code via `env` object", + "type": "array", + "items": { + "$ref": "#/components/schemas/CodeToolEnvironmentVariable" + } }, - "twilioAuthToken": { - "type": "string", - "description": "This is the Twilio Auth Token for the phone number." + "timeoutSeconds": { + "type": "number", + "description": "This is the timeout in seconds for the code execution. Defaults to 10 seconds.\nMaximum is 30 seconds to prevent abuse.\n\n@default 10", + "minimum": 1, + "maximum": 30, + "example": 10 }, - "twilioApiKey": { + "credentialId": { "type": "string", - "description": "This is the Twilio API Key for the phone number." + "description": "Credential ID containing the Val Town API key", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "twilioApiSecret": { - "type": "string", - "description": "This is the Twilio API Secret for the phone number." - } - } - }, - "UpdateVonagePhoneNumberDTO": { - "type": "object", - "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ + "variableExtractionPlan": { + "description": "Plan to extract variables from the tool response", + "allOf": [ { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "hooks": { + "function": { + "description": "This is the function definition of the tool.\n\nFor the Code tool, this defines the name, description, and parameters that the model\nwill use to understand when and how to call this tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] + } + } + }, + "UpdateDtmfToolDTO": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "sipInfoDtmfEnabled": { + "type": "boolean", + "description": "This enables sending DTMF tones via SIP INFO messages instead of RFC 2833 (RTP events). When enabled, DTMF digits will be sent using the SIP INFO method, which can be more reliable in some network configurations. Only relevant when using the `vapi.sip` transport.", + "default": false }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." - }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." } } }, - "UpdateVapiPhoneNumberDTO": { + "UpdateEndCallToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "sipUri": { - "type": "string", - "description": "This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." - }, - "authentication": { - "description": "This enables authentication for incoming SIP INVITE requests to the `sipUri`.\n\nIf not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/SipAuthentication" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } } }, - "UpdateTelnyxPhoneNumberDTO": { + "UpdateFunctionToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." + "async": { + "type": "boolean", + "example": false, + "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." }, "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ { "$ref": "#/components/schemas/Server" } ] }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Telnyx." + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." + "function": { + "description": "This is the function definition of the tool.", + "allOf": [ + { + "$ref": "#/components/schemas/OpenAIFunction" + } + ] } } }, - "ImportVonagePhoneNumberDTO": { + "UpdateGhlToolDTO": { "type": "object", "properties": { - "fallbackDestination": { - "description": "This is the fallback destination an inbound call will be transferred to if:\n1. `assistantId` is not set\n2. `squadId` is not set\n3. and, `assistant-request` message to the `serverUrl` fails\n\nIf this is not set and above conditions are met, the inbound call is hung up with an error message.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" - } - ] - }, - "hooks": { + "messages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "vonagePhoneNumber": { - "type": "string", - "description": "These are the digits of the phone number you own on your Vonage.", - "deprecated": true - }, - "credentialId": { - "type": "string", - "description": "This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups." - }, - "name": { - "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, - "assistantId": { - "type": "string", - "description": "This is the assistant that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "workflowId": { - "type": "string", - "description": "This is the workflow that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "squadId": { - "type": "string", - "description": "This is the squad that will be used for incoming calls to this phone number.\n\nIf neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected." - }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. assistant.server\n2. phoneNumber.server\n3. org.server", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] + }, + "metadata": { + "$ref": "#/components/schemas/GhlToolMetadata" } - }, - "required": [ - "vonagePhoneNumber", - "credentialId" - ] + } }, - "PhoneNumberPaginatedResponse": { + "UpdateMakeToolDTO": { "type": "object", "properties": { - "results": { + "messages": { "type": "array", - "description": "A list of phone numbers, which can be of any provider type.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ByoPhoneNumber" - }, - { - "$ref": "#/components/schemas/TwilioPhoneNumber" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/VonagePhoneNumber" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/VapiPhoneNumber" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/TelnyxPhoneNumber" + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "metadata": { - "description": "Metadata about the pagination.", + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/PaginationMeta" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] + }, + "metadata": { + "$ref": "#/components/schemas/MakeToolMetadata" } - }, - "required": [ - "results", - "metadata" - ] + } }, - "ApiRequestTool": { + "UpdateHandoffToolDTO": { "type": "object", "properties": { "messages": { @@ -33056,47 +42204,25 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "apiRequest" - ], - "description": "The type of tool. \"apiRequest\" for API request tool." - }, - "method": { - "type": "string", - "enum": [ - "POST", - "GET", - "PUT", - "PATCH", - "DELETE" - ] - }, - "timeoutSeconds": { - "type": "number", - "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", - "minimum": 1, - "maximum": 300, - "example": 20 - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "destinations": { + "type": "array", + "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/HandoffDestinationDynamic", + "title": "Dynamic" + }, + { + "$ref": "#/components/schemas/HandoffDestinationSquad", + "title": "Squad" + } + ] + } }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -33106,65 +42232,17 @@ } ] }, - "name": { - "type": "string", - "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", - "maxLength": 40, - "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" - }, - "description": { - "type": "string", - "description": "This is the description of the tool. This will be passed to the model.", - "maxLength": 1000 - }, - "url": { - "type": "string", - "description": "This is where the request will be sent." - }, - "body": { - "description": "This is the body of the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] - }, - "headers": { - "description": "These are the headers to send with the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] - }, - "backoffPlan": { - "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", - "allOf": [ - { - "$ref": "#/components/schemas/BackoffPlan" - } - ] - }, - "variableExtractionPlan": { - "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", + "function": { + "description": "This is the optional function definition that will be passed to the LLM.\nIf this is not defined, we will construct this based on the other properties.\n\nFor example, given the following tools definition:\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\nWe will construct the following function definition:\n```json\n{\n \"function\": {\n \"name\": \"handoff_to_assistant-123\",\n \"description\": \"\n Use this function to handoff the call to the next assistant.\n Only use it when instructions explicitly ask you to use the handoff_to_assistant function.\n DO NOT call this function unless you are instructed to do so.\n Here are the destinations you can handoff the call to:\n 1. assistant-123. When: customer wants to be handed off to assistant-123\n 2. assistant-456. When: customer wants to be handed off to assistant-456\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Options: assistant-123 (customer wants to be handed off to assistant-123), assistant-456 (customer wants to be handed off to assistant-456)\",\n \"enum\": [\"assistant-123\", \"assistant-456\"]\n },\n },\n \"required\": [\"destination\"]\n }\n }\n}\n```\n\nTo override this function, please provide an OpenAI function definition and refer to it in the system prompt.\nYou may override parts of the function definition (i.e. you may only want to change the function name for your prompt).\nIf you choose to override the function parameters, it must include `destination` as a required parameter, and it must evaluate to either an assistantId, assistantName, or a the string literal `dynamic`.\n\nTo pass custom parameters to the server in a dynamic handoff, you can use the function parameters, with `dynamic` as the destination.\n```json\n{\n \"function\": {\n \"name\": \"dynamic_handoff\",\n \"description\": \"\n Call this function when the customer is ready to be handed off to the next assistant\n \",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n },\n \"required\": [\"destination\", \"customerAreaCode\", \"customerIntent\", \"customerSentiment\"]\n }\n }\n}\n```", "allOf": [ { - "$ref": "#/components/schemas/VariableExtractionPlan" + "$ref": "#/components/schemas/OpenAIFunction" } ] } - }, - "required": [ - "type", - "method", - "id", - "orgId", - "createdAt", - "updatedAt", - "url" - ] + } }, - "DtmfTool": { + "UpdateTransferCallToolDTO": { "type": "object", "properties": { "messages": { @@ -33191,30 +42269,25 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "dtmf" - ], - "description": "The type of tool. \"dtmf\" for DTMF tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "destinations": { + "type": "array", + "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "Sip" + } + ] + } }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -33224,16 +42297,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "EndCallTool": { + "UpdateOutputToolDTO": { "type": "object", "properties": { "messages": { @@ -33260,31 +42326,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "endCall" - ], - "description": "The type of tool. \"endCall\" for End Call tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33293,16 +42334,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "FunctionTool": { + "UpdateBashToolDTO": { "type": "object", "properties": { "messages": { @@ -33329,17 +42363,12 @@ ] } }, - "type": { + "subType": { "type": "string", "enum": [ - "function" + "bash_20241022" ], - "description": "The type of tool. \"function\" for Function tool." - }, - "async": { - "type": "boolean", - "example": false, - "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." + "description": "The sub type of tool." }, "server": { "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", @@ -33349,24 +42378,6 @@ } ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33375,24 +42386,17 @@ } ] }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunction" - } + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'bash'", + "default": "bash", + "enum": [ + "bash" ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GhlTool": { + "UpdateComputerToolDTO": { "type": "object", "properties": { "messages": { @@ -33419,30 +42423,20 @@ ] } }, - "type": { + "subType": { "type": "string", "enum": [ - "ghl" + "computer_20241022" ], - "description": "The type of tool. \"ghl\" for GHL tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "The sub type of tool." }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -33452,20 +42446,29 @@ } ] }, - "metadata": { - "$ref": "#/components/schemas/GhlToolMetadata" - } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt", - "metadata" - ] + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'computer'", + "default": "computer", + "enum": [ + "computer" + ] + }, + "displayWidthPx": { + "type": "number", + "description": "The display width in pixels" + }, + "displayHeightPx": { + "type": "number", + "description": "The display height in pixels" + }, + "displayNumber": { + "type": "number", + "description": "Optional display number" + } + } }, - "MakeTool": { + "UpdateTextEditorToolDTO": { "type": "object", "properties": { "messages": { @@ -33492,30 +42495,20 @@ ] } }, - "type": { + "subType": { "type": "string", "enum": [ - "make" + "text_editor_20241022" ], - "description": "The type of tool. \"make\" for Make tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "The sub type of tool." }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "server": { + "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -33525,20 +42518,17 @@ } ] }, - "metadata": { - "$ref": "#/components/schemas/MakeToolMetadata" + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'str_replace_editor'", + "default": "str_replace_editor", + "enum": [ + "str_replace_editor" + ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt", - "metadata" - ] + } }, - "TransferCallTool": { + "UpdateQueryToolDTO": { "type": "object", "properties": { "messages": { @@ -33565,50 +42555,13 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "transferCall" - ] - }, - "destinations": { + "knowledgeBases": { + "description": "The knowledge bases to query", "type": "array", - "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" - } - ] + "$ref": "#/components/schemas/KnowledgeBase" } }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33617,16 +42570,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "HandoffTool": { + "UpdateGoogleCalendarCreateEventToolDTO": { "type": "object", "properties": { "messages": { @@ -33653,47 +42599,43 @@ ] } }, - "type": { - "type": "string", - "description": "This is the type of the tool.\nWhen you're using handoff tool, we recommend adding this to your system prompt\n---\n# System context\n\nYou are part of a multi-agent system designed to make agent coordination and execution easy. Agents uses two primary abstraction: **Agents** and **Handoffs**. An agent encompasses instructions and tools and can hand off a conversation to another agent when appropriate. Handoffs are achieved by calling a handoff function, generally named `handoff_to_`. Handoffs between agents are handled seamlessly in the background; do not mention or draw attention to these handoffs in your conversation with the user.\n\n# Agent context\n\n{put your agent system prompt here}\n---", - "enum": [ - "handoff" + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } ] - }, - "destinations": { + } + } + }, + "UpdateGoogleSheetsRowAppendToolDTO": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", + "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/HandoffDestinationAssistant", - "title": "Assistant" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/HandoffDestinationDynamic", - "title": "Dynamic" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33702,16 +42644,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "OutputTool": { + "UpdateGoogleCalendarCheckAvailabilityToolDTO": { "type": "object", "properties": { "messages": { @@ -33738,31 +42673,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "output" - ], - "description": "The type of tool. \"output\" for Output tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33771,16 +42681,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "BashTool": { + "UpdateSlackSendMessageToolDTO": { "type": "object", "properties": { "messages": { @@ -33807,46 +42710,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "bash" - ], - "description": "The type of tool. \"bash\" for Bash tool." - }, - "subType": { - "type": "string", - "enum": [ - "bash_20241022" - ], - "description": "The sub type of tool." - }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33854,27 +42717,10 @@ "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "name": { - "type": "string", - "description": "The name of the tool, fixed to 'bash'", - "default": "bash", - "enum": [ - "bash" - ] } - }, - "required": [ - "type", - "subType", - "id", - "orgId", - "createdAt", - "updatedAt", - "name" - ] + } }, - "ComputerTool": { + "UpdateSmsToolDTO": { "type": "object", "properties": { "messages": { @@ -33901,46 +42747,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "computer" - ], - "description": "The type of tool. \"computer\" for Computer tool." - }, - "subType": { - "type": "string", - "enum": [ - "computer_20241022" - ], - "description": "The sub type of tool." - }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -33948,41 +42754,10 @@ "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "name": { - "type": "string", - "description": "The name of the tool, fixed to 'computer'", - "default": "computer", - "enum": [ - "computer" - ] - }, - "displayWidthPx": { - "type": "number", - "description": "The display width in pixels" - }, - "displayHeightPx": { - "type": "number", - "description": "The display height in pixels" - }, - "displayNumber": { - "type": "number", - "description": "Optional display number" } - }, - "required": [ - "type", - "subType", - "id", - "orgId", - "createdAt", - "updatedAt", - "name", - "displayWidthPx", - "displayHeightPx" - ] + } }, - "TextEditorTool": { + "UpdateMcpToolDTO": { "type": "object", "properties": { "messages": { @@ -34009,20 +42784,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "textEditor" - ], - "description": "The type of tool. \"textEditor\" for Text Editor tool." - }, - "subType": { - "type": "string", - "enum": [ - "text_editor_20241022" - ], - "description": "The sub type of tool." - }, "server": { "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", "allOf": [ @@ -34031,24 +42792,6 @@ } ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -34057,26 +42800,12 @@ } ] }, - "name": { - "type": "string", - "description": "The name of the tool, fixed to 'str_replace_editor'", - "default": "str_replace_editor", - "enum": [ - "str_replace_editor" - ] + "metadata": { + "$ref": "#/components/schemas/McpToolMetadata" } - }, - "required": [ - "type", - "subType", - "id", - "orgId", - "createdAt", - "updatedAt", - "name" - ] + } }, - "QueryTool": { + "UpdateGoHighLevelCalendarAvailabilityToolDTO": { "type": "object", "properties": { "messages": { @@ -34103,38 +42832,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "query" - ], - "description": "The type of tool. \"query\" for Query tool." - }, - "knowledgeBases": { - "description": "The knowledge bases to query", - "type": "array", - "items": { - "$ref": "#/components/schemas/KnowledgeBase" - } - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -34143,16 +42840,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GoogleCalendarCreateEventTool": { + "UpdateGoHighLevelCalendarEventCreateToolDTO": { "type": "object", "properties": { "messages": { @@ -34179,31 +42869,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "google.calendar.event.create" - ], - "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -34212,16 +42877,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GoogleSheetsRowAppendTool": { + "UpdateGoHighLevelContactCreateToolDTO": { "type": "object", "properties": { "messages": { @@ -34243,35 +42901,10 @@ }, { "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "google.sheets.row.append" - ], - "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "title": "ToolMessageDelayed" + } + ] + } }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -34281,16 +42914,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GoogleCalendarCheckAvailabilityTool": { + "UpdateGoHighLevelContactGetToolDTO": { "type": "object", "properties": { "messages": { @@ -34317,31 +42943,6 @@ ] } }, - "type": { - "type": "string", - "enum": [ - "google.calendar.availability.check" - ], - "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." - }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", "allOf": [ @@ -34350,16 +42951,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "SlackSendMessageTool": { + "UpdateSipRequestToolDTO": { "type": "object", "properties": { "messages": { @@ -34386,30 +42980,33 @@ ] } }, - "type": { + "verb": { "type": "string", "enum": [ - "slack.message.send" + "INFO", + "MESSAGE", + "NOTIFY" ], - "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "The SIP method to send." }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "headers": { + "description": "JSON schema for headers the model should populate when sending the SIP request.", + "allOf": [ + { + "$ref": "#/components/schemas/JsonSchema" + } + ] }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "body": { + "description": "Body to include in the SIP request. Either a literal string body, or a JSON schema describing a structured body that the model should populate.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/JsonSchema" + } + ] }, "rejectionPlan": { "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", @@ -34419,16 +43016,9 @@ } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "SmsTool": { + "UpdateVoicemailToolDTO": { "type": "object", "properties": { "messages": { @@ -34455,3663 +43045,5190 @@ ] } }, - "type": { + "beepDetectionEnabled": { + "type": "boolean", + "description": "This is the flag that enables beep detection for voicemail detection and applies only for twilio based calls.\n\n@default false", + "default": false, + "example": false + }, + "rejectionPlan": { + "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "CreateFileDTO": { + "type": "object", + "properties": { + "file": { + "type": "string", + "description": "This is the File you want to upload for use with the Knowledge Base.", + "format": "binary" + } + }, + "required": [ + "file" + ] + }, + "File": { + "type": "object", + "properties": { + "object": { "type": "string", "enum": [ - "sms" + "file" + ] + }, + "status": { + "enum": [ + "processing", + "done", + "failed" ], - "description": "The type of tool. \"sms\" for Twilio SMS sending tool." + "type": "string" + }, + "name": { + "type": "string", + "description": "This is the name of the file. This is just for your own reference.", + "maxLength": 40 + }, + "originalName": { + "type": "string" + }, + "bytes": { + "type": "number" + }, + "purpose": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "key": { + "type": "string" + }, + "path": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "url": { + "type": "string" + }, + "parsedTextUrl": { + "type": "string" + }, + "parsedTextBytes": { + "type": "number" + }, + "metadata": { + "type": "object" }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the file." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "This is the unique identifier for the org that this file belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the ISO 8601 date-time string of when the file was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the ISO 8601 date-time string of when the file was last updated." + } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "UpdateFileDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the file. This is just for your own reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "TrieveKnowledgeBaseSearchPlan": { + "type": "object", + "properties": { + "topK": { + "type": "number", + "description": "Specifies the number of top chunks to return. This corresponds to the `page_size` parameter in Trieve." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "removeStopWords": { + "type": "boolean", + "description": "If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words." + }, + "scoreThreshold": { + "type": "number", + "description": "This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold." + }, + "searchType": { + "type": "string", + "description": "This is the search method used when searching for relevant chunks from the vector store.", + "enum": [ + "fulltext", + "semantic", + "hybrid", + "bm25" + ] + } + }, + "required": [ + "searchType" + ] + }, + "TrieveKnowledgeBase": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This knowledge base is provided by Trieve.\n\nTo learn more about Trieve, visit https://trieve.ai.", + "enum": [ + "trieve" + ] + }, + "name": { + "type": "string", + "description": "This is the name of the knowledge base." + }, + "searchPlan": { + "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" + } + ] + }, + "createPlan": { + "description": "This is the plan if you want us to create/import a new vector store using Trieve.", + "oneOf": [ + { + "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", + "title": "Import" } ] + }, + "id": { + "type": "string", + "description": "This is the id of the knowledge base." + }, + "orgId": { + "type": "string", + "description": "This is the org id of the knowledge base." } }, "required": [ - "type", + "provider", "id", - "orgId", - "createdAt", - "updatedAt" + "orgId" ] }, - "McpTool": { + "CustomKnowledgeBase": { "type": "object", "properties": { - "messages": { + "provider": { + "type": "string", + "description": "This knowledge base is bring your own knowledge base implementation.", + "enum": [ + "custom-knowledge-base" + ] + }, + "server": { + "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + }, + "id": { + "type": "string", + "description": "This is the id of the knowledge base." + }, + "orgId": { + "type": "string", + "description": "This is the org id of the knowledge base." + } + }, + "required": [ + "provider", + "server", + "id", + "orgId" + ] + }, + "CreateTrieveKnowledgeBaseDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This knowledge base is provided by Trieve.\n\nTo learn more about Trieve, visit https://trieve.ai.", + "enum": [ + "trieve" + ] + }, + "name": { + "type": "string", + "description": "This is the name of the knowledge base." + }, + "searchPlan": { + "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", + "allOf": [ + { + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" + } + ] + }, + "createPlan": { + "description": "This is the plan if you want us to create/import a new vector store using Trieve.", + "oneOf": [ + { + "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", + "title": "Import" + } + ] + } + }, + "required": [ + "provider" + ] + }, + "UpdateTrieveKnowledgeBaseDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the knowledge base." + }, + "searchPlan": { + "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", + "allOf": [ + { + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" + } + ] + }, + "createPlan": { + "description": "This is the plan if you want us to create/import a new vector store using Trieve.", + "oneOf": [ + { + "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", + "title": "Import" + } + ] + } + } + }, + "UpdateCustomKnowledgeBaseDTO": { + "type": "object", + "properties": { + "server": { + "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", + "allOf": [ + { + "$ref": "#/components/schemas/Server" + } + ] + } + } + }, + "TrieveKnowledgeBaseChunkPlan": { + "type": "object", + "properties": { + "fileIds": { + "description": "These are the file ids that will be used to create the vector store. To upload files, use the `POST /files` endpoint.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "type": "string" + } + }, + "websites": { + "description": "These are the websites that will be used to create the vector store.", + "type": "array", + "items": { + "type": "string" } }, + "targetSplitsPerChunk": { + "type": "number", + "description": "This is an optional field which allows you to specify the number of splits you want per chunk. If not specified, the default 20 is used. However, you may want to use a different number." + }, + "splitDelimiters": { + "description": "This is an optional field which allows you to specify the delimiters to use when splitting the file before chunking the text. If not specified, the default [.!?\\n] are used to split into sentences. However, you may want to use spaces or other delimiters.", + "type": "array", + "items": { + "type": "string" + } + }, + "rebalanceChunks": { + "type": "boolean", + "description": "This is an optional field which allows you to specify whether or not to rebalance the chunks created from the file. If not specified, the default true is used. If true, Trieve will evenly distribute remainder splits across chunks such that 66 splits with a target_splits_per_chunk of 20 will result in 3 chunks with 22 splits each." + } + } + }, + "TrieveKnowledgeBaseCreate": { + "type": "object", + "properties": { "type": { "type": "string", + "description": "This is to create a new dataset on Trieve.", "enum": [ - "mcp" - ], - "description": "The type of tool. \"mcp\" for MCP tool." + "create" + ] }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "chunkPlans": { + "description": "These are the chunk plans used to create the dataset.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TrieveKnowledgeBaseChunkPlan" + } + } + }, + "required": [ + "type", + "chunkPlans" + ] + }, + "TrieveKnowledgeBaseImport": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is to import an existing dataset from Trieve.", + "enum": [ + "import" + ] + }, + "providerId": { + "type": "string", + "description": "This is the `datasetId` of the dataset on your Trieve account." + } + }, + "required": [ + "type", + "providerId" + ] + }, + "StructuredOutput": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of structured output.\n\n- 'ai': Uses an LLM to extract structured data from the conversation (default).\n- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.", + "enum": [ + "ai", + "regex" + ] + }, + "regex": { + "type": "string", + "description": "This is the regex pattern to match against the transcript.\n\nOnly used when type is 'regex'. Supports both raw patterns (e.g. '\\d+') and\nregex literal format (e.g. '/\\d+/gi'). Uses RE2 syntax for safety.\n\nThe result depends on the schema type:\n- boolean: true if the pattern matches, false otherwise\n- string: the first match or first capture group\n- number/integer: the first match parsed as a number\n- array: all matches", + "minLength": 1, + "maxLength": 1000 + }, + "model": { + "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.\ni.e.:\n`{{structuredOutput}}`\n`{{structuredOutput.name}}`\n`{{structuredOutput.description}}`\n`{{structuredOutput.schema}}`\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] + }, + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ComplianceOverride" } ] }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the structured output." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "This is the unique identifier for the org that this structured output belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the ISO 8601 date-time string of when the structured output was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the ISO 8601 date-time string of when the structured output was last updated." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "name": { + "type": "string", + "description": "This is the name of the structured output.", + "minLength": 1, + "maxLength": 40 + }, + "description": { + "type": "string", + "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." + }, + "assistantIds": { + "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", + "type": "array", + "items": { + "type": "string" + } + }, + "workflowIds": { + "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "type": "array", + "items": { + "type": "string" + } + }, + "schema": { + "description": "This is the JSON Schema definition for the structured output.\n\nDefines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/JsonSchema" } ] - }, - "metadata": { - "$ref": "#/components/schemas/McpToolMetadata" } }, "required": [ - "type", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "name", + "schema" ] }, - "GoHighLevelCalendarAvailabilityTool": { + "StructuredOutputPaginatedResponse": { "type": "object", "properties": { - "messages": { + "results": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "$ref": "#/components/schemas/StructuredOutput" } }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "UpdateStructuredOutputDTO": { + "type": "object", + "properties": { "type": { "type": "string", + "description": "This is the type of structured output.\n\n- 'ai': Uses an LLM to extract structured data from the conversation (default).\n- 'regex': Uses a regex pattern to extract data from the transcript without an LLM.", "enum": [ - "gohighlevel.calendar.availability.check" - ], - "description": "The type of tool. \"gohighlevel.calendar.availability.check\" for GoHighLevel Calendar Availability Check tool." + "ai", + "regex" + ] }, - "id": { + "regex": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the regex pattern to match against the transcript.\n\nOnly used when type is 'regex'. Supports both raw patterns (e.g. '\\d+') and\nregex literal format (e.g. '/\\d+/gi'). Uses RE2 syntax for safety.\n\nThe result depends on the schema type:\n- boolean: true if the pattern matches, false otherwise\n- string: the first match or first capture group\n- number/integer: the first match parsed as a number\n- array: all matches", + "minLength": 1, + "maxLength": 1000 }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "model": { + "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the `{{}}` syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the `{{}}` syntax to access the structured output definition.\ni.e.:\n`{{structuredOutput}}`\n`{{structuredOutput.name}}`\n`{{structuredOutput.description}}`\n`{{structuredOutput.schema}}`\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", + "oneOf": [ + { + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicBedrockModel", + "title": "WorkflowAnthropicBedrockModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" + } + ] }, - "createdAt": { - "format": "date-time", + "compliancePlan": { + "description": "Compliance configuration for this output. Only enable overrides if no sensitive data will be stored.", + "example": { + "forceStoreOnHipaaEnabled": false + }, + "allOf": [ + { + "$ref": "#/components/schemas/ComplianceOverride" + } + ] + }, + "name": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the name of the structured output.", + "minLength": 1, + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "description": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "assistantIds": { + "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", + "type": "array", + "items": { + "type": "string" + } + }, + "workflowIds": { + "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "type": "array", + "items": { + "type": "string" + } + }, + "schema": { + "description": "This is the JSON Schema definition for the structured output.\n\nDefines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/JsonSchema" } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GoHighLevelCalendarEventCreateTool": { + "StructuredOutputRunDTO": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "gohighlevel.calendar.event.create" - ], - "description": "The type of tool. \"gohighlevel.calendar.event.create\" for GoHighLevel Calendar Event Create tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "previewEnabled": { + "type": "boolean", + "description": "This is the preview flag for the re-run. If true, the re-run will be executed and the response will be returned immediately and the call artifact will NOT be updated.\nIf false (default), the re-run will be executed and the response will be updated in the call artifact.", + "default": false }, - "updatedAt": { - "format": "date-time", + "structuredOutputId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the ID of the structured output that will be run. This must be provided unless a transient structured output is provided.\nWhen the re-run is executed, only the value of this structured output will be replaced with the new value, or added if not present." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "structuredOutput": { + "description": "This is the transient structured output that will be run. This must be provided if a structured output ID is not provided.\nWhen the re-run is executed, the structured output value will be added to the existing artifact.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/CreateStructuredOutputDTO" } ] + }, + "callIds": { + "description": "This is the array of callIds that will be updated with the new structured output value. If preview is true, this array must be provided and contain exactly 1 callId.\nIf preview is false, up to 100 callIds may be provided.", + "type": "array", + "items": { + "type": "string" + } } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "callIds" ] }, - "GoHighLevelContactCreateTool": { + "TesterPlan": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "assistant": { + "description": "Pass a transient assistant to use for the test assistant.\n\nMake sure to write a detailed system prompt for a test assistant, and use the {{test.script}} variable to access the test script.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] }, - "type": { + "assistantId": { "type": "string", - "enum": [ - "gohighlevel.contact.create" - ], - "description": "The type of tool. \"gohighlevel.contact.create\" for GoHighLevel Contact Create tool." + "description": "Pass an assistant id that can be access\n\nMake sure to write a detailed system prompt for the test assistant, and use the {{test.script}} variable to access the test script." }, - "id": { + "assistantOverrides": { + "description": "Add any assistant overrides to the test assistant.\n\nOne use case is if you want to pass custom variables into the test using variableValues, that you can then access in the script\nand rubric using {{varName}}.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + } + } + }, + "TestSuitePhoneNumber": { + "type": "object", + "properties": { + "provider": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the provider of the phone number.", + "enum": [ + "test-suite" + ] }, - "orgId": { + "number": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." - }, - "createdAt": { - "format": "date-time", + "description": "This is the phone number that is being tested.", + "maxLength": 50 + } + }, + "required": [ + "provider", + "number" + ] + }, + "TargetPlan": { + "type": "object", + "properties": { + "phoneNumberId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the phone number that is being tested.\nDuring the actual test, it'll be called and the assistant attached to it will pick up and be tested.\nTo test an assistant directly, send assistantId instead." }, - "updatedAt": { - "format": "date-time", + "phoneNumber": { + "description": "This can be any phone number (even not on Vapi).\nDuring the actual test, it'll be called.\nTo test a Vapi number, send phoneNumberId. To test an assistant directly, send assistantId instead.", + "allOf": [ + { + "$ref": "#/components/schemas/TestSuitePhoneNumber" + } + ] + }, + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the assistant being tested.\nDuring the actual test, it'll invoked directly.\nTo test the assistant over phone number, send phoneNumberId instead." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "assistantOverrides": { + "description": "This is the assistant overrides applied to assistantId before it is tested.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/AssistantOverrides" } ] } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "GoHighLevelContactGetTool": { + "TestSuite": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "type": { - "type": "string", - "enum": [ - "gohighlevel.contact.get" - ], - "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." - }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the test suite." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "This is the unique identifier for the org that this test suite belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the ISO 8601 date-time string of when the test suite was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the ISO 8601 date-time string of when the test suite was last updated." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "name": { + "type": "string", + "description": "This is the name of the test suite.", + "maxLength": 80 + }, + "phoneNumberId": { + "type": "string", + "description": "This is the phone number ID associated with this test suite.", + "deprecated": true + }, + "testerPlan": { + "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TesterPlan" + } + ] + }, + "targetPlan": { + "description": "These are the configuration for the assistant / phone number that is being tested.", + "allOf": [ + { + "$ref": "#/components/schemas/TargetPlan" } ] } }, "required": [ - "type", "id", "orgId", "createdAt", "updatedAt" ] }, - "CreateApiRequestToolDTO": { + "TestSuitesPaginatedResponse": { "type": "object", "properties": { - "messages": { + "results": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "$ref": "#/components/schemas/TestSuite" } }, - "type": { - "type": "string", - "enum": [ - "apiRequest" - ], - "description": "The type of tool. \"apiRequest\" for API request tool." - }, - "method": { - "type": "string", - "enum": [ - "POST", - "GET", - "PUT", - "PATCH", - "DELETE" - ] - }, - "timeoutSeconds": { - "type": "number", - "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", - "minimum": 1, - "maximum": 300, - "example": 20 - }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateTestSuiteDto": { + "type": "object", + "properties": { "name": { "type": "string", - "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", - "maxLength": 40, - "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" - }, - "description": { - "type": "string", - "description": "This is the description of the tool. This will be passed to the model.", - "maxLength": 1000 + "description": "This is the name of the test suite.", + "maxLength": 80 }, - "url": { + "phoneNumberId": { "type": "string", - "description": "This is where the request will be sent." - }, - "body": { - "description": "This is the body of the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] + "description": "This is the phone number ID associated with this test suite.", + "deprecated": true }, - "headers": { - "description": "These are the headers to send with the request.", + "testerPlan": { + "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", "allOf": [ { - "$ref": "#/components/schemas/JsonSchema" + "$ref": "#/components/schemas/TesterPlan" } ] }, - "backoffPlan": { - "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", + "targetPlan": { + "description": "These are the configuration for the assistant / phone number that is being tested.", "allOf": [ { - "$ref": "#/components/schemas/BackoffPlan" + "$ref": "#/components/schemas/TargetPlan" } ] + } + } + }, + "UpdateTestSuiteDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the test suite.", + "maxLength": 80 }, - "variableExtractionPlan": { - "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", + "phoneNumberId": { + "type": "string", + "description": "This is the phone number ID associated with this test suite.", + "deprecated": true + }, + "testerPlan": { + "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", "allOf": [ { - "$ref": "#/components/schemas/VariableExtractionPlan" + "$ref": "#/components/schemas/TesterPlan" } ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "targetPlan": { + "description": "These are the configuration for the assistant / phone number that is being tested.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TargetPlan" } ] } - }, - "required": [ - "type", - "method", - "url" - ] + } }, - "CreateOutputToolDTO": { + "TestSuiteTestVoice": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, "type": { "type": "string", + "description": "This is the type of the test, which must be voice.", "enum": [ - "output" + "voice" ], - "description": "The type of tool. \"output\" for Output tool." + "maxLength": 100 }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "id": { + "type": "string", + "description": "This is the unique identifier for the test." + }, + "testSuiteId": { + "type": "string", + "description": "This is the unique identifier for the test suite this test belongs to." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization this test belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of the test.", + "maxLength": 80 + }, + "script": { + "type": "string", + "description": "This is the script to be used for the voice test.", + "maxLength": 10000 + }, + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 } }, "required": [ - "type" + "scorers", + "type", + "id", + "testSuiteId", + "orgId", + "createdAt", + "updatedAt", + "script" ] }, - "CreateBashToolDTO": { + "TestSuiteTestChat": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, "type": { "type": "string", + "description": "This is the type of the test, which must be chat.", "enum": [ - "bash" + "chat" ], - "description": "The type of tool. \"bash\" for Bash tool." + "maxLength": 100 }, - "subType": { + "id": { "type": "string", - "enum": [ - "bash_20241022" - ], - "description": "The sub type of tool." + "description": "This is the unique identifier for the test." }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "testSuiteId": { + "type": "string", + "description": "This is the unique identifier for the test suite this test belongs to." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization this test belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test was last updated." }, "name": { "type": "string", - "description": "The name of the tool, fixed to 'bash'", - "default": "bash", - "enum": [ - "bash" - ] + "description": "This is the name of the test.", + "maxLength": 80 }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "script": { + "type": "string", + "description": "This is the script to be used for the chat test.", + "maxLength": 10000 + }, + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 } }, "required": [ + "scorers", "type", - "subType", - "name" + "id", + "testSuiteId", + "orgId", + "createdAt", + "updatedAt", + "script" ] }, - "CreateComputerToolDTO": { + "CreateTestSuiteTestVoiceDto": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, "type": { "type": "string", + "description": "This is the type of the test, which must be voice.", "enum": [ - "computer" + "voice" ], - "description": "The type of tool. \"computer\" for Computer tool." + "maxLength": 100 }, - "subType": { + "script": { "type": "string", - "enum": [ - "computer_20241022" - ], - "description": "The sub type of tool." + "description": "This is the script to be used for the voice test.", + "maxLength": 10000 }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 }, "name": { "type": "string", - "description": "The name of the tool, fixed to 'computer'", - "default": "computer", - "enum": [ - "computer" - ] - }, - "displayWidthPx": { - "type": "number", - "description": "The display width in pixels" - }, - "displayHeightPx": { - "type": "number", - "description": "The display height in pixels" - }, - "displayNumber": { - "type": "number", - "description": "Optional display number" - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "description": "This is the name of the test.", + "maxLength": 80 } }, "required": [ + "scorers", "type", - "subType", - "name", - "displayWidthPx", - "displayHeightPx" + "script" ] }, - "CreateTextEditorToolDTO": { + "CreateTestSuiteTestChatDto": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, "type": { "type": "string", + "description": "This is the type of the test, which must be chat.", "enum": [ - "textEditor" + "chat" ], - "description": "The type of tool. \"textEditor\" for Text Editor tool." + "maxLength": 100 }, - "subType": { + "script": { "type": "string", - "enum": [ - "text_editor_20241022" - ], - "description": "The sub type of tool." + "description": "This is the script to be used for the chat test.", + "maxLength": 10000 }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 }, "name": { "type": "string", - "description": "The name of the tool, fixed to 'str_replace_editor'", - "default": "str_replace_editor", - "enum": [ - "str_replace_editor" - ] - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "description": "This is the name of the test.", + "maxLength": 80 } }, "required": [ + "scorers", "type", - "subType", - "name" + "script" ] }, - "CreateSmsToolDTO": { + "UpdateTestSuiteTestVoiceDto": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, "type": { "type": "string", + "description": "This is the type of the test, which must be voice.", "enum": [ - "sms" + "voice" ], - "description": "The type of tool. \"sms\" for Twilio SMS sending tool." + "maxLength": 100 }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "name": { + "type": "string", + "description": "This is the name of the test.", + "maxLength": 80 + }, + "script": { + "type": "string", + "description": "This is the script to be used for the voice test.", + "maxLength": 10000 + }, + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 } - }, - "required": [ - "type" - ] + } }, - "UpdateApiRequestToolDTO": { + "UpdateTestSuiteTestChatDto": { "type": "object", "properties": { - "messages": { + "scorers": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the scorers used to evaluate the test.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestScorerAI", + "title": "AI" } ] } }, - "method": { + "type": { "type": "string", + "description": "This is the type of the test, which must be chat.", "enum": [ - "POST", - "GET", - "PUT", - "PATCH", - "DELETE" - ] - }, - "timeoutSeconds": { - "type": "number", - "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", - "minimum": 1, - "maximum": 300, - "example": 20 - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "chat" + ], + "maxLength": 100 }, "name": { "type": "string", - "description": "This is the name of the tool. This will be passed to the model.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 40.", - "maxLength": 40, - "pattern": "/^[a-zA-Z0-9_-]{1,40}$/" + "description": "This is the name of the test.", + "maxLength": 80 }, - "description": { + "script": { "type": "string", - "description": "This is the description of the tool. This will be passed to the model.", - "maxLength": 1000 + "description": "This is the script to be used for the chat test.", + "maxLength": 10000 }, - "url": { + "numAttempts": { + "type": "number", + "description": "This is the number of attempts allowed for the test.", + "minimum": 1, + "maximum": 10 + } + } + }, + "TestSuiteTestScorerAI": { + "type": "object", + "properties": { + "type": { "type": "string", - "description": "This is where the request will be sent." - }, - "body": { - "description": "This is the body of the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] - }, - "headers": { - "description": "These are the headers to send with the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] - }, - "backoffPlan": { - "description": "This is the backoff plan if the request fails. Defaults to undefined (the request will not be retried).\n\n@default undefined (the request will not be retried)", - "allOf": [ - { - "$ref": "#/components/schemas/BackoffPlan" - } - ] + "description": "This is the type of the scorer, which must be AI.", + "enum": [ + "ai" + ], + "maxLength": 100 }, - "variableExtractionPlan": { - "description": "This is the plan to extract variables from the tool's response. These will be accessible during the call and stored in `call.artifact.variableValues` after the call.\n\nUsage:\n1. Use `aliases` to extract variables from the tool's response body. (Most common case)\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{customer.name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{customer.age}}\"\n }\n ]\n}\n```\n\nThe tool response body is made available to the liquid template.\n\n2. Use `aliases` to extract variables from the tool's response body if the response is an array.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{$[0].name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{$[0].age}}\"\n }\n ]\n}\n```\n\n$ is a shorthand for the tool's response body. `$[0]` is the first item in the array. `$[n]` is the nth item in the array. Note, $ is available regardless of the response body type (both object and array).\n\n3. Use `aliases` to extract variables from the tool's response headers.\n\n```json\n{\n \"aliases\": [\n {\n \"key\": \"customerName\",\n \"value\": \"{{tool.response.headers.customer-name}}\"\n },\n {\n \"key\": \"customerAge\",\n \"value\": \"{{tool.response.headers.customer-age}}\"\n }\n ]\n}\n```\n\n`tool.response` is made available to the liquid template. Particularly, both `tool.response.headers` and `tool.response.body` are available. Note, `tool.response` is available regardless of the response body type (both object and array).\n\n4. Use `schema` to extract a large portion of the tool's response body.\n\n4.1. If you hit example.com and it returns `{\"name\": \"John\", \"age\": 30}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n }\n }\n }\n}\n```\nThese will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables.\n\n4.2. If you hit example.com and it returns `{\"name\": {\"first\": \"John\", \"last\": \"Doe\"}}`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"object\",\n \"properties\": {\n \"first\": {\n \"type\": \"string\"\n },\n \"last\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThese will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible.\n\n4.3. If you hit example.com and it returns `[\"94123\", \"94124\"]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"zipCodes\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n}\n```\n\nThis will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`.\n\n4.4. If you hit example.com and it returns `[{\"name\": \"John\", \"age\": 30, \"zipCodes\": [\"94123\", \"94124\"]}, {\"name\": \"Jane\", \"age\": 25, \"zipCodes\": [\"94125\", \"94126\"]}]`, then you can specify the schema as:\n\n```json\n{\n \"schema\": {\n \"type\": \"array\",\n \"title\": \"people\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"type\": \"number\"\n },\n \"zipCodes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n }\n }\n }\n}\n```\n\nThis will be extracted as `{{ people }}`. To access the array items, you can use `{{ people[n].name }}`, `{{ people[n].age }}`, `{{ people[n].zipCodes }}`, `{{ people[n].zipCodes[0] }}` and `{{ people[n].zipCodes[1] }}`.\n\nNote: Both `aliases` and `schema` can be used together.", - "allOf": [ - { - "$ref": "#/components/schemas/VariableExtractionPlan" - } - ] + "rubric": { + "type": "string", + "description": "This is the rubric used by the AI scorer.", + "maxLength": 10000 } - } + }, + "required": [ + "type", + "rubric" + ] }, - "UpdateDtmfToolDTO": { + "TestSuiteTestsPaginatedResponse": { "type": "object", "properties": { - "messages": { + "results": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "A list of test suite tests.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/TestSuiteTestVoice" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteTestChat" } ] } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "metadata": { + "description": "Metadata about the pagination.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/PaginationMeta" } ] } - } + }, + "required": [ + "results", + "metadata" + ] }, - "UpdateEndCallToolDTO": { + "TestSuiteRunScorerAI": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "type": { + "type": "string", + "description": "This is the type of the scorer, which must be AI.", + "enum": [ + "ai" + ], + "maxLength": 100 }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "result": { + "type": "string", + "description": "This is the result of the test suite.", + "enum": [ + "pass", + "fail" + ], + "maxLength": 100 + }, + "reasoning": { + "type": "string", + "description": "This is the reasoning provided by the AI scorer.", + "maxLength": 10000 + }, + "rubric": { + "type": "string", + "description": "This is the rubric used by the AI scorer.", + "maxLength": 10000 + } + }, + "required": [ + "type", + "result", + "reasoning", + "rubric" + ] + }, + "TestSuiteRunTestAttemptCall": { + "type": "object", + "properties": { + "artifact": { + "description": "This is the artifact of the call.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/Artifact" } ] } - } + }, + "required": [ + "artifact" + ] }, - "UpdateFunctionToolDTO": { + "TestSuiteRunTestAttemptMetadata": { "type": "object", "properties": { - "messages": { + "sessionId": { + "type": "string", + "description": "This is the session ID for the test attempt." + } + }, + "required": [ + "sessionId" + ] + }, + "TestSuiteRunTestAttempt": { + "type": "object", + "properties": { + "scorerResults": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "These are the results of the scorers used to evaluate the test attempt.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TestSuiteRunScorerAI", + "title": "AI" } ] } }, - "async": { - "type": "boolean", - "example": false, - "description": "This determines if the tool is async.\n\n If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\n If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\n Defaults to synchronous (`false`)." - }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "call": { + "description": "This is the call made during the test attempt.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/TestSuiteRunTestAttemptCall" } ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "callId": { + "type": "string", + "description": "This is the call ID for the test attempt." + }, + "metadata": { + "description": "This is the metadata for the test attempt.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/TestSuiteRunTestAttemptMetadata" } ] - }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ + } + }, + "required": [ + "scorerResults" + ] + }, + "TestSuiteRunTestResult": { + "type": "object", + "properties": { + "test": { + "description": "This is the test that was run.", + "oneOf": [ { - "$ref": "#/components/schemas/OpenAIFunction" + "$ref": "#/components/schemas/TestSuiteTestVoice", + "title": "TestSuiteTestVoice" } ] + }, + "attempts": { + "description": "These are the attempts made for this test.", + "type": "array", + "items": { + "$ref": "#/components/schemas/TestSuiteRunTestAttempt" + } } - } + }, + "required": [ + "test", + "attempts" + ] }, - "UpdateGhlToolDTO": { + "TestSuiteRun": { "type": "object", "properties": { - "messages": { + "status": { + "type": "string", + "description": "This is the current status of the test suite run.", + "enum": [ + "queued", + "in-progress", + "completed", + "failed" + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the test suite run." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization this run belongs to." + }, + "testSuiteId": { + "type": "string", + "description": "This is the unique identifier for the test suite this run belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test suite run was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the test suite run was last updated." + }, + "testResults": { + "description": "These are the results of the tests in this test suite run.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "$ref": "#/components/schemas/TestSuiteRunTestResult" } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "name": { + "type": "string", + "description": "This is the name of the test suite run.", + "maxLength": 80 + } + }, + "required": [ + "status", + "id", + "orgId", + "testSuiteId", + "createdAt", + "updatedAt", + "testResults" + ] + }, + "TestSuiteRunsPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TestSuiteRun" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateTestSuiteRunDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the test suite run.", + "maxLength": 80 + } + } + }, + "UpdateTestSuiteRunDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the test suite run.", + "maxLength": 80 + } + } + }, + "CreatePersonalityDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the personality (e.g., \"Confused Carl\", \"Rude Rob\").", + "maxLength": 80 + }, + "assistant": { + "description": "This is the full assistant configuration for this personality.\nIt defines the tester's voice, model, behavior via system prompt, and other settings.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "metadata": { - "$ref": "#/components/schemas/GhlToolMetadata" + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing personalities.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } - } + }, + "required": [ + "name", + "assistant" + ] }, - "UpdateMakeToolDTO": { + "Personality": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "id": { + "type": "string", + "description": "This is the unique identifier for the personality.", + "format": "uuid" }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "orgId": { + "type": "string", + "nullable": true, + "description": "This is the unique identifier for the organization this personality belongs to.\nIf null, this is a Vapi-provided default personality available to all organizations.", + "format": "uuid" + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the personality was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the personality was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of the personality (e.g., \"Confused Carl\", \"Rude Rob\").", + "maxLength": 80 + }, + "assistant": { + "description": "This is the full assistant configuration for this personality.\nIt defines the tester's voice, model, behavior via system prompt, and other settings.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "metadata": { - "$ref": "#/components/schemas/MakeToolMetadata" + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing personalities.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } - } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "assistant" + ] }, - "UpdateHandoffToolDTO": { + "UpdatePersonalityDTO": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } - }, - "destinations": { - "type": "array", - "description": "These are the destinations that the call can be handed off to.\n\nUsage:\n1. Single destination\n\nUse `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\", // or \"assistantName\": \"Assistant123\"\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2. Multiple destinations\n\n2.1. Multiple Tools, Each With One Destination (OpenAI recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n ],\n },\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n2.2. One Tool, Multiple Destinations (Anthropic recommended)\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-123\",\n \"description\": \"customer wants to be handed off to assistant-123\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n },\n {\n \"type\": \"assistant\",\n \"assistantId\": \"assistant-456\",\n \"description\": \"customer wants to be handed off to assistant-456\",\n \"contextEngineeringPlan\": {\n \"type\": \"all\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3. Dynamic destination\n\n3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object.\n VAPI will send a handoff-destination-request webhook to the `server.url`.\n The response from the server will be used as the destination (if valid).\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n }\n }\n ],\n }\n ]\n}\n```\n\n3.2. To pass custom parameters to the server, you can use the `function` object.\n\n```json\n{\n \"tools\": [\n {\n \"type\": \"handoff\",\n \"destinations\": [\n {\n \"type\": \"dynamic\",\n \"server\": {\n \"url\": \"https://example.com\"\n },\n }\n ],\n \"function\": {\n \"name\": \"handoff\",\n \"description\": \"Call this function when the customer is ready to be handed off to the next assistant\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\",\n \"description\": \"Use dynamic when customer is ready to be handed off to the next assistant\",\n \"enum\": [\"dynamic\"]\n },\n \"customerAreaCode\": {\n \"type\": \"number\",\n \"description\": \"Area code of the customer\"\n },\n \"customerIntent\": {\n \"type\": \"string\",\n \"enum\": [\"new-customer\", \"existing-customer\"],\n \"description\": \"Use new-customer when customer is a new customer, existing-customer when customer is an existing customer\"\n },\n \"customerSentiment\": {\n \"type\": \"string\",\n \"enum\": [\"positive\", \"negative\", \"neutral\"],\n \"description\": \"Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral\"\n }\n }\n }\n }\n }\n ]\n}\n```\n\nThe properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/HandoffDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/HandoffDestinationDynamic", - "title": "Dynamic" - } - ] - } + "name": { + "type": "string", + "description": "This is the name of the personality.", + "maxLength": 80 }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "assistant": { + "description": "This is the full assistant configuration for this personality.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] + }, + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing personalities.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nSet to null to remove from folder.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } } }, - "UpdateTransferCallToolDTO": { + "SimulationHookInclude": { "type": "object", "properties": { + "transcript": { + "type": "boolean", + "description": "Include transcript in the hook payload", + "default": false + }, "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "type": "boolean", + "description": "Include messages in the hook payload", + "default": false }, - "destinations": { - "type": "array", - "description": "These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" - } - ] - } + "recordingUrl": { + "type": "boolean", + "description": "Include recordingUrl in the hook payload", + "default": false + } + } + }, + "SimulationHookWebhookAction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "webhook" + ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "server": { + "description": "Optional server override for this hook action.\nIf omitted, runtime defaults may apply (e.g. org server).", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" + } + ] + }, + "include": { + "description": "Optional payload include controls.", + "allOf": [ + { + "$ref": "#/components/schemas/SimulationHookInclude" } ] } - } + }, + "required": [ + "type" + ] }, - "UpdateOutputToolDTO": { + "SimulationHookCallStarted": { "type": "object", "properties": { - "messages": { + "on": { + "type": "string", + "enum": [ + "simulation.run.started" + ], + "maxLength": 1000 + }, + "do": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookWebhookAction", + "title": "SimulationHookWebhookAction" } ] } - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] } - } + }, + "required": [ + "on", + "do" + ] }, - "UpdateBashToolDTO": { + "SimulationHookCallEnded": { "type": "object", "properties": { - "messages": { + "on": { + "type": "string", + "enum": [ + "simulation.run.ended" + ], + "maxLength": 1000 + }, + "do": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookWebhookAction", + "title": "SimulationHookWebhookAction" } ] } - }, - "subType": { + } + }, + "required": [ + "on", + "do" + ] + }, + "EvaluationPlanItem": { + "type": "object", + "properties": { + "structuredOutputId": { "type": "string", - "enum": [ - "bash_20241022" - ], - "description": "The sub type of tool." + "description": "This is the ID of an existing structured output to use for evaluation.\nMutually exclusive with structuredOutput.", + "format": "uuid" }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", + "structuredOutput": { + "description": "This is an inline structured output definition for evaluation.\nMutually exclusive with structuredOutputId.\nOnly primitive schema types (string, number, integer, boolean) are allowed.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/CreateStructuredOutputDTO" } ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ + "comparator": { + "type": "string", + "description": "This is the comparison operator to use when evaluating the extracted value against the expected value.\nAvailable operators depend on the structured output's schema type:\n- boolean: '=', '!='\n- string: '=', '!='\n- number/integer: '=', '!=', '>', '<', '>=', '<='", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ], + "example": "=" + }, + "value": { + "description": "This is the expected value to compare against the extracted structured output result.\nType should match the structured output's schema type.", + "oneOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" } ] }, - "name": { + "required": { + "type": "boolean", + "description": "This is whether this evaluation must pass for the simulation to pass.\nDefaults to true. If false, the result is informational only.", + "default": true + } + }, + "required": [ + "comparator", + "value" + ] + }, + "ScenarioToolMock": { + "type": "object", + "properties": { + "toolName": { "type": "string", - "description": "The name of the tool, fixed to 'bash'", - "default": "bash", - "enum": [ - "bash" - ] + "description": "This is the tool call function name to mock (must match `toolCall.function.name`)." + }, + "result": { + "type": "string", + "description": "This is the result content to return for this tool call." + }, + "enabled": { + "type": "boolean", + "description": "This is whether this mock is enabled. Defaults to true when omitted.", + "default": true } - } + }, + "required": [ + "toolName" + ] }, - "UpdateComputerToolDTO": { + "CreateScenarioDTO": { "type": "object", "properties": { - "messages": { + "name": { + "type": "string", + "description": "This is the name of the scenario.", + "maxLength": 80, + "example": "Health Enrollment - Eligible Path" + }, + "instructions": { + "type": "string", + "description": "This is the script/instructions for the tester to follow during the simulation.", + "maxLength": 10000, + "example": "You are calling to enroll in the Twin Health program. Confirm your identity when asked." + }, + "evaluations": { + "description": "This is the structured output-based evaluation plan for the simulation.\nEach item defines a structured output to extract and evaluate against an expected value.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "$ref": "#/components/schemas/EvaluationPlanItem" + } + }, + "hooks": { + "type": "array", + "description": "Hooks to run on simulation lifecycle events", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationHookCallStarted", + "title": "SimulationHookCallStarted" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookCallEnded", + "title": "SimulationHookCallEnded" } ] } }, - "subType": { + "toolMocks": { + "description": "Scenario-level tool call mocks to use during simulations.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ScenarioToolMock" + } + }, + "path": { "type": "string", - "enum": [ - "computer_20241022" - ], - "description": "The sub type of tool." + "nullable": true, + "description": "Optional folder path for organizing scenarios.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" + } + }, + "required": [ + "name", + "instructions", + "evaluations" + ] + }, + "Scenario": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "This is the unique identifier for the scenario.", + "format": "uuid" }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization this scenario belongs to.", + "format": "uuid" }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the scenario was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the scenario was last updated." }, "name": { "type": "string", - "description": "The name of the tool, fixed to 'computer'", - "default": "computer", - "enum": [ - "computer" - ] + "description": "This is the name of the scenario.", + "maxLength": 80, + "example": "Health Enrollment - Eligible Path" }, - "displayWidthPx": { - "type": "number", - "description": "The display width in pixels" + "instructions": { + "type": "string", + "description": "This is the script/instructions for the tester to follow during the simulation.", + "maxLength": 10000, + "example": "You are calling to enroll in the Twin Health program. Confirm your identity when asked." }, - "displayHeightPx": { - "type": "number", - "description": "The display height in pixels" + "evaluations": { + "description": "This is the structured output-based evaluation plan for the simulation.\nEach item defines a structured output to extract and evaluate against an expected value.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EvaluationPlanItem" + } }, - "displayNumber": { - "type": "number", - "description": "Optional display number" - } - } - }, - "UpdateTextEditorToolDTO": { - "type": "object", - "properties": { - "messages": { + "hooks": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "Hooks to run on simulation lifecycle events", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationHookCallStarted", + "title": "SimulationHookCallStarted" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookCallEnded", + "title": "SimulationHookCallEnded" } ] } }, - "subType": { - "type": "string", - "enum": [ - "text_editor_20241022" - ], - "description": "The sub type of tool." - }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "toolMocks": { + "description": "Scenario-level tool call mocks to use during simulations.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ScenarioToolMock" + } }, - "name": { + "path": { "type": "string", - "description": "The name of the tool, fixed to 'str_replace_editor'", - "default": "str_replace_editor", - "enum": [ - "str_replace_editor" - ] + "nullable": true, + "description": "Optional folder path for organizing scenarios.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } - } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "instructions", + "evaluations" + ] }, - "UpdateQueryToolDTO": { + "UpdateScenarioDTO": { "type": "object", "properties": { - "messages": { + "name": { + "type": "string", + "description": "This is the name of the scenario.", + "maxLength": 80 + }, + "instructions": { + "type": "string", + "description": "This is the script/instructions for the tester to follow during the simulation.", + "maxLength": 10000 + }, + "evaluations": { + "description": "This is the structured output-based evaluation plan for the simulation.\nEach item defines a structured output to extract and evaluate against an expected value.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "items": { + "$ref": "#/components/schemas/EvaluationPlanItem" + } + }, + "hooks": { + "type": "array", + "description": "Hooks to run on simulation lifecycle events", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationHookCallStarted", + "title": "SimulationHookCallStarted" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookCallEnded", + "title": "SimulationHookCallEnded" } ] } }, - "knowledgeBases": { - "description": "The knowledge bases to query", + "toolMocks": { "type": "array", "items": { - "$ref": "#/components/schemas/KnowledgeBase" + "$ref": "#/components/schemas/ScenarioToolMock" } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing scenarios.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nSet to null to remove from folder.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } } }, - "UpdateGoogleCalendarCreateEventToolDTO": { + "SimulationRunSimulationEntry": { "type": "object", "properties": { - "messages": { + "type": { + "type": "string", + "enum": [ + "simulation" + ], + "description": "Type discriminator" + }, + "simulationId": { + "type": "string", + "description": "ID of the simulation to run", + "format": "uuid" + } + }, + "required": [ + "type", + "simulationId" + ] + }, + "SimulationRunSuiteEntry": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type discriminator", + "enum": [ + "simulationSuite" + ] + }, + "simulationSuiteId": { + "type": "string", + "description": "ID of the simulation suite to run", + "format": "uuid" + }, + "suiteId": { + "type": "string", + "deprecated": true + } + }, + "required": [ + "type" + ] + }, + "SimulationRunTargetAssistant": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "Type of target" + }, + "assistantId": { + "type": "string", + "description": "ID of the assistant to test against", + "format": "uuid" + } + }, + "required": [ + "type", + "assistantId" + ] + }, + "SimulationRunTargetSquad": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "squad" + ], + "description": "Type of target" + }, + "squadId": { + "type": "string", + "description": "ID of the squad to test against", + "format": "uuid" + } + }, + "required": [ + "type", + "squadId" + ] + }, + "SimulationRunTransportConfiguration": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "Transport provider for the simulation run", + "enum": [ + "vapi.websocket", + "vapi.webchat" + ] + } + }, + "required": [ + "provider" + ] + }, + "CreateSimulationRunDTO": { + "type": "object", + "properties": { + "simulations": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "Array of simulations and/or suites to run", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationRunSimulationEntry", + "title": "Simulation" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationRunSuiteEntry", + "title": "Suite" } ] } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "target": { + "description": "Target to test against", + "oneOf": [ + { + "$ref": "#/components/schemas/SimulationRunTargetAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/SimulationRunTargetSquad", + "title": "Squad" + } + ] + }, + "iterations": { + "type": "number", + "minimum": 1, + "description": "Number of times to run each simulation (default: 1)", + "default": 1 + }, + "transport": { + "description": "Transport configuration for the simulation runs", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunTransportConfiguration" } ] } - } + }, + "required": [ + "simulations", + "target" + ] }, - "UpdateGoogleSheetsRowAppendToolDTO": { + "SimulationRunItemCounts": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "total": { + "type": "number", + "description": "Total number of run items" }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "passed": { + "type": "number", + "description": "Number of passed run items" + }, + "failed": { + "type": "number", + "description": "Number of failed run items" + }, + "running": { + "type": "number", + "description": "Number of running/evaluating run items" + }, + "queued": { + "type": "number", + "description": "Number of queued run items" + }, + "canceled": { + "type": "number", + "description": "Number of canceled run items" + } + }, + "required": [ + "total", + "passed", + "failed", + "running", + "queued", + "canceled" + ] + }, + "SimulationRun": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the run", + "format": "uuid" + }, + "orgId": { + "type": "string", + "description": "Organization ID", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "queued", + "running", + "ended" + ], + "description": "Current status of the run" + }, + "queuedAt": { + "format": "date-time", + "type": "string", + "description": "When the run was queued" + }, + "startedAt": { + "format": "date-time", + "type": "string", + "description": "When the run started" + }, + "endedAt": { + "format": "date-time", + "type": "string", + "description": "When the run ended" + }, + "endedReason": { + "type": "string", + "description": "Reason the run ended" + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "ISO 8601 date-time when created" + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "ISO 8601 date-time when last updated" + }, + "itemCounts": { + "description": "Aggregate counts of run items by status", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunItemCounts" } ] - } - } - }, - "UpdateGoogleCalendarCheckAvailabilityToolDTO": { - "type": "object", - "properties": { - "messages": { + }, + "simulations": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "Array of simulations and/or suites to run", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationRunSimulationEntry", + "title": "Simulation" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationRunSuiteEntry", + "title": "Suite" } ] } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "target": { + "description": "Target to test against", + "oneOf": [ + { + "$ref": "#/components/schemas/SimulationRunTargetAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/SimulationRunTargetSquad", + "title": "Squad" + } + ] + }, + "iterations": { + "type": "number", + "minimum": 1, + "description": "Number of times to run each simulation (default: 1)", + "default": 1 + }, + "transport": { + "description": "Transport configuration for the simulation runs", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunTransportConfiguration" } ] } + }, + "required": [ + "id", + "orgId", + "status", + "queuedAt", + "createdAt", + "updatedAt", + "simulations", + "target" + ] + }, + "SimulationRunItemCallMonitor": { + "type": "object", + "properties": { + "listenUrl": { + "type": "string", + "description": "This is the WebSocket URL to listen to the live call audio (combined both parties)." + } } }, - "UpdateSlackSendMessageToolDTO": { + "SimulationRunItemCallMetadata": { "type": "object", "properties": { + "transcript": { + "type": "string", + "description": "This is the transcript of the conversation." + }, "messages": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "This is the list of conversation messages in OpenAI format.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "type": "object" } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "recordingUrl": { + "type": "string", + "description": "This is the URL to the call recording." + }, + "monitor": { + "description": "This is the call monitoring data (live listen URL).", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunItemCallMonitor" } ] } } }, - "UpdateSmsToolDTO": { + "SimulationRunItemMetadata": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "assistant": { + "type": "object", + "description": "This is a snapshot of the assistant at run creation time.", + "additionalProperties": true }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "squad": { + "type": "object", + "description": "This is a snapshot of the squad at run creation time.", + "additionalProperties": true + }, + "scenario": { + "type": "object", + "description": "This is a snapshot of the scenario at run creation time.", + "additionalProperties": true + }, + "personality": { + "type": "object", + "description": "This is a snapshot of the personality at run creation time.", + "additionalProperties": true + }, + "simulation": { + "type": "object", + "description": "This is a snapshot of the simulation at run creation time.", + "additionalProperties": true + }, + "call": { + "description": "This is the call-related data (transcript, messages, recording).", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunItemCallMetadata" } ] + }, + "hooks": { + "type": "object", + "description": "Hook execution state for this run item (used for idempotency + debugging).", + "additionalProperties": true } } }, - "UpdateMcpToolDTO": { + "StructuredOutputEvaluationResult": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "structuredOutputId": { + "type": "string", + "description": "This is the ID of the structured output that was evaluated.\nWill be 'inline' for inline structured output definitions." }, - "server": { - "description": "\n This is the server where a `tool-calls` webhook will be sent.\n\n Notes:\n - Webhook is sent to this server when a tool call is made.\n - Webhook contains the call, assistant, and phone number objects.\n - Webhook contains the variables set on the assistant.\n - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}.\n - Webhook expects a response with tool call result.", - "allOf": [ + "name": { + "type": "string", + "description": "This is the name of the structured output." + }, + "extractedValue": { + "description": "This is the value extracted from the call by the structured output.", + "oneOf": [ { - "$ref": "#/components/schemas/Server" + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "null" } ] }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ + "expectedValue": { + "description": "This is the expected value that was defined in the evaluation plan.", + "oneOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" } ] }, - "metadata": { - "$ref": "#/components/schemas/McpToolMetadata" + "comparator": { + "type": "string", + "description": "This is the comparison operator used for evaluation.", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ] + }, + "passed": { + "type": "boolean", + "description": "This indicates whether the evaluation passed (extracted value matched expected value using comparator)." + }, + "required": { + "type": "boolean", + "description": "This indicates whether this evaluation was required for the simulation to pass." + }, + "error": { + "type": "string", + "description": "This contains any error that occurred during extraction." + }, + "isSkipped": { + "type": "boolean", + "description": "This indicates whether this evaluation was skipped (e.g., multimodal in chat mode)." + }, + "skipReason": { + "type": "string", + "description": "This contains the reason for skipping the evaluation." } - } + }, + "required": [ + "structuredOutputId", + "name", + "extractedValue", + "expectedValue", + "comparator", + "passed", + "required" + ] }, - "UpdateGoHighLevelCalendarAvailabilityToolDTO": { + "LatencyMetrics": { "type": "object", "properties": { - "messages": { - "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] - } + "turnCount": { + "type": "number", + "description": "This is the number of conversation turns." }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } - ] + "avgTurn": { + "type": "number", + "description": "This is the average total turn latency in milliseconds." + }, + "avgTranscriber": { + "type": "number", + "description": "This is the average transcriber latency in milliseconds." + }, + "avgModel": { + "type": "number", + "description": "This is the average LLM/model latency in milliseconds." + }, + "avgVoice": { + "type": "number", + "description": "This is the average voice/TTS latency in milliseconds." + }, + "avgEndpointing": { + "type": "number", + "description": "This is the average endpointing latency in milliseconds." } - } + }, + "required": [ + "turnCount" + ] }, - "UpdateGoHighLevelCalendarEventCreateToolDTO": { + "SimulationRunItemResults": { "type": "object", "properties": { - "messages": { + "evaluations": { + "description": "This is the list of results from structured output evaluations.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "$ref": "#/components/schemas/StructuredOutputEvaluationResult" } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "passed": { + "type": "boolean", + "description": "This indicates whether all required evaluations passed." + }, + "latencyMetrics": { + "description": "This contains the latency metrics collected from the call.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/LatencyMetrics" } ] } - } + }, + "required": [ + "evaluations", + "passed" + ] }, - "UpdateGoHighLevelContactCreateToolDTO": { + "SimulationRunItemImprovementSuggestion": { "type": "object", "properties": { - "messages": { + "issue": { + "type": "string", + "description": "This is the issue identified." + }, + "suggestion": { + "type": "string", + "description": "This is the suggested improvement." + } + }, + "required": [ + "issue", + "suggestion" + ] + }, + "SimulationRunItemImprovements": { + "type": "object", + "properties": { + "analysis": { + "type": "string", + "description": "This is a summary analysis of why evaluations failed." + }, + "systemPromptSuggestions": { + "description": "This is the list of suggestions for improving the system prompt.", "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" - }, - { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" - } - ] + "$ref": "#/components/schemas/SimulationRunItemImprovementSuggestion" } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "toolSuggestions": { + "description": "This is the list of suggestions for improving tools.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationRunItemImprovementSuggestion" + } + }, + "scenarioSuggestions": { + "description": "This is the list of suggestions for improving the scenario/evaluation plan.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SimulationRunItemImprovementSuggestion" + } + }, + "suggestedSystemPrompt": { + "type": "string", + "description": "This is a complete revised system prompt if major changes are needed." + } + }, + "required": [ + "analysis", + "systemPromptSuggestions", + "toolSuggestions", + "scenarioSuggestions" + ] + }, + "SimulationRunConfiguration": { + "type": "object", + "properties": { + "transport": { + "description": "Transport configuration for the simulation run", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunTransportConfiguration" } ] } } }, - "UpdateGoHighLevelContactGetToolDTO": { + "SimulationRunItem": { "type": "object", "properties": { - "messages": { + "id": { + "type": "string", + "description": "This is the unique identifier for the simulation run item.", + "format": "uuid" + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization.", + "format": "uuid" + }, + "simulationId": { + "type": "string", + "description": "This is the ID of the simulation this run belongs to.", + "format": "uuid" + }, + "status": { + "type": "string", + "description": "This is the current status of the run.", + "enum": [ + "queued", + "running", + "evaluating", + "passed", + "failed", + "canceled" + ] + }, + "queuedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run was queued." + }, + "startedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run started." + }, + "completedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run completed." + }, + "failedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run failed." + }, + "canceledAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run was canceled." + }, + "failureReason": { + "type": "string", + "description": "This is the reason for failure.", + "maxLength": 2000 + }, + "callId": { + "type": "string", + "description": "This is the ID of the target Vapi call (the assistant being tested).", + "format": "uuid" + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run item was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the run item was last updated." + }, + "runId": { + "type": "string", + "description": "This is the ID of the parent run (batch/group).", + "format": "uuid" + }, + "hooks": { "type": "array", - "description": "These are the messages that will be spoken to the user as the tool is running.\n\nFor some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured.", + "description": "Hooks configured for this simulation run item", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/SimulationHookCallStarted", + "title": "SimulationHookCallStarted" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/SimulationHookCallEnded", + "title": "SimulationHookCallEnded" } ] } }, - "rejectionPlan": { - "description": "This is the plan to reject a tool call based on the conversation state.\n\n// Example 1: Reject endCall if user didn't say goodbye\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '(?i)\\\\b(bye|goodbye|farewell|see you later|take care)\\\\b',\n target: { position: -1, role: 'user' },\n negate: true // Reject if pattern does NOT match\n }]\n}\n```\n\n// Example 2: Reject transfer if user is actually asking a question\n```json\n{\n conditions: [{\n type: 'regex',\n regex: '\\\\?',\n target: { position: -1, role: 'user' }\n }]\n}\n```\n\n// Example 3: Reject transfer if user didn't mention transfer recently\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 5 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' %}\n{% assign mentioned = false %}\n{% for msg in userMessages %}\n {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %}\n {% assign mentioned = true %}\n {% break %}\n {% endif %}\n{% endfor %}\n{% if mentioned %}\n false\n{% else %}\n true\n{% endif %}`\n }]\n}\n```\n\n// Example 4: Reject endCall if the bot is looping and trying to exit\n```json\n{\n conditions: [{\n type: 'liquid',\n liquid: `{% assign recentMessages = messages | last: 6 %}\n{% assign userMessages = recentMessages | where: 'role', 'user' | reverse %}\n{% if userMessages.size < 3 %}\n false\n{% else %}\n {% assign msg1 = userMessages[0].content | downcase %}\n {% assign msg2 = userMessages[1].content | downcase %}\n {% assign msg3 = userMessages[2].content | downcase %}\n {% comment %} Check for repetitive messages {% endcomment %}\n {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %}\n true\n {% comment %} Check for common loop phrases {% endcomment %}\n {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %}\n true\n {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %}\n true\n {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %}\n true\n {% else %}\n false\n {% endif %}\n{% endif %}`\n }]\n}\n```", + "iterationNumber": { + "type": "number", + "description": "This is the iteration number (1-indexed) when run with iterations > 1.", + "default": 1 + }, + "sessionId": { + "type": "string", + "description": "This is the session ID for chat-based simulations (webchat transport).", + "format": "uuid" + }, + "scenarioId": { + "type": "string", + "description": "This is the scenario ID at run creation time.", + "format": "uuid" + }, + "personalityId": { + "type": "string", + "description": "This is the personality ID at run creation time.", + "format": "uuid" + }, + "metadata": { + "description": "This is the metadata containing snapshots and call data.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SimulationRunItemMetadata" + } + ] + }, + "results": { + "description": "This is the results of the simulation run.", + "allOf": [ + { + "$ref": "#/components/schemas/SimulationRunItemResults" + } + ] + }, + "improvementSuggestions": { + "description": "This is the AI-generated improvement suggestions for failed runs.", + "allOf": [ + { + "$ref": "#/components/schemas/SimulationRunItemImprovements" + } + ] + }, + "configurations": { + "description": "This is the configuration for how this simulation run executes.", + "allOf": [ + { + "$ref": "#/components/schemas/SimulationRunConfiguration" } ] - } - } - }, - "CreateFileDTO": { - "type": "object", - "properties": { - "file": { - "type": "string", - "description": "This is the File you want to upload for use with the Knowledge Base.", - "format": "binary" } }, "required": [ - "file" + "id", + "orgId", + "simulationId", + "status", + "queuedAt", + "createdAt", + "updatedAt" ] }, - "File": { + "CreateSimulationSuiteDTO": { "type": "object", "properties": { - "object": { - "type": "string", - "enum": [ - "file" - ] - }, - "status": { - "enum": [ - "processing", - "done", - "failed" - ], - "type": "string" - }, "name": { "type": "string", - "description": "This is the name of the file. This is just for your own reference.", - "maxLength": 40 - }, - "originalName": { - "type": "string" - }, - "bytes": { - "type": "number" - }, - "purpose": { - "type": "string" + "description": "This is the name of the simulation suite.", + "maxLength": 80, + "example": "Checkout Flow Tests" }, - "mimetype": { - "type": "string" + "slackWebhookUrl": { + "type": "string", + "description": "This is the Slack webhook URL for notifications." }, - "key": { - "type": "string" + "simulationIds": { + "description": "This is the list of simulation IDs to include in the suite.", + "type": "array", + "items": { + "type": "string" + } }, "path": { - "type": "string" - }, - "bucket": { - "type": "string" - }, - "url": { - "type": "string" - }, - "parsedTextUrl": { - "type": "string" - }, - "parsedTextBytes": { - "type": "number" - }, - "metadata": { - "type": "object" - }, + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing simulation suites.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" + } + }, + "required": [ + "name", + "simulationIds" + ] + }, + "SimulationSuite": { + "type": "object", + "properties": { "id": { "type": "string", - "description": "This is the unique identifier for the file." + "description": "This is the unique identifier for the simulation suite.", + "format": "uuid" }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this file belongs to." + "description": "This is the unique identifier for the organization this suite belongs to.", + "format": "uuid" }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the file was created." + "description": "This is the ISO 8601 date-time string of when the suite was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the suite was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of the simulation suite.", + "maxLength": 80, + "example": "Checkout Flow Tests" + }, + "slackWebhookUrl": { + "type": "string", + "description": "This is the Slack webhook URL for notifications." }, - "updatedAt": { - "format": "date-time", + "path": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the file was last updated." + "nullable": true, + "description": "Optional folder path for organizing simulation suites.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" + }, + "simulationIds": { + "description": "This is the list of simulation IDs in this suite.", + "type": "array", + "items": { + "type": "string" + } } }, "required": [ "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "name", + "simulationIds" ] }, - "UpdateFileDTO": { + "UpdateSimulationSuiteDTO": { "type": "object", "properties": { "name": { "type": "string", - "description": "This is the name of the file. This is just for your own reference.", - "minLength": 1, - "maxLength": 40 + "description": "This is the name of the simulation suite.", + "maxLength": 80 + }, + "slackWebhookUrl": { + "type": "string", + "description": "This is the Slack webhook URL for notifications." + }, + "simulationIds": { + "description": "This is the list of simulation IDs to include in the suite (replaces existing).", + "type": "array", + "items": { + "type": "string" + } + }, + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing simulation suites.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nSet to null to remove from folder.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } } }, - "TrieveKnowledgeBaseSearchPlan": { + "GenerateScenariosDTO": { "type": "object", "properties": { - "topK": { - "type": "number", - "description": "Specifies the number of top chunks to return. This corresponds to the `page_size` parameter in Trieve." - }, - "removeStopWords": { - "type": "boolean", - "description": "If true, stop words (specified in server/src/stop-words.txt in the git repo) will be removed. This will preserve queries that are entirely stop words." - }, - "scoreThreshold": { - "type": "number", - "description": "This is the score threshold to filter out chunks with a score below the threshold for cosine distance metric. For Manhattan Distance, Euclidean Distance, and Dot Product, it will filter out scores above the threshold distance. This threshold applies before weight and bias modifications. If not specified, this defaults to no threshold. A threshold of 0 will default to no threshold." + "assistantId": { + "type": "string", + "description": "ID of the assistant to generate scenarios for" }, - "searchType": { + "squadId": { "type": "string", - "description": "This is the search method used when searching for relevant chunks from the vector store.", - "enum": [ - "fulltext", - "semantic", - "hybrid", - "bm25" - ] + "description": "ID of the squad to generate scenarios for" } - }, - "required": [ - "searchType" - ] + } }, - "TrieveKnowledgeBase": { + "GeneratedScenario": { "type": "object", "properties": { - "provider": { - "type": "string", - "description": "This knowledge base is provided by Trieve.\n\nTo learn more about Trieve, visit https://trieve.ai.", - "enum": [ - "trieve" - ] - }, "name": { "type": "string", - "description": "This is the name of the knowledge base." + "description": "Short descriptive name" }, - "searchPlan": { - "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", - "allOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" - } - ] + "instructions": { + "type": "string", + "description": "Instructions for the tester" }, - "createPlan": { - "description": "This is the plan if you want us to create/import a new vector store using Trieve.", - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", - "title": "Import" - } - ] + "category": { + "type": "string", + "enum": [ + "happy_path", + "edge_case", + "failure_mode" + ], + "description": "Scenario category" }, - "id": { + "reasoning": { "type": "string", - "description": "This is the id of the knowledge base." + "description": "Why this scenario is valuable" + } + }, + "required": [ + "name", + "instructions", + "category", + "reasoning" + ] + }, + "GenerateScenariosResponse": { + "type": "object", + "properties": { + "scenarios": { + "description": "Generated scenarios", + "type": "array", + "items": { + "$ref": "#/components/schemas/GeneratedScenario" + } }, - "orgId": { + "coverageNotes": { "type": "string", - "description": "This is the org id of the knowledge base." + "description": "Summary of test coverage" } }, "required": [ - "provider", - "id", - "orgId" + "scenarios", + "coverageNotes" ] }, - "CustomKnowledgeBase": { + "CreateSimulationDTO": { "type": "object", "properties": { - "provider": { + "name": { "type": "string", - "description": "This knowledge base is bring your own knowledge base implementation.", - "enum": [ - "custom-knowledge-base" - ] + "description": "This is an optional friendly name for the simulation.", + "maxLength": 80, + "example": "Eligible Path with Confused User" }, - "server": { - "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "scenarioId": { + "type": "string", + "description": "This is the ID of the scenario to use for this simulation.", + "format": "uuid" }, - "id": { + "personalityId": { "type": "string", - "description": "This is the id of the knowledge base." + "description": "This is the ID of the personality to use for this simulation.", + "format": "uuid" }, - "orgId": { + "path": { "type": "string", - "description": "This is the org id of the knowledge base." + "nullable": true, + "description": "Optional folder path for organizing simulations.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } }, "required": [ - "provider", - "server", - "id", - "orgId" + "scenarioId", + "personalityId" ] }, - "CreateTrieveKnowledgeBaseDTO": { + "Simulation": { "type": "object", "properties": { - "provider": { + "id": { "type": "string", - "description": "This knowledge base is provided by Trieve.\n\nTo learn more about Trieve, visit https://trieve.ai.", - "enum": [ - "trieve" - ] + "description": "This is the unique identifier for the simulation.", + "format": "uuid" + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the organization this simulation belongs to.", + "format": "uuid" + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the simulation was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the simulation was last updated." }, "name": { "type": "string", - "description": "This is the name of the knowledge base." + "description": "This is an optional friendly name for the simulation.", + "maxLength": 80, + "example": "Eligible Path with Confused User" }, - "searchPlan": { - "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", - "allOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" - } - ] + "scenarioId": { + "type": "string", + "description": "This is the ID of the scenario to use for this simulation.", + "format": "uuid" }, - "createPlan": { - "description": "This is the plan if you want us to create/import a new vector store using Trieve.", - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", - "title": "Import" - } - ] + "personalityId": { + "type": "string", + "description": "This is the ID of the personality to use for this simulation.", + "format": "uuid" + }, + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing simulations.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nMaps to GitOps resource folder structure.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } }, "required": [ - "provider" + "id", + "orgId", + "createdAt", + "updatedAt", + "scenarioId", + "personalityId" ] }, - "UpdateTrieveKnowledgeBaseDTO": { + "UpdateSimulationDTO": { "type": "object", "properties": { "name": { "type": "string", - "description": "This is the name of the knowledge base." + "description": "This is an optional friendly name for the simulation.", + "maxLength": 80 }, - "searchPlan": { - "description": "This is the searching plan used when searching for relevant chunks from the vector store.\n\nYou should configure this if you're running into these issues:\n- Too much unnecessary context is being fed as knowledge base context.\n- Not enough relevant context is being fed as knowledge base context.", - "allOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" - } - ] + "scenarioId": { + "type": "string", + "description": "This is the ID of the scenario to use for this simulation.", + "format": "uuid" }, - "createPlan": { - "description": "This is the plan if you want us to create/import a new vector store using Trieve.", - "oneOf": [ - { - "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", - "title": "Import" - } - ] + "personalityId": { + "type": "string", + "description": "This is the ID of the personality to use for this simulation.", + "format": "uuid" + }, + "path": { + "type": "string", + "nullable": true, + "description": "Optional folder path for organizing simulations.\nSupports up to 3 levels (e.g., \"dept/feature/variant\").\nSet to null to remove from folder.", + "maxLength": 255, + "pattern": "/^[a-zA-Z0-9][a-zA-Z0-9._-]*(?:\\/[a-zA-Z0-9][a-zA-Z0-9._-]*){0,2}$/" } } }, - "UpdateCustomKnowledgeBaseDTO": { + "SimulationConcurrencyResponse": { "type": "object", "properties": { - "server": { - "description": "This is where the knowledge base request will be sent.\n\nRequest Example:\n\nPOST https://{server.url}\nContent-Type: application/json\n\n{\n \"messsage\": {\n \"type\": \"knowledge-base-request\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Why is ocean blue?\"\n }\n ],\n ...other metadata about the call...\n }\n}\n\nResponse Expected:\n```\n{\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The ocean is blue because water absorbs everything but blue.\",\n }, // YOU CAN RETURN THE EXACT RESPONSE TO SPEAK\n \"documents\": [\n {\n \"content\": \"The ocean is blue primarily because water absorbs colors in the red part of the light spectrum and scatters the blue light, making it more visible to our eyes.\",\n \"similarity\": 1\n },\n {\n \"content\": \"Blue light is scattered more by the water molecules than other colors, enhancing the blue appearance of the ocean.\",\n \"similarity\": .5\n }\n ] // OR, YOU CAN RETURN AN ARRAY OF DOCUMENTS THAT WILL BE SENT TO THE MODEL\n}\n```", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "orgId": { + "type": "string" + }, + "concurrencyLimit": { + "type": "number", + "description": "Max call slots for simulations (each voice simulation uses 2 call slots: tester + target)" + }, + "activeSimulations": { + "type": "number", + "description": "Number of call slots currently in use by running simulations" + }, + "availableToStart": { + "type": "number", + "description": "Number of voice simulations that can start now (available call slots / 2)" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "isDefault": { + "type": "boolean", + "description": "True if org is using platform default concurrency limit" } - } + }, + "required": [ + "orgId", + "concurrencyLimit", + "activeSimulations", + "availableToStart", + "createdAt", + "updatedAt", + "isDefault" + ] }, - "TrieveKnowledgeBaseChunkPlan": { + "BarInsightMetadata": { "type": "object", "properties": { - "fileIds": { - "description": "These are the file ids that will be used to create the vector store. To upload files, use the `POST /files` endpoint.", - "type": "array", - "items": { - "type": "string" - } + "xAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 }, - "websites": { - "description": "These are the websites that will be used to create the vector store.", - "type": "array", - "items": { - "type": "string" - } + "yAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 }, - "targetSplitsPerChunk": { - "type": "number", - "description": "This is an optional field which allows you to specify the number of splits you want per chunk. If not specified, the default 20 is used. However, you may want to use a different number." + "yAxisMin": { + "type": "number" }, - "splitDelimiters": { - "description": "This is an optional field which allows you to specify the delimiters to use when splitting the file before chunking the text. If not specified, the default [.!?\\n] are used to split into sentences. However, you may want to use spaces or other delimiters.", - "type": "array", - "items": { - "type": "string" - } + "yAxisMax": { + "type": "number" }, - "rebalanceChunks": { - "type": "boolean", - "description": "This is an optional field which allows you to specify whether or not to rebalance the chunks created from the file. If not specified, the default true is used. If true, Trieve will evenly distribute remainder splits across chunks such that 66 splits with a target_splits_per_chunk of 20 will result in 3 chunks with 22 splits each." + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 } } }, - "TrieveKnowledgeBaseCreate": { + "InsightTimeRangeWithStep": { "type": "object", "properties": { - "type": { + "step": { "type": "string", - "description": "This is to create a new dataset on Trieve.", + "description": "This is the group by step for aggregation.\n\nIf not provided, defaults to group by day.", "enum": [ - "create" + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" ] }, - "chunkPlans": { - "description": "These are the chunk plans used to create the dataset.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TrieveKnowledgeBaseChunkPlan" - } + "start": { + "type": "object", + "description": "This is the start date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to the 7 days ago.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"-7d\" or \"now\"" + }, + "end": { + "type": "object", + "description": "This is the end date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to now.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"now\"" + }, + "timezone": { + "type": "string", + "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." } - }, - "required": [ - "type", - "chunkPlans" - ] + } }, - "TrieveKnowledgeBaseImport": { + "BarInsight": { "type": "object", "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, "type": { "type": "string", - "description": "This is to import an existing dataset from Trieve.", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", "enum": [ - "import" + "bar" ] }, - "providerId": { - "type": "string", - "description": "This is the `datasetId` of the dataset on your Trieve account." - } - }, - "required": [ - "type", - "providerId" - ] - }, - "Workflow": { - "type": "object", - "properties": { - "nodes": { + "formulas": { "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ConversationNode", - "title": "ConversationNode" - }, - { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" - } - ] + "$ref": "#/components/schemas/InsightFormula" } }, - "model": { - "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", - "oneOf": [ - { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, - { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, - { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, - { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, - "transcriber": { - "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", - "oneOf": [ - { - "$ref": "#/components/schemas/AssemblyAITranscriber", - "title": "AssemblyAITranscriber" - }, - { - "$ref": "#/components/schemas/AzureSpeechTranscriber", - "title": "AzureSpeechTranscriber" - }, - { - "$ref": "#/components/schemas/CustomTranscriber", - "title": "CustomTranscriber" - }, - { - "$ref": "#/components/schemas/DeepgramTranscriber", - "title": "DeepgramTranscriber" - }, - { - "$ref": "#/components/schemas/ElevenLabsTranscriber", - "title": "ElevenLabsTranscriber" - }, - { - "$ref": "#/components/schemas/GladiaTranscriber", - "title": "GladiaTranscriber" - }, - { - "$ref": "#/components/schemas/GoogleTranscriber", - "title": "GoogleTranscriber" - }, - { - "$ref": "#/components/schemas/SpeechmaticsTranscriber", - "title": "SpeechmaticsTranscriber" - }, - { - "$ref": "#/components/schemas/TalkscriberTranscriber", - "title": "TalkscriberTranscriber" - }, - { - "$ref": "#/components/schemas/OpenAITranscriber", - "title": "OpenAITranscriber" - }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ { - "$ref": "#/components/schemas/CartesiaTranscriber", - "title": "CartesiaTranscriber" + "$ref": "#/components/schemas/BarInsightMetadata" } ] }, - "voice": { - "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", - "oneOf": [ - { - "$ref": "#/components/schemas/AzureVoice", - "title": "AzureVoice" - }, - { - "$ref": "#/components/schemas/CartesiaVoice", - "title": "CartesiaVoice" - }, - { - "$ref": "#/components/schemas/CustomVoice", - "title": "CustomVoice" - }, - { - "$ref": "#/components/schemas/DeepgramVoice", - "title": "DeepgramVoice" - }, - { - "$ref": "#/components/schemas/ElevenLabsVoice", - "title": "ElevenLabsVoice" - }, - { - "$ref": "#/components/schemas/HumeVoice", - "title": "HumeVoice" - }, - { - "$ref": "#/components/schemas/LMNTVoice", - "title": "LMNTVoice" - }, - { - "$ref": "#/components/schemas/NeuphonicVoice", - "title": "NeuphonicVoice" - }, - { - "$ref": "#/components/schemas/OpenAIVoice", - "title": "OpenAIVoice" - }, - { - "$ref": "#/components/schemas/PlayHTVoice", - "title": "PlayHTVoice" - }, - { - "$ref": "#/components/schemas/RimeAIVoice", - "title": "RimeAIVoice" - }, - { - "$ref": "#/components/schemas/SmallestAIVoice", - "title": "SmallestAIVoice" - }, - { - "$ref": "#/components/schemas/TavusVoice", - "title": "TavusVoice" - }, - { - "$ref": "#/components/schemas/VapiVoice", - "title": "VapiVoice" - }, - { - "$ref": "#/components/schemas/SesameVoice", - "title": "SesameVoice" - }, - { - "$ref": "#/components/schemas/InworldVoice", - "title": "InworldVoice" - }, - { - "$ref": "#/components/schemas/MinimaxVoice", - "title": "MinimaxVoice" - } - ] + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" }, - "observabilityPlan": { - "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", - "oneOf": [ - { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" - } + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" ], - "allOf": [ - { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" - } - ] - }, - "backgroundSound": { - "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", - "oneOf": [ - { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" - }, - { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" - } + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" ] }, - "hooks": { + "queries": { "type": "array", - "description": "This is a set of actions that will be performed on certain events.", + "description": "These are the queries to run to generate the insight.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" + "$ref": "#/components/schemas/JSONQueryOnEventsTable", + "title": "JSONQueryOnEventsTable" } ] } }, - "credentials": { + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "InsightTimeRange": { + "type": "object", + "properties": { + "start": { + "type": "object", + "description": "This is the start date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to the 7 days ago.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"-7d\" or \"now\"" + }, + "end": { + "type": "object", + "description": "This is the end date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to now.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"now\"" + }, + "timezone": { + "type": "string", + "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." + } + } + }, + "PieInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { "type": "array", - "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", - "title": "AnthropicCredential" - }, - { - "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", - "title": "AnyscaleCredential" - }, - { - "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", - "title": "AssemblyAICredential" - }, - { - "$ref": "#/components/schemas/CreateAzureCredentialDTO", - "title": "AzureCredential" - }, - { - "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "title": "AzureOpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "title": "ByoSipTrunkCredential" - }, - { - "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", - "title": "CartesiaCredential" - }, - { - "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", - "title": "CerebrasCredential" - }, - { - "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", - "title": "CloudflareCredential" - }, - { - "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", - "title": "CustomLLMCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" - }, - { - "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" - }, - { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" - }, - { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCredentialDTO", - "title": "GoogleCredential" - }, - { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" - }, - { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" - }, - { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" - }, - { - "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" - }, - { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" - }, - { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" - }, - { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, - { - "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" - }, - { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" - }, - { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" - }, - { - "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", - "title": "PlayHTCredential" - }, - { - "$ref": "#/components/schemas/CreateRimeAICredentialDTO", - "title": "RimeAICredential" - }, - { - "$ref": "#/components/schemas/CreateRunpodCredentialDTO", - "title": "RunpodCredential" - }, - { - "$ref": "#/components/schemas/CreateS3CredentialDTO", - "title": "S3Credential" - }, - { - "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", - "title": "SmallestAICredential" - }, - { - "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "title": "SpeechmaticsCredential" - }, - { - "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", - "title": "SupabaseCredential" - }, - { - "$ref": "#/components/schemas/CreateTavusCredentialDTO", - "title": "TavusCredential" - }, - { - "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" - }, - { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" - }, - { - "$ref": "#/components/schemas/CreateTwilioCredentialDTO", - "title": "TwilioCredential" - }, - { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" - }, - { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" - }, - { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" - }, - { - "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "title": "SlackOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "title": "GoHighLevelMCPCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateInworldCredentialDTO", - "title": "InworldCredential" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", - "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", - "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", - "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", - "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "azure": "#/components/schemas/CreateAzureCredentialDTO", - "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", - "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", - "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", - "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", - "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", - "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", - "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", - "gcp": "#/components/schemas/CreateGcpCredentialDTO", - "gladia": "#/components/schemas/CreateGladiaCredentialDTO", - "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "google": "#/components/schemas/CreateGoogleCredentialDTO", - "groq": "#/components/schemas/CreateGroqCredentialDTO", - "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", - "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", - "lmnt": "#/components/schemas/CreateLmntCredentialDTO", - "make": "#/components/schemas/CreateMakeCredentialDTO", - "openai": "#/components/schemas/CreateOpenAICredentialDTO", - "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", - "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", - "playht": "#/components/schemas/CreatePlayHTCredentialDTO", - "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", - "runpod": "#/components/schemas/CreateRunpodCredentialDTO", - "s3": "#/components/schemas/CreateS3CredentialDTO", - "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", - "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", - "tavus": "#/components/schemas/CreateTavusCredentialDTO", - "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", - "twilio": "#/components/schemas/CreateTwilioCredentialDTO", - "vonage": "#/components/schemas/CreateVonageCredentialDTO", - "webhook": "#/components/schemas/CreateWebhookCredentialDTO", - "xai": "#/components/schemas/CreateXAiCredentialDTO", - "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", - "hume": "#/components/schemas/CreateHumeCredentialDTO", - "mistral": "#/components/schemas/CreateMistralCredentialDTO", - "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "trieve": "#/components/schemas/CreateTrieveCredentialDTO", - "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" } - } + ] } }, "id": { - "type": "string" + "type": "string", + "description": "This is the unique identifier for the Insight." }, "orgId": { - "type": "string" + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." }, "createdAt": { "format": "date-time", - "type": "string" + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." }, "updatedAt": { "format": "date-time", - "type": "string" + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "LineInsightMetadata": { + "type": "object", + "properties": { + "xAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisMin": { + "type": "number" + }, + "yAxisMax": { + "type": "number" }, "name": { "type": "string", - "maxLength": 80 + "minLength": 1, + "maxLength": 255 + } + } + }, + "LineInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "edges": { + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", "items": { - "$ref": "#/components/schemas/Edge" + "$ref": "#/components/schemas/InsightFormula" } }, - "globalPrompt": { - "type": "string", - "maxLength": 5000 - }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", + "metadata": { + "description": "This is the metadata for the insight.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/LineInsightMetadata" } ] }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", - "allOf": [ - { - "$ref": "#/components/schemas/CompliancePlan" - } - ] + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" }, - "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" - } + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" ] }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactPlan" - } + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "TextInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" ] }, - "startSpeakingPlan": { - "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", - "allOf": [ - { - "$ref": "#/components/schemas/StartSpeakingPlan" - } + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "UpdateBarInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" ] }, - "stopSpeakingPlan": { - "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", - "allOf": [ - { - "$ref": "#/components/schemas/StopSpeakingPlan" - } - ] + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } }, - "monitorPlan": { - "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", + "metadata": { + "description": "This is the metadata for the insight.", "allOf": [ { - "$ref": "#/components/schemas/MonitorPlan" + "$ref": "#/components/schemas/BarInsightMetadata" } ] }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", - "allOf": [ - { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" - } + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" ] }, - "credentialIds": { - "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "queries": { "type": "array", + "description": "These are the queries to run to generate the insight.", "items": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnEventsTable", + "title": "JSONQueryOnEventsTable" + } + ] } - }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", - "allOf": [ - { - "$ref": "#/components/schemas/KeypadInputPlan" - } - ] } - }, - "required": [ - "nodes", - "id", - "orgId", - "createdAt", - "updatedAt", - "name", - "edges" - ] + } }, - "UpdateWorkflowDTO": { + "UpdatePieInsightFromCallTableDTO": { "type": "object", "properties": { - "nodes": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { "type": "array", + "description": "These are the queries to run to generate the insight.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ConversationNode", - "title": "ConversationNode" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" } ] } + } + } + }, + "UpdateLineInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "model": { - "description": "This is the model for the workflow.\n\nThis can be overridden at node level using `nodes[n].model`.", - "oneOf": [ - { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, - { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, - { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, - { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, - "transcriber": { - "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", - "oneOf": [ - { - "$ref": "#/components/schemas/AssemblyAITranscriber", - "title": "AssemblyAITranscriber" - }, - { - "$ref": "#/components/schemas/AzureSpeechTranscriber", - "title": "AzureSpeechTranscriber" - }, - { - "$ref": "#/components/schemas/CustomTranscriber", - "title": "CustomTranscriber" - }, - { - "$ref": "#/components/schemas/DeepgramTranscriber", - "title": "DeepgramTranscriber" - }, - { - "$ref": "#/components/schemas/ElevenLabsTranscriber", - "title": "ElevenLabsTranscriber" - }, - { - "$ref": "#/components/schemas/GladiaTranscriber", - "title": "GladiaTranscriber" - }, - { - "$ref": "#/components/schemas/GoogleTranscriber", - "title": "GoogleTranscriber" - }, - { - "$ref": "#/components/schemas/SpeechmaticsTranscriber", - "title": "SpeechmaticsTranscriber" - }, - { - "$ref": "#/components/schemas/TalkscriberTranscriber", - "title": "TalkscriberTranscriber" - }, - { - "$ref": "#/components/schemas/OpenAITranscriber", - "title": "OpenAITranscriber" - }, - { - "$ref": "#/components/schemas/CartesiaTranscriber", - "title": "CartesiaTranscriber" - } + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" ] }, - "voice": { - "description": "This is the voice for the workflow.\n\nThis can be overridden at node level using `nodes[n].voice`.", - "oneOf": [ - { - "$ref": "#/components/schemas/AzureVoice", - "title": "AzureVoice" - }, - { - "$ref": "#/components/schemas/CartesiaVoice", - "title": "CartesiaVoice" - }, - { - "$ref": "#/components/schemas/CustomVoice", - "title": "CustomVoice" - }, - { - "$ref": "#/components/schemas/DeepgramVoice", - "title": "DeepgramVoice" - }, - { - "$ref": "#/components/schemas/ElevenLabsVoice", - "title": "ElevenLabsVoice" - }, - { - "$ref": "#/components/schemas/HumeVoice", - "title": "HumeVoice" - }, - { - "$ref": "#/components/schemas/LMNTVoice", - "title": "LMNTVoice" - }, - { - "$ref": "#/components/schemas/NeuphonicVoice", - "title": "NeuphonicVoice" - }, - { - "$ref": "#/components/schemas/OpenAIVoice", - "title": "OpenAIVoice" - }, - { - "$ref": "#/components/schemas/PlayHTVoice", - "title": "PlayHTVoice" - }, - { - "$ref": "#/components/schemas/RimeAIVoice", - "title": "RimeAIVoice" - }, - { - "$ref": "#/components/schemas/SmallestAIVoice", - "title": "SmallestAIVoice" - }, - { - "$ref": "#/components/schemas/TavusVoice", - "title": "TavusVoice" - }, - { - "$ref": "#/components/schemas/VapiVoice", - "title": "VapiVoice" - }, - { - "$ref": "#/components/schemas/SesameVoice", - "title": "SesameVoice" - }, - { - "$ref": "#/components/schemas/InworldVoice", - "title": "InworldVoice" - }, - { - "$ref": "#/components/schemas/MinimaxVoice", - "title": "MinimaxVoice" - } - ] + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } }, - "observabilityPlan": { - "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", - "oneOf": [ - { - "$ref": "#/components/schemas/LangfuseObservabilityPlan", - "title": "Langfuse" - } - ], + "metadata": { + "description": "This is the metadata for the insight.", "allOf": [ { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$ref": "#/components/schemas/LineInsightMetadata" } ] }, - "backgroundSound": { - "description": "This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'.\nYou can also provide a custom sound by providing a URL to an audio file.", - "oneOf": [ - { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" - }, - { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" - } + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" ] }, - "hooks": { + "queries": { "type": "array", - "description": "This is a set of actions that will be performed on certain events.", + "description": "These are the queries to run to generate the insight.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CallHookCallEnding", - "title": "CallHookCallEnding" - }, - { - "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", - "title": "CallHookAssistantSpeechInterrupted" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", - "title": "CallHookCustomerSpeechInterrupted" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", - "title": "CallHookCustomerSpeechTimeout" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" } ] } + } + } + }, + "UpdateTextInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } }, - "credentials": { + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { "type": "array", - "description": "These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", "items": { "oneOf": [ { - "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", - "title": "AnthropicCredential" - }, - { - "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", - "title": "AnyscaleCredential" - }, - { - "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", - "title": "AssemblyAICredential" - }, - { - "$ref": "#/components/schemas/CreateAzureCredentialDTO", - "title": "AzureCredential" - }, - { - "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "title": "AzureOpenAICredential" - }, - { - "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "title": "ByoSipTrunkCredential" - }, - { - "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", - "title": "CartesiaCredential" - }, - { - "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", - "title": "CerebrasCredential" - }, - { - "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", - "title": "CloudflareCredential" - }, - { - "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", - "title": "CustomLLMCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" - }, - { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" - }, + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + } + }, + "CreateBarInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/BarInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateGoogleCredentialDTO", - "title": "GoogleCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" }, { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" - }, + "$ref": "#/components/schemas/JSONQueryOnEventsTable", + "title": "JSONQueryOnEventsTable" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreatePieInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" - }, + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreateLineInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/LineInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreateTextInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" }, { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" }, { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" - }, + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "JSONQueryOnCallTableWithStringTypeColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreatePlayHTCredentialDTO", - "title": "PlayHTCredential" + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateRimeAICredentialDTO", - "title": "RimeAICredential" + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateRunpodCredentialDTO", - "title": "RunpodCredential" + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateS3CredentialDTO", - "title": "S3Credential" + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateSmallestAICredentialDTO", - "title": "SmallestAICredential" - }, + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "id", + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the selected table.\nAvailable columns depend on the selected table.\nString Type columns are columns where the rows store String data", + "example": "id" + }, + "operation": { + "type": "string", + "enum": [ + "count" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a string type, the operation must be \"count\".", + "example": "count" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "JSONQueryOnCallTableWithNumberTypeColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "title": "SpeechmaticsCredential" + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateSupabaseCredentialDTO", - "title": "SupabaseCredential" + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateTavusCredentialDTO", - "title": "TavusCredential" + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateTwilioCredentialDTO", - "title": "TwilioCredential" - }, + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "cost", + "duration", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency", + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the selected table.\nAvailable columns depend on the selected table.\nNumber Type columns are columns where the rows store Number data", + "example": "duration" + }, + "operation": { + "type": "string", + "enum": [ + "average", + "sum", + "min", + "max" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a number type, the operation must be one of the following:\n- average\n- sum\n- min\n- max", + "example": "sum" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "JSONQueryOnCallTableWithStructuredOutputColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" }, { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" - }, + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the call table.\nStructured Output Type columns are only to query on artifact.structuredOutputs[OutputID] column.", + "example": "artifact.structuredOutputs[OutputID]" + }, + "operation": { + "type": "string", + "enum": [ + "average", + "count", + "sum", + "min", + "max" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a structured output type, the operation depends on the value of the structured output.\nIf the structured output is a string or boolean, the operation must be \"count\".\nIf the structured output is a number, the operation can be \"average\", \"sum\", \"min\", or \"max\".", + "example": "count" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "JSONQueryOnEventsTable": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.\nMust be \"events\" for event-based insights.", + "enum": [ + "events" + ] + }, + "on": { + "type": "string", + "description": "The event type to query", + "example": "assistant.model.requestFailed", + "enum": [ + "call.started", + "call.ended", + "call.inProgress", + "call.queued", + "call.transportConnected", + "call.transportDisconnected", + "call.transportReconnected", + "call.transferInitiated", + "call.transferCompleted", + "call.transferFailed", + "call.transferCancelled", + "call.handoffInitiated", + "call.handoffCompleted", + "call.handoffFailed", + "call.assistantSwapped", + "call.assistantStarted", + "call.customerJoined", + "call.customerLeft", + "call.controlReceived", + "call.listenStarted", + "call.recordingStarted", + "call.recordingPaused", + "call.recordingResumed", + "call.voicemailDetected", + "call.voicemailNotDetected", + "call.dtmfReceived", + "call.dtmfSent", + "call.amdDetected", + "call.hookTriggered", + "call.hookSucceeded", + "call.hookFailed", + "call.statusReceived", + "call.silenceTimeout", + "call.microphoneTimeout", + "call.maxDurationReached", + "assistant.voice.requestStarted", + "assistant.voice.requestSucceeded", + "assistant.voice.requestFailed", + "assistant.voice.connectionOpened", + "assistant.voice.connectionClosed", + "assistant.voice.firstAudioReceived", + "assistant.voice.audioChunkReceived", + "assistant.voice.generationSucceeded", + "assistant.voice.generationFailed", + "assistant.voice.textPushed", + "assistant.voice.reconnecting", + "assistant.voice.cleanup", + "assistant.voice.clearing", + "assistant.voice.voiceSwitched", + "assistant.model.requestStarted", + "assistant.model.requestSucceeded", + "assistant.model.requestFailed", + "assistant.model.requestAttemptStarted", + "assistant.model.requestAttemptSucceeded", + "assistant.model.requestAttemptFailed", + "assistant.model.connectionOpened", + "assistant.model.connectionClosed", + "assistant.model.firstTokenReceived", + "assistant.model.tokenReceived", + "assistant.model.responseSucceeded", + "assistant.model.responseFailed", + "assistant.model.toolCallsReceived", + "assistant.model.reconnecting", + "assistant.model.cleanup", + "assistant.model.clearing", + "assistant.tool.started", + "assistant.tool.completed", + "assistant.tool.failed", + "assistant.tool.delayedMessageSent", + "assistant.tool.timeout", + "assistant.tool.asyncCallbackReceived", + "assistant.transcriber.requestStarted", + "assistant.transcriber.requestSucceeded", + "assistant.transcriber.requestFailed", + "assistant.transcriber.connectionOpened", + "assistant.transcriber.connectionClosed", + "assistant.transcriber.partialTranscript", + "assistant.transcriber.finalTranscript", + "assistant.transcriber.keepAlive", + "assistant.transcriber.reconnecting", + "assistant.transcriber.cleanup", + "assistant.transcriber.clearing", + "assistant.transcriber.transcriptIgnored", + "assistant.transcriber.languageSwitched", + "assistant.analysis.structuredOutputGenerated" + ] + }, + "operation": { + "type": "string", + "description": "This is the operation to perform on matching events.\n- \"count\": Returns the raw count of matching events\n- \"percentage\": Returns (count of matching events / total calls) * 100", + "example": "count", + "enum": [ + "count", + "percentage" + ] + }, + "filters": { + "type": "array", + "description": "These are the filters to apply to the events query.\nEach filter filters on a field specific to the event type.", + "items": { + "oneOf": [ { - "$ref": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "title": "SlackOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/EventsTableStringCondition" }, { - "$ref": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "title": "GoHighLevelMCPCredential" + "$ref": "#/components/schemas/EventsTableNumberCondition" }, { - "$ref": "#/components/schemas/CreateInworldCredentialDTO", - "title": "InworldCredential" - } - ], - "discriminator": { - "propertyName": "provider", - "mapping": { - "11labs": "#/components/schemas/CreateElevenLabsCredentialDTO", - "anthropic": "#/components/schemas/CreateAnthropicCredentialDTO", - "anyscale": "#/components/schemas/CreateAnyscaleCredentialDTO", - "assembly-ai": "#/components/schemas/CreateAssemblyAICredentialDTO", - "azure-openai": "#/components/schemas/CreateAzureOpenAICredentialDTO", - "azure": "#/components/schemas/CreateAzureCredentialDTO", - "byo-sip-trunk": "#/components/schemas/CreateByoSipTrunkCredentialDTO", - "cartesia": "#/components/schemas/CreateCartesiaCredentialDTO", - "cerebras": "#/components/schemas/CreateCerebrasCredentialDTO", - "cloudflare": "#/components/schemas/CreateCloudflareCredentialDTO", - "custom-llm": "#/components/schemas/CreateCustomLLMCredentialDTO", - "deepgram": "#/components/schemas/CreateDeepgramCredentialDTO", - "deepinfra": "#/components/schemas/CreateDeepInfraCredentialDTO", - "deep-seek": "#/components/schemas/CreateDeepSeekCredentialDTO", - "gcp": "#/components/schemas/CreateGcpCredentialDTO", - "gladia": "#/components/schemas/CreateGladiaCredentialDTO", - "gohighlevel": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "google": "#/components/schemas/CreateGoogleCredentialDTO", - "groq": "#/components/schemas/CreateGroqCredentialDTO", - "inflection-ai": "#/components/schemas/CreateInflectionAICredentialDTO", - "langfuse": "#/components/schemas/CreateLangfuseCredentialDTO", - "lmnt": "#/components/schemas/CreateLmntCredentialDTO", - "make": "#/components/schemas/CreateMakeCredentialDTO", - "openai": "#/components/schemas/CreateOpenAICredentialDTO", - "openrouter": "#/components/schemas/CreateOpenRouterCredentialDTO", - "perplexity-ai": "#/components/schemas/CreatePerplexityAICredentialDTO", - "playht": "#/components/schemas/CreatePlayHTCredentialDTO", - "rime-ai": "#/components/schemas/CreateRimeAICredentialDTO", - "runpod": "#/components/schemas/CreateRunpodCredentialDTO", - "s3": "#/components/schemas/CreateS3CredentialDTO", - "supabase": "#/components/schemas/CreateSupabaseCredentialDTO", - "smallest-ai": "#/components/schemas/CreateSmallestAICredentialDTO", - "tavus": "#/components/schemas/CreateTavusCredentialDTO", - "together-ai": "#/components/schemas/CreateTogetherAICredentialDTO", - "twilio": "#/components/schemas/CreateTwilioCredentialDTO", - "vonage": "#/components/schemas/CreateVonageCredentialDTO", - "webhook": "#/components/schemas/CreateWebhookCredentialDTO", - "xai": "#/components/schemas/CreateXAiCredentialDTO", - "neuphonic": "#/components/schemas/CreateNeuphonicCredentialDTO", - "hume": "#/components/schemas/CreateHumeCredentialDTO", - "mistral": "#/components/schemas/CreateMistralCredentialDTO", - "speechmatics": "#/components/schemas/CreateSpeechmaticsCredentialDTO", - "trieve": "#/components/schemas/CreateTrieveCredentialDTO", - "google.calendar.oauth2-client": "#/components/schemas/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "google.calendar.oauth2-authorization": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "google.sheets.oauth2-authorization": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "slack.oauth2-authorization": "#/components/schemas/CreateSlackOAuth2AuthorizationCredentialDTO", - "ghl.oauth2-authorization": "#/components/schemas/CreateGoHighLevelMCPCredentialDTO", - "inworld": "#/components/schemas/CreateInworldCredentialDTO", - "minimax": "#/components/schemas/CreateMinimaxCredentialDTO" + "$ref": "#/components/schemas/EventsTableBooleanCondition" } - } + ] } }, "name": { "type": "string", - "maxLength": 80 - }, - "edges": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Edge" - } + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Model Failures" + } + }, + "required": [ + "type", + "table", + "on", + "operation" + ] + }, + "FilterStringTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nString Type columns are columns where the rows store data as a string.\nMust be a valid column for the selected table.", + "example": "assistant_id", + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "customerNumber", + "status", + "endedReason", + "forwardedPhoneNumber", + "campaignId" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor string type columns, the operator must be \"=\", \"!=\", \"contains\", \"not contains\"", + "example": "\"=\" or \"!=\"", + "enum": [ + "=", + "!=", + "contains", + "not_contains" + ] + }, + "value": { + "type": "string", + "description": "This is the value to filter on." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterNumberTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nNumber Type columns are columns where the rows store data as a number.\nMust be a valid column for the selected table.", + "example": "duration", + "enum": [ + "duration", + "cost", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor number type columns, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"", + "example": "\"=\" or \">\" or \"<\" or \">=\" or \"<=\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ] + }, + "value": { + "type": "number", + "description": "This is the value to filter on." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterDateTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nDate Type columns are columns where the rows store data as a date.\nMust be a valid column for the selected table.", + "example": "created_at", + "enum": [ + "startedAt", + "endedAt" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor date type columns, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"", + "example": "\"=\" or \">\" or \"<\" or \">=\" or \"<=\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ] + }, + "value": { + "type": "string", + "description": "This is the value to filter on.\nMust be a valid ISO 8601 date-time string.", + "example": "2025-01-01T00:00:00Z" + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterStructuredOutputColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nStructured Output Type columns are only to filter on artifact.structuredOutputs[OutputID] column.", + "example": "artifact.structuredOutputs[OutputID]", + "enum": [ + "artifact.structuredOutputs[OutputID]" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator depends on the value type of the structured output.\nIf the structured output is a string or boolean, the operator must be \"=\", \"!=\"\nIf the structured output is a number, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"\nIf the structured output is an array, the operator must be \"in\" or \"not_in\"", + "example": "\"=\" or \">\" or \"<\" or \"in\" or \"not_in\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=", + "in", + "not_in", + "contains", + "not_contains", + "is_empty", + "is_not_empty" + ] + }, + "value": { + "type": "object", + "description": "This is the value to filter on.\nThe value type depends on the structured output type being filtered." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterStringArrayTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nString Array Type columns are the same as String Type columns, but provides the ability to filter on multiple values provided as an array.\nMust be a valid column for the selected table.", + "example": "assistant_id", + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "customerNumber", + "status", + "endedReason", + "forwardedPhoneNumber", + "campaignId" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator must be `in` or `not_in`.", + "example": "\"in\" or \"not_in\"", + "enum": [ + "in", + "not_in", + "is_empty", + "is_not_empty" + ] + }, + "value": { + "description": "These are the values to filter on.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterNumberArrayTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nNumber Array Type columns are the same as Number Type columns, but provides the ability to filter on multiple values provided as an array.\nMust be a valid column for the selected table.", + "example": "duration", + "enum": [ + "duration", + "cost", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator must be `in` or `not_in`.", + "example": "\"in\" or \"not_in\"", + "enum": [ + "in", + "not_in", + "is_empty", + "is_not_empty" + ] + }, + "value": { + "description": "This is the value to filter on.", + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "EventsTableStringCondition": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "The string field name from the event data", + "example": "provider" + }, + "operator": { + "type": "string", + "description": "String comparison operator", + "example": "=", + "enum": [ + "=", + "!=", + "contains", + "notContains" + ] + }, + "value": { + "type": "string", + "description": "The string value to compare", + "example": "openai" + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "EventsTableNumberCondition": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "The number field name from the event data", + "example": "latency" + }, + "operator": { + "type": "string", + "description": "Number comparison operator", + "example": ">=", + "enum": [ + "=", + "!=", + ">", + ">=", + "<", + "<=" + ] + }, + "value": { + "type": "number", + "description": "The number value to compare", + "example": 1000 + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "EventsTableBooleanCondition": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "The boolean field name from the event data", + "example": "success" }, - "globalPrompt": { + "operator": { "type": "string", - "maxLength": 5000 - }, - "server": { - "description": "This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.\n\nThe order of precedence is:\n\n1. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. org.server", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] - }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", - "allOf": [ - { - "$ref": "#/components/schemas/CompliancePlan" - } + "description": "Boolean comparison operator", + "example": "=", + "enum": [ + "=" ] }, - "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" - } - ] + "value": { + "type": "boolean", + "description": "The boolean value to compare", + "example": true + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "BarInsightFromCallTable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactPlan" - } + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" ] }, - "startSpeakingPlan": { - "description": "This is the plan for when the workflow nodes should start talking.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to start talking after the customer is done speaking.\n- The assistant is too fast to start talking after the customer is done speaking.\n- The assistant is so fast that it's actually interrupting the customer.", - "allOf": [ - { - "$ref": "#/components/schemas/StartSpeakingPlan" - } - ] + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } }, - "stopSpeakingPlan": { - "description": "This is the plan for when workflow nodes should stop talking on customer interruption.\n\nYou should configure this if you're running into these issues:\n- The assistant is too slow to recognize customer's interruption.\n- The assistant is too fast to recognize customer's interruption.\n- The assistant is getting interrupted by phrases that are just acknowledgments.\n- The assistant is getting interrupted by background noises.\n- The assistant is not properly stopping -- it starts talking right after getting interrupted.", + "metadata": { + "description": "This is the metadata for the insight.", "allOf": [ { - "$ref": "#/components/schemas/StopSpeakingPlan" + "$ref": "#/components/schemas/BarInsightMetadata" } ] }, - "monitorPlan": { - "description": "This is the plan for real-time monitoring of the workflow's calls.\n\nUsage:\n- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`.\n- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`.", - "allOf": [ - { - "$ref": "#/components/schemas/MonitorPlan" - } - ] + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" }, - "backgroundSpeechDenoisingPlan": { - "description": "This enables filtering of noise and background speech while the user is talking.\n\nFeatures:\n- Smart denoising using Krisp\n- Fourier denoising\n\nBoth can be used together. Order of precedence:\n- Smart denoising\n- Fourier denoising", - "allOf": [ - { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" - } + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" ] }, - "credentialIds": { - "description": "These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this.", + "queries": { "type": "array", + "description": "These are the queries to run to generate the insight.", "items": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnEventsTable", + "title": "JSONQueryOnEventsTable" + } + ] } - }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", - "allOf": [ - { - "$ref": "#/components/schemas/KeypadInputPlan" - } - ] } - } + }, + "required": [ + "type", + "queries" + ] }, - "Squad": { + "PieInsightFromCallTable": { "type": "object", "properties": { "name": { "type": "string", - "description": "This is the name of the squad." + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "members": { - "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", "items": { - "$ref": "#/components/schemas/SquadMemberDTO" + "$ref": "#/components/schemas/InsightFormula" } }, - "membersOverrides": { - "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } - ] - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the squad." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this squad belongs to." + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" }, - "createdAt": { - "format": "date-time", + "groupBy": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the squad was created." + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the squad was last updated." + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } } }, "required": [ - "members", - "id", - "orgId", - "createdAt", - "updatedAt" + "type", + "queries" ] }, - "UpdateSquadDTO": { + "LineInsightFromCallTable": { "type": "object", "properties": { "name": { "type": "string", - "description": "This is the name of the squad." + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "members": { - "description": "This is the list of assistants that make up the squad.\n\nThe call will start with the first assistant in the list.", + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", "items": { - "$ref": "#/components/schemas/SquadMemberDTO" + "$ref": "#/components/schemas/InsightFormula" } }, - "membersOverrides": { - "description": "This can be used to override all the assistants' settings and provide values for their template variables.\n\nBoth `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.", + "metadata": { + "description": "This is the metadata for the insight.", "allOf": [ { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/LineInsightMetadata" } ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "customerNumber", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } } }, "required": [ - "members" + "type", + "queries" ] }, - "TesterPlan": { + "TextInsightFromCallTable": { "type": "object", "properties": { - "assistant": { - "description": "Pass a transient assistant to use for the test assistant.\n\nMake sure to write a detailed system prompt for a test assistant, and use the {{test.script}} variable to access the test script.", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "assistantId": { + "name": { "type": "string", - "description": "Pass an assistant id that can be access\n\nMake sure to write a detailed system prompt for the test assistant, and use the {{test.script}} variable to access the test script." + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "assistantOverrides": { - "description": "Add any assistant overrides to the test assistant.\n\nOne use case is if you want to pass custom variables into the test using variableValues, that you can then access in the script\nand rubric using {{varName}}.", - "allOf": [ - { - "$ref": "#/components/schemas/AssistantOverrides" - } + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn", + "title": "JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn", + "title": "JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn", + "title": "JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } } - } + }, + "required": [ + "type", + "queries" + ] }, - "TestSuitePhoneNumber": { + "InsightFormula": { "type": "object", "properties": { - "provider": { + "name": { "type": "string", - "description": "This is the provider of the phone number.", - "enum": [ - "test-suite" - ] + "description": "This is the name of the formula.\nIt will be used to label the formula in the insight board on the UI.", + "example": "Booking Rate", + "minLength": 1, + "maxLength": 255 }, - "number": { + "formula": { "type": "string", - "description": "This is the phone number that is being tested.", - "maxLength": 50 + "description": "This is the formula to calculate the insight from the queries.\nThe formula needs to be a valid mathematical expression.\nThe formula must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nAny MathJS formula is allowed - https://mathjs.org/docs/expressions/syntax.html\n\nCommon valid math operations are +, -, *, /, %", + "minLength": 1, + "maxLength": 1000 } }, "required": [ - "provider", - "number" + "formula" ] }, - "TargetPlan": { + "InsightRunFormatPlan": { "type": "object", "properties": { - "phoneNumberId": { + "format": { "type": "string", - "description": "This is the phone number that is being tested.\nDuring the actual test, it'll be called and the assistant attached to it will pick up and be tested.\nTo test an assistant directly, send assistantId instead." - }, - "phoneNumber": { - "description": "This can be any phone number (even not on Vapi).\nDuring the actual test, it'll be called.\nTo test a Vapi number, send phoneNumberId. To test an assistant directly, send assistantId instead.", - "allOf": [ - { - "$ref": "#/components/schemas/TestSuitePhoneNumber" - } + "description": "This is the format of the data to return.\nIf not provided, defaults to \"raw\".\nRaw provides the data as fetched from the database, with formulas evaluated.\nRecharts provides the data in a format that can is ready to be used by recharts.js to render charts.", + "example": "raw", + "enum": [ + "raw", + "recharts" ] + } + } + }, + "InsightRunDTO": { + "type": "object", + "properties": { + "formatPlan": { + "$ref": "#/components/schemas/InsightRunFormatPlan" }, - "assistantId": { - "type": "string", - "description": "This is the assistant being tested.\nDuring the actual test, it'll invoked directly.\nTo test the assistant over phone number, send phoneNumberId instead." - }, - "assistantOverrides": { - "description": "This is the assistant overrides applied to assistantId before it is tested.", + "timeRangeOverride": { + "description": "This is the optional time range override for the insight.\nIf provided, overrides every field in the insight's timeRange.\nIf this is provided with missing fields, defaults will be used, not the insight's timeRange.\nstart default - \"-7d\"\nend default - \"now\"\nstep default - \"day\"\nFor Pie and Text Insights, step will be ignored even if provided.", + "example": "{ start: \"2025-01-01\", end: \"2025-01-07\", step: \"day\" }", "allOf": [ { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/InsightTimeRangeWithStep" } ] } } }, - "TestSuite": { + "InsightRunResponse": { "type": "object", "properties": { "id": { - "type": "string", - "description": "This is the unique identifier for the test suite." + "type": "string" + }, + "insightId": { + "type": "string" }, "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this test suite belongs to." + "type": "string" }, "createdAt": { "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the test suite was created." + "type": "string" }, "updatedAt": { "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "insightId", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "Insight": { + "type": "object", + "properties": { + "name": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the test suite was last updated." + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 255 }, - "name": { + "type": { "type": "string", - "description": "This is the name of the test suite.", - "maxLength": 80 + "description": "This is the type of the Insight.", + "enum": [ + "bar", + "line", + "pie", + "text" + ] }, - "phoneNumberId": { + "id": { "type": "string", - "description": "This is the phone number ID associated with this test suite.", - "deprecated": true + "description": "This is the unique identifier for the Insight." }, - "testerPlan": { - "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", - "allOf": [ - { - "$ref": "#/components/schemas/TesterPlan" - } - ] + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." }, - "targetPlan": { - "description": "These are the configuration for the assistant / phone number that is being tested.", - "allOf": [ - { - "$ref": "#/components/schemas/TargetPlan" - } - ] + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." } }, "required": [ + "type", "id", "orgId", "createdAt", "updatedAt" ] }, - "TestSuitesPaginatedResponse": { + "InsightPaginatedResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { - "$ref": "#/components/schemas/TestSuite" + "$ref": "#/components/schemas/Insight" } }, "metadata": { @@ -38123,637 +48240,1017 @@ "metadata" ] }, - "CreateTestSuiteDto": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the test suite.", - "maxLength": 80 - }, - "phoneNumberId": { - "type": "string", - "description": "This is the phone number ID associated with this test suite.", - "deprecated": true - }, - "testerPlan": { - "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", - "allOf": [ - { - "$ref": "#/components/schemas/TesterPlan" - } - ] - }, - "targetPlan": { - "description": "These are the configuration for the assistant / phone number that is being tested.", - "allOf": [ - { - "$ref": "#/components/schemas/TargetPlan" - } - ] - } - } - }, - "UpdateTestSuiteDto": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the test suite.", - "maxLength": 80 - }, - "phoneNumberId": { - "type": "string", - "description": "This is the phone number ID associated with this test suite.", - "deprecated": true - }, - "testerPlan": { - "description": "Override the default tester plan by providing custom assistant configuration for the test agent.\n\nWe recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.", - "allOf": [ - { - "$ref": "#/components/schemas/TesterPlan" - } - ] - }, - "targetPlan": { - "description": "These are the configuration for the assistant / phone number that is being tested.", - "allOf": [ - { - "$ref": "#/components/schemas/TargetPlan" - } - ] - } - } - }, - "TestSuiteTestVoice": { + "CreateEvalDTO": { "type": "object", "properties": { - "scorers": { + "messages": { "type": "array", - "description": "These are the scorers used to evaluate the test.", + "description": "This is the mock conversation that will be used to evaluate the flow of the conversation.\n\nMock Messages are used to simulate the flow of the conversation\n\nEvaluation Messages are used as checkpoints in the flow where the model's response to previous conversation needs to be evaluated to check the content and tool calls", + "example": "[{ role: \"user\", content: \"Hello, how are you?\" }, { role: \"assistant\", judgePlan: { type: \"exact\", content: \"I am good, thank you!\" } }]", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" + "$ref": "#/components/schemas/ChatEvalAssistantMessageMock", + "title": "ChatEvalAssistantMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalSystemMessageMock", + "title": "ChatEvalSystemMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", + "title": "ChatEvalToolResponseMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, + { + "$ref": "#/components/schemas/ChatEvalUserMessageMock", + "title": "ChatEvalUserMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageEvaluation", + "title": "ChatEvalAssistantMessageEvaluation" } ] } }, - "type": { - "type": "string", - "description": "This is the type of the test, which must be voice.", - "enum": [ - "voice" - ], - "maxLength": 100 - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the test." - }, - "testSuiteId": { - "type": "string", - "description": "This is the unique identifier for the test suite this test belongs to." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization this test belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the test was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the test was last updated." - }, "name": { "type": "string", - "description": "This is the name of the test.", + "description": "This is the name of the eval.\nIt helps identify what the eval is checking for.", + "example": "Verified User Flow Eval", + "minLength": 1, "maxLength": 80 }, - "script": { + "description": { "type": "string", - "description": "This is the script to be used for the voice test.", - "maxLength": 10000 + "description": "This is the description of the eval.\nThis helps describe the eval and its purpose in detail. It will not be used to evaluate the flow of the conversation.", + "example": "This eval checks if the user flow is verified.", + "maxLength": 500 }, - "numAttempts": { - "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "type": { + "type": "string", + "description": "This is the type of the eval.\nCurrently it is fixed to `chat.mockConversation`.", + "example": "chat.mockConversation", + "enum": [ + "chat.mockConversation" + ] } }, "required": [ - "scorers", - "type", - "id", - "testSuiteId", - "orgId", - "createdAt", - "updatedAt", - "script" + "messages", + "type" ] }, - "TestSuiteTestChat": { + "Eval": { "type": "object", "properties": { - "scorers": { + "messages": { "type": "array", - "description": "These are the scorers used to evaluate the test.", + "description": "This is the mock conversation that will be used to evaluate the flow of the conversation.\n\nMock Messages are used to simulate the flow of the conversation\n\nEvaluation Messages are used as checkpoints in the flow where the model's response to previous conversation needs to be evaluated to check the content and tool calls", + "example": "[{ role: \"user\", content: \"Hello, how are you?\" }, { role: \"assistant\", judgePlan: { type: \"exact\", content: \"I am good, thank you!\" } }]", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" + "$ref": "#/components/schemas/ChatEvalAssistantMessageMock", + "title": "ChatEvalAssistantMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalSystemMessageMock", + "title": "ChatEvalSystemMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", + "title": "ChatEvalToolResponseMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, + { + "$ref": "#/components/schemas/ChatEvalUserMessageMock", + "title": "ChatEvalUserMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageEvaluation", + "title": "ChatEvalAssistantMessageEvaluation" } ] } }, - "type": { - "type": "string", - "description": "This is the type of the test, which must be chat.", - "enum": [ - "chat" - ], - "maxLength": 100 - }, "id": { - "type": "string", - "description": "This is the unique identifier for the test." - }, - "testSuiteId": { - "type": "string", - "description": "This is the unique identifier for the test suite this test belongs to." + "type": "string" }, "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization this test belongs to." + "type": "string" }, "createdAt": { "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the test was created." + "type": "string" }, "updatedAt": { "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the test was last updated." + "type": "string" }, "name": { "type": "string", - "description": "This is the name of the test.", + "description": "This is the name of the eval.\nIt helps identify what the eval is checking for.", + "example": "Verified User Flow Eval", + "minLength": 1, "maxLength": 80 }, - "script": { + "description": { "type": "string", - "description": "This is the script to be used for the chat test.", - "maxLength": 10000 + "description": "This is the description of the eval.\nThis helps describe the eval and its purpose in detail. It will not be used to evaluate the flow of the conversation.", + "example": "This eval checks if the user flow is verified.", + "maxLength": 500 }, - "numAttempts": { - "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "type": { + "type": "string", + "description": "This is the type of the eval.\nCurrently it is fixed to `chat.mockConversation`.", + "example": "chat.mockConversation", + "enum": [ + "chat.mockConversation" + ] } }, "required": [ - "scorers", - "type", + "messages", "id", - "testSuiteId", "orgId", "createdAt", "updatedAt", - "script" + "type" ] }, - "CreateTestSuiteTestVoiceDto": { + "EvalModelListOptions": { "type": "object", "properties": { - "scorers": { + "provider": { + "type": "string", + "description": "This is the provider of the model.", + "enum": [ + "openai", + "anthropic", + "google", + "groq", + "custom-llm" + ] + } + }, + "required": [ + "provider" + ] + }, + "EvalUserEditable": { + "type": "object", + "properties": { + "messages": { "type": "array", - "description": "These are the scorers used to evaluate the test.", + "description": "This is the mock conversation that will be used to evaluate the flow of the conversation.\n\nMock Messages are used to simulate the flow of the conversation\n\nEvaluation Messages are used as checkpoints in the flow where the model's response to previous conversation needs to be evaluated to check the content and tool calls", + "example": "[{ role: \"user\", content: \"Hello, how are you?\" }, { role: \"assistant\", judgePlan: { type: \"exact\", content: \"I am good, thank you!\" } }]", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" + "$ref": "#/components/schemas/ChatEvalAssistantMessageMock", + "title": "ChatEvalAssistantMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalSystemMessageMock", + "title": "ChatEvalSystemMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", + "title": "ChatEvalToolResponseMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, + { + "$ref": "#/components/schemas/ChatEvalUserMessageMock", + "title": "ChatEvalUserMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageEvaluation", + "title": "ChatEvalAssistantMessageEvaluation" } ] } }, - "type": { + "name": { "type": "string", - "description": "This is the type of the test, which must be voice.", - "enum": [ - "voice" - ], - "maxLength": 100 + "description": "This is the name of the eval.\nIt helps identify what the eval is checking for.", + "example": "Verified User Flow Eval", + "minLength": 1, + "maxLength": 80 }, - "script": { + "description": { "type": "string", - "description": "This is the script to be used for the voice test.", - "maxLength": 10000 - }, - "numAttempts": { - "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "description": "This is the description of the eval.\nThis helps describe the eval and its purpose in detail. It will not be used to evaluate the flow of the conversation.", + "example": "This eval checks if the user flow is verified.", + "maxLength": 500 }, + "type": { + "type": "string", + "description": "This is the type of the eval.\nCurrently it is fixed to `chat.mockConversation`.", + "example": "chat.mockConversation", + "enum": [ + "chat.mockConversation" + ] + } + }, + "required": [ + "messages", + "type" + ] + }, + "ChatEvalAssistantMessageMockToolCall": { + "type": "object", + "properties": { "name": { "type": "string", - "description": "This is the name of the test.", - "maxLength": 80 + "description": "This is the name of the tool that will be called.\nIt should be one of the tools created in the organization.", + "example": "get_weather", + "maxLength": 100 + }, + "arguments": { + "type": "object", + "description": "This is the arguments that will be passed to the tool call.", + "example": "\"{\"city\": \"San Francisco\"}\"" } }, "required": [ - "scorers", - "type", - "script" + "name" ] }, - "CreateTestSuiteTestChatDto": { + "ChatEvalAssistantMessageMock": { "type": "object", "properties": { - "scorers": { + "role": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "This is the role of the message author.\nFor a mock assistant message, the role is always 'assistant'\n@default 'assistant'", + "default": "assistant" + }, + "content": { + "type": "string", + "description": "This is the content of the assistant message.\nThis is the message that the assistant would have sent.", + "example": "The weather in San Francisco is sunny.", + "maxLength": 1000 + }, + "toolCalls": { + "description": "This is the tool calls that will be made by the assistant.", + "example": "[{ name: \"get_weather\", arguments: { city: \"San Francisco\" } }]", "type": "array", - "description": "These are the scorers used to evaluate the test.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" - } - ] + "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" } - }, - "type": { + } + }, + "required": [ + "role" + ] + }, + "ChatEvalSystemMessageMock": { + "type": "object", + "properties": { + "role": { "type": "string", - "description": "This is the type of the test, which must be chat.", "enum": [ - "chat" + "system" ], - "maxLength": 100 + "description": "This is the role of the message author.\nFor a mock system message, the role is always 'system'\n@default 'system'", + "default": "system" }, - "script": { + "content": { "type": "string", - "description": "This is the script to be used for the chat test.", - "maxLength": 10000 + "description": "This is the content of the system message that would have been added in the middle of the conversation.\nDo not include the assistant prompt as a part of this message. It will automatically be fetched during runtime.", + "example": "You are a helpful assistant." + } + }, + "required": [ + "role", + "content" + ] + }, + "ChatEvalToolResponseMessageMock": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "tool" + ], + "description": "This is the role of the message author.\nFor a mock tool response message, the role is always 'tool'\n@default 'tool'", + "default": "tool" }, - "numAttempts": { - "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "content": { + "type": "string", + "description": "This is the content of the tool response message. JSON Objects should be stringified.", + "examples": [ + "The weather in San Francisco is sunny.", + "{weather: sunny}" + ] + } + }, + "required": [ + "role", + "content" + ] + }, + "ChatEvalUserMessageMock": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "user" + ], + "description": "This is the role of the message author.\nFor a mock user message, the role is always 'user'\n@default 'user'", + "default": "user" }, - "name": { + "content": { "type": "string", - "description": "This is the name of the test.", - "maxLength": 80 + "description": "This is the content of the user message.\nThis is the message that the user would have sent.", + "example": "Hello, how are you?", + "maxLength": 1000 } }, "required": [ - "scorers", - "type", - "script" + "role", + "content" ] }, - "UpdateTestSuiteTestVoiceDto": { + "AssistantMessageEvaluationContinuePlan": { "type": "object", "properties": { - "scorers": { + "exitOnFailureEnabled": { + "type": "boolean", + "description": "This is whether the evaluation should exit if the assistant message evaluates to false.\nBy default, it is false and the evaluation will continue.\n@default false" + }, + "contentOverride": { + "type": "string", + "description": "This is the content that will be used in the conversation for this assistant turn moving forward if provided.\nIt will override the content received from the model.", + "example": "The weather in San Francisco is sunny.", + "maxLength": 1000 + }, + "toolCallsOverride": { + "description": "This is the tool calls that will be used in the conversation for this assistant turn moving forward if provided.\nIt will override the tool calls received from the model.", + "example": "[{ name: \"get_weather\", arguments: { city: \"San Francisco\" } }]", "type": "array", - "description": "These are the scorers used to evaluate the test.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" - } - ] + "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" } - }, - "type": { + } + } + }, + "ChatEvalAssistantMessageEvaluation": { + "type": "object", + "properties": { + "role": { "type": "string", - "description": "This is the type of the test, which must be voice.", "enum": [ - "voice" + "assistant" ], - "maxLength": 100 + "description": "This is the role of the message author.\nFor an assistant message evaluation, the role is always 'assistant'\n@default 'assistant'", + "default": "assistant" }, - "name": { + "judgePlan": { + "description": "This is the judge plan that instructs how to evaluate the assistant message.\nThe assistant message can be evaluated against fixed content (exact match or RegEx) or with an LLM-as-judge by defining the evaluation criteria in a prompt.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanExact", + "title": "AssistantMessageJudgePlanExact" + }, + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanRegex", + "title": "AssistantMessageJudgePlanRegex" + }, + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanAI", + "title": "AssistantMessageJudgePlanAI" + } + ] + }, + "continuePlan": { + "description": "This is the plan for how the overall evaluation will proceed after the assistant message is evaluated.\nThis lets you configure whether to stop the evaluation if this message fails, and whether to override any content for future turns", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantMessageEvaluationContinuePlan" + } + ] + } + }, + "required": [ + "role", + "judgePlan" + ] + }, + "EvalOpenAIModel": { + "type": "object", + "properties": { + "provider": { "type": "string", - "description": "This is the name of the test.", - "maxLength": 80 + "description": "This is the provider of the model (`openai`).", + "enum": [ + "openai" + ] }, - "script": { + "model": { "type": "string", - "description": "This is the script to be used for the voice test.", - "maxLength": 10000 + "description": "This is the OpenAI model that will be used.\n\nWhen using Vapi OpenAI or your own Azure Credentials, you have the option to specify the region for the selected model. This shouldn't be specified unless you have a specific reason to do so. Vapi will automatically find the fastest region that make sense.\nThis is helpful when you are required to comply with Data Residency rules. Learn more about Azure regions here https://azure.microsoft.com/en-us/explore/global-infrastructure/data-residency/.", + "maxLength": 100, + "enum": [ + "gpt-5.2", + "gpt-5.2-chat-latest", + "gpt-5.1", + "gpt-5.1-chat-latest", + "gpt-5", + "gpt-5-chat-latest", + "gpt-5-mini", + "gpt-5-nano", + "gpt-4.1-2025-04-14", + "gpt-4.1-mini-2025-04-14", + "gpt-4.1-nano-2025-04-14", + "gpt-4.1", + "gpt-4.1-mini", + "gpt-4.1-nano", + "chatgpt-4o-latest", + "o3", + "o3-mini", + "o4-mini", + "o1-mini", + "o1-mini-2024-09-12", + "gpt-4o-mini-2024-07-18", + "gpt-4o-mini", + "gpt-4o", + "gpt-4o-2024-05-13", + "gpt-4o-2024-08-06", + "gpt-4o-2024-11-20", + "gpt-4-turbo", + "gpt-4-turbo-2024-04-09", + "gpt-4-turbo-preview", + "gpt-4-0125-preview", + "gpt-4-1106-preview", + "gpt-4", + "gpt-4-0613", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0125", + "gpt-3.5-turbo-1106", + "gpt-3.5-turbo-16k", + "gpt-3.5-turbo-0613", + "gpt-4.1-2025-04-14:westus", + "gpt-4.1-2025-04-14:eastus2", + "gpt-4.1-2025-04-14:eastus", + "gpt-4.1-2025-04-14:westus3", + "gpt-4.1-2025-04-14:northcentralus", + "gpt-4.1-2025-04-14:southcentralus", + "gpt-4.1-2025-04-14:westeurope", + "gpt-4.1-2025-04-14:germanywestcentral", + "gpt-4.1-2025-04-14:polandcentral", + "gpt-4.1-2025-04-14:spaincentral", + "gpt-4.1-mini-2025-04-14:westus", + "gpt-4.1-mini-2025-04-14:eastus2", + "gpt-4.1-mini-2025-04-14:eastus", + "gpt-4.1-mini-2025-04-14:westus3", + "gpt-4.1-mini-2025-04-14:northcentralus", + "gpt-4.1-mini-2025-04-14:southcentralus", + "gpt-4.1-mini-2025-04-14:westeurope", + "gpt-4.1-mini-2025-04-14:germanywestcentral", + "gpt-4.1-mini-2025-04-14:polandcentral", + "gpt-4.1-mini-2025-04-14:spaincentral", + "gpt-4.1-nano-2025-04-14:westus", + "gpt-4.1-nano-2025-04-14:eastus2", + "gpt-4.1-nano-2025-04-14:westus3", + "gpt-4.1-nano-2025-04-14:northcentralus", + "gpt-4.1-nano-2025-04-14:southcentralus", + "gpt-4o-2024-11-20:swedencentral", + "gpt-4o-2024-11-20:westus", + "gpt-4o-2024-11-20:eastus2", + "gpt-4o-2024-11-20:eastus", + "gpt-4o-2024-11-20:westus3", + "gpt-4o-2024-11-20:southcentralus", + "gpt-4o-2024-11-20:westeurope", + "gpt-4o-2024-11-20:germanywestcentral", + "gpt-4o-2024-11-20:polandcentral", + "gpt-4o-2024-11-20:spaincentral", + "gpt-4o-2024-08-06:westus", + "gpt-4o-2024-08-06:westus3", + "gpt-4o-2024-08-06:eastus", + "gpt-4o-2024-08-06:eastus2", + "gpt-4o-2024-08-06:northcentralus", + "gpt-4o-2024-08-06:southcentralus", + "gpt-4o-mini-2024-07-18:westus", + "gpt-4o-mini-2024-07-18:westus3", + "gpt-4o-mini-2024-07-18:eastus", + "gpt-4o-mini-2024-07-18:eastus2", + "gpt-4o-mini-2024-07-18:northcentralus", + "gpt-4o-mini-2024-07-18:southcentralus", + "gpt-4o-2024-05-13:eastus2", + "gpt-4o-2024-05-13:eastus", + "gpt-4o-2024-05-13:northcentralus", + "gpt-4o-2024-05-13:southcentralus", + "gpt-4o-2024-05-13:westus3", + "gpt-4o-2024-05-13:westus", + "gpt-4-turbo-2024-04-09:eastus2", + "gpt-4-0125-preview:eastus", + "gpt-4-0125-preview:northcentralus", + "gpt-4-0125-preview:southcentralus", + "gpt-4-1106-preview:australia", + "gpt-4-1106-preview:canadaeast", + "gpt-4-1106-preview:france", + "gpt-4-1106-preview:india", + "gpt-4-1106-preview:norway", + "gpt-4-1106-preview:swedencentral", + "gpt-4-1106-preview:uk", + "gpt-4-1106-preview:westus", + "gpt-4-1106-preview:westus3", + "gpt-4-0613:canadaeast", + "gpt-3.5-turbo-0125:canadaeast", + "gpt-3.5-turbo-0125:northcentralus", + "gpt-3.5-turbo-0125:southcentralus", + "gpt-3.5-turbo-1106:canadaeast", + "gpt-3.5-turbo-1106:westus" + ] }, - "numAttempts": { + "temperature": { "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "description": "This is the temperature of the model. For LLM-as-a-judge, it's recommended to set it between 0 - 0.3 to avoid hallucinations and ensure the model judges the output correctly based on the instructions.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", + "minimum": 50, + "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } - } + }, + "required": [ + "provider", + "model", + "messages" + ] }, - "UpdateTestSuiteTestChatDto": { + "EvalAnthropicModel": { "type": "object", "properties": { - "scorers": { - "type": "array", - "description": "These are the scorers used to evaluate the test.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestScorerAI", - "title": "AI" - } - ] - } - }, - "type": { + "provider": { "type": "string", - "description": "This is the type of the test, which must be chat.", + "description": "This is the provider of the model (`anthropic`).", "enum": [ - "chat" - ], - "maxLength": 100 + "anthropic" + ] }, - "name": { + "model": { "type": "string", - "description": "This is the name of the test.", - "maxLength": 80 + "description": "This is the specific model that will be used.", + "maxLength": 100, + "enum": [ + "claude-3-opus-20240229", + "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", + "claude-3-5-sonnet-20240620", + "claude-3-5-sonnet-20241022", + "claude-3-5-haiku-20241022", + "claude-3-7-sonnet-20250219", + "claude-opus-4-20250514", + "claude-opus-4-5-20251101", + "claude-opus-4-6", + "claude-sonnet-4-20250514", + "claude-sonnet-4-5-20250929", + "claude-haiku-4-5-20251001" + ] }, - "script": { - "type": "string", - "description": "This is the script to be used for the chat test.", - "maxLength": 10000 + "thinking": { + "description": "This is the optional configuration for Anthropic's thinking feature.\n\n- If provided, `maxTokens` must be greater than `thinking.budgetTokens`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnthropicThinkingConfig" + } + ] }, - "numAttempts": { + "temperature": { "type": "number", - "description": "This is the number of attempts allowed for the test.", - "minimum": 1, - "maximum": 10 + "description": "This is the temperature of the model. For LLM-as-a-judge, it's recommended to set it between 0 - 0.3 to avoid hallucinations and ensure the model judges the output correctly based on the instructions.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", + "minimum": 50, + "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } - } + }, + "required": [ + "provider", + "model", + "messages" + ] }, - "TestSuiteTestScorerAI": { + "EvalGoogleModel": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of the scorer, which must be AI.", + "description": "This is the provider of the model (`google`).", "enum": [ - "ai" - ], - "maxLength": 100 + "google" + ] }, - "rubric": { + "model": { "type": "string", - "description": "This is the rubric used by the AI scorer.", - "maxLength": 10000 + "description": "This is the name of the model. Ex. gpt-4o", + "maxLength": 100, + "enum": [ + "gemini-3-flash-preview", + "gemini-2.5-pro", + "gemini-2.5-flash", + "gemini-2.5-flash-lite", + "gemini-2.0-flash-thinking-exp", + "gemini-2.0-pro-exp-02-05", + "gemini-2.0-flash", + "gemini-2.0-flash-lite", + "gemini-2.0-flash-exp", + "gemini-2.0-flash-realtime-exp", + "gemini-1.5-flash", + "gemini-1.5-flash-002", + "gemini-1.5-pro", + "gemini-1.5-pro-002", + "gemini-1.0-pro" + ] + }, + "temperature": { + "type": "number", + "description": "This is the temperature of the model. For LLM-as-a-judge, it's recommended to set it between 0 - 0.3 to avoid hallucinations and ensure the model judges the output correctly based on the instructions.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", + "minimum": 50, + "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ - "type", - "rubric" + "provider", + "model", + "messages" ] }, - "TestSuiteTestsPaginatedResponse": { + "EvalGroqModel": { "type": "object", "properties": { - "results": { + "provider": { + "type": "string", + "description": "This is the provider of the model (`groq`).", + "enum": [ + "groq" + ] + }, + "model": { + "type": "string", + "description": "This is the name of the model. Ex. gpt-4o", + "maxLength": 100, + "enum": [ + "openai/gpt-oss-20b", + "openai/gpt-oss-120b", + "deepseek-r1-distill-llama-70b", + "llama-3.3-70b-versatile", + "llama-3.1-405b-reasoning", + "llama-3.1-8b-instant", + "llama3-8b-8192", + "llama3-70b-8192", + "gemma2-9b-it", + "moonshotai/kimi-k2-instruct-0905", + "meta-llama/llama-4-maverick-17b-128e-instruct", + "meta-llama/llama-4-scout-17b-16e-instruct", + "mistral-saba-24b", + "compound-beta", + "compound-beta-mini" + ] + }, + "temperature": { + "type": "number", + "description": "This is the temperature of the model. For LLM-as-a-judge, it's recommended to set it between 0 - 0.3 to avoid hallucinations and ensure the model judges the output correctly based on the instructions.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", + "minimum": 50, + "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", "type": "array", - "description": "A list of test suite tests.", "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat" - } - ] + "type": "object" } - }, - "metadata": { - "description": "Metadata about the pagination.", - "allOf": [ - { - "$ref": "#/components/schemas/PaginationMeta" - } - ] } }, "required": [ - "results", - "metadata" + "provider", + "model", + "messages" ] }, - "TestSuiteRunScorerAI": { + "EvalCustomModel": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type of the scorer, which must be AI.", + "description": "This is the provider of the model (`custom-llm`).", "enum": [ - "ai" - ], - "maxLength": 100 + "custom-llm" + ] }, - "result": { + "url": { "type": "string", - "description": "This is the result of the test suite.", - "enum": [ - "pass", - "fail" - ], - "maxLength": 100 + "description": "These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1" }, - "reasoning": { - "type": "string", - "description": "This is the reasoning provided by the AI scorer.", - "maxLength": 10000 + "headers": { + "type": "object", + "description": "These are the headers we'll use for the OpenAI client's `headers`." }, - "rubric": { + "timeoutSeconds": { + "type": "number", + "description": "This sets the timeout for the connection to the custom provider without needing to stream any tokens back. Default is 20 seconds.", + "minimum": 20, + "maximum": 600 + }, + "model": { "type": "string", - "description": "This is the rubric used by the AI scorer.", - "maxLength": 10000 + "description": "This is the name of the model. Ex. gpt-4o", + "maxLength": 100 + }, + "temperature": { + "type": "number", + "description": "This is the temperature of the model. For LLM-as-a-judge, it's recommended to set it between 0 - 0.3 to avoid hallucinations and ensure the model judges the output correctly based on the instructions.", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number", + "description": "This is the max tokens of the model.\nIf your Judge instructions return `true` or `false` takes only 1 token (as per the OpenAI Tokenizer), and therefore is recommended to set it to a low number to force the model to return a short response.", + "minimum": 50, + "maximum": 10000 + }, + "messages": { + "description": "These are the messages which will instruct the AI Judge on how to evaluate the assistant message.\nThe LLM-Judge must respond with \"pass\" or \"fail\" to indicate if the assistant message passes the eval.\n\nTo access the messages in the mock conversation, use the LiquidJS variable `{{messages}}`.\nThe assistant message to be evaluated will be passed as the last message in the `messages` array and can be accessed using `{{messages[-1]}}`.\n\nIt is recommended to use the system message to instruct the LLM how to evaluate the assistant message, and then use the first user message to pass the assistant message to be evaluated.", + "example": "{", + "type": "array", + "items": { + "type": "object" + } } }, "required": [ - "type", - "result", - "reasoning", - "rubric" + "provider", + "url", + "model", + "messages" ] }, - "TestSuiteRunTestAttemptCall": { + "AssistantMessageJudgePlanAI": { "type": "object", "properties": { - "artifact": { - "description": "This is the artifact of the call.", - "allOf": [ + "model": { + "description": "This is the model to use for the LLM-as-a-judge.\nIf not provided, will default to the assistant's model.\n\nThe instructions on how to evaluate the model output with this LLM-Judge must be passed as a system message in the messages array of the model.\n\nThe Mock conversation can be passed to the LLM-Judge to evaluate using the prompt {{messages}} and will be evaluated as a LiquidJS Variable. To access and judge only the last message, use {{messages[-1]}}\n\nThe LLM-Judge must respond with \"pass\" or \"fail\" and only those two responses are allowed.", + "example": "{", + "oneOf": [ { - "$ref": "#/components/schemas/Artifact" + "$ref": "#/components/schemas/EvalOpenAIModel", + "title": "EvalOpenAIModel" + }, + { + "$ref": "#/components/schemas/EvalAnthropicModel", + "title": "EvalAnthropicModel" + }, + { + "$ref": "#/components/schemas/EvalGoogleModel", + "title": "EvalGoogleModel" + }, + { + "$ref": "#/components/schemas/EvalCustomModel", + "title": "EvalCustomModel" } ] + }, + "type": { + "type": "string", + "enum": [ + "ai" + ], + "description": "This is the type of the judge plan.\nUse 'ai' to evaluate the assistant message content using LLM-as-a-judge.\n@default 'ai'" + }, + "autoIncludeMessageHistory": { + "type": "boolean", + "description": "This is the flag to enable automatically adding the liquid variable {{messages}} to the model's messages array\nThis is only applicable if the user has not provided any messages in the model's messages array\n@default true" } }, "required": [ - "artifact" + "model", + "type" ] }, - "TestSuiteRunTestAttemptMetadata": { + "ChatEvalToolResponseMessageEvaluation": { "type": "object", "properties": { - "sessionId": { + "role": { "type": "string", - "description": "This is the session ID for the test attempt." + "enum": [ + "tool" + ], + "description": "This is the role of the message author.\nFor a tool response message evaluation, the role is always 'tool'\n@default 'tool'", + "default": "tool" + }, + "judgePlan": { + "description": "This is the judge plan that instructs how to evaluate the tool response message.\nThe tool response message can be evaluated with an LLM-as-judge by defining the evaluation criteria in a prompt.", + "oneOf": [ + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanAI", + "title": "AssistantMessageJudgePlanAI" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/AssistantMessageJudgePlanAI" + } + ] } }, "required": [ - "sessionId" + "role", + "judgePlan" ] }, - "TestSuiteRunTestAttempt": { + "AssistantMessageJudgePlanExact": { "type": "object", "properties": { - "scorerResults": { - "type": "array", - "description": "These are the results of the scorers used to evaluate the test attempt.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteRunScorerAI", - "title": "AI" - } - ] - } - }, - "call": { - "description": "This is the call made during the test attempt.", - "allOf": [ - { - "$ref": "#/components/schemas/TestSuiteRunTestAttemptCall" - } - ] + "type": { + "type": "string", + "enum": [ + "exact" + ], + "description": "This is the type of the judge plan.\nUse 'exact' for an exact match on the content and tool calls - without using LLM-as-a-judge.\n@default 'exact'" }, - "callId": { + "content": { "type": "string", - "description": "This is the call ID for the test attempt." + "description": "This is what that will be used to evaluate the model's message content.\nIf you provide a string, the assistant message content will be evaluated against it as an exact match, case-insensitive.", + "example": "The weather in San Francisco is sunny.", + "maxLength": 1000 }, - "metadata": { - "description": "This is the metadata for the test attempt.", - "allOf": [ - { - "$ref": "#/components/schemas/TestSuiteRunTestAttemptMetadata" - } - ] + "toolCalls": { + "description": "This is the tool calls that will be used to evaluate the model's message content.\nThe tool name must be a valid tool that the assistant is allowed to call.\n\nFor the Query tool, the arguments for the tool call are in the format - {knowledgeBaseNames: ['kb_name', 'kb_name_2']}\n\nFor the DTMF tool, the arguments for the tool call are in the format - {dtmf: \"1234*\"}\n\nFor the Handoff tool, the arguments for the tool call are in the format - {destination: \"assistant_id\"}\n\nFor the Transfer Call tool, the arguments for the tool call are in the format - {destination: \"phone_number_or_assistant_id\"}\n\nFor all other tools, they are called without arguments or with user-defined arguments", + "example": "[{ name: \"get_weather\", arguments: { city: \"San Francisco\" } }]", + "type": "array", + "items": { + "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" + } } }, "required": [ - "scorerResults" + "type", + "content" ] }, - "TestSuiteRunTestResult": { + "AssistantMessageJudgePlanRegex": { "type": "object", "properties": { - "test": { - "description": "This is the test that was run.", - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice", - "title": "TestSuiteTestVoice" - } - ] + "type": { + "type": "string", + "enum": [ + "regex" + ], + "description": "This is the type of the judge plan.\nUse 'regex' for a regex match on the content and tool calls - without using LLM-as-a-judge.\n@default 'regex'" }, - "attempts": { - "description": "These are the attempts made for this test.", + "content": { + "type": "string", + "description": "This is what that will be used to evaluate the model's message content.\nThe content will be evaluated against the regex pattern provided in the Judge Plan content field.\nEvaluation is considered successful if the regex pattern matches any part of the assistant message content.", + "example": "/sunny/i", + "maxLength": 1000 + }, + "toolCalls": { + "description": "This is the tool calls that will be used to evaluate the model's message content.\nThe tool name must be a valid tool that the assistant is allowed to call.\nThe values to the arguments for the tool call should be a Regular Expression.\nEvaluation is considered successful if the regex pattern matches any part of each tool call argument.\n\nFor the Query tool, the arguments for the tool call are in the format - {knowledgeBaseNames: ['kb_name', 'kb_name_2']}\n\nFor the DTMF tool, the arguments for the tool call are in the format - {dtmf: \"1234*\"}\n\nFor the Handoff tool, the arguments for the tool call are in the format - {destination: \"assistant_id\"}\n\nFor the Transfer Call tool, the arguments for the tool call are in the format - {destination: \"phone_number_or_assistant_id\"}\n\nFor all other tools, they are called without arguments or with user-defined arguments", + "example": "[{ name: \"get_weather\", arguments: { city: \"/San Francisco/i\" } }]", "type": "array", "items": { - "$ref": "#/components/schemas/TestSuiteRunTestAttempt" + "$ref": "#/components/schemas/ChatEvalAssistantMessageMockToolCall" } } }, "required": [ - "test", - "attempts" + "type", + "content" ] }, - "TestSuiteRun": { + "GetEvalPaginatedDTO": { "type": "object", "properties": { - "status": { + "id": { + "type": "string" + }, + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 + }, + "sortOrder": { "type": "string", - "description": "This is the current status of the test suite run.", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", "enum": [ - "queued", - "in-progress", - "completed", - "failed" + "ASC", + "DESC" ] }, - "id": { + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 + }, + "createdAtGt": { + "format": "date-time", "type": "string", - "description": "This is the unique identifier for the test suite run." + "description": "This will return items where the createdAt is greater than the specified value." }, - "orgId": { + "createdAtLt": { + "format": "date-time", "type": "string", - "description": "This is the unique identifier for the organization this run belongs to." + "description": "This will return items where the createdAt is less than the specified value." }, - "testSuiteId": { + "createdAtGe": { + "format": "date-time", "type": "string", - "description": "This is the unique identifier for the test suite this run belongs to." + "description": "This will return items where the createdAt is greater than or equal to the specified value." }, - "createdAt": { + "createdAtLe": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the test suite run was created." + "description": "This will return items where the createdAt is less than or equal to the specified value." }, - "updatedAt": { + "updatedAtGt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the test suite run was last updated." + "description": "This will return items where the updatedAt is greater than the specified value." }, - "testResults": { - "description": "These are the results of the tests in this test suite run.", - "type": "array", - "items": { - "$ref": "#/components/schemas/TestSuiteRunTestResult" - } + "updatedAtLt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than the specified value." }, - "name": { + "updatedAtGe": { + "format": "date-time", "type": "string", - "description": "This is the name of the test suite run.", - "maxLength": 80 + "description": "This will return items where the updatedAt is greater than or equal to the specified value." + }, + "updatedAtLe": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is less than or equal to the specified value." } - }, - "required": [ - "status", - "id", - "orgId", - "testSuiteId", - "createdAt", - "updatedAt", - "testResults" - ] + } }, - "TestSuiteRunsPaginatedResponse": { + "EvalPaginatedResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { - "$ref": "#/components/schemas/TestSuiteRun" + "$ref": "#/components/schemas/Eval" } }, "metadata": { @@ -38765,259 +49262,301 @@ "metadata" ] }, - "CreateTestSuiteRunDto": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the test suite run.", - "maxLength": 80 - } - } - }, - "UpdateTestSuiteRunDto": { + "UpdateEvalDTO": { "type": "object", "properties": { + "messages": { + "type": "array", + "description": "This is the mock conversation that will be used to evaluate the flow of the conversation.\n\nMock Messages are used to simulate the flow of the conversation\n\nEvaluation Messages are used as checkpoints in the flow where the model's response to previous conversation needs to be evaluated to check the content and tool calls", + "example": "[{ role: \"user\", content: \"Hello, how are you?\" }, { role: \"assistant\", judgePlan: { type: \"exact\", content: \"I am good, thank you!\" } }]", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageMock", + "title": "ChatEvalAssistantMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalSystemMessageMock", + "title": "ChatEvalSystemMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", + "title": "ChatEvalToolResponseMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageEvaluation", + "title": "ChatEvalToolResponseMessageEvaluation" + }, + { + "$ref": "#/components/schemas/ChatEvalUserMessageMock", + "title": "ChatEvalUserMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageEvaluation", + "title": "ChatEvalAssistantMessageEvaluation" + } + ] + } + }, "name": { "type": "string", - "description": "This is the name of the test suite run.", + "description": "This is the name of the eval.\nIt helps identify what the eval is checking for.", + "example": "Verified User Flow Eval", + "minLength": 1, "maxLength": 80 - } - } - }, - "TimeRange": { - "type": "object", - "properties": { - "step": { - "type": "string", - "description": "This is the time step for aggregations.\n\nIf not provided, defaults to returning for the entire time range.", - "enum": [ - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year", - "decade", - "century", - "millennium" - ] }, - "start": { - "format": "date-time", - "type": "string", - "description": "This is the start date for the time range.\n\nIf not provided, defaults to the 7 days ago." - }, - "end": { - "format": "date-time", + "description": { "type": "string", - "description": "This is the end date for the time range.\n\nIf not provided, defaults to now." + "description": "This is the description of the eval.\nThis helps describe the eval and its purpose in detail. It will not be used to evaluate the flow of the conversation.", + "example": "This eval checks if the user flow is verified.", + "maxLength": 500 }, - "timezone": { + "type": { "type": "string", - "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." + "description": "This is the type of the eval.\nCurrently it is fixed to `chat.mockConversation`.", + "example": "chat.mockConversation", + "enum": [ + "chat.mockConversation" + ] } } }, - "AnalyticsOperation": { + "CreateEvalRunDTO": { "type": "object", "properties": { - "operation": { - "type": "string", - "description": "This is the aggregation operation you want to perform.", - "enum": [ - "sum", - "avg", - "count", - "min", - "max", - "history" + "eval": { + "description": "This is the transient eval that will be run", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateEvalDTO", + "title": "CreateEvalDTO" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/CreateEvalDTO" + } ] }, - "column": { + "target": { + "description": "This is the target that will be run against the eval", + "oneOf": [ + { + "$ref": "#/components/schemas/EvalRunTargetAssistant", + "title": "EvalRunTargetAssistant" + }, + { + "$ref": "#/components/schemas/EvalRunTargetSquad", + "title": "EvalRunTargetSquad" + } + ] + }, + "type": { "type": "string", - "description": "This is the columns you want to perform the aggregation operation on.", + "description": "This is the type of the run.\nCurrently it is fixed to `eval`.", + "example": "eval", "enum": [ - "id", - "cost", - "costBreakdown.llm", - "costBreakdown.stt", - "costBreakdown.tts", - "costBreakdown.vapi", - "costBreakdown.transport", - "costBreakdown.analysisBreakdown.summary", - "costBreakdown.transcriber", - "costBreakdown.ttsCharacters", - "costBreakdown.llmPromptTokens", - "costBreakdown.llmCompletionTokens", - "duration", - "concurrency", - "minutesUsed" + "eval" ] }, - "alias": { + "evalId": { "type": "string", - "description": "This is the alias for column name returned. Defaults to `${operation}${column}`.", - "maxLength": 40 + "description": "This is the id of the eval that will be run.", + "example": "123e4567-e89b-12d3-a456-426614174000" } }, "required": [ - "operation", - "column" + "target", + "type" ] }, - "AnalyticsQuery": { + "EvalRunResult": { "type": "object", "properties": { - "table": { + "status": { "type": "string", - "description": "This is the table you want to query.", + "description": "This is the status of the eval run result.\nThe status is only 'pass' or 'fail' for an eval run result.\nCurrently, An eval is considered `pass` only if all the Assistant Judge messages are evaluated to pass.", + "example": "pass", "enum": [ - "call", - "subscription" + "pass", + "fail" ] }, - "groupBy": { + "messages": { "type": "array", - "description": "This is the list of columns you want to group by.", - "enum": [ - "type", - "assistantId", - "endedReason", - "analysis.successEvaluation", - "status" - ], + "description": "This is the messages of the eval run result.\nIt contains the user/system messages", "items": { - "type": "string", - "enum": [ - "type", - "assistantId", - "endedReason", - "analysis.successEvaluation", - "status" + "oneOf": [ + { + "$ref": "#/components/schemas/ChatEvalUserMessageMock", + "title": "ChatEvalUserMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalSystemMessageMock", + "title": "ChatEvalSystemMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalToolResponseMessageMock", + "title": "ChatEvalToolResponseMessageMock" + }, + { + "$ref": "#/components/schemas/ChatEvalAssistantMessageMock", + "title": "ChatEvalAssistantMessageMock" + } ] } }, - "name": { + "startedAt": { + "format": "date-time", "type": "string", - "description": "This is the name of the query. This will be used to identify the query in the response.", - "maxLength": 40 - }, - "timeRange": { - "description": "This is the time range for the query.", - "allOf": [ - { - "$ref": "#/components/schemas/TimeRange" - } - ] + "description": "This is the start time of the eval run result.", + "example": "2021-01-01T00:00:00.000Z" }, - "operations": { - "description": "This is the list of operations you want to perform.", - "type": "array", - "items": { - "$ref": "#/components/schemas/AnalyticsOperation" - } - } - }, - "required": [ - "table", - "name", - "operations" - ] - }, - "AnalyticsQueryDTO": { - "type": "object", - "properties": { - "queries": { - "description": "This is the list of metric queries you want to perform.", - "type": "array", - "items": { - "$ref": "#/components/schemas/AnalyticsQuery" - } + "endedAt": { + "format": "date-time", + "type": "string", + "description": "This is the end time of the eval run result.", + "example": "2021-01-01T00:00:00.000Z" } }, "required": [ - "queries" + "status", + "messages", + "startedAt", + "endedAt" ] }, - "AnalyticsQueryResult": { + "EvalRun": { "type": "object", "properties": { - "name": { + "status": { "type": "string", - "description": "This is the unique key for the query." + "description": "This is the status of the eval run. When an eval run is created, the status is 'running'.\nWhen the eval run is completed, the status is 'ended'.", + "example": "running", + "enum": [ + "running", + "ended", + "queued" + ] }, - "timeRange": { - "description": "This is the time range for the query.", + "endedReason": { + "type": "string", + "description": "This is the reason for the eval run to end.\nWhen the eval run is completed normally i.e end of mock conversation, the status is 'mockConversation.done'.\nWhen the eval fails due to an error like Chat error or incorrect configuration, the status is 'error'.\nWhen the eval runs for too long, due to model issues or tool call issues, the status is 'timeout'.\nWhen the eval run is cancelled by the user, the status is 'cancelled'.\nWhen the eval run is cancelled by Vapi for any reason, the status is 'aborted'.", + "example": "mockConversation.done", + "enum": [ + "mockConversation.done", + "error", + "timeout", + "cancelled", + "aborted" + ] + }, + "eval": { + "description": "This is the transient eval that will be run", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateEvalDTO", + "title": "CreateEvalDTO" + } + ], "allOf": [ { - "$ref": "#/components/schemas/TimeRange" + "$ref": "#/components/schemas/CreateEvalDTO" } ] }, - "result": { - "description": "This is the result of the query, a list of unique groups with result of their aggregations.\n\nExample:\n\"result\": [\n { \"date\": \"2023-01-01\", \"assistantId\": \"123\", \"endedReason\": \"customer-ended-call\", \"sumDuration\": 120, \"avgCost\": 10.5 },\n { \"date\": \"2023-01-02\", \"assistantId\": \"123\", \"endedReason\": \"customer-did-not-give-microphone-permission\", \"sumDuration\": 0, \"avgCost\": 0 },\n // Additional results\n]", + "target": { + "description": "This is the target that will be run against the eval", + "oneOf": [ + { + "$ref": "#/components/schemas/EvalRunTargetAssistant", + "title": "EvalRunTargetAssistant" + }, + { + "$ref": "#/components/schemas/EvalRunTargetSquad", + "title": "EvalRunTargetSquad" + } + ] + }, + "id": { + "type": "string" + }, + "orgId": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "startedAt": { + "format": "date-time", + "type": "string" + }, + "endedAt": { + "format": "date-time", + "type": "string" + }, + "endedMessage": { + "type": "string", + "description": "This is the ended message when the eval run ended for any reason apart from mockConversation.done", + "example": "The Assistant returned an error" + }, + "results": { + "description": "This is the results of the eval or suite run.\nThe array will have a single item for an eval run, and multiple items each corresponding to the an eval in a suite run in the same order as the evals in the suite.", "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/EvalRunResult" } - } - }, - "required": [ - "name", - "timeRange", - "result" - ] - }, - "CallLogPrivileged": { - "type": "object", - "properties": { - "callId": { - "type": "string", - "description": "This is the unique identifier for the call." }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this call log belongs to." + "cost": { + "type": "number", + "description": "This is the cost of the eval or suite run in USD.", + "example": 0.01 }, - "log": { - "type": "string", - "description": "This is the log message associated with the call." + "costs": { + "description": "This is the break up of costs of the eval or suite run.", + "example": "[{ type: \"model\", model: \"gpt-4o\", cost: 0.01 }]", + "type": "array", + "items": { + "type": "object" + } }, - "level": { + "type": { "type": "string", - "description": "This is the level of the log message.", + "description": "This is the type of the run.\nCurrently it is fixed to `eval`.", + "example": "eval", "enum": [ - "INFO", - "LOG", - "WARN", - "ERROR", - "CHECKPOINT" + "eval" ] }, - "time": { - "format": "date-time", + "evalId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the log was created." + "description": "This is the id of the eval that will be run.", + "example": "123e4567-e89b-12d3-a456-426614174000" } }, "required": [ - "callId", + "status", + "endedReason", + "target", + "id", "orgId", - "log", - "level", - "time" + "createdAt", + "startedAt", + "endedAt", + "results", + "cost", + "costs", + "type" ] }, - "CallLogsPaginatedResponse": { + "EvalRunPaginatedResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { - "$ref": "#/components/schemas/CallLogPrivileged" + "$ref": "#/components/schemas/EvalRun" } }, "metadata": { @@ -39029,250 +49568,217 @@ "metadata" ] }, - "Error": { + "GetEvalRunPaginatedDTO": { "type": "object", "properties": { - "message": { + "id": { "type": "string" - } - }, - "required": [ - "message" - ] - }, - "Log": { - "type": "object", - "properties": { - "time": { - "type": "string", - "description": "This is the timestamp at which the log was written." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this log belongs to." - }, - "type": { - "type": "string", - "description": "This is the type of the log.", - "enum": [ - "API", - "Webhook", - "Call", - "Provider" - ] }, - "webhookType": { - "type": "string", - "description": "This is the type of the webhook, given the log is from a webhook." + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 }, - "resource": { + "sortOrder": { "type": "string", - "description": "This is the specific resource, relevant only to API logs.", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", "enum": [ - "org", - "assistant", - "analytics", - "credential", - "phone-number", - "block", - "voice-library", - "provider", - "tool", - "token", - "template", - "squad", - "call", - "file", - "metric", - "log" + "ASC", + "DESC" ] }, - "requestDurationSeconds": { + "limit": { "type": "number", - "description": "'This is how long the request took.", - "minimum": 0 + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 }, - "requestStartedAt": { + "createdAtGt": { + "format": "date-time", "type": "string", - "description": "This is the timestamp at which the request began." + "description": "This will return items where the createdAt is greater than the specified value." }, - "requestFinishedAt": { + "createdAtLt": { + "format": "date-time", "type": "string", - "description": "This is the timestamp at which the request finished." - }, - "requestBody": { - "type": "object", - "description": "This is the body of the request." + "description": "This will return items where the createdAt is less than the specified value." }, - "requestHttpMethod": { + "createdAtGe": { + "format": "date-time", "type": "string", - "description": "This is the request method.", - "enum": [ - "POST", - "GET", - "PUT", - "PATCH", - "DELETE" - ] + "description": "This will return items where the createdAt is greater than or equal to the specified value." }, - "requestUrl": { + "createdAtLe": { + "format": "date-time", "type": "string", - "description": "This is the request URL." + "description": "This will return items where the createdAt is less than or equal to the specified value." }, - "requestPath": { + "updatedAtGt": { + "format": "date-time", "type": "string", - "description": "This is the request path." + "description": "This will return items where the updatedAt is greater than the specified value." }, - "requestQuery": { + "updatedAtLt": { + "format": "date-time", "type": "string", - "description": "This is the request query." - }, - "responseHttpCode": { - "type": "number", - "description": "This the HTTP status code of the response." + "description": "This will return items where the updatedAt is less than the specified value." }, - "requestIpAddress": { + "updatedAtGe": { + "format": "date-time", "type": "string", - "description": "This is the request IP address." + "description": "This will return items where the updatedAt is greater than or equal to the specified value." }, - "requestOrigin": { + "updatedAtLe": { + "format": "date-time", "type": "string", - "description": "This is the origin of the request" - }, - "responseBody": { - "type": "object", - "description": "This is the body of the response." - }, - "requestHeaders": { - "type": "object", - "description": "These are the headers of the request." - }, - "error": { - "description": "This is the error, if one occurred.", + "description": "This will return items where the updatedAt is less than or equal to the specified value." + } + } + }, + "EvalRunTargetAssistant": { + "type": "object", + "properties": { + "assistant": { + "description": "This is the transient assistant that will be run against the eval", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO", + "title": "CreateAssistantDTO" + } + ], "allOf": [ { - "$ref": "#/components/schemas/Error" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "assistantId": { - "type": "string", - "description": "This is the ID of the assistant." - }, - "phoneNumberId": { - "type": "string", - "description": "This is the ID of the phone number." - }, - "customerId": { - "type": "string", - "description": "This is the ID of the customer." + "assistantOverrides": { + "description": "This is the overrides that will be applied to the assistant.", + "example": "{", + "oneOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides", + "title": "AssistantOverrides" + } + ], + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] }, - "squadId": { + "type": { "type": "string", - "description": "This is the ID of the squad." + "description": "This is the type of the target.\nCurrently it is fixed to `assistant`.", + "example": "assistant", + "enum": [ + "assistant" + ] }, - "callId": { + "assistantId": { "type": "string", - "description": "This is the ID of the call." + "description": "This is the id of the assistant that will be run against the eval", + "example": "123e4567-e89b-12d3-a456-426614174000" } }, "required": [ - "time", - "orgId", "type" ] }, - "LogsPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Log" - } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "StructuredOutput": { + "EvalRunTargetSquad": { "type": "object", "properties": { - "model": { - "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition.\ni.e.:\n{{structuredOutput}}\n{{structuredOutput.name}}\n{{structuredOutput.description}}\n{{structuredOutput.schema}}\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", + "squad": { + "description": "This is the transient squad that will be run against the eval", "oneOf": [ { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, + "$ref": "#/components/schemas/CreateSquadDTO", + "title": "CreateSquadDTO" + } + ], + "allOf": [ { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, + "$ref": "#/components/schemas/CreateSquadDTO" + } + ] + }, + "assistantOverrides": { + "description": "This is the overrides that will be applied to the assistants.", + "example": "{", + "oneOf": [ { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, + "$ref": "#/components/schemas/AssistantOverrides", + "title": "AssistantOverrides" + } + ], + "allOf": [ { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, + "type": { + "type": "string", + "description": "This is the type of the target.\nCurrently it is fixed to `squad`.", + "example": "squad", + "enum": [ + "squad" + ] + }, + "squadId": { + "type": "string", + "description": "This is the id of the squad that will be run against the eval", + "example": "123e4567-e89b-12d3-a456-426614174000" + } + }, + "required": [ + "type" + ] + }, + "Scorecard": { + "type": "object", + "properties": { "id": { "type": "string", - "description": "This is the unique identifier for the structured output." + "description": "This is the unique identifier for the scorecard." }, "orgId": { "type": "string", - "description": "This is the unique identifier for the org that this structured output belongs to." + "description": "This is the unique identifier for the org that this scorecard belongs to." }, "createdAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the structured output was created." + "description": "This is the ISO 8601 date-time string of when the scorecard was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the structured output was last updated." + "description": "This is the ISO 8601 date-time string of when the scorecard was last updated." }, "name": { "type": "string", - "description": "This is the name of the structured output.", - "minLength": 1, - "maxLength": 40 + "description": "This is the name of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 80 }, "description": { "type": "string", - "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." + "description": "This is the description of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 500 }, - "assistantIds": { - "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", + "metrics": { + "description": "These are the metrics that will be used to evaluate the scorecard.\nEach metric will have a set of conditions and points that will be used to generate the score.", "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/ScorecardMetric" } }, - "workflowIds": { - "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "assistantIds": { + "description": "These are the assistant IDs that this scorecard is linked to.\nWhen linked to assistants, this scorecard will be available for evaluation during those assistants' calls.", "type": "array", "items": { "type": "string" } - }, - "schema": { - "description": "This is the JSON Schema definition for the structured output.\n\nDefines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] } }, "required": [ @@ -39280,17 +49786,16 @@ "orgId", "createdAt", "updatedAt", - "name", - "schema" + "metrics" ] }, - "StructuredOutputPaginatedResponse": { + "ScorecardPaginatedResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { - "$ref": "#/components/schemas/StructuredOutput" + "$ref": "#/components/schemas/Scorecard" } }, "metadata": { @@ -39302,123 +49807,32 @@ "metadata" ] }, - "CreateStructuredOutputDTO": { + "UpdateScorecardDTO": { "type": "object", "properties": { - "model": { - "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition.\ni.e.:\n{{structuredOutput}}\n{{structuredOutput.name}}\n{{structuredOutput.description}}\n{{structuredOutput.schema}}\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", - "oneOf": [ - { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, - { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, - { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, - { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, "name": { "type": "string", - "description": "This is the name of the structured output.", - "minLength": 1, - "maxLength": 40 - }, - "schema": { - "description": "This is the JSON Schema definition for the structured output.\n\nThis is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] + "description": "This is the name of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 80 }, "description": { "type": "string", - "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." - }, - "assistantIds": { - "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", - "type": "array", - "items": { - "type": "string" - } + "description": "This is the description of the scorecard. It is only for user reference and will not be used for any evaluation.", + "maxLength": 500 }, - "workflowIds": { - "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "metrics": { + "description": "These are the metrics that will be used to evaluate the scorecard.\nEach metric will have a set of conditions and points that will be used to generate the score.", "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/ScorecardMetric" } - } - }, - "required": [ - "name", - "schema" - ] - }, - "UpdateStructuredOutputDTO": { - "type": "object", - "properties": { - "model": { - "description": "This is the model that will be used to extract the structured output.\n\nTo provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages.\nBetween the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history.\nBetween the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition.\ni.e.:\n{{structuredOutput}}\n{{structuredOutput.name}}\n{{structuredOutput.description}}\n{{structuredOutput.schema}}\n\nIf model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts.\nIf messages or required fields are not specified, the default system and user prompts will be used.", - "oneOf": [ - { - "$ref": "#/components/schemas/WorkflowOpenAIModel", - "title": "WorkflowOpenAIModel" - }, - { - "$ref": "#/components/schemas/WorkflowAnthropicModel", - "title": "WorkflowAnthropicModel" - }, - { - "$ref": "#/components/schemas/WorkflowGoogleModel", - "title": "WorkflowGoogleModel" - }, - { - "$ref": "#/components/schemas/WorkflowCustomModel", - "title": "WorkflowCustomModel" - } - ] - }, - "name": { - "type": "string", - "description": "This is the name of the structured output.", - "minLength": 1, - "maxLength": 40 - }, - "description": { - "type": "string", - "description": "This is the description of what the structured output extracts.\n\nUse this to provide context about what data will be extracted and how it will be used." }, "assistantIds": { - "description": "These are the assistant IDs that this structured output is linked to.\n\nWhen linked to assistants, this structured output will be available for extraction during those assistant's calls.", - "type": "array", - "items": { - "type": "string" - } - }, - "workflowIds": { - "description": "These are the workflow IDs that this structured output is linked to.\n\nWhen linked to workflows, this structured output will be available for extraction during those workflow's execution.", + "description": "These are the assistant IDs that this scorecard is linked to.\nWhen linked to assistants, this scorecard will be available for evaluation during those assistants' calls.", "type": "array", "items": { "type": "string" } - }, - "schema": { - "description": "This is the JSON Schema definition for the structured output.\n\nDefines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including:\n- Objects and nested properties\n- Arrays and array validation\n- String, number, boolean, and null types\n- Enums and const values\n- Validation constraints (min/max, patterns, etc.)\n- Composition with allOf, anyOf, oneOf", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] } } }, @@ -39443,8 +49857,10 @@ "type": "string", "description": "This is the channel of the org. There is the cluster the API traffic for the org will be directed.", "enum": [ + "daily", "default", - "weekly" + "weekly", + "intuit" ] }, "billingLimit": { @@ -39610,6 +50026,10 @@ "type": "boolean", "description": "This is the HIPAA enabled flag for the subscription. It determines whether orgs under this\nsubscription have the option to enable HIPAA compliance." }, + "dataRetentionEnabled": { + "type": "boolean", + "description": "This is the data retention enabled flag for the subscription. It determines whether orgs under this\nsubscription have the option to enable data retention." + }, "hipaaCommonPaperAgreementId": { "type": "string", "description": "This is the ID for the Common Paper agreement outlining the HIPAA contract." @@ -39802,8 +50222,10 @@ "type": "string", "description": "This is the channel of the org. There is the cluster the API traffic for the org will be directed.", "enum": [ + "daily", "default", - "weekly" + "weekly", + "intuit" ] }, "billingLimit": { @@ -39863,8 +50285,10 @@ "type": "string", "description": "This is the channel of the org. There is the cluster the API traffic for the org will be directed.", "enum": [ + "daily", "default", - "weekly" + "weekly", + "intuit" ] }, "billingLimit": { @@ -40097,8 +50521,7 @@ "id", "orgId", "createdAt", - "updatedAt", - "value" + "updatedAt" ] }, "UpdateTokenDTO": { @@ -40175,6 +50598,165 @@ "updatedAt" ] }, + "AWSStsAuthenticationArtifact": { + "type": "object", + "properties": { + "externalId": { + "type": "string", + "description": "This is the optional external ID for the AWS credential" + } + }, + "required": [ + "externalId" + ] + }, + "AWSStsAssumeRoleUser": { + "type": "object", + "properties": { + "AssumedRoleId": { + "type": "string", + "description": "This is the assumed role ID" + }, + "Arn": { + "type": "string", + "description": "This is the assumed role ARN" + } + } + }, + "AWSStsCredentials": { + "type": "object", + "properties": { + "AccessKeyId": { + "type": "string", + "description": "This is the access key ID for the AWS credential" + }, + "Expiration": { + "format": "date-time", + "type": "string", + "description": "This is the expiration date for the AWS credential" + }, + "SecretAccessKey": { + "type": "string", + "description": "This is the secret access key for the AWS credential" + }, + "SessionToken": { + "type": "string", + "description": "This is the session token for the AWS credential" + } + } + }, + "AWSStsAuthenticationSession": { + "type": "object", + "properties": { + "assumedRoleUser": { + "description": "This is the assumed role user", + "allOf": [ + { + "$ref": "#/components/schemas/AWSStsAssumeRoleUser" + } + ] + }, + "credentials": { + "description": "This is the credentials for the AWS STS assume role", + "allOf": [ + { + "$ref": "#/components/schemas/AWSStsCredentials" + } + ] + }, + "packedPolicySize": { + "type": "number", + "description": "This is the size of the policy" + }, + "sourcedIDEntity": { + "type": "string", + "description": "This is the sourced ID entity" + } + } + }, + "AnthropicBedrockCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "anthropic-bedrock" + ] + }, + "region": { + "type": "string", + "description": "AWS region where Bedrock is configured.", + "enum": [ + "us-east-1", + "us-west-2", + "eu-west-1", + "eu-west-3", + "ap-northeast-1", + "ap-southeast-2" + ] + }, + "authenticationPlan": { + "description": "Authentication method - either direct IAM credentials or cross-account role assumption.", + "oneOf": [ + { + "$ref": "#/components/schemas/AWSIAMCredentialsAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/AWSStsAuthenticationPlan" + } + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "authenticationArtifact": { + "description": "Stores the external ID (generated or user-provided) for future AssumeRole calls.", + "allOf": [ + { + "$ref": "#/components/schemas/AWSStsAuthenticationArtifact" + } + ] + }, + "authenticationSession": { + "description": "Cached authentication session from AssumeRole (temporary credentials).\nManaged by the system, auto-refreshed when expired.", + "allOf": [ + { + "$ref": "#/components/schemas/AWSStsAuthenticationSession" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "region", + "authenticationPlan", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, "AnyscaleCredential": { "type": "object", "properties": { @@ -40298,16 +50880,20 @@ "eastus2", "eastus", "france", + "germanywestcentral", "india", "japaneast", "japanwest", - "uaenorth", "northcentralus", "norway", + "polandcentral", "southcentralus", + "spaincentral", "swedencentral", "switzerland", + "uaenorth", "uk", + "westeurope", "westus", "westus3" ] @@ -40382,16 +50968,20 @@ "eastus2", "eastus", "france", + "germanywestcentral", "india", "japaneast", "japanwest", - "uaenorth", "northcentralus", "norway", + "polandcentral", "southcentralus", + "spaincentral", "swedencentral", "switzerland", + "uaenorth", "uk", + "westeurope", "westus", "westus3" ] @@ -40399,6 +50989,10 @@ "models": { "type": "array", "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", "gpt-5", "gpt-5-mini", "gpt-5-nano", @@ -40423,6 +51017,10 @@ "items": { "type": "string", "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", "gpt-5", "gpt-5-mini", "gpt-5-nano", @@ -40962,18 +51560,272 @@ "updatedAt" ] }, - "ElevenLabsCredential": { + "ElevenLabsCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "11labs" + ] + }, + "apiKey": { + "type": "string", + "maxLength": 10000, + "description": "This is not returned in the API." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GcpCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "gcp" + ] + }, + "fallbackIndex": { + "type": "number", + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", + "minimum": 1 + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + }, + "gcpKey": { + "description": "This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys.\n\nThe schema is identical to the JSON that GCP outputs.", + "allOf": [ + { + "$ref": "#/components/schemas/GcpKey" + } + ] + }, + "region": { + "type": "string", + "description": "This is the region of the GCP resource.", + "maxLength": 40 + }, + "bucketPlan": { + "$ref": "#/components/schemas/BucketPlan" + } + }, + "required": [ + "provider", + "id", + "orgId", + "createdAt", + "updatedAt", + "gcpKey" + ] + }, + "GladiaCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "gladia" + ] + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoHighLevelCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "gohighlevel" + ] + }, + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GoogleCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey", + "enum": [ + "google" + ] + }, + "apiKey": { + "type": "string", + "maxLength": 10000, + "description": "This is not returned in the API." + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "GroqCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "11labs" + "groq" ] }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -41010,19 +51862,19 @@ "updatedAt" ] }, - "GcpCredential": { + "HumeCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "gcp" + "hume" ] }, - "fallbackIndex": { - "type": "number", - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order.", - "minimum": 1 + "apiKey": { + "type": "string", + "maxLength": 10000, + "description": "This is not returned in the API." }, "id": { "type": "string", @@ -41047,45 +51899,86 @@ "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 - }, - "gcpKey": { - "description": "This is the GCP key. This is the JSON that can be generated in the Google Cloud Console at https://console.cloud.google.com/iam-admin/serviceaccounts/details//keys.\n\nThe schema is identical to the JSON that GCP outputs.", - "allOf": [ - { - "$ref": "#/components/schemas/GcpKey" - } + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "InflectionAICredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup", + "enum": [ + "inflection-ai" ] }, - "region": { + "apiKey": { "type": "string", - "description": "This is the region of the GCP resource.", - "maxLength": 40 + "maxLength": 10000, + "description": "This is not returned in the API." }, - "bucketPlan": { - "$ref": "#/components/schemas/BucketPlan" + "id": { + "type": "string", + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 } }, "required": [ "provider", + "apiKey", "id", "orgId", "createdAt", - "updatedAt", - "gcpKey" + "updatedAt" ] }, - "GladiaCredential": { + "LangfuseCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "gladia" + "langfuse" ] }, + "publicKey": { + "type": "string", + "description": "The public key for Langfuse project. Eg: pk-lf-..." + }, "apiKey": { "type": "string", - "description": "This is not returned in the API." + "description": "The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API." + }, + "apiUrl": { + "type": "string", + "description": "The host URL for Langfuse project. Eg: https://cloud.langfuse.com" }, "id": { "type": "string", @@ -41114,20 +52007,22 @@ }, "required": [ "provider", + "publicKey", "apiKey", + "apiUrl", "id", "orgId", "createdAt", "updatedAt" ] }, - "GoHighLevelCredential": { + "LmntCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "gohighlevel" + "lmnt" ] }, "apiKey": { @@ -41168,19 +52063,25 @@ "updatedAt" ] }, - "GoogleCredential": { + "MakeCredential": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey", "enum": [ - "google" + "make" ] }, + "teamId": { + "type": "string", + "description": "Team ID" + }, + "region": { + "type": "string", + "description": "Region of your application. For example: eu1, eu2, us1, us2" + }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -41210,6 +52111,8 @@ }, "required": [ "provider", + "teamId", + "region", "apiKey", "id", "orgId", @@ -41217,17 +52120,18 @@ "updatedAt" ] }, - "GroqCredential": { + "MistralCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "groq" + "mistral" ] }, "apiKey": { "type": "string", + "maxLength": 100, "description": "This is not returned in the API." }, "id": { @@ -41264,18 +52168,17 @@ "updatedAt" ] }, - "HumeCredential": { + "NeuphonicCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "hume" + "neuphonic" ] }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -41312,19 +52215,17 @@ "updatedAt" ] }, - "InflectionAICredential": { + "OpenAICredential": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup", "enum": [ - "inflection-ai" + "openai" ] }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -41361,26 +52262,18 @@ "updatedAt" ] }, - "LangfuseCredential": { + "OpenRouterCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "langfuse" + "openrouter" ] }, - "publicKey": { - "type": "string", - "description": "The public key for Langfuse project. Eg: pk-lf-..." - }, "apiKey": { "type": "string", - "description": "The secret key for Langfuse project. Eg: sk-lf-... .This is not returned in the API." - }, - "apiUrl": { - "type": "string", - "description": "The host URL for Langfuse project. Eg: https://cloud.langfuse.com" + "description": "This is not returned in the API." }, "id": { "type": "string", @@ -41409,22 +52302,20 @@ }, "required": [ "provider", - "publicKey", "apiKey", - "apiUrl", "id", "orgId", "createdAt", "updatedAt" ] }, - "LmntCredential": { + "PerplexityAICredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "lmnt" + "perplexity-ai" ] }, "apiKey": { @@ -41465,22 +52356,65 @@ "updatedAt" ] }, - "MakeCredential": { + "PlayHTCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "make" + "playht" ] }, - "teamId": { + "apiKey": { "type": "string", - "description": "Team ID" + "description": "This is not returned in the API." }, - "region": { + "id": { "type": "string", - "description": "Region of your application. For example: eu1, eu2, us1, us2" + "description": "This is the unique identifier for the credential." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this credential belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the credential was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + }, + "userId": { + "type": "string" + } + }, + "required": [ + "provider", + "apiKey", + "id", + "orgId", + "createdAt", + "updatedAt", + "userId" + ] + }, + "RimeAICredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "rime-ai" + ] }, "apiKey": { "type": "string", @@ -41513,8 +52447,6 @@ }, "required": [ "provider", - "teamId", - "region", "apiKey", "id", "orgId", @@ -41522,18 +52454,17 @@ "updatedAt" ] }, - "MistralCredential": { + "RunpodCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "mistral" + "runpod" ] }, "apiKey": { "type": "string", - "maxLength": 100, "description": "This is not returned in the API." }, "id": { @@ -41570,17 +52501,18 @@ "updatedAt" ] }, - "NeuphonicCredential": { + "WellSaidCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "neuphonic" + "wellsaid" ] }, "apiKey": { "type": "string", + "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -41617,18 +52549,40 @@ "updatedAt" ] }, - "OpenAICredential": { + "S3Credential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "openai" - ] + "s3" + ], + "description": "Credential provider. Only allowed value is s3" }, - "apiKey": { + "awsAccessKeyId": { "type": "string", - "description": "This is not returned in the API." + "description": "AWS access key ID." + }, + "awsSecretAccessKey": { + "type": "string", + "description": "AWS access key secret. This is not returned in the API." + }, + "region": { + "type": "string", + "description": "AWS region in which the S3 bucket is located." + }, + "s3BucketName": { + "type": "string", + "description": "AWS S3 bucket name." + }, + "s3PathPrefix": { + "type": "string", + "description": "The path prefix for the uploaded recording. Ex. \"recordings/\"" + }, + "fallbackIndex": { + "type": "number", + "minimum": 1, + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." }, "id": { "type": "string", @@ -41657,20 +52611,24 @@ }, "required": [ "provider", - "apiKey", + "awsAccessKeyId", + "awsSecretAccessKey", + "region", + "s3BucketName", + "s3PathPrefix", "id", "orgId", "createdAt", "updatedAt" ] }, - "OpenRouterCredential": { + "SmallestAICredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "openrouter" + "smallest-ai" ] }, "apiKey": { @@ -41711,13 +52669,13 @@ "updatedAt" ] }, - "PerplexityAICredential": { + "SonioxCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "perplexity-ai" + "soniox" ] }, "apiKey": { @@ -41758,13 +52716,13 @@ "updatedAt" ] }, - "PlayHTCredential": { + "SpeechmaticsCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "playht" + "speechmatics" ] }, "apiKey": { @@ -41794,9 +52752,6 @@ "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 - }, - "userId": { - "type": "string" } }, "required": [ @@ -41805,22 +52760,23 @@ "id", "orgId", "createdAt", - "updatedAt", - "userId" + "updatedAt" ] }, - "RimeAICredential": { + "SupabaseCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "rime-ai" - ] + "supabase" + ], + "description": "This is for supabase storage." }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." + "fallbackIndex": { + "type": "number", + "minimum": 1, + "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." }, "id": { "type": "string", @@ -41845,24 +52801,26 @@ "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 + }, + "bucketPlan": { + "$ref": "#/components/schemas/SupabaseBucketPlan" } }, "required": [ "provider", - "apiKey", "id", "orgId", "createdAt", "updatedAt" ] }, - "RunpodCredential": { + "TavusCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "runpod" + "tavus" ] }, "apiKey": { @@ -41903,40 +52861,18 @@ "updatedAt" ] }, - "S3Credential": { + "TogetherAICredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "s3" - ], - "description": "Credential provider. Only allowed value is s3" - }, - "awsAccessKeyId": { - "type": "string", - "description": "AWS access key ID." - }, - "awsSecretAccessKey": { - "type": "string", - "description": "AWS access key secret. This is not returned in the API." - }, - "region": { - "type": "string", - "description": "AWS region in which the S3 bucket is located." - }, - "s3BucketName": { - "type": "string", - "description": "AWS S3 bucket name." + "together-ai" + ] }, - "s3PathPrefix": { + "apiKey": { "type": "string", - "description": "The path prefix for the uploaded recording. Ex. \"recordings/\"" - }, - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + "description": "This is not returned in the API." }, "id": { "type": "string", @@ -41965,24 +52901,20 @@ }, "required": [ "provider", - "awsAccessKeyId", - "awsSecretAccessKey", - "region", - "s3BucketName", - "s3PathPrefix", + "apiKey", "id", "orgId", "createdAt", "updatedAt" ] }, - "SmallestAICredential": { + "TrieveCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "smallest-ai" + "trieve" ] }, "apiKey": { @@ -42023,19 +52955,27 @@ "updatedAt" ] }, - "SpeechmaticsCredential": { + "TwilioCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "speechmatics" + "twilio" ] }, + "authToken": { + "type": "string", + "description": "This is not returned in the API." + }, "apiKey": { "type": "string", "description": "This is not returned in the API." }, + "apiSecret": { + "type": "string", + "description": "This is not returned in the API." + }, "id": { "type": "string", "description": "This is the unique identifier for the credential." @@ -42059,31 +52999,37 @@ "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 + }, + "accountSid": { + "type": "string" } }, "required": [ "provider", - "apiKey", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "accountSid" ] }, - "SupabaseCredential": { + "VonageCredential": { "type": "object", "properties": { + "vonageApplicationPrivateKey": { + "type": "string", + "description": "This is not returned in the API.", + "maxLength": 10000 + }, "provider": { "type": "string", "enum": [ - "supabase" - ], - "description": "This is for supabase storage." + "vonage" + ] }, - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." + "apiSecret": { + "type": "string", + "description": "This is not returned in the API." }, "id": { "type": "string", @@ -42103,36 +53049,63 @@ "type": "string", "description": "This is the ISO 8601 date-time string of when the assistant was last updated." }, + "vonageApplicationId": { + "type": "string", + "description": "This is the Vonage Application ID for the credential.\n\nOnly relevant for Vonage credentials.", + "maxLength": 10000 + }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 }, - "bucketPlan": { - "$ref": "#/components/schemas/SupabaseBucketPlan" + "apiKey": { + "type": "string" } }, "required": [ + "vonageApplicationPrivateKey", "provider", + "apiSecret", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "vonageApplicationId", + "apiKey" ] }, - "TavusCredential": { + "WebhookCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "tavus" + "webhook" ] }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." + "authenticationPlan": { + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", + "oneOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + }, + { + "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" + } + } }, "id": { "type": "string", @@ -42152,6 +53125,14 @@ "type": "string", "description": "This is the ISO 8601 date-time string of when the assistant was last updated." }, + "authenticationSession": { + "description": "This is the authentication session for the credential. Available for credentials that have an authentication plan.", + "allOf": [ + { + "$ref": "#/components/schemas/Oauth2AuthenticationSession" + } + ] + }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -42161,25 +53142,131 @@ }, "required": [ "provider", - "apiKey", + "authenticationPlan", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "authenticationSession" ] }, - "TogetherAICredential": { + "SpkiPemPublicKeyConfig": { "type": "object", "properties": { - "provider": { + "name": { + "type": "string", + "description": "Optional name of the key for identification purposes.", + "maxLength": 100 + }, + "format": { "type": "string", + "description": "The format of the public key.", "enum": [ - "together-ai" + "spki-pem" ] }, - "apiKey": { + "pem": { "type": "string", - "description": "This is not returned in the API." + "description": "The PEM-encoded public key." + } + }, + "required": [ + "format", + "pem" + ] + }, + "PublicKeyEncryptionPlan": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of encryption plan.", + "enum": [ + "public-key" + ] + }, + "algorithm": { + "type": "string", + "description": "The encryption algorithm to use.", + "enum": [ + "RSA-OAEP-256" + ] + }, + "publicKey": { + "description": "The public key configuration.", + "oneOf": [ + { + "$ref": "#/components/schemas/SpkiPemPublicKeyConfig" + } + ], + "discriminator": { + "propertyName": "format", + "mapping": { + "spki-pem": "#/components/schemas/SpkiPemPublicKeyConfig" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/SpkiPemPublicKeyConfig" + } + ] + } + }, + "required": [ + "type", + "algorithm", + "publicKey" + ] + }, + "CustomCredential": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "custom-credential" + ] + }, + "authenticationPlan": { + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", + "oneOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + }, + { + "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" + } + } + }, + "encryptionPlan": { + "description": "This is the encryption plan for encrypting sensitive data. Currently supports public-key encryption.", + "oneOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "public-key": "#/components/schemas/PublicKeyEncryptionPlan" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ] }, "id": { "type": "string", @@ -42199,6 +53286,14 @@ "type": "string", "description": "This is the ISO 8601 date-time string of when the assistant was last updated." }, + "authenticationSession": { + "description": "This is the authentication session for the credential. Available for credentials that have an authentication plan.", + "allOf": [ + { + "$ref": "#/components/schemas/Oauth2AuthenticationSession" + } + ] + }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -42208,24 +53303,27 @@ }, "required": [ "provider", - "apiKey", + "authenticationPlan", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "authenticationSession" ] }, - "TrieveCredential": { + "XAiCredential": { "type": "object", "properties": { "provider": { "type": "string", + "description": "This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai", "enum": [ - "trieve" + "xai" ] }, "apiKey": { "type": "string", + "maxLength": 10000, "description": "This is not returned in the API." }, "id": { @@ -42262,27 +53360,15 @@ "updatedAt" ] }, - "TwilioCredential": { + "GoogleCalendarOAuth2ClientCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "twilio" + "google.calendar.oauth2-client" ] }, - "authToken": { - "type": "string", - "description": "This is not returned in the API." - }, - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "apiSecret": { - "type": "string", - "description": "This is not returned in the API." - }, "id": { "type": "string", "description": "This is the unique identifier for the credential." @@ -42306,9 +53392,6 @@ "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 - }, - "accountSid": { - "type": "string" } }, "required": [ @@ -42316,27 +53399,21 @@ "id", "orgId", "createdAt", - "updatedAt", - "accountSid" + "updatedAt" ] }, - "VonageCredential": { + "GoogleCalendarOAuth2AuthorizationCredential": { "type": "object", "properties": { - "vonageApplicationPrivateKey": { - "type": "string", - "description": "This is not returned in the API.", - "maxLength": 10000 - }, "provider": { "type": "string", "enum": [ - "vonage" + "google.calendar.oauth2-authorization" ] }, - "apiSecret": { + "authorizationId": { "type": "string", - "description": "This is not returned in the API." + "description": "The authorization ID for the OAuth2 authorization" }, "id": { "type": "string", @@ -42356,59 +53433,34 @@ "type": "string", "description": "This is the ISO 8601 date-time string of when the assistant was last updated." }, - "vonageApplicationId": { - "type": "string", - "description": "This is the Vonage Application ID for the credential.\n\nOnly relevant for Vonage credentials.", - "maxLength": 10000 - }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", "minLength": 1, "maxLength": 40 - }, - "apiKey": { - "type": "string" } }, "required": [ - "vonageApplicationPrivateKey", "provider", - "apiSecret", + "authorizationId", "id", "orgId", "createdAt", - "updatedAt", - "vonageApplicationId", - "apiKey" + "updatedAt" ] }, - "WebhookCredential": { + "GoogleSheetsOAuth2AuthorizationCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "webhook" + "google.sheets.oauth2-authorization" ] }, - "authenticationPlan": { - "description": "This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing.", - "oneOf": [ - { - "$ref": "#/components/schemas/OAuth2AuthenticationPlan" - }, - { - "$ref": "#/components/schemas/HMACAuthenticationPlan" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", - "hmac": "#/components/schemas/HMACAuthenticationPlan" - } - } + "authorizationId": { + "type": "string", + "description": "The authorization ID for the OAuth2 authorization" }, "id": { "type": "string", @@ -42428,14 +53480,6 @@ "type": "string", "description": "This is the ISO 8601 date-time string of when the assistant was last updated." }, - "authenticationSession": { - "description": "This is the authentication session for the credential. Available for credentials that have an authentication plan.", - "allOf": [ - { - "$ref": "#/components/schemas/Oauth2AuthenticationSession" - } - ] - }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -42445,28 +53489,25 @@ }, "required": [ "provider", - "authenticationPlan", + "authorizationId", "id", "orgId", "createdAt", - "updatedAt", - "authenticationSession" + "updatedAt" ] }, - "XAiCredential": { + "SlackOAuth2AuthorizationCredential": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the api key for Grok in XAi's console. Get it from here: https://console.x.ai", "enum": [ - "xai" + "slack.oauth2-authorization" ] }, - "apiKey": { + "authorizationId": { "type": "string", - "maxLength": 10000, - "description": "This is not returned in the API." + "description": "The authorization ID for the OAuth2 authorization" }, "id": { "type": "string", @@ -42495,20 +53536,28 @@ }, "required": [ "provider", - "apiKey", + "authorizationId", "id", "orgId", "createdAt", "updatedAt" ] }, - "GoogleCalendarOAuth2ClientCredential": { + "GoHighLevelMCPCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.calendar.oauth2-client" + "ghl.oauth2-authorization" + ] + }, + "authenticationSession": { + "description": "This is the authentication session for the credential.", + "allOf": [ + { + "$ref": "#/components/schemas/Oauth2AuthenticationSession" + } ] }, "id": { @@ -42538,24 +53587,26 @@ }, "required": [ "provider", + "authenticationSession", "id", "orgId", "createdAt", "updatedAt" ] }, - "GoogleCalendarOAuth2AuthorizationCredential": { + "InworldCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.calendar.oauth2-authorization" + "inworld" ] }, - "authorizationId": { + "apiKey": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "description": "This is the Inworld Basic (Base64) authentication token. This is not returned in the API.", + "example": "your-base64-token-here" }, "id": { "type": "string", @@ -42584,25 +53635,25 @@ }, "required": [ "provider", - "authorizationId", + "apiKey", "id", "orgId", "createdAt", "updatedAt" ] }, - "GoogleSheetsOAuth2AuthorizationCredential": { + "EmailCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "google.sheets.oauth2-authorization" + "email" ] }, - "authorizationId": { + "email": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "description": "The recipient email address for alerts" }, "id": { "type": "string", @@ -42631,25 +53682,25 @@ }, "required": [ "provider", - "authorizationId", + "email", "id", "orgId", "createdAt", "updatedAt" ] }, - "SlackOAuth2AuthorizationCredential": { + "SlackWebhookCredential": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "slack.oauth2-authorization" + "slack-webhook" ] }, - "authorizationId": { + "webhookUrl": { "type": "string", - "description": "The authorization ID for the OAuth2 authorization" + "description": "Slack incoming webhook URL. See https://api.slack.com/messaging/webhooks for setup instructions. This is not returned in the API." }, "id": { "type": "string", @@ -42678,47 +53729,26 @@ }, "required": [ "provider", - "authorizationId", + "webhookUrl", "id", "orgId", "createdAt", "updatedAt" ] }, - "GoHighLevelMCPCredential": { + "CreateCerebrasCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "ghl.oauth2-authorization" - ] - }, - "authenticationSession": { - "description": "This is the authentication session for the credential.", - "allOf": [ - { - "$ref": "#/components/schemas/Oauth2AuthenticationSession" - } + "cerebras" ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the credential." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this credential belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the credential was created." - }, - "updatedAt": { - "format": "date-time", + "apiKey": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + "maxLength": 10000, + "description": "This is not returned in the API." }, "name": { "type": "string", @@ -42729,44 +53759,23 @@ }, "required": [ "provider", - "authenticationSession", - "id", - "orgId", - "createdAt", - "updatedAt" + "apiKey" ] }, - "InworldCredential": { + "CreateGoogleCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", + "description": "This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey", "enum": [ - "inworld" + "google" ] }, "apiKey": { "type": "string", - "description": "This is the Inworld Basic (Base64) authentication token. This is not returned in the API.", - "example": "your-base64-token-here" - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the credential." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this credential belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the credential was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + "maxLength": 10000, + "description": "This is not returned in the API." }, "name": { "type": "string", @@ -42777,20 +53786,16 @@ }, "required": [ "provider", - "apiKey", - "id", - "orgId", - "createdAt", - "updatedAt" + "apiKey" ] }, - "CreateCerebrasCredentialDTO": { + "CreateHumeCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "cerebras" + "hume" ] }, "apiKey": { @@ -42810,14 +53815,14 @@ "apiKey" ] }, - "CreateGoogleCredentialDTO": { + "CreateInflectionAICredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey", + "description": "This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup", "enum": [ - "google" + "inflection-ai" ] }, "apiKey": { @@ -42837,18 +53842,18 @@ "apiKey" ] }, - "CreateHumeCredentialDTO": { + "CreateMistralCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "hume" + "mistral" ] }, "apiKey": { "type": "string", - "maxLength": 10000, + "maxLength": 100, "description": "This is not returned in the API." }, "name": { @@ -42863,19 +53868,17 @@ "apiKey" ] }, - "CreateInflectionAICredentialDTO": { + "CreateNeuphonicCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the api key for Pi in InflectionAI's console. Get it from here: https://developers.inflection.ai/keys, billing will need to be setup", "enum": [ - "inflection-ai" + "neuphonic" ] }, "apiKey": { "type": "string", - "maxLength": 10000, "description": "This is not returned in the API." }, "name": { @@ -42890,18 +53893,18 @@ "apiKey" ] }, - "CreateMistralCredentialDTO": { + "CreateWellSaidCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "mistral" + "wellsaid" ] }, "apiKey": { "type": "string", - "maxLength": 100, + "maxLength": 10000, "description": "This is not returned in the API." }, "name": { @@ -42916,13 +53919,13 @@ "apiKey" ] }, - "CreateNeuphonicCredentialDTO": { + "CreateSonioxCredentialDTO": { "type": "object", "properties": { "provider": { "type": "string", "enum": [ - "neuphonic" + "soniox" ] }, "apiKey": { @@ -42991,6 +53994,68 @@ "apiKey" ] }, + "CreateCustomCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "custom-credential" + ] + }, + "authenticationPlan": { + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", + "oneOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + }, + { + "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" + } + } + }, + "encryptionPlan": { + "description": "This is the encryption plan for encrypting sensitive data. Currently supports public-key encryption.", + "oneOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "public-key": "#/components/schemas/PublicKeyEncryptionPlan" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authenticationPlan" + ] + }, "CreateGoHighLevelMCPCredentialDTO": { "type": "object", "properties": { @@ -43046,6 +54111,56 @@ "apiKey" ] }, + "CreateEmailCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "email" + ] + }, + "email": { + "type": "string", + "description": "The recipient email address for alerts" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "email" + ] + }, + "CreateSlackWebhookCredentialDTO": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "slack-webhook" + ] + }, + "webhookUrl": { + "type": "string", + "description": "Slack incoming webhook URL. See https://api.slack.com/messaging/webhooks for setup instructions. This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "webhookUrl" + ] + }, "UpdateAnthropicCredentialDTO": { "type": "object", "properties": { @@ -43062,6 +54177,40 @@ } } }, + "UpdateAnthropicBedrockCredentialDTO": { + "type": "object", + "properties": { + "region": { + "type": "string", + "description": "AWS region where Bedrock is configured.", + "enum": [ + "us-east-1", + "us-west-2", + "eu-west-1", + "eu-west-3", + "ap-northeast-1", + "ap-southeast-2" + ] + }, + "authenticationPlan": { + "description": "Authentication method - either direct IAM credentials or cross-account role assumption.", + "oneOf": [ + { + "$ref": "#/components/schemas/AWSIAMCredentialsAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/AWSStsAuthenticationPlan" + } + ] + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, "UpdateAnyscaleCredentialDTO": { "type": "object", "properties": { @@ -43115,16 +54264,20 @@ "eastus2", "eastus", "france", + "germanywestcentral", "india", "japaneast", "japanwest", - "uaenorth", "northcentralus", "norway", + "polandcentral", "southcentralus", + "spaincentral", "swedencentral", "switzerland", + "uaenorth", "uk", + "westeurope", "westus", "westus3" ] @@ -43167,16 +54320,20 @@ "eastus2", "eastus", "france", + "germanywestcentral", "india", "japaneast", "japanwest", - "uaenorth", "northcentralus", "norway", + "polandcentral", "southcentralus", + "spaincentral", "swedencentral", "switzerland", + "uaenorth", "uk", + "westeurope", "westus", "westus3" ] @@ -43184,6 +54341,10 @@ "models": { "type": "array", "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", "gpt-5", "gpt-5-mini", "gpt-5-nano", @@ -43208,6 +54369,10 @@ "items": { "type": "string", "enum": [ + "gpt-5.2", + "gpt-5.2-chat", + "gpt-5.1", + "gpt-5.1-chat", "gpt-5", "gpt-5-mini", "gpt-5-nano", @@ -43762,6 +54927,22 @@ } } }, + "UpdateWellSaidCredentialDTO": { + "type": "object", + "properties": { + "apiKey": { + "type": "string", + "maxLength": 10000, + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, "UpdateS3CredentialDTO": { "type": "object", "properties": { @@ -43798,70 +54979,6 @@ } } }, - "UpdateSmallestAICredentialDTO": { - "type": "object", - "properties": { - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - } - }, - "UpdateSpeechmaticsCredentialDTO": { - "type": "object", - "properties": { - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - } - }, - "UpdateSupabaseCredentialDTO": { - "type": "object", - "properties": { - "fallbackIndex": { - "type": "number", - "minimum": 1, - "description": "This is the order in which this storage provider is tried during upload retries. Lower numbers are tried first in increasing order." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - }, - "bucketPlan": { - "$ref": "#/components/schemas/SupabaseBucketPlan" - } - } - }, - "UpdateTavusCredentialDTO": { - "type": "object", - "properties": { - "apiKey": { - "type": "string", - "description": "This is not returned in the API." - }, - "name": { - "type": "string", - "description": "This is the name of credential. This is just for your reference.", - "minLength": 1, - "maxLength": 40 - } - } - }, "UpdateTogetherAICredentialDTO": { "type": "object", "properties": { @@ -43940,23 +55057,79 @@ "type": "object", "properties": { "authenticationPlan": { - "description": "This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing.", + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", + "oneOf": [ + { + "$ref": "#/components/schemas/OAuth2AuthenticationPlan" + }, + { + "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" + } + } + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "UpdateCustomCredentialDTO": { + "type": "object", + "properties": { + "authenticationPlan": { + "description": "This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication.", "oneOf": [ { "$ref": "#/components/schemas/OAuth2AuthenticationPlan" }, { "$ref": "#/components/schemas/HMACAuthenticationPlan" + }, + { + "$ref": "#/components/schemas/BearerAuthenticationPlan" } ], "discriminator": { "propertyName": "type", "mapping": { "oauth2": "#/components/schemas/OAuth2AuthenticationPlan", - "hmac": "#/components/schemas/HMACAuthenticationPlan" + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" } } }, + "encryptionPlan": { + "description": "This is the encryption plan for encrypting sensitive data. Currently supports public-key encryption.", + "oneOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "public-key": "#/components/schemas/PublicKeyEncryptionPlan" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/PublicKeyEncryptionPlan" + } + ] + }, "name": { "type": "string", "description": "This is the name of credential. This is just for your reference.", @@ -44072,6 +55245,51 @@ } } }, + "UpdateEmailCredentialDTO": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "The recipient email address for alerts" + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "UpdateSlackWebhookCredentialDTO": { + "type": "object", + "properties": { + "webhookUrl": { + "type": "string", + "description": "Slack incoming webhook URL. See https://api.slack.com/messaging/webhooks for setup instructions. This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, + "UpdateSonioxCredentialDTO": { + "type": "object", + "properties": { + "apiKey": { + "type": "string", + "description": "This is not returned in the API." + }, + "name": { + "type": "string", + "description": "This is the name of credential. This is just for your reference.", + "minLength": 1, + "maxLength": 40 + } + } + }, "CredentialSessionResponse": { "type": "object", "properties": { @@ -44086,11 +55304,18 @@ "CredentialEndUser": { "type": "object", "properties": { + "endUserEmail": { + "type": "string", + "nullable": true + }, "endUserId": { "type": "string" }, "organizationId": { "type": "string" + }, + "tags": { + "type": "object" } }, "required": [ @@ -44163,6 +55388,9 @@ }, "error": { "$ref": "#/components/schemas/CredentialSessionError" + }, + "tags": { + "type": "object" } }, "required": [ @@ -44258,22 +55486,82 @@ "algorithm" ] }, - "CredentialSessionDTO": { + "BearerAuthenticationPlan": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", "enum": [ - "google.calendar.oauth2-client", - "google.calendar.oauth2-authorization", - "google.sheets.oauth2-authorization", - "slack.oauth2-authorization" - ], - "description": "The type of credential to generate a session for. Only Nango user-facing providers are supported." + "bearer" + ] + }, + "token": { + "type": "string", + "description": "This is the bearer token value." + }, + "headerName": { + "type": "string", + "description": "This is the header name where the bearer token will be sent. Defaults to 'Authorization'." + }, + "bearerPrefixEnabled": { + "type": "boolean", + "description": "Whether to include the 'Bearer ' prefix in the header value. Defaults to true." } }, "required": [ - "provider" + "type", + "token" + ] + }, + "AWSIAMCredentialsAuthenticationPlan": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "aws-iam" + ] + }, + "awsAccessKeyId": { + "type": "string", + "description": "AWS Access Key ID. This is not returned in the API.", + "maxLength": 128 + }, + "awsSecretAccessKey": { + "type": "string", + "description": "AWS Secret Access Key. This is not returned in the API.", + "maxLength": 256 + } + }, + "required": [ + "type", + "awsAccessKeyId", + "awsSecretAccessKey" + ] + }, + "AWSStsAuthenticationPlan": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of authentication plan", + "enum": [ + "aws-sts" + ] + }, + "roleArn": { + "type": "string", + "description": "This is the role ARN for the AWS credential" + }, + "externalId": { + "type": "string", + "description": "Optional external ID for additional security in the role trust policy.", + "maxLength": 256 + } + }, + "required": [ + "type", + "roleArn" ] }, "ToolTemplateSetup": { @@ -44575,6 +55863,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -44646,6 +55938,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] }, @@ -44738,6 +56038,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -44809,6 +56113,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] }, @@ -44923,6 +56235,10 @@ "$ref": "#/components/schemas/CreateBashToolDTO", "title": "BashTool" }, + { + "$ref": "#/components/schemas/CreateCodeToolDTO", + "title": "CodeTool" + }, { "$ref": "#/components/schemas/CreateComputerToolDTO", "title": "ComputerTool" @@ -44994,6 +56310,14 @@ { "$ref": "#/components/schemas/CreateTransferCallToolDTO", "title": "TransferCallTool" + }, + { + "$ref": "#/components/schemas/CreateSipRequestToolDTO", + "title": "SipRequestTool" + }, + { + "$ref": "#/components/schemas/CreateVoicemailToolDTO", + "title": "VoicemailTool" } ] }, @@ -45096,7 +56420,9 @@ "tavus", "sesame", "inworld", - "minimax" + "minimax", + "wellsaid", + "orpheus" ] }, "providerId": { @@ -45210,7 +56536,9 @@ "tavus", "sesame", "inworld", - "minimax" + "minimax", + "wellsaid", + "orpheus" ], "items": { "type": "string", @@ -45231,7 +56559,9 @@ "tavus", "sesame", "inworld", - "minimax" + "minimax", + "wellsaid", + "orpheus" ] } } @@ -45250,6 +56580,70 @@ } } }, + "CartesiaPronunciationDictItem": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The text to be replaced in pronunciation", + "example": "Vapi" + }, + "alias": { + "type": "string", + "description": "The pronunciation alias or IPA representation\nCan be a \"sounds-like\" guidance (e.g., \"VAH-pee\") or IPA notation (e.g., \"<<ˈ|v|ɑ|ˈ|p|i>>\")", + "example": "VAH-pee" + } + }, + "required": [ + "text", + "alias" + ] + }, + "CartesiaPronunciationDictionary": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the pronunciation dictionary", + "example": "dict_abc123" + }, + "name": { + "type": "string", + "description": "Name of the pronunciation dictionary", + "example": "My Dictionary" + }, + "ownerId": { + "type": "string", + "description": "ID of the user who owns this dictionary", + "example": "user_xyz789" + }, + "pinned": { + "type": "boolean", + "description": "Whether this dictionary is pinned for the user", + "example": false + }, + "items": { + "description": "List of text-to-pronunciation mappings", + "type": "array", + "items": { + "$ref": "#/components/schemas/CartesiaPronunciationDictItem" + } + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp of when the dictionary was created", + "example": "2024-01-15T10:30:00Z" + } + }, + "required": [ + "id", + "name", + "ownerId", + "pinned", + "items", + "createdAt" + ] + }, "ElevenLabsPronunciationDictionary": { "type": "object", "properties": { @@ -45332,6 +56726,7 @@ "type": "string", "description": "This is the provider that manages this resource.", "enum": [ + "cartesia", "11labs" ] }, @@ -45347,12 +56742,8 @@ "description": "This is the provider-specific identifier for the resource." }, "resource": { - "description": "This is the full resource data from the provider's API.", - "allOf": [ - { - "$ref": "#/components/schemas/ElevenLabsPronunciationDictionary" - } - ] + "type": "object", + "description": "This is the full resource data from the provider's API." } }, "required": [ @@ -45465,6 +56856,213 @@ "files" ] }, + "VariableValueGroupBy": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "This is the key of the variable value to group by.", + "maxLength": 100 + } + }, + "required": [ + "key" + ] + }, + "TimeRange": { + "type": "object", + "properties": { + "step": { + "type": "string", + "description": "This is the time step for aggregations.\n\nIf not provided, defaults to returning for the entire time range.", + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year", + "decade", + "century", + "millennium" + ] + }, + "start": { + "format": "date-time", + "type": "string", + "description": "This is the start date for the time range.\n\nIf not provided, defaults to the 7 days ago." + }, + "end": { + "format": "date-time", + "type": "string", + "description": "This is the end date for the time range.\n\nIf not provided, defaults to now." + }, + "timezone": { + "type": "string", + "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." + } + } + }, + "AnalyticsOperation": { + "type": "object", + "properties": { + "operation": { + "type": "string", + "description": "This is the aggregation operation you want to perform.", + "enum": [ + "sum", + "avg", + "count", + "min", + "max", + "history" + ] + }, + "column": { + "type": "string", + "description": "This is the columns you want to perform the aggregation operation on.", + "enum": [ + "id", + "cost", + "costBreakdown.llm", + "costBreakdown.stt", + "costBreakdown.tts", + "costBreakdown.vapi", + "costBreakdown.transport", + "costBreakdown.analysisBreakdown.summary", + "costBreakdown.transcriber", + "costBreakdown.ttsCharacters", + "costBreakdown.llmPromptTokens", + "costBreakdown.llmCompletionTokens", + "costBreakdown.llmCachedPromptTokens", + "duration", + "concurrency", + "minutesUsed" + ] + }, + "alias": { + "type": "string", + "description": "This is the alias for column name returned. Defaults to `${operation}${column}`.", + "maxLength": 40 + } + }, + "required": [ + "operation", + "column" + ] + }, + "AnalyticsQuery": { + "type": "object", + "properties": { + "table": { + "type": "string", + "description": "This is the table you want to query.", + "enum": [ + "call", + "subscription" + ] + }, + "groupBy": { + "type": "array", + "description": "This is the list of columns you want to group by.", + "enum": [ + "type", + "assistantId", + "endedReason", + "analysis.successEvaluation", + "status" + ], + "items": { + "type": "string", + "enum": [ + "type", + "assistantId", + "endedReason", + "analysis.successEvaluation", + "status" + ] + } + }, + "groupByVariableValue": { + "description": "This is the list of variable value keys you want to group by.", + "type": "array", + "items": { + "$ref": "#/components/schemas/VariableValueGroupBy" + } + }, + "name": { + "type": "string", + "description": "This is the name of the query. This will be used to identify the query in the response.", + "maxLength": 40 + }, + "timeRange": { + "description": "This is the time range for the query.", + "allOf": [ + { + "$ref": "#/components/schemas/TimeRange" + } + ] + }, + "operations": { + "description": "This is the list of operations you want to perform.", + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalyticsOperation" + } + } + }, + "required": [ + "table", + "name", + "operations" + ] + }, + "AnalyticsQueryDTO": { + "type": "object", + "properties": { + "queries": { + "description": "This is the list of metric queries you want to perform.", + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalyticsQuery" + } + } + }, + "required": [ + "queries" + ] + }, + "AnalyticsQueryResult": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the unique key for the query." + }, + "timeRange": { + "description": "This is the time range for the query.", + "allOf": [ + { + "$ref": "#/components/schemas/TimeRange" + } + ] + }, + "result": { + "description": "This is the result of the query, a list of unique groups with result of their aggregations.\n\nExample:\n\"result\": [\n { \"date\": \"2023-01-01\", \"assistantId\": \"123\", \"endedReason\": \"customer-ended-call\", \"sumDuration\": 120, \"avgCost\": 10.5 },\n { \"date\": \"2023-01-02\", \"assistantId\": \"123\", \"endedReason\": \"customer-did-not-give-microphone-permission\", \"sumDuration\": 0, \"avgCost\": 0 },\n // Additional results\n]", + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "name", + "timeRange", + "result" + ] + }, "ClientMessageWorkflowNodeStarted": { "type": "object", "properties": { @@ -45538,6 +57136,83 @@ "node" ] }, + "ClientMessageAssistantStarted": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"assistant.started\" is sent when the assistant is started.", + "enum": [ + "assistant.started" + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "newAssistant": { + "description": "This is the assistant that was updated.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + } + }, + "required": [ + "type", + "newAssistant" + ] + }, "ClientMessageConversationUpdate": { "type": "object", "properties": { @@ -46268,26 +57943,186 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.", + "description": "This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.", + "enum": [ + "transfer-update" + ] + }, + "destination": { + "description": "This is the destination of the transfer.", + "oneOf": [ + { + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" + }, + { + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" + }, + { + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "Sip" + } + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "toAssistant": { + "description": "This is the assistant that the call is being transferred to. This is only sent if `destination.type` is \"assistant\".", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "fromAssistant": { + "description": "This is the assistant that the call is being transferred from. This is only sent if `destination.type` is \"assistant\".", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "toStepRecord": { + "type": "object", + "description": "This is the step that the conversation moved to." + }, + "fromStepRecord": { + "type": "object", + "description": "This is the step that the conversation moved from. =" + } + }, + "required": [ + "type" + ] + }, + "ClientMessageUserInterrupted": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"user-interrupted\" is sent when the user interrupts the assistant.", + "enum": [ + "user-interrupted" + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + } + }, + "required": [ + "type" + ] + }, + "ClientMessageLanguageChangeDetected": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"language-change-detected\" is sent when the transcriber is automatically switched based on the detected language.", "enum": [ - "transfer-update" - ] - }, - "destination": { - "description": "This is the destination of the transfer.", - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" - } + "language-change-detected" ] }, "timestamp": { @@ -46318,36 +58153,17 @@ } ] }, - "toAssistant": { - "description": "This is the assistant that the call is being transferred to. This is only sent if `destination.type` is \"assistant\".", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "fromAssistant": { - "description": "This is the assistant that the call is being transferred from. This is only sent if `destination.type` is \"assistant\".", - "allOf": [ - { - "$ref": "#/components/schemas/CreateAssistantDTO" - } - ] - }, - "toStepRecord": { - "type": "object", - "description": "This is the step that the conversation moved to." - }, - "fromStepRecord": { - "type": "object", - "description": "This is the step that the conversation moved from. =" + "language": { + "type": "string", + "description": "This is the language the transcriber is switched to." } }, "required": [ - "type" + "type", + "language" ] }, - "ClientMessageUserInterrupted": { + "ClientMessageVoiceInput": { "type": "object", "properties": { "phoneNumber": { @@ -46377,9 +58193,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"user-interrupted\" is sent when the user interrupts the assistant.", + "description": "This is the type of the message. \"voice-input\" is sent when a generation is requested from voice provider.", "enum": [ - "user-interrupted" + "voice-input" ] }, "timestamp": { @@ -46409,13 +58225,18 @@ "$ref": "#/components/schemas/CreateAssistantDTO" } ] + }, + "input": { + "type": "string", + "description": "This is the voice input content" } }, "required": [ - "type" + "type", + "input" ] }, - "ClientMessageLanguageChangeDetected": { + "ClientMessageChatCreated": { "type": "object", "properties": { "phoneNumber": { @@ -46445,9 +58266,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"language-change-detected\" is sent when the transcriber is automatically switched based on the detected language.", + "description": "This is the type of the message. \"chat.created\" is sent when a new chat is created.", "enum": [ - "language-change-detected" + "chat.created" ] }, "timestamp": { @@ -46478,17 +58299,21 @@ } ] }, - "language": { - "type": "string", - "description": "This is the language the transcriber is switched to." + "chat": { + "description": "This is the chat that was created.", + "allOf": [ + { + "$ref": "#/components/schemas/Chat" + } + ] } }, "required": [ "type", - "language" + "chat" ] }, - "ClientMessageVoiceInput": { + "ClientMessageChatDeleted": { "type": "object", "properties": { "phoneNumber": { @@ -46518,9 +58343,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"voice-input\" is sent when a generation is requested from voice provider.", + "description": "This is the type of the message. \"chat.deleted\" is sent when a chat is deleted.", "enum": [ - "voice-input" + "chat.deleted" ] }, "timestamp": { @@ -46551,17 +58376,21 @@ } ] }, - "input": { - "type": "string", - "description": "This is the voice input content" + "chat": { + "description": "This is the chat that was deleted.", + "allOf": [ + { + "$ref": "#/components/schemas/Chat" + } + ] } }, "required": [ "type", - "input" + "chat" ] }, - "ClientMessageChatCreated": { + "ClientMessageSessionCreated": { "type": "object", "properties": { "phoneNumber": { @@ -46591,9 +58420,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"chat.created\" is sent when a new chat is created.", + "description": "This is the type of the message. \"session.created\" is sent when a new session is created.", "enum": [ - "chat.created" + "session.created" ] }, "timestamp": { @@ -46624,21 +58453,21 @@ } ] }, - "chat": { - "description": "This is the chat that was created.", + "session": { + "description": "This is the session that was created.", "allOf": [ { - "$ref": "#/components/schemas/Chat" + "$ref": "#/components/schemas/Session" } ] } }, "required": [ "type", - "chat" + "session" ] }, - "ClientMessageChatDeleted": { + "ClientMessageSessionUpdated": { "type": "object", "properties": { "phoneNumber": { @@ -46668,9 +58497,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"chat.deleted\" is sent when a chat is deleted.", + "description": "This is the type of the message. \"session.updated\" is sent when a session is updated.", "enum": [ - "chat.deleted" + "session.updated" ] }, "timestamp": { @@ -46701,21 +58530,21 @@ } ] }, - "chat": { - "description": "This is the chat that was deleted.", + "session": { + "description": "This is the session that was updated.", "allOf": [ { - "$ref": "#/components/schemas/Chat" + "$ref": "#/components/schemas/Session" } ] } }, "required": [ "type", - "chat" + "session" ] }, - "ClientMessageSessionCreated": { + "ClientMessageSessionDeleted": { "type": "object", "properties": { "phoneNumber": { @@ -46745,9 +58574,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"session.created\" is sent when a new session is created.", + "description": "This is the type of the message. \"session.deleted\" is sent when a session is deleted.", "enum": [ - "session.created" + "session.deleted" ] }, "timestamp": { @@ -46779,7 +58608,7 @@ ] }, "session": { - "description": "This is the session that was created.", + "description": "This is the session that was deleted.", "allOf": [ { "$ref": "#/components/schemas/Session" @@ -46792,7 +58621,7 @@ "session" ] }, - "ClientMessageSessionUpdated": { + "ClientMessageCallDeleted": { "type": "object", "properties": { "phoneNumber": { @@ -46822,9 +58651,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"session.updated\" is sent when a session is updated.", + "description": "This is the type of the message. \"call.deleted\" is sent when a call is deleted.", "enum": [ - "session.updated" + "call.deleted" ] }, "timestamp": { @@ -46854,22 +58683,13 @@ "$ref": "#/components/schemas/CreateAssistantDTO" } ] - }, - "session": { - "description": "This is the session that was updated.", - "allOf": [ - { - "$ref": "#/components/schemas/Session" - } - ] } }, "required": [ - "type", - "session" + "type" ] }, - "ClientMessageSessionDeleted": { + "ClientMessageCallDeleteFailed": { "type": "object", "properties": { "phoneNumber": { @@ -46899,9 +58719,9 @@ }, "type": { "type": "string", - "description": "This is the type of the message. \"session.deleted\" is sent when a session is deleted.", + "description": "This is the type of the message. \"call.deleted\" is sent when a call is deleted.", "enum": [ - "session.deleted" + "call.delete.failed" ] }, "timestamp": { @@ -46931,19 +58751,10 @@ "$ref": "#/components/schemas/CreateAssistantDTO" } ] - }, - "session": { - "description": "This is the session that was deleted.", - "allOf": [ - { - "$ref": "#/components/schemas/Session" - } - ] } }, "required": [ - "type", - "session" + "type" ] }, "ClientMessage": { @@ -46956,6 +58767,10 @@ "$ref": "#/components/schemas/ClientMessageWorkflowNodeStarted", "title": "WorkflowNodeStarted" }, + { + "$ref": "#/components/schemas/ClientMessageAssistantStarted", + "title": "AssistantStarted" + }, { "$ref": "#/components/schemas/ClientMessageConversationUpdate", "title": "ConversationUpdate" @@ -47023,6 +58838,14 @@ { "$ref": "#/components/schemas/ClientMessageSessionDeleted", "title": "SessionDeleted" + }, + { + "$ref": "#/components/schemas/ClientMessageCallDeleted", + "title": "CallDeleted" + }, + { + "$ref": "#/components/schemas/ClientMessageCallDeleteFailed", + "title": "CallDeleteFailed" } ] } @@ -47292,12 +59115,14 @@ "call.start.error-vapi-number-outbound-daily-limit", "call.start.error-get-transport", "call.start.error-subscription-wallet-does-not-exist", + "call.start.error-fraud-check-failed", "call.start.error-subscription-frozen", "call.start.error-subscription-insufficient-credits", "call.start.error-subscription-upgrade-failed", "call.start.error-subscription-concurrency-limit-reached", + "call.start.error-enterprise-feature-not-available-recording-consent", "assistant-not-valid", - "database-error", + "call.start.error-vapifault-database-error", "assistant-not-found", "pipeline-error-openai-voice-failed", "pipeline-error-cartesia-voice-failed", @@ -47308,11 +59133,13 @@ "pipeline-error-azure-voice-failed", "pipeline-error-rime-ai-voice-failed", "pipeline-error-smallest-ai-voice-failed", + "pipeline-error-vapi-voice-failed", "pipeline-error-neuphonic-voice-failed", "pipeline-error-hume-voice-failed", "pipeline-error-sesame-voice-failed", "pipeline-error-inworld-voice-failed", "pipeline-error-minimax-voice-failed", + "pipeline-error-wellsaid-voice-failed", "pipeline-error-tavus-video-failed", "call.in-progress.error-vapifault-openai-voice-failed", "call.in-progress.error-vapifault-cartesia-voice-failed", @@ -47323,11 +59150,13 @@ "call.in-progress.error-vapifault-azure-voice-failed", "call.in-progress.error-vapifault-rime-ai-voice-failed", "call.in-progress.error-vapifault-smallest-ai-voice-failed", + "call.in-progress.error-vapifault-vapi-voice-failed", "call.in-progress.error-vapifault-neuphonic-voice-failed", "call.in-progress.error-vapifault-hume-voice-failed", "call.in-progress.error-vapifault-sesame-voice-failed", "call.in-progress.error-vapifault-inworld-voice-failed", "call.in-progress.error-vapifault-minimax-voice-failed", + "call.in-progress.error-vapifault-wellsaid-voice-failed", "call.in-progress.error-vapifault-tavus-video-failed", "pipeline-error-vapi-llm-failed", "pipeline-error-vapi-400-bad-request-validation-failed", @@ -47336,7 +59165,7 @@ "pipeline-error-vapi-429-exceeded-quota", "pipeline-error-vapi-500-server-error", "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", + "call.in-progress.error-providerfault-vapi-llm-failed", "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", "call.in-progress.error-vapifault-vapi-401-unauthorized", "call.in-progress.error-vapifault-vapi-403-model-access-denied", @@ -47344,6 +59173,7 @@ "call.in-progress.error-providerfault-vapi-500-server-error", "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-transcriber-api-key-missing", "call.in-progress.error-vapifault-deepgram-transcriber-failed", "pipeline-error-gladia-transcriber-failed", "call.in-progress.error-vapifault-gladia-transcriber-failed", @@ -47379,15 +59209,16 @@ "call.in-progress.error-vapifault-worker-died", "call.in-progress.twilio-completed-call", "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-baseten-llm-failed", "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", "pipeline-error-openai-400-bad-request-validation-failed", "pipeline-error-openai-401-unauthorized", @@ -47447,6 +59278,19 @@ "call.in-progress.error-vapifault-xai-429-exceeded-quota", "call.in-progress.error-providerfault-xai-500-server-error", "call.in-progress.error-providerfault-xai-503-server-overloaded-error", + "pipeline-error-baseten-400-bad-request-validation-failed", + "pipeline-error-baseten-401-unauthorized", + "pipeline-error-baseten-403-model-access-denied", + "pipeline-error-baseten-429-exceeded-quota", + "pipeline-error-baseten-500-server-error", + "pipeline-error-baseten-503-server-overloaded-error", + "pipeline-error-baseten-llm-failed", + "call.in-progress.error-vapifault-baseten-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-baseten-401-unauthorized", + "call.in-progress.error-vapifault-baseten-403-model-access-denied", + "call.in-progress.error-vapifault-baseten-429-exceeded-quota", + "call.in-progress.error-providerfault-baseten-500-server-error", + "call.in-progress.error-providerfault-baseten-503-server-overloaded-error", "pipeline-error-mistral-400-bad-request-validation-failed", "pipeline-error-mistral-401-unauthorized", "pipeline-error-mistral-403-model-access-denied", @@ -47519,7 +59363,7 @@ "pipeline-error-anthropic-500-server-error", "pipeline-error-anthropic-503-server-overloaded-error", "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-401-unauthorized", "call.in-progress.error-vapifault-anthropic-403-model-access-denied", @@ -47533,7 +59377,7 @@ "pipeline-error-anthropic-bedrock-500-server-error", "pipeline-error-anthropic-bedrock-503-server-overloaded-error", "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", @@ -47547,7 +59391,7 @@ "pipeline-error-anthropic-vertex-500-server-error", "pipeline-error-anthropic-vertex-503-server-overloaded-error", "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", @@ -47561,7 +59405,7 @@ "pipeline-error-together-ai-500-server-error", "pipeline-error-together-ai-503-server-overloaded-error", "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-together-ai-401-unauthorized", "call.in-progress.error-vapifault-together-ai-403-model-access-denied", @@ -47575,7 +59419,7 @@ "pipeline-error-anyscale-500-server-error", "pipeline-error-anyscale-503-server-overloaded-error", "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anyscale-401-unauthorized", "call.in-progress.error-vapifault-anyscale-403-model-access-denied", @@ -47589,7 +59433,7 @@ "pipeline-error-openrouter-500-server-error", "pipeline-error-openrouter-503-server-overloaded-error", "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", "call.in-progress.error-vapifault-openrouter-401-unauthorized", "call.in-progress.error-vapifault-openrouter-403-model-access-denied", @@ -47603,7 +59447,7 @@ "pipeline-error-perplexity-ai-500-server-error", "pipeline-error-perplexity-ai-503-server-overloaded-error", "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", @@ -47617,7 +59461,7 @@ "pipeline-error-deepinfra-500-server-error", "pipeline-error-deepinfra-503-server-overloaded-error", "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", "call.in-progress.error-vapifault-deepinfra-401-unauthorized", "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", @@ -47631,7 +59475,7 @@ "pipeline-error-runpod-500-server-error", "pipeline-error-runpod-503-server-overloaded-error", "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", "call.in-progress.error-vapifault-runpod-401-unauthorized", "call.in-progress.error-vapifault-runpod-403-model-access-denied", @@ -47645,13 +59489,14 @@ "pipeline-error-custom-llm-500-server-error", "pipeline-error-custom-llm-503-server-overloaded-error", "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", "call.in-progress.error-vapifault-custom-llm-401-unauthorized", "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota", "call.in-progress.error-providerfault-custom-llm-500-server-error", "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error", + "call.in-progress.error-pipeline-ws-model-connection-failed", "pipeline-error-custom-voice-failed", "pipeline-error-cartesia-socket-hang-up", "pipeline-error-cartesia-requested-payment", @@ -47707,6 +59552,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out", @@ -47756,12 +59602,20 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "pipeline-error-soniox-transcriber-auth-failed", + "pipeline-error-soniox-transcriber-rate-limited", + "pipeline-error-soniox-transcriber-invalid-config", + "pipeline-error-soniox-transcriber-server-error", + "pipeline-error-soniox-transcriber-failed", + "call.in-progress.error-vapifault-soniox-transcriber-auth-failed", + "call.in-progress.error-vapifault-soniox-transcriber-rate-limited", + "call.in-progress.error-vapifault-soniox-transcriber-invalid-config", + "call.in-progress.error-vapifault-soniox-transcriber-server-error", + "call.in-progress.error-vapifault-soniox-transcriber-failed", "call.in-progress.error-warm-transfer-max-duration", "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -47772,7 +59626,9 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-before-warm-transfer", "customer-ended-call-after-warm-transfer-attempt", + "customer-ended-call-during-transfer", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -47795,7 +59651,8 @@ "twilio-failed-to-connect-call", "twilio-reported-customer-misdialed", "vonage-rejected", - "voicemail" + "voicemail", + "call-deleted" ] }, "cost": { @@ -47903,6 +59760,14 @@ "format": "date-time", "type": "string", "description": "This is the ISO 8601 date-time string of when the call ended. This can also be found at `call.endedAt` on GET /call/:id." + }, + "compliance": { + "description": "This is the compliance result of the call. This can also be found at `call.compliance` on GET /call/:id.", + "allOf": [ + { + "$ref": "#/components/schemas/Compliance" + } + ] } }, "required": [ @@ -47912,6 +59777,95 @@ "analysis" ] }, + "ServerMessageHandoffDestinationRequest": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"handoff-destination-request\" is sent when the model is requesting handoff but destination is unknown.", + "enum": [ + "handoff-destination-request" + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "artifact": { + "description": "This is a live version of the `call.artifact`.\n\nThis matches what is stored on `call.artifact` after the call.", + "allOf": [ + { + "$ref": "#/components/schemas/Artifact" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "chat": { + "description": "This is the chat object.", + "allOf": [ + { + "$ref": "#/components/schemas/Chat" + } + ] + }, + "parameters": { + "type": "object", + "description": "This is the parameters of the handoff destination request." + } + }, + "required": [ + "type", + "parameters" + ] + }, "ServerMessageHang": { "type": "object", "properties": { @@ -48461,7 +60415,9 @@ "ringing", "in-progress", "forwarding", - "ended" + "ended", + "not-found", + "deletion-failed" ] }, "endedReason": { @@ -48486,12 +60442,14 @@ "call.start.error-vapi-number-outbound-daily-limit", "call.start.error-get-transport", "call.start.error-subscription-wallet-does-not-exist", + "call.start.error-fraud-check-failed", "call.start.error-subscription-frozen", "call.start.error-subscription-insufficient-credits", "call.start.error-subscription-upgrade-failed", "call.start.error-subscription-concurrency-limit-reached", + "call.start.error-enterprise-feature-not-available-recording-consent", "assistant-not-valid", - "database-error", + "call.start.error-vapifault-database-error", "assistant-not-found", "pipeline-error-openai-voice-failed", "pipeline-error-cartesia-voice-failed", @@ -48502,11 +60460,13 @@ "pipeline-error-azure-voice-failed", "pipeline-error-rime-ai-voice-failed", "pipeline-error-smallest-ai-voice-failed", + "pipeline-error-vapi-voice-failed", "pipeline-error-neuphonic-voice-failed", "pipeline-error-hume-voice-failed", "pipeline-error-sesame-voice-failed", "pipeline-error-inworld-voice-failed", "pipeline-error-minimax-voice-failed", + "pipeline-error-wellsaid-voice-failed", "pipeline-error-tavus-video-failed", "call.in-progress.error-vapifault-openai-voice-failed", "call.in-progress.error-vapifault-cartesia-voice-failed", @@ -48517,11 +60477,13 @@ "call.in-progress.error-vapifault-azure-voice-failed", "call.in-progress.error-vapifault-rime-ai-voice-failed", "call.in-progress.error-vapifault-smallest-ai-voice-failed", + "call.in-progress.error-vapifault-vapi-voice-failed", "call.in-progress.error-vapifault-neuphonic-voice-failed", "call.in-progress.error-vapifault-hume-voice-failed", "call.in-progress.error-vapifault-sesame-voice-failed", "call.in-progress.error-vapifault-inworld-voice-failed", "call.in-progress.error-vapifault-minimax-voice-failed", + "call.in-progress.error-vapifault-wellsaid-voice-failed", "call.in-progress.error-vapifault-tavus-video-failed", "pipeline-error-vapi-llm-failed", "pipeline-error-vapi-400-bad-request-validation-failed", @@ -48530,7 +60492,7 @@ "pipeline-error-vapi-429-exceeded-quota", "pipeline-error-vapi-500-server-error", "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", + "call.in-progress.error-providerfault-vapi-llm-failed", "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", "call.in-progress.error-vapifault-vapi-401-unauthorized", "call.in-progress.error-vapifault-vapi-403-model-access-denied", @@ -48538,6 +60500,7 @@ "call.in-progress.error-providerfault-vapi-500-server-error", "call.in-progress.error-providerfault-vapi-503-server-overloaded-error", "pipeline-error-deepgram-transcriber-failed", + "pipeline-error-deepgram-transcriber-api-key-missing", "call.in-progress.error-vapifault-deepgram-transcriber-failed", "pipeline-error-gladia-transcriber-failed", "call.in-progress.error-vapifault-gladia-transcriber-failed", @@ -48573,15 +60536,16 @@ "call.in-progress.error-vapifault-worker-died", "call.in-progress.twilio-completed-call", "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-baseten-llm-failed", "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", "pipeline-error-openai-400-bad-request-validation-failed", "pipeline-error-openai-401-unauthorized", @@ -48641,6 +60605,19 @@ "call.in-progress.error-vapifault-xai-429-exceeded-quota", "call.in-progress.error-providerfault-xai-500-server-error", "call.in-progress.error-providerfault-xai-503-server-overloaded-error", + "pipeline-error-baseten-400-bad-request-validation-failed", + "pipeline-error-baseten-401-unauthorized", + "pipeline-error-baseten-403-model-access-denied", + "pipeline-error-baseten-429-exceeded-quota", + "pipeline-error-baseten-500-server-error", + "pipeline-error-baseten-503-server-overloaded-error", + "pipeline-error-baseten-llm-failed", + "call.in-progress.error-vapifault-baseten-400-bad-request-validation-failed", + "call.in-progress.error-vapifault-baseten-401-unauthorized", + "call.in-progress.error-vapifault-baseten-403-model-access-denied", + "call.in-progress.error-vapifault-baseten-429-exceeded-quota", + "call.in-progress.error-providerfault-baseten-500-server-error", + "call.in-progress.error-providerfault-baseten-503-server-overloaded-error", "pipeline-error-mistral-400-bad-request-validation-failed", "pipeline-error-mistral-401-unauthorized", "pipeline-error-mistral-403-model-access-denied", @@ -48713,7 +60690,7 @@ "pipeline-error-anthropic-500-server-error", "pipeline-error-anthropic-503-server-overloaded-error", "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-401-unauthorized", "call.in-progress.error-vapifault-anthropic-403-model-access-denied", @@ -48727,7 +60704,7 @@ "pipeline-error-anthropic-bedrock-500-server-error", "pipeline-error-anthropic-bedrock-503-server-overloaded-error", "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", @@ -48741,7 +60718,7 @@ "pipeline-error-anthropic-vertex-500-server-error", "pipeline-error-anthropic-vertex-503-server-overloaded-error", "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", @@ -48755,7 +60732,7 @@ "pipeline-error-together-ai-500-server-error", "pipeline-error-together-ai-503-server-overloaded-error", "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-together-ai-401-unauthorized", "call.in-progress.error-vapifault-together-ai-403-model-access-denied", @@ -48769,7 +60746,7 @@ "pipeline-error-anyscale-500-server-error", "pipeline-error-anyscale-503-server-overloaded-error", "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anyscale-401-unauthorized", "call.in-progress.error-vapifault-anyscale-403-model-access-denied", @@ -48783,7 +60760,7 @@ "pipeline-error-openrouter-500-server-error", "pipeline-error-openrouter-503-server-overloaded-error", "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", "call.in-progress.error-vapifault-openrouter-401-unauthorized", "call.in-progress.error-vapifault-openrouter-403-model-access-denied", @@ -48797,7 +60774,7 @@ "pipeline-error-perplexity-ai-500-server-error", "pipeline-error-perplexity-ai-503-server-overloaded-error", "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", @@ -48811,7 +60788,7 @@ "pipeline-error-deepinfra-500-server-error", "pipeline-error-deepinfra-503-server-overloaded-error", "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", "call.in-progress.error-vapifault-deepinfra-401-unauthorized", "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", @@ -48825,7 +60802,7 @@ "pipeline-error-runpod-500-server-error", "pipeline-error-runpod-503-server-overloaded-error", "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", "call.in-progress.error-vapifault-runpod-401-unauthorized", "call.in-progress.error-vapifault-runpod-403-model-access-denied", @@ -48839,13 +60816,14 @@ "pipeline-error-custom-llm-500-server-error", "pipeline-error-custom-llm-503-server-overloaded-error", "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", "call.in-progress.error-vapifault-custom-llm-401-unauthorized", "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", "call.in-progress.error-vapifault-custom-llm-429-exceeded-quota", "call.in-progress.error-providerfault-custom-llm-500-server-error", "call.in-progress.error-providerfault-custom-llm-503-server-overloaded-error", + "call.in-progress.error-pipeline-ws-model-connection-failed", "pipeline-error-custom-voice-failed", "pipeline-error-cartesia-socket-hang-up", "pipeline-error-cartesia-requested-payment", @@ -48901,6 +60879,7 @@ "call.in-progress.error-vapifault-eleven-labs-voice-not-allowed-for-free-users", "call.in-progress.error-vapifault-eleven-labs-max-character-limit-exceeded", "call.in-progress.error-vapifault-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "call.in-progress.error-providerfault-eleven-labs-system-busy-and-requested-upgrade", "call.in-progress.error-providerfault-eleven-labs-500-server-error", "call.in-progress.error-providerfault-eleven-labs-503-server-error", "pipeline-error-playht-request-timed-out", @@ -48950,12 +60929,20 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "pipeline-error-soniox-transcriber-auth-failed", + "pipeline-error-soniox-transcriber-rate-limited", + "pipeline-error-soniox-transcriber-invalid-config", + "pipeline-error-soniox-transcriber-server-error", + "pipeline-error-soniox-transcriber-failed", + "call.in-progress.error-vapifault-soniox-transcriber-auth-failed", + "call.in-progress.error-vapifault-soniox-transcriber-rate-limited", + "call.in-progress.error-vapifault-soniox-transcriber-invalid-config", + "call.in-progress.error-vapifault-soniox-transcriber-server-error", + "call.in-progress.error-vapifault-soniox-transcriber-failed", "call.in-progress.error-warm-transfer-max-duration", "call.in-progress.error-warm-transfer-assistant-cancelled", "call.in-progress.error-warm-transfer-silence-timeout", "call.in-progress.error-warm-transfer-microphone-timeout", - "call.in-progress.error-warm-transfer-hang-timeout", - "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -48966,7 +60953,9 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-before-warm-transfer", "customer-ended-call-after-warm-transfer-attempt", + "customer-ended-call-during-transfer", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -48989,7 +60978,8 @@ "twilio-failed-to-connect-call", "twilio-reported-customer-misdialed", "vonage-rejected", - "voicemail" + "voicemail", + "call-deleted" ] }, "messages": { @@ -50487,6 +62477,174 @@ "session" ] }, + "ServerMessageCallDeleted": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"call.deleted\" is sent when a call is deleted.", + "enum": [ + "call.deleted" + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "artifact": { + "description": "This is a live version of the `call.artifact`.\n\nThis matches what is stored on `call.artifact` after the call.", + "allOf": [ + { + "$ref": "#/components/schemas/Artifact" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "chat": { + "description": "This is the chat object.", + "allOf": [ + { + "$ref": "#/components/schemas/Chat" + } + ] + } + }, + "required": [ + "type" + ] + }, + "ServerMessageCallDeleteFailed": { + "type": "object", + "properties": { + "phoneNumber": { + "description": "This is the phone number that the message is associated with.", + "oneOf": [ + { + "$ref": "#/components/schemas/CreateByoPhoneNumberDTO", + "title": "ByoPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTwilioPhoneNumberDTO", + "title": "TwilioPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVonagePhoneNumberDTO", + "title": "VonagePhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateVapiPhoneNumberDTO", + "title": "VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/CreateTelnyxPhoneNumberDTO", + "title": "TelnyxPhoneNumber" + } + ] + }, + "type": { + "type": "string", + "description": "This is the type of the message. \"call.deleted\" is sent when a call is deleted.", + "enum": [ + "call.delete.failed" + ] + }, + "timestamp": { + "type": "number", + "description": "This is the timestamp of the message." + }, + "artifact": { + "description": "This is a live version of the `call.artifact`.\n\nThis matches what is stored on `call.artifact` after the call.", + "allOf": [ + { + "$ref": "#/components/schemas/Artifact" + } + ] + }, + "assistant": { + "description": "This is the assistant that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, + "customer": { + "description": "This is the customer that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateCustomerDTO" + } + ] + }, + "call": { + "description": "This is the call that the message is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/Call" + } + ] + }, + "chat": { + "description": "This is the chat object.", + "allOf": [ + { + "$ref": "#/components/schemas/Chat" + } + ] + } + }, + "required": [ + "type" + ] + }, "ServerMessage": { "type": "object", "properties": { @@ -50505,6 +62663,10 @@ "$ref": "#/components/schemas/ServerMessageEndOfCallReport", "title": "EndOfCallReport" }, + { + "$ref": "#/components/schemas/ServerMessageHandoffDestinationRequest", + "title": "HandoffDestinationRequest" + }, { "$ref": "#/components/schemas/ServerMessageHang", "title": "Hang" @@ -50584,6 +62746,14 @@ { "$ref": "#/components/schemas/ServerMessageSessionDeleted", "title": "SessionDeleted" + }, + { + "$ref": "#/components/schemas/ServerMessageCallDeleted", + "title": "CallDeleted" + }, + { + "$ref": "#/components/schemas/ServerMessageCallDeleteFailed", + "title": "CallDeleteFailed" } ] } @@ -50640,6 +62810,14 @@ } ] }, + "squadOverrides": { + "description": "These are the overrides for the `squad` or `squadId`'s member settings and template variables.\nThis will apply to all members of the squad.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, "workflowId": { "type": "string", "description": "This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead.\n\nTo start a call with:\n- Assistant, use `assistant` or `assistantId`\n- Squad, use `squad` or `squadId`\n- Workflow, use `workflow` or `workflowId`" @@ -50670,12 +62848,12 @@ "type": "object", "properties": { "destination": { - "description": "This is the destination you'd like the call to be transferred to.", - "allOf": [ - { - "$ref": "#/components/schemas/HandoffDestinationAssistant" - } - ] + "type": "object", + "description": "This is the destination you'd like the call to be transferred to." + }, + "error": { + "type": "string", + "description": "This is the error message if the handoff should not be made." } }, "required": [ @@ -50929,7 +63107,7 @@ "properties": { "type": { "type": "string", - "description": "This is the type of the message. Send \"control\" message to control the assistant. `control` options are:\n- \"mute-assistant\" - mute the assistant\n- \"unmute-assistant\" - unmute the assistant\n- \"say-first-message\" - say the first message (this is used when video recording is enabled and the conversation is only started once the client side kicks off the recording)", + "description": "This is the type of the message. Send \"control\" message to control the assistant. `control` options are:\n- \"mute-assistant\" - mute the assistant\n- \"unmute-assistant\" - unmute the assistant\n- \"mute-customer\" - mute the user\n- \"unmute-customer\" - unmute the user\n- \"say-first-message\" - say the first message (this is used when video recording is enabled and the conversation is only started once the client side kicks off the recording)", "enum": [ "control" ] @@ -50940,6 +63118,8 @@ "enum": [ "mute-assistant", "unmute-assistant", + "mute-customer", + "unmute-customer", "say-first-message" ] } @@ -51025,6 +63205,35 @@ "type" ] }, + "ClientInboundMessageSendTransportMessage": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of the message. Send \"send-transport-message\" to send a transport-specific message during the call.", + "enum": [ + "send-transport-message" + ] + }, + "message": { + "description": "This is the transport-specific message to send.", + "oneOf": [ + { + "$ref": "#/components/schemas/VapiSipTransportMessage", + "title": "VapiSipTransportMessage" + }, + { + "$ref": "#/components/schemas/TwilioTransportMessage", + "title": "TwilioTransportMessage" + } + ] + } + }, + "required": [ + "type", + "message" + ] + }, "ClientInboundMessage": { "type": "object", "properties": { @@ -51050,6 +63259,10 @@ { "$ref": "#/components/schemas/ClientInboundMessageTransfer", "title": "Transfer" + }, + { + "$ref": "#/components/schemas/ClientInboundMessageSendTransportMessage", + "title": "SendTransportMessage" } ] } @@ -51187,9 +63400,12 @@ "provider": { "type": "string", "enum": [ + "daily", + "vapi.websocket", "twilio", "vonage", - "vapi" + "telnyx", + "vapi.sip" ] }, "minutes": { @@ -51259,6 +63475,10 @@ "type": "number", "description": "This is the number of completion tokens generated in the call. These should be total completion tokens used in the call for single assistant calls, while squad calls will have multiple model costs one for each assistant that was used." }, + "cachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used in the call. This is only applicable to certain providers (e.g., OpenAI, Azure OpenAI) that support prompt caching. Cached tokens are billed at a discounted rate." + }, "cost": { "type": "number", "description": "This is the cost of the component in USD." @@ -51368,6 +63588,10 @@ "type": "number", "description": "This is the number of completion tokens generated in the analysis." }, + "cachedPromptTokens": { + "type": "number", + "description": "This is the number of cached prompt tokens used in the analysis. This is only applicable to certain providers (e.g., OpenAI, Azure OpenAI) that support prompt caching. Cached tokens are billed at a discounted rate." + }, "cost": { "type": "number", "description": "This is the cost of the component in USD." @@ -51493,6 +63717,26 @@ "cost" ] }, + "SessionCost": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of cost, always 'session' for this class.", + "enum": [ + "session" + ] + }, + "cost": { + "type": "number", + "description": "This is the cost of the component in USD." + } + }, + "required": [ + "type", + "cost" + ] + }, "FunctionToolWithToolCall": { "type": "object", "properties": { @@ -52222,6 +64466,59 @@ "type", "toolCall" ] + }, + "VapiSipTransportMessage": { + "type": "object", + "properties": { + "transport": { + "type": "string", + "description": "This is the transport type.", + "enum": [ + "vapi.sip" + ] + }, + "sipVerb": { + "type": "string", + "description": "This is the SIP verb to use. Must be one of INFO, MESSAGE, or NOTIFY.", + "enum": [ + "INFO", + "MESSAGE", + "NOTIFY" + ] + }, + "headers": { + "type": "object", + "description": "These are the headers to include with the SIP request." + }, + "body": { + "type": "string", + "description": "This is the body of the SIP request, if any." + } + }, + "required": [ + "transport", + "sipVerb" + ] + }, + "TwilioTransportMessage": { + "type": "object", + "properties": { + "transport": { + "type": "string", + "description": "This is the transport type.", + "enum": [ + "twilio" + ] + }, + "twiml": { + "type": "string", + "description": "This is the TwiML to send to the Twilio call." + } + }, + "required": [ + "transport", + "twiml" + ] } } }