diff --git a/fern/apis/api/openapi.json b/fern/apis/api/openapi.json index f24a120e3..9044bc121 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,8 +814,8 @@ ] }, "delete": { - "operationId": "CampaignController_remove", - "summary": "Delete Campaign", + "operationId": "CallController_deleteCallData", + "summary": "Delete Call Data", "parameters": [ { "name": "id", @@ -957,14 +832,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Campaign" + "$ref": "#/components/schemas/Call" } } } } }, "tags": [ - "Campaigns" + "Calls" ], "security": [ { @@ -973,69 +848,34 @@ ] } }, - "/session": { - "post": { - "operationId": "SessionController_create", - "summary": "Create Session", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSessionDTO" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - } - }, - "tags": [ - "Sessions" - ], - "security": [ - { - "bearer": [] - } - ] - }, + "/chat": { "get": { - "operationId": "SessionController_findAllPaginated", - "summary": "List Sessions", + "operationId": "ChatController_listChats", + "summary": "List Chats", "parameters": [ { - "name": "name", + "name": "assistantId", "required": false, "in": "query", - "description": "This is the name of the session to filter by.", + "description": "This is the unique identifier for the assistant that will be used for the chat.", "schema": { "type": "string" } }, { - "name": "assistantId", + "name": "workflowId", "required": false, "in": "query", - "description": "This is the ID of the assistant to filter sessions by.", + "description": "This is the unique identifier for the workflow that will be used for the chat.", "schema": { "type": "string" } }, { - "name": "workflowId", + "name": "sessionId", "required": false, "in": "query", - "description": "This is the ID of the workflow to filter sessions by.", + "description": "This is the unique identifier for the session that will be used for the chat.", "schema": { "type": "string" } @@ -1161,14 +1001,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. 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" + } + } + } + }, + "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 +1070,10 @@ ] } }, - "/session/{id}": { + "/chat/{id}": { "get": { - "operationId": "SessionController_findOne", - "summary": "Get Session", + "operationId": "ChatController_getChat", + "summary": "Get Chat", "parameters": [ { "name": "id", @@ -1197,14 +1090,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Session" + "$ref": "#/components/schemas/Chat" } } } } }, "tags": [ - "Sessions" + "Chats" ], "security": [ { @@ -1212,9 +1105,9 @@ } ] }, - "patch": { - "operationId": "SessionController_update", - "summary": "Update Session", + "delete": { + "operationId": "ChatController_deleteChat", + "summary": "Delete Chat", "parameters": [ { "name": "id", @@ -1225,64 +1118,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 +1203,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 +1224,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1328,9 +1240,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 +1385,14 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Assistant" - } + "$ref": "#/components/schemas/CampaignPaginatedResponse" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1448,10 +1401,10 @@ ] } }, - "/assistant/{id}": { + "/campaign/{id}": { "get": { - "operationId": "AssistantController_findOne", - "summary": "Get Assistant", + "operationId": "CampaignController_findOne", + "summary": "Get Campaign", "parameters": [ { "name": "id", @@ -1468,14 +1421,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1484,8 +1437,8 @@ ] }, "patch": { - "operationId": "AssistantController_update", - "summary": "Update Assistant", + "operationId": "CampaignController_update", + "summary": "Update Campaign", "parameters": [ { "name": "id", @@ -1501,7 +1454,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateAssistantDTO" + "$ref": "#/components/schemas/UpdateCampaignDTO" } } } @@ -1512,14 +1465,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1528,8 +1481,8 @@ ] }, "delete": { - "operationId": "AssistantController_remove", - "summary": "Delete Assistant", + "operationId": "CampaignController_remove", + "summary": "Delete Campaign", "parameters": [ { "name": "id", @@ -1546,14 +1499,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Assistant" + "$ref": "#/components/schemas/Campaign" } } } } }, "tags": [ - "Assistants" + "Campaigns" ], "security": [ { @@ -1562,48 +1515,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 +1536,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 +1552,59 @@ ] }, "get": { - "operationId": "PhoneNumberController_findAll", - "summary": "List Phone Numbers", + "operationId": "SessionController_findAllPaginated", + "summary": "List Sessions", "parameters": [ + { + "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": "workflowId", + "required": false, + "in": "query", + "description": "This is the ID of the workflow to filter sessions by.", + "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, @@ -1763,49 +1703,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 +1719,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 +1739,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 +1755,8 @@ ] }, "patch": { - "operationId": "PhoneNumberController_update", - "summary": "Update Phone Number", + "operationId": "SessionController_update", + "summary": "Update Session", "parameters": [ { "name": "id", @@ -1899,38 +1772,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,32 +1783,461 @@ "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": { + "$ref": "#/components/schemas/Session" + } + } + } + } + }, + "tags": [ + "Sessions" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "operationId": "SessionController_remove", + "summary": "Delete Session", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + } + }, + "tags": [ + "Sessions" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/phone-number": { + "post": { + "operationId": "PhoneNumberController_create", + "summary": "Create Phone Number", + "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" + } + } + } + } + } + }, + "responses": { + "201": { + "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": [] + } + ] + }, + "get": { + "operationId": "PhoneNumberController_findAll", + "summary": "List Phone Numbers", + "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": { + "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": [] + } + ] + } + }, + "/phone-number/{id}": { + "get": { + "operationId": "PhoneNumberController_findOne", + "summary": "Get Phone Number", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "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": [] + } + ] + }, + "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/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", @@ -3270,78 +3541,52 @@ ] } }, - "/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" - } - } - } + "/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": { - "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" - } - } - } - } + }, + { + "name": "name", + "required": false, + "in": "query", + "description": "This will return structured outputs where the name matches the specified value.", + "schema": { + "type": "string" } - } - }, - "tags": [ - "Knowledge Base" - ], - "security": [ + }, { - "bearer": [] - } - ] - }, - "get": { - "operationId": "KnowledgeBaseController_findAll", - "summary": "List Knowledge Bases", - "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, @@ -3440,95 +3685,61 @@ "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" - } - } - } + "$ref": "#/components/schemas/StructuredOutputPaginatedResponse" } } } } }, "tags": [ - "Knowledge Base" + "Structured Outputs" ], "security": [ { "bearer": [] } ] - } - }, - "/knowledge-base/{id}": { - "get": { - "operationId": "KnowledgeBaseController_findOne", - "summary": "Get Knowledge Base", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" + }, + "post": { + "operationId": "StructuredOutputController_create", + "summary": "Create Structured Output", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStructuredOutputDTO" + } } } - ], + }, "responses": { - "200": { + "201": { "description": "", "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" - } - } + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Knowledge Base" + "Structured Outputs" ], "security": [ { "bearer": [] } ] - }, - "patch": { - "operationId": "KnowledgeBaseController_update", - "summary": "Update Knowledge Base", + } + }, + "/structured-output/{id}": { + "get": { + "operationId": "StructuredOutputController_findOne", + "summary": "Get Structured Output", "parameters": [ { "name": "id", @@ -3539,62 +3750,20 @@ } } ], - "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" - } - } - } - } - } - }, "responses": { "200": { "description": "", "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" - } - } + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Knowledge Base" + "Structured Outputs" ], "security": [ { @@ -3602,9 +3771,9 @@ } ] }, - "delete": { - "operationId": "KnowledgeBaseController_remove", - "summary": "Delete Knowledge Base", + "patch": { + "operationId": "StructuredOutputController_update", + "summary": "Update Structured Output", "parameters": [ { "name": "id", @@ -3613,115 +3782,50 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "", - "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" - } - } - } - } - } - } - }, - "tags": [ - "Knowledge Base" - ], - "security": [ + }, { - "bearer": [] - } - ] - } - }, - "/workflow": { - "get": { - "operationId": "WorkflowController_findAll", - "summary": "Get Workflows", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Workflow" - } - } - } + "name": "schemaOverride", + "required": true, + "in": "query", + "schema": { + "type": "string" } } - }, - "tags": [ - "Workflow" ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "WorkflowController_create", - "summary": "Create Workflow", - "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateWorkflowDTO" + "$ref": "#/components/schemas/UpdateStructuredOutputDTO" } } } }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Workflow" + "Structured Outputs" ], "security": [ { "bearer": [] } ] - } - }, - "/workflow/{id}": { - "get": { - "operationId": "WorkflowController_findOne", - "summary": "Get Workflow", + }, + "delete": { + "operationId": "StructuredOutputController_remove", + "summary": "Delete Structured Output", "parameters": [ { "name": "id", @@ -3738,48 +3842,74 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/StructuredOutput" } } } } }, "tags": [ - "Workflow" + "Structured Outputs" ], "security": [ { "bearer": [] } ] - }, - "delete": { - "operationId": "WorkflowController_delete", - "summary": "Delete Workflow", + } + }, + "/provider/{provider}/{resourceName}": { + "post": { + "operationId": "ProviderResourceController_createProviderResource", + "summary": "Create Provider Resource", "parameters": [ { - "name": "id", + "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": { - "200": { - "description": "", + "201": { + "description": "Successfully created provider resource", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Workflow" + "$ref": "#/components/schemas/ProviderResource" } } } } }, "tags": [ - "Workflow" + "Provider Resources" ], "security": [ { @@ -3787,91 +3917,73 @@ } ] }, - "patch": { - "operationId": "WorkflowController_update", - "summary": "Update Workflow", + "get": { + "operationId": "ProviderResourceController_getProviderResourcesPaginated", + "summary": "List Provider Resources", "parameters": [ { - "name": "id", + "name": "provider", "required": true, "in": "path", + "description": "The provider (e.g., 11labs)", "schema": { + "enum": [ + "11labs" + ], "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateWorkflowDTO" - } + }, + { + "name": "resourceName", + "required": true, + "in": "path", + "description": "The resource name (e.g., pronunciation-dictionary)", + "schema": { + "enum": [ + "pronunciation-dictionary" + ], + "type": "string" } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Workflow" - } - } + }, + { + "name": "id", + "required": false, + "in": "query", + "schema": { + "type": "string" } - } - }, - "tags": [ - "Workflow" - ], - "security": [ + }, { - "bearer": [] - } - ] - } - }, - "/squad": { - "post": { - "operationId": "SquadController_create", - "summary": "Create Squad", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateSquadDTO" - } + "name": "resourceId", + "required": false, + "in": "query", + "schema": { + "type": "string" } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Squad" - } - } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" } - } - }, - "tags": [ - "Squads" - ], - "security": [ + }, { - "bearer": [] - } - ] - }, - "get": { - "operationId": "SquadController_findAll", - "summary": "List Squads", - "parameters": [ + "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, @@ -3966,21 +4078,18 @@ ], "responses": { "200": { - "description": "", + "description": "List of provider resources", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Squad" - } + "$ref": "#/components/schemas/ProviderResourcePaginatedResponse" } } } } }, "tags": [ - "Squads" + "Provider Resources" ], "security": [ { @@ -3989,34 +4098,62 @@ ] } }, - "/squad/{id}": { + "/provider/{provider}/{resourceName}/{id}": { "get": { - "operationId": "SquadController_findOne", - "summary": "Get Squad", + "operationId": "ProviderResourceController_getProviderResource", + "summary": "Get 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" } } ], "responses": { "200": { - "description": "", + "description": "Successfully retrieved provider resource", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Squad" + "$ref": "#/components/schemas/ProviderResource" } } } + }, + "404": { + "description": "Provider resource not found" } }, "tags": [ - "Squads" + "Provider Resources" ], "security": [ { @@ -4024,43 +4161,61 @@ } ] }, - "patch": { - "operationId": "SquadController_update", - "summary": "Update Squad", + "delete": { + "operationId": "ProviderResourceController_deleteProviderResource", + "summary": "Delete 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" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateSquadDTO" - } - } - } - }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Squad" + "$ref": "#/components/schemas/ProviderResource" } } } + }, + "404": { + "description": "Provider resource not found" } }, "tags": [ - "Squads" + "Provider Resources" ], "security": [ { @@ -4068,157 +4223,40 @@ } ] }, - "delete": { - "operationId": "SquadController_remove", - "summary": "Delete Squad", + "patch": { + "operationId": "ProviderResourceController_updateProviderResource", + "summary": "Update Provider Resource", "parameters": [ { - "name": "id", + "name": "provider", "required": true, "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Squad" - } - } - } - } - }, - "tags": [ - "Squads" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-suite": { - "get": { - "operationId": "TestSuiteController_findAllPaginated", - "summary": "List Test Suites", - "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'.", + "description": "The provider (e.g., 11labs)", "schema": { "enum": [ - "ASC", - "DESC" + "11labs" ], "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.", + "name": "resourceName", + "required": true, + "in": "path", + "description": "The resource name (e.g., pronunciation-dictionary)", "schema": { - "format": "date-time", + "enum": [ + "pronunciation-dictionary" + ], "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.", + "name": "id", + "required": true, + "in": "path", "schema": { - "format": "date-time", + "format": "uuid", "type": "string" } } @@ -4229,49 +4267,60 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuitesPaginatedResponse" + "$ref": "#/components/schemas/ProviderResource" } } } + }, + "404": { + "description": "Provider resource not found" } }, "tags": [ - "Test Suites" + "Provider Resources" ], "security": [ { "bearer": [] } ] - }, + } + }, + "/analytics": { "post": { - "operationId": "TestSuiteController_create", - "summary": "Create Test Suite", + "operationId": "AnalyticsController_query", + "summary": "Create Analytics Queries", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateTestSuiteDto" + "$ref": "#/components/schemas/AnalyticsQueryDTO" } } } }, "responses": { - "201": { + "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TestSuite" + "type": "array", + "items": { + "$ref": "#/components/schemas/AnalyticsQueryResult" + } } } } + }, + "201": { + "description": "" } }, "tags": [ - "Test Suites" + "Analytics" ], "security": [ { @@ -4279,2629 +4328,1953 @@ } ] } + } + }, + "info": { + "title": "Vapi API", + "description": "Voice AI for developers.", + "version": "1.0", + "contact": {} + }, + "tags": [], + "servers": [ + { + "url": "https://api.vapi.ai" + } + ], + "components": { + "securitySchemes": { + "bearer": { + "scheme": "bearer", + "bearerFormat": "Bearer", + "type": "http", + "description": "Retrieve your API Key from [Dashboard](dashboard.vapi.ai)." + } }, - "/test-suite/{id}": { - "get": { - "operationId": "TestSuiteController_findOne", - "summary": "Get Test Suite", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuite" - } - } - } - } - }, - "tags": [ - "Test Suites" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "patch": { - "operationId": "TestSuiteController_update", - "summary": "Update Test Suite", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateTestSuiteDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuite" + "schemas": { + "FallbackTranscriberPlan": { + "type": "object", + "properties": { + "transcribers": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FallbackAssemblyAITranscriber", + "title": "AssemblyAI" + }, + { + "$ref": "#/components/schemas/FallbackAzureSpeechTranscriber", + "title": "Azure" + }, + { + "$ref": "#/components/schemas/FallbackCustomTranscriber", + "title": "Custom" + }, + { + "$ref": "#/components/schemas/FallbackDeepgramTranscriber", + "title": "Deepgram" + }, + { + "$ref": "#/components/schemas/FallbackElevenLabsTranscriber", + "title": "ElevenLabs" + }, + { + "$ref": "#/components/schemas/FallbackGladiaTranscriber", + "title": "Gladia" + }, + { + "$ref": "#/components/schemas/FallbackGoogleTranscriber", + "title": "Google" + }, + { + "$ref": "#/components/schemas/FallbackTalkscriberTranscriber", + "title": "Talkscriber" + }, + { + "$ref": "#/components/schemas/FallbackSpeechmaticsTranscriber", + "title": "Speechmatics" + }, + { + "$ref": "#/components/schemas/FallbackOpenAITranscriber", + "title": "OpenAI" + }, + { + "$ref": "#/components/schemas/FallbackCartesiaTranscriber", + "title": "Cartesia" } - } + ] } } }, - "tags": [ - "Test Suites" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "transcribers" ] }, - "delete": { - "operationId": "TestSuiteController_remove", - "summary": "Delete Test Suite", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuite" - } - } - } - } - }, - "tags": [ - "Test Suites" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-suite/{testSuiteId}/test": { - "get": { - "operationId": "TestSuiteTestController_findAllPaginated", - "summary": "List Tests", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "AssemblyAITranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "assembly-ai" + ] }, - { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" - } + "language": { + "type": "string", + "description": "This is the language that will be set for the transcription.", + "enum": [ + "en" + ] }, - { - "name": "sortOrder", - "required": false, - "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "schema": { - "enum": [ - "ASC", - "DESC" - ], - "type": "string" - } + "confidenceThreshold": { + "type": "number", + "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", + "minimum": 0, + "maximum": 1, + "example": 0.4 }, - { - "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" - } + "formatTurns": { + "type": "boolean", + "description": "This enables formatting of transcripts.\n\n@default true", + "example": true }, - { - "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" - } + "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", + "minimum": 0, + "maximum": 1, + "example": 0.7 }, - { - "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" - } + "minEndOfTurnSilenceWhenConfident": { + "type": "number", + "description": "This is the minimum end of turn silence when confident in milliseconds.\n\n@default 160", + "minimum": 0, + "example": 160 }, - { - "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" - } + "wordFinalizationMaxWaitTime": { + "type": "number", + "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", + "minimum": 0, + "example": 160 }, - { - "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" - } + "maxTurnSilence": { + "type": "number", + "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", + "minimum": 0, + "example": 400 }, - { - "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" - } + "realtimeUrl": { + "type": "string", + "description": "The WebSocket URL that the transcriber connects to." }, - { - "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" + "wordBoost": { + "description": "Add up to 2500 characters of custom vocabulary.", + "type": "array", + "items": { + "type": "string", + "maxLength": 2500 } }, - { - "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" - } + "endUtteranceSilenceThreshold": { + "type": "number", + "description": "The duration of the end utterance silence threshold in milliseconds." }, - { - "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/TestSuiteTestsPaginatedResponse" - } - } - } - } - }, - "tags": [ - "Test Suite Tests" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "TestSuiteTestController_create", - "summary": "Create Test", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "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" - } - } - } - } - } - }, - "responses": { - "201": { - "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" - } - } - } - } - } - } - }, - "tags": [ - "Test Suite Tests" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-suite/{testSuiteId}/test/{id}": { - "get": { - "operationId": "TestSuiteTestController_findOne", - "summary": "Get Test", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "disablePartialTranscripts": { + "type": "boolean", + "description": "Disable partial transcripts.\nSet to `true` to not receive partial transcripts. Defaults to `false`." }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "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" - } - } - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Test Suite Tests" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] }, - "patch": { - "operationId": "TestSuiteTestController_update", - "summary": "Update Test", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "AzureSpeechTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "azure" + ] }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "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" - } - } - } - } - } - } - }, - "tags": [ - "Test Suite Tests" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "delete": { - "operationId": "TestSuiteTestController_remove", - "summary": "Delete Test", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "language": { + "type": "string", + "description": "This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt", + "enum": [ + "af-ZA", + "am-ET", + "ar-AE", + "ar-BH", + "ar-DZ", + "ar-EG", + "ar-IL", + "ar-IQ", + "ar-JO", + "ar-KW", + "ar-LB", + "ar-LY", + "ar-MA", + "ar-OM", + "ar-PS", + "ar-QA", + "ar-SA", + "ar-SY", + "ar-TN", + "ar-YE", + "az-AZ", + "bg-BG", + "bn-IN", + "bs-BA", + "ca-ES", + "cs-CZ", + "cy-GB", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AU", + "en-CA", + "en-GB", + "en-GH", + "en-HK", + "en-IE", + "en-IN", + "en-KE", + "en-NG", + "en-NZ", + "en-PH", + "en-SG", + "en-TZ", + "en-US", + "en-ZA", + "es-AR", + "es-BO", + "es-CL", + "es-CO", + "es-CR", + "es-CU", + "es-DO", + "es-EC", + "es-ES", + "es-GQ", + "es-GT", + "es-HN", + "es-MX", + "es-NI", + "es-PA", + "es-PE", + "es-PR", + "es-PY", + "es-SV", + "es-US", + "es-UY", + "es-VE", + "et-EE", + "eu-ES", + "fa-IR", + "fi-FI", + "fil-PH", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "ga-IE", + "gl-ES", + "gu-IN", + "he-IL", + "hi-IN", + "hr-HR", + "hu-HU", + "hy-AM", + "id-ID", + "is-IS", + "it-CH", + "it-IT", + "ja-JP", + "jv-ID", + "ka-GE", + "kk-KZ", + "km-KH", + "kn-IN", + "ko-KR", + "lo-LA", + "lt-LT", + "lv-LV", + "mk-MK", + "ml-IN", + "mn-MN", + "mr-IN", + "ms-MY", + "mt-MT", + "my-MM", + "nb-NO", + "ne-NP", + "nl-BE", + "nl-NL", + "pa-IN", + "pl-PL", + "ps-AF", + "pt-BR", + "pt-PT", + "ro-RO", + "ru-RU", + "si-LK", + "sk-SK", + "sl-SI", + "so-SO", + "sq-AL", + "sr-RS", + "sv-SE", + "sw-KE", + "sw-TZ", + "ta-IN", + "te-IN", + "th-TH", + "tr-TR", + "uk-UA", + "ur-IN", + "uz-UZ", + "vi-VN", + "wuu-CN", + "yue-CN", + "zh-CN", + "zh-CN-shandong", + "zh-CN-sichuan", + "zh-HK", + "zh-TW", + "zu-ZA" + ] }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "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" - } - } - } + "segmentationStrategy": { + "type": "string", + "description": "Controls how phrase boundaries are detected, enabling either simple time/silence heuristics or more advanced semantic segmentation.", + "enum": [ + "Default", + "Time", + "Semantic" + ] + }, + "segmentationSilenceTimeoutMs": { + "type": "number", + "description": "Duration of detected silence after which the service finalizes a phrase. Configure to adjust sensitivity to pauses in speech.", + "minimum": 100, + "maximum": 5000 + }, + "segmentationMaximumTimeMs": { + "type": "number", + "description": "Maximum duration a segment can reach before being cut off when using time-based segmentation.", + "minimum": 20000, + "maximum": 70000 + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Test Suite Tests" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] - } - }, - "/test-suite/{testSuiteId}/run": { - "get": { - "operationId": "TestSuiteRunController_findAllPaginated", - "summary": "List Test Suite Runs", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "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" - } + }, + "CartesiaTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "cartesia" + ] }, - { - "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" - } + "model": { + "type": "string", + "enum": [ + "ink-whisper" + ] }, - { - "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" - } + "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" + ] }, - { - "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/TestSuiteRunsPaginatedResponse" - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] }, - "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" - } - } + "BackoffPlan": { + "type": "object", + "properties": { + "type": { + "type": "object", + "description": "This is the type of backoff plan to use. Defaults to fixed.\n\n@default fixed", + "enum": [ + "fixed", + "exponential" + ], + "example": "fixed" + }, + "maxRetries": { + "type": "number", + "description": "This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries).\n\n@default 0", + "minimum": 0, + "maximum": 10, + "example": 0 + }, + "baseDelaySeconds": { + "type": "number", + "description": "This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay.", + "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" } } }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "type", + "maxRetries", + "baseDelaySeconds" ] - } - }, - "/test-suite/{testSuiteId}/run/{id}": { - "get": { - "operationId": "TestSuiteRunController_findOne", - "summary": "Get Test Suite Run", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + }, + "Server": { + "type": "object", + "properties": { + "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 }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuiteRun" - } + "credentialId": { + "type": "string", + "description": "The credential ID for server authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "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." + }, + "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" } - } - } - }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] + ] } - ] + } }, - "patch": { - "operationId": "TestSuiteRunController_update", - "summary": "Update Test Suite Run", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "CustomTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used. Use `custom-transcriber` for providers that are not natively supported.", + "enum": [ + "custom-transcriber" + ] }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateTestSuiteRunDto" + "server": { + "description": "This is where the transcription request will be sent.\n\nUsage:\n1. Vapi will initiate a websocket connection with `server.url`.\n\n2. Vapi will send an initial text frame with the sample rate. Format:\n```\n {\n \"type\": \"start\",\n \"encoding\": \"linear16\", // 16-bit raw PCM format\n \"container\": \"raw\",\n \"sampleRate\": {{sampleRate}},\n \"channels\": 2 // customer is channel 0, assistant is channel 1\n }\n```\n\n3. Vapi will send the audio data in 16-bit raw PCM format as binary frames.\n\n4. You can read the messages something like this:\n```\nws.on('message', (data, isBinary) => {\n if (isBinary) {\n pcmBuffer = Buffer.concat([pcmBuffer, data]);\n console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`);\n } else {\n console.log('Received message:', JSON.parse(data.toString()));\n }\n});\n```\n\n5. You will respond with transcriptions as you have them. Format:\n```\n {\n \"type\": \"transcriber-response\",\n \"transcription\": \"Hello, world!\",\n \"channel\": \"customer\" | \"assistant\"\n }\n```", + "allOf": [ + { + "$ref": "#/components/schemas/Server" } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestSuiteRun" - } + ] + }, + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Test Suite Runs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider", + "server" ] }, - "delete": { - "operationId": "TestSuiteRunController_remove", - "summary": "Delete Test Suite Run", - "parameters": [ - { - "name": "testSuiteId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "DeepgramTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "deepgram" + ] }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "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" - } - } + "model": { + "description": "This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview", + "oneOf": [ + { + "type": "string", + "enum": [ + "nova-3", + "nova-3-general", + "nova-3-medical", + "nova-2", + "nova-2-general", + "nova-2-meeting", + "nova-2-phonecall", + "nova-2-finance", + "nova-2-conversationalai", + "nova-2-voicemail", + "nova-2-video", + "nova-2-medical", + "nova-2-drivethru", + "nova-2-automotive", + "nova", + "nova-general", + "nova-phonecall", + "nova-medical", + "enhanced", + "enhanced-general", + "enhanced-meeting", + "enhanced-phonecall", + "enhanced-finance", + "base", + "base-general", + "base-meeting", + "base-phonecall", + "base-finance", + "base-conversationalai", + "base-voicemail", + "base-video", + "whisper" + ] + }, + { + "type": "string" } - } - }, - "201": { - "description": "" - } - }, - "tags": [ - "Analytics" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/logs": { - "get": { - "operationId": "LoggingController_logsQuery", - "summary": "Get 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" - } - }, - { - "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", - "required": false, - "in": "query", - "description": "This is the ID of the call.", - "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" - } + "language": { + "type": "string", + "description": "This is the language that will be set for the transcription. The list of languages Deepgram supports can be found here: https://developers.deepgram.com/docs/models-languages-overview", + "enum": [ + "ar", + "az", + "ba", + "bg", + "br", + "ca", + "cs", + "da", + "da-DK", + "de", + "de-CH", + "el", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-US", + "es", + "es-419", + "es-LATAM", + "et", + "eu", + "fi", + "fr", + "fr-CA", + "ha", + "haw", + "he", + "hi", + "hi-Latn", + "hu", + "id", + "is", + "it", + "ja", + "jw", + "kn", + "ko", + "ko-KR", + "ln", + "lt", + "lv", + "mk", + "ms", + "multi", + "nl", + "nl-BE", + "no", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sn", + "so", + "sr", + "su", + "sv", + "sv-SE", + "ta", + "taq", + "th", + "th-TH", + "tr", + "tt", + "uk", + "ur", + "vi", + "yo", + "zh", + "zh-CN", + "zh-HK", + "zh-Hans", + "zh-Hant", + "zh-TW" + ] }, - { - "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" - } + "smartFormat": { + "type": "boolean", + "description": "This will be use smart format option provided by Deepgram. It's default disabled because it can sometimes format numbers as times but it's getting better.", + "example": false }, - { - "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" - } + "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 }, - { - "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" - } + "numerals": { + "type": "boolean", + "description": "If set to true, this will cause deepgram to convert spoken numbers to literal numerals. For example, \"my phone number is nine-seven-two...\" would become \"my phone number is 972...\"\n\n@default false", + "example": false }, - { - "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" - } + "confidenceThreshold": { + "type": "number", + "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", + "minimum": 0, + "maximum": 1, + "example": 0.4 }, - { - "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" + "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", + "items": { + "type": "string", + "pattern": "/^\\p{L}[\\p{L}\\d]*(?::[+-]?\\d+)?$/u" } }, - { - "name": "updatedAtLt", - "required": false, - "in": "query", - "description": "This will return items where the updatedAt is less than the specified value.", - "schema": { - "format": "date-time", + "keyterm": { + "description": "Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%.", + "type": "array", + "items": { "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" - } + "endpointing": { + "type": "number", + "description": "This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing.\n\nHere are the most important bits:\n- Defaults to 10. This is recommended for most use cases to optimize for latency.\n- 10 can cause some missing transcriptions since because of the shorter context. This mostly happens for one-word utterances. For those uses cases, it's recommended to try 300. It will add a bit of latency but the quality and reliability of the experience will be better.\n- If neither 10 nor 300 work, contact support@vapi.ai and we'll find another solution.\n\n@default 10", + "minimum": 10, + "maximum": 500 }, - { - "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/LogsPaginatedResponse" - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Logs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] }, - "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" - } - }, - { - "name": "assistantId", - "required": false, - "in": "query", - "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", - "required": false, - "in": "query", - "description": "This is the ID of the call.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "202": { - "description": "" - } - }, - "tags": [ - "Logs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/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" - } - }, - { - "name": "name", - "required": false, - "in": "query", - "description": "This will return structured outputs where the name matches the specified value.", - "schema": { - "type": "string" - } + "ElevenLabsTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "11labs" + ] }, - { - "name": "page", - "required": false, - "in": "query", - "description": "This is the page number to return. Defaults to 1.", - "schema": { - "minimum": 1, - "type": "number" - } + "model": { + "type": "string", + "description": "This is the model that will be used for the transcription.", + "enum": [ + "scribe_v1" + ] }, - { - "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" - } + "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" + ] }, - { - "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/StructuredOutputPaginatedResponse" - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] }, - "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": [ - { - "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" + "GladiaCustomVocabularyConfigDTO": { + "type": "object", + "properties": { + "vocabulary": { + "type": "array", + "description": "Array of vocabulary items (strings or objects with value, pronunciations, intensity, language)", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/GladiaVocabularyItemDTO" } - } + ] } + }, + "defaultIntensity": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Default intensity for vocabulary items (0.0 to 1.0)", + "default": 0.5 } }, - "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "vocabulary" ] }, - "patch": { - "operationId": "StructuredOutputController_update", - "summary": "Update Structured Output", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } + "GladiaTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "gladia" + ] }, - { - "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" - } + "model": { + "description": "This is the Gladia model that will be used. Default is 'fast'", + "oneOf": [ + { + "enum": [ + "fast", + "accurate", + "solaria-1" + ] } - } - } - }, - "tags": [ - "Structured Outputs" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "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" - } + ] + }, + "languageBehaviour": { + "description": "Defines how the transcription model detects the audio language. Default value is 'automatic single language'.", + "oneOf": [ + { + "type": "string", + "enum": [ + "manual", + "automatic single language", + "automatic multiple languages" + ] } - } - } - }, - "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" - } + "language": { + "type": "string", + "description": "Defines the language to use for the transcription. Required when languageBehaviour is 'manual'.", + "enum": [ + "af", + "sq", + "am", + "ar", + "hy", + "as", + "az", + "ba", + "eu", + "be", + "bn", + "bs", + "br", + "bg", + "ca", + "zh", + "hr", + "cs", + "da", + "nl", + "en", + "et", + "fo", + "fi", + "fr", + "gl", + "ka", + "de", + "el", + "gu", + "ht", + "ha", + "haw", + "he", + "hi", + "hu", + "is", + "id", + "it", + "ja", + "jv", + "kn", + "kk", + "km", + "ko", + "lo", + "la", + "lv", + "ln", + "lt", + "lb", + "mk", + "mg", + "ms", + "ml", + "mt", + "mi", + "mr", + "mn", + "my", + "ne", + "no", + "nn", + "oc", + "ps", + "fa", + "pl", + "pt", + "pa", + "ro", + "ru", + "sa", + "sr", + "sn", + "sd", + "si", + "sk", + "sl", + "so", + "es", + "su", + "sw", + "sv", + "tl", + "tg", + "ta", + "tt", + "te", + "th", + "bo", + "tr", + "tk", + "uk", + "ur", + "uz", + "vi", + "cy", + "yi", + "yo" + ] }, - { - "name": "sortOrder", - "required": false, - "in": "query", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "schema": { - "enum": [ - "ASC", - "DESC" - ], - "type": "string" - } + "languages": { + "type": "string", + "description": "Defines the languages to use for the transcription. Required when languageBehaviour is 'manual'.", + "enum": [ + "af", + "sq", + "am", + "ar", + "hy", + "as", + "az", + "ba", + "eu", + "be", + "bn", + "bs", + "br", + "bg", + "ca", + "zh", + "hr", + "cs", + "da", + "nl", + "en", + "et", + "fo", + "fi", + "fr", + "gl", + "ka", + "de", + "el", + "gu", + "ht", + "ha", + "haw", + "he", + "hi", + "hu", + "is", + "id", + "it", + "ja", + "jv", + "kn", + "kk", + "km", + "ko", + "lo", + "la", + "lv", + "ln", + "lt", + "lb", + "mk", + "mg", + "ms", + "ml", + "mt", + "mi", + "mr", + "mn", + "my", + "ne", + "no", + "nn", + "oc", + "ps", + "fa", + "pl", + "pt", + "pa", + "ro", + "ru", + "sa", + "sr", + "sn", + "sd", + "si", + "sk", + "sl", + "so", + "es", + "su", + "sw", + "sv", + "tl", + "tg", + "ta", + "tt", + "te", + "th", + "bo", + "tr", + "tk", + "uk", + "ur", + "uz", + "vi", + "cy", + "yi", + "yo" + ] }, - { - "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" - } + "transcriptionHint": { + "type": "string", + "description": "Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. If empty, this argument is ignored.\n⚠️ Warning ⚠️: Please be aware that the transcription_hint field has a character limit of 600. If you provide a transcription_hint longer than 600 characters, it will be automatically truncated to meet this limit.", + "maxLength": 600, + "example": "custom vocabulary" }, - { - "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" - } + "prosody": { + "type": "boolean", + "description": "If prosody is true, you will get a transcription that can contain prosodies i.e. (laugh) (giggles) (malefic laugh) (toss) (music)… Default value is false.", + "example": false }, - { - "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" - } + "audioEnhancer": { + "type": "boolean", + "description": "If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false.", + "example": false }, - { - "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" - } + "confidenceThreshold": { + "type": "number", + "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", + "minimum": 0, + "maximum": 1, + "example": 0.4 }, - { - "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" - } + "endpointing": { + "type": "number", + "minimum": 0.01, + "maximum": 10, + "example": 0.05, + "description": "Endpointing time in seconds - time to wait before considering speech ended" }, - { - "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" - } + "speechThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "example": 0.6, + "description": "Speech threshold - sensitivity configuration for speech detection (0.0 to 1.0)" }, - { - "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" - } + "customVocabularyEnabled": { + "type": "boolean", + "example": false, + "description": "Enable custom vocabulary for improved accuracy" }, - { - "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" - } + "customVocabularyConfig": { + "description": "Custom vocabulary configuration", + "allOf": [ + { + "$ref": "#/components/schemas/GladiaCustomVocabularyConfigDTO" + } + ] }, - { - "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" - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } + ] } }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] - } - }, - "/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": [ - "11labs" - ], - "type": "string" - } + }, + "SpeechmaticsTranscriber": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "speechmatics" + ] }, - { - "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": { - "200": { - "description": "Successfully retrieved provider resource", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderResource" - } - } - } - }, - "404": { - "description": "Provider resource not found" - } - }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "delete": { - "operationId": "ProviderResourceController_deleteProviderResource", - "summary": "Delete 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" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderResource" - } - } - } - }, - "404": { - "description": "Provider resource not found" - } - }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "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" - } + "model": { + "type": "string", + "description": "This is the model that will be used for the transcription.", + "enum": [ + "default" + ] }, - { - "name": "resourceName", - "required": true, - "in": "path", - "description": "The resource name (e.g., pronunciation-dictionary)", - "schema": { - "enum": [ - "pronunciation-dictionary" - ], - "type": "string" - } + "language": { + "type": "string", + "enum": [ + "auto", + "ar", + "ba", + "eu", + "be", + "bn", + "bg", + "yue", + "ca", + "hr", + "cs", + "da", + "nl", + "en", + "eo", + "et", + "fi", + "fr", + "gl", + "de", + "el", + "he", + "hi", + "hu", + "id", + "ia", + "ga", + "it", + "ja", + "ko", + "lv", + "lt", + "ms", + "mt", + "cmn", + "mr", + "mn", + "no", + "fa", + "pl", + "pt", + "ro", + "ru", + "sk", + "sl", + "es", + "sw", + "sv", + "ta", + "th", + "tr", + "uk", + "ur", + "ug", + "vi", + "cy" + ] }, - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "format": "uuid", - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderResource" - } + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", + "allOf": [ + { + "$ref": "#/components/schemas/FallbackTranscriberPlan" } - } - }, - "404": { - "description": "Provider resource not found" + ] } }, - "tags": [ - "Provider Resources" - ], - "security": [ - { - "bearer": [] - } + "required": [ + "provider" ] - } - } - }, - "info": { - "title": "Vapi API", - "description": "Voice AI for developers.", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [ - { - "url": "https://api.vapi.ai" - } - ], - "components": { - "securitySchemes": { - "bearer": { - "scheme": "bearer", - "bearerFormat": "Bearer", - "type": "http", - "description": "Retrieve your API Key from [Dashboard](dashboard.vapi.ai)." - } - }, - "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": { + "TalkscriberTranscriber": { "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." + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "talkscriber" + ] }, - "llmCompletionTokens": { - "type": "number", - "description": "This is the LLM completion tokens used for the call." + "model": { + "type": "string", + "description": "This is the model that will be used for the transcription.", + "enum": [ + "whisper" + ] }, - "ttsCharacters": { - "type": "number", - "description": "This is the TTS characters used for the call." + "language": { + "type": "string", + "description": "This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py", + "enum": [ + "en", + "zh", + "de", + "es", + "ru", + "ko", + "fr", + "ja", + "pt", + "tr", + "pl", + "ca", + "nl", + "ar", + "sv", + "it", + "id", + "hi", + "fi", + "vi", + "he", + "uk", + "el", + "ms", + "cs", + "ro", + "da", + "hu", + "ta", + "no", + "th", + "ur", + "hr", + "bg", + "lt", + "la", + "mi", + "ml", + "cy", + "sk", + "te", + "fa", + "lv", + "bn", + "sr", + "az", + "sl", + "kn", + "et", + "mk", + "br", + "eu", + "is", + "hy", + "ne", + "mn", + "bs", + "kk", + "sq", + "sw", + "gl", + "mr", + "pa", + "si", + "km", + "sn", + "yo", + "so", + "af", + "oc", + "ka", + "be", + "tg", + "sd", + "gu", + "am", + "yi", + "lo", + "uz", + "fo", + "ht", + "ps", + "tk", + "nn", + "mt", + "sa", + "lb", + "my", + "bo", + "tl", + "mg", + "as", + "tt", + "haw", + "ln", + "ha", + "ba", + "jw", + "su", + "yue" + ] }, - "analysisCostBreakdown": { - "description": "This is the cost of the analysis.", + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ { - "$ref": "#/components/schemas/AnalysisCostBreakdown" + "$ref": "#/components/schemas/FallbackTranscriberPlan" } ] } - } - }, - "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'" - } - } + }, + "required": [ + "provider" + ] }, - "ArtifactPlan": { + "GoogleTranscriber": { "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": { + "provider": { "type": "string", - "description": "This determines the format of the recording. Defaults to `wav;l16`.\n\n@default 'wav;l16'", + "description": "This is the transcription provider that will be used.", "enum": [ - "wav;l16", - "mp3" + "google" ] }, - "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": { + "model": { "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" + "description": "This is the model that will be used for the transcription.", + "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" + ] }, - "loggingEnabled": { - "type": "boolean", - "description": "This determines whether the call logs are enabled. Defaults to true.\n\n@default true", - "example": true + "language": { + "type": "string", + "description": "This is the language that will be set for the transcription.", + "enum": [ + "Multilingual", + "Arabic", + "Bengali", + "Bulgarian", + "Chinese", + "Croatian", + "Czech", + "Danish", + "Dutch", + "English", + "Estonian", + "Finnish", + "French", + "German", + "Greek", + "Hebrew", + "Hindi", + "Hungarian", + "Indonesian", + "Italian", + "Japanese", + "Korean", + "Latvian", + "Lithuanian", + "Norwegian", + "Polish", + "Portuguese", + "Romanian", + "Russian", + "Serbian", + "Slovak", + "Slovenian", + "Spanish", + "Swahili", + "Swedish", + "Thai", + "Turkish", + "Ukrainian", + "Vietnamese" + ] }, - "transcriptPlan": { - "description": "This is the plan for `call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.", + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ { - "$ref": "#/components/schemas/TranscriptPlan" + "$ref": "#/components/schemas/FallbackTranscriberPlan" } ] - }, - "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" + "provider" ] }, - "Mono": { + "OpenAITranscriber": { "type": "object", "properties": { - "combinedUrl": { - "type": "string", - "description": "This is the combined recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." - }, - "assistantUrl": { + "provider": { "type": "string", - "description": "This is the mono recording url for the assistant. To enable, set `assistant.artifactPlan.recordingEnabled`." + "description": "This is the transcription provider that will be used.", + "enum": [ + "openai" + ] }, - "customerUrl": { - "type": "string", - "description": "This is the mono recording url for the customer. To enable, set `assistant.artifactPlan.recordingEnabled`." - } - } - }, - "Recording": { - "type": "object", - "properties": { - "stereoUrl": { + "model": { "type": "string", - "description": "This is the stereo recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`." + "description": "This is the model that will be used for the transcription.", + "enum": [ + "gpt-4o-transcribe", + "gpt-4o-mini-transcribe" + ] }, - "videoUrl": { + "language": { "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." + "description": "This is the language that will be set for the transcription.", + "enum": [ + "af", + "ar", + "hy", + "az", + "be", + "bs", + "bg", + "ca", + "zh", + "hr", + "cs", + "da", + "nl", + "en", + "et", + "fi", + "fr", + "gl", + "de", + "el", + "he", + "hi", + "hu", + "is", + "id", + "it", + "ja", + "kn", + "kk", + "ko", + "lv", + "lt", + "mk", + "ms", + "mr", + "mi", + "ne", + "no", + "fa", + "pl", + "pt", + "ro", + "ru", + "sr", + "sk", + "sl", + "es", + "sw", + "sv", + "tl", + "ta", + "th", + "tr", + "uk", + "ur", + "vi", + "cy" + ] }, - "mono": { - "description": "This is the mono recording url for the call. To enable, set `assistant.artifactPlan.recordingEnabled`.", + "fallbackPlan": { + "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", "allOf": [ { - "$ref": "#/components/schemas/Mono" + "$ref": "#/components/schemas/FallbackTranscriberPlan" } ] } - } + }, + "required": [ + "provider", + "model" + ] }, - "NodeArtifact": { + "FallbackAssemblyAITranscriber": { "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" - } - ] - } + "provider": { + "type": "string", + "description": "This is the transcription provider that will be used.", + "enum": [ + "assembly-ai" + ] }, - "nodeName": { + "language": { "type": "string", - "description": "This is the node name." + "description": "This is the language that will be set for the transcription.", + "enum": [ + "en" + ] }, - "variableValues": { - "type": "object", - "description": "These are the variable values that were extracted from the node." - } - } - }, - "TurnLatency": { - "type": "object", - "properties": { - "modelLatency": { + "confidenceThreshold": { "type": "number", - "description": "This is the model latency for the first token." + "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", + "minimum": 0, + "maximum": 1, + "example": 0.4 }, - "voiceLatency": { - "type": "number", - "description": "This is the voice latency from the model output." + "formatTurns": { + "type": "boolean", + "description": "This enables formatting of transcripts.\n\n@default true", + "example": true }, - "transcriberLatency": { + "endOfTurnConfidenceThreshold": { "type": "number", - "description": "This is the transcriber latency from the user speech." + "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", + "minimum": 0, + "maximum": 1, + "example": 0.7 }, - "endpointingLatency": { + "minEndOfTurnSilenceWhenConfident": { "type": "number", - "description": "This is the endpointing latency." + "description": "This is the minimum end of turn silence when confident in milliseconds.\n\n@default 160", + "minimum": 0, + "example": 160 }, - "turnLatency": { + "wordFinalizationMaxWaitTime": { "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" - } + "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", + "minimum": 0, + "example": 160 }, - "modelLatencyAverage": { + "maxTurnSilence": { "type": "number", - "description": "This is the average latency for the model to output the first token." + "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", + "minimum": 0, + "example": 400 }, - "voiceLatencyAverage": { - "type": "number", - "description": "This is the average latency for the text to speech." + "realtimeUrl": { + "type": "string", + "description": "The WebSocket URL that the transcriber connects to." }, - "transcriberLatencyAverage": { - "type": "number", - "description": "This is the average latency for the transcriber." + "wordBoost": { + "description": "Add up to 2500 characters of custom vocabulary.", + "type": "array", + "items": { + "type": "string", + "maxLength": 2500 + } }, - "endpointingLatencyAverage": { + "endUtteranceSilenceThreshold": { "type": "number", - "description": "This is the average latency for the endpointing." + "description": "The duration of the end utterance silence threshold in milliseconds." }, - "turnLatencyAverage": { - "type": "number", - "description": "This is the average latency for complete turns." + "disablePartialTranscripts": { + "type": "boolean", + "description": "Disable partial transcripts.\nSet to `true` to not receive partial transcripts. Defaults to `false`." } - } + }, + "required": [ + "provider" + ] }, - "Artifact": { + "FallbackAzureSpeechTranscriber": { "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": { + "provider": { "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" - } + "description": "This is the transcription provider that will be used.", + "enum": [ + "azure" ] }, - "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": { - "type": "object", - "properties": { - "transcribers": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/FallbackAssemblyAITranscriber", - "title": "AssemblyAI" - }, - { - "$ref": "#/components/schemas/FallbackAzureSpeechTranscriber", - "title": "Azure" - }, - { - "$ref": "#/components/schemas/FallbackCustomTranscriber", - "title": "Custom" - }, - { - "$ref": "#/components/schemas/FallbackDeepgramTranscriber", - "title": "Deepgram" - }, - { - "$ref": "#/components/schemas/FallbackElevenLabsTranscriber", - "title": "ElevenLabs" - }, - { - "$ref": "#/components/schemas/FallbackGladiaTranscriber", - "title": "Gladia" - }, - { - "$ref": "#/components/schemas/FallbackGoogleTranscriber", - "title": "Google" - }, - { - "$ref": "#/components/schemas/FallbackTalkscriberTranscriber", - "title": "Talkscriber" - }, - { - "$ref": "#/components/schemas/FallbackSpeechmaticsTranscriber", - "title": "Speechmatics" - }, - { - "$ref": "#/components/schemas/FallbackOpenAITranscriber", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/FallbackCartesiaTranscriber", - "title": "Cartesia" - } - ] - } - } - }, - "required": [ - "transcribers" - ] - }, - "AssemblyAITranscriber": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "assembly-ai" - ] - }, - "language": { - "type": "string", - "description": "This is the language that will be set for the transcription.", - "enum": [ - "en" - ] - }, - "confidenceThreshold": { - "type": "number", - "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", - "minimum": 0, - "maximum": 1, - "example": 0.4 - }, - "formatTurns": { - "type": "boolean", - "description": "This enables formatting of transcripts.\n\n@default true", - "example": true - }, - "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", - "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", - "minimum": 0, - "example": 160 - }, - "wordFinalizationMaxWaitTime": { - "type": "number", - "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", - "minimum": 0, - "example": 160 - }, - "maxTurnSilence": { - "type": "number", - "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", - "minimum": 0, - "example": 400 - }, - "realtimeUrl": { - "type": "string", - "description": "The WebSocket URL that the transcriber connects to." - }, - "wordBoost": { - "description": "Add up to 2500 characters of custom vocabulary.", - "type": "array", - "items": { - "type": "string", - "maxLength": 2500 - } - }, - "endUtteranceSilenceThreshold": { - "type": "number", - "description": "The duration of the end utterance silence threshold in milliseconds." - }, - "disablePartialTranscripts": { - "type": "boolean", - "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.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] - } - }, - "required": [ - "provider" - ] - }, - "AzureSpeechTranscriber": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "azure" - ] - }, - "language": { + "language": { "type": "string", "description": "This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt", "enum": [ @@ -7070,21 +6443,13 @@ "description": "Maximum duration a segment can reach before being cut off when using time-based segmentation.", "minimum": 20000, "maximum": 70000 - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "CartesiaTranscriber": { + "FallbackCartesiaTranscriber": { "type": "object", "properties": { "provider": { @@ -7288,95 +6653,13 @@ "zh", "zu" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "BackoffPlan": { - "type": "object", - "properties": { - "type": { - "type": "object", - "description": "This is the type of backoff plan to use. Defaults to fixed.\n\n@default fixed", - "enum": [ - "fixed", - "exponential" - ], - "example": "fixed" - }, - "maxRetries": { - "type": "number", - "description": "This is the maximum number of retries to attempt if the request fails. Defaults to 0 (no retries).\n\n@default 0", - "minimum": 0, - "maximum": 10, - "example": 0 - }, - "baseDelaySeconds": { - "type": "number", - "description": "This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay.", - "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": [ - "type", - "maxRetries", - "baseDelaySeconds" - ] - }, - "Server": { - "type": "object", - "properties": { - "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 - }, - "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." - }, - "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" - } - ] - } - } - }, - "CustomTranscriber": { + "FallbackCustomTranscriber": { "type": "object", "properties": { "provider": { @@ -7393,14 +6676,6 @@ "$ref": "#/components/schemas/Server" } ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ @@ -7408,7 +6683,7 @@ "server" ] }, - "DeepgramTranscriber": { + "FallbackDeepgramTranscriber": { "type": "object", "properties": { "provider": { @@ -7592,21 +6867,13 @@ "description": "This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing.\n\nHere are the most important bits:\n- Defaults to 10. This is recommended for most use cases to optimize for latency.\n- 10 can cause some missing transcriptions since because of the shorter context. This mostly happens for one-word utterances. For those uses cases, it's recommended to try 300. It will add a bit of latency but the quality and reliability of the experience will be better.\n- If neither 10 nor 300 work, contact support@vapi.ai and we'll find another solution.\n\n@default 10", "minimum": 10, "maximum": 500 - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "ElevenLabsTranscriber": { + "FallbackElevenLabsTranscriber": { "type": "object", "properties": { "provider": { @@ -7812,50 +7079,42 @@ "zh", "zu" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "GladiaCustomVocabularyConfigDTO": { + "GladiaVocabularyItemDTO": { "type": "object", "properties": { - "vocabulary": { + "value": { + "type": "string", + "description": "The vocabulary word or phrase" + }, + "pronunciations": { + "description": "Alternative pronunciations for the vocabulary item", "type": "array", - "description": "Array of vocabulary items (strings or objects with value, pronunciations, intensity, language)", "items": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/GladiaVocabularyItemDTO" - } - ] + "type": "string" } }, - "defaultIntensity": { + "intensity": { "type": "number", "minimum": 0, "maximum": 1, - "description": "Default intensity for vocabulary items (0.0 to 1.0)", - "default": 0.5 + "description": "Intensity for this specific vocabulary item (0.0 to 1.0)" + }, + "language": { + "type": "string", + "description": "Language code for this vocabulary item (ISO 639-1)" } }, "required": [ - "vocabulary" + "value" ] }, - "GladiaTranscriber": { + "FallbackGladiaTranscriber": { "type": "object", "properties": { "provider": { @@ -8149,21 +7408,13 @@ "$ref": "#/components/schemas/GladiaCustomVocabularyConfigDTO" } ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "SpeechmaticsTranscriber": { + "FallbackSpeechmaticsTranscriber": { "type": "object", "properties": { "provider": { @@ -8240,21 +7491,13 @@ "vi", "cy" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "TalkscriberTranscriber": { + "FallbackTalkscriberTranscriber": { "type": "object", "properties": { "provider": { @@ -8376,21 +7619,13 @@ "su", "yue" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "GoogleTranscriber": { + "FallbackGoogleTranscriber": { "type": "object", "properties": { "provider": { @@ -8464,21 +7699,13 @@ "Ukrainian", "Vietnamese" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ "provider" ] }, - "OpenAITranscriber": { + "FallbackOpenAITranscriber": { "type": "object", "properties": { "provider": { @@ -8558,14 +7785,6 @@ "vi", "cy" ] - }, - "fallbackPlan": { - "description": "This is the plan for voice provider fallbacks in the event that the primary voice provider fails.", - "allOf": [ - { - "$ref": "#/components/schemas/FallbackTranscriberPlan" - } - ] } }, "required": [ @@ -8573,284 +7792,43 @@ "model" ] }, - "FallbackAssemblyAITranscriber": { + "LangfuseObservabilityPlan": { "type": "object", "properties": { "provider": { "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "assembly-ai" - ] - }, - "language": { - "type": "string", - "description": "This is the language that will be set for the transcription.", "enum": [ - "en" + "langfuse" ] }, - "confidenceThreshold": { - "type": "number", - "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", - "minimum": 0, - "maximum": 1, - "example": 0.4 - }, - "formatTurns": { - "type": "boolean", - "description": "This enables formatting of transcripts.\n\n@default true", - "example": true - }, - "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", - "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", - "minimum": 0, - "example": 160 - }, - "wordFinalizationMaxWaitTime": { - "type": "number", - "description": "This is the maximum wait time for word finalization in milliseconds.\n\n@default 160", - "minimum": 0, - "example": 160 - }, - "maxTurnSilence": { - "type": "number", - "description": "This is the maximum turn silence time in milliseconds.\n\n@default 400", - "minimum": 0, - "example": 400 - }, - "realtimeUrl": { - "type": "string", - "description": "The WebSocket URL that the transcriber connects to." - }, - "wordBoost": { - "description": "Add up to 2500 characters of custom vocabulary.", + "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", "items": { - "type": "string", - "maxLength": 2500 + "type": "string" } }, - "endUtteranceSilenceThreshold": { - "type": "number", - "description": "The duration of the end utterance silence threshold in milliseconds." - }, - "disablePartialTranscripts": { - "type": "boolean", - "description": "Disable partial transcripts.\nSet to `true` to not receive partial transcripts. Defaults to `false`." - } - }, - "required": [ - "provider" - ] - }, - "FallbackAzureSpeechTranscriber": { - "type": "object", - "properties": { - "provider": { - "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "azure" - ] - }, - "language": { - "type": "string", - "description": "This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt", - "enum": [ - "af-ZA", - "am-ET", - "ar-AE", - "ar-BH", - "ar-DZ", - "ar-EG", - "ar-IL", - "ar-IQ", - "ar-JO", - "ar-KW", - "ar-LB", - "ar-LY", - "ar-MA", - "ar-OM", - "ar-PS", - "ar-QA", - "ar-SA", - "ar-SY", - "ar-TN", - "ar-YE", - "az-AZ", - "bg-BG", - "bn-IN", - "bs-BA", - "ca-ES", - "cs-CZ", - "cy-GB", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AU", - "en-CA", - "en-GB", - "en-GH", - "en-HK", - "en-IE", - "en-IN", - "en-KE", - "en-NG", - "en-NZ", - "en-PH", - "en-SG", - "en-TZ", - "en-US", - "en-ZA", - "es-AR", - "es-BO", - "es-CL", - "es-CO", - "es-CR", - "es-CU", - "es-DO", - "es-EC", - "es-ES", - "es-GQ", - "es-GT", - "es-HN", - "es-MX", - "es-NI", - "es-PA", - "es-PE", - "es-PR", - "es-PY", - "es-SV", - "es-US", - "es-UY", - "es-VE", - "et-EE", - "eu-ES", - "fa-IR", - "fi-FI", - "fil-PH", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "ga-IE", - "gl-ES", - "gu-IN", - "he-IL", - "hi-IN", - "hr-HR", - "hu-HU", - "hy-AM", - "id-ID", - "is-IS", - "it-CH", - "it-IT", - "ja-JP", - "jv-ID", - "ka-GE", - "kk-KZ", - "km-KH", - "kn-IN", - "ko-KR", - "lo-LA", - "lt-LT", - "lv-LV", - "mk-MK", - "ml-IN", - "mn-MN", - "mr-IN", - "ms-MY", - "mt-MT", - "my-MM", - "nb-NO", - "ne-NP", - "nl-BE", - "nl-NL", - "pa-IN", - "pl-PL", - "ps-AF", - "pt-BR", - "pt-PT", - "ro-RO", - "ru-RU", - "si-LK", - "sk-SK", - "sl-SI", - "so-SO", - "sq-AL", - "sr-RS", - "sv-SE", - "sw-KE", - "sw-TZ", - "ta-IN", - "te-IN", - "th-TH", - "tr-TR", - "uk-UA", - "ur-IN", - "uz-UZ", - "vi-VN", - "wuu-CN", - "yue-CN", - "zh-CN", - "zh-CN-shandong", - "zh-CN-sichuan", - "zh-HK", - "zh-TW", - "zu-ZA" - ] - }, - "segmentationStrategy": { - "type": "string", - "description": "Controls how phrase boundaries are detected, enabling either simple time/silence heuristics or more advanced semantic segmentation.", - "enum": [ - "Default", - "Time", - "Semantic" - ] - }, - "segmentationSilenceTimeoutMs": { - "type": "number", - "description": "Duration of detected silence after which the service finalizes a phrase. Configure to adjust sensitivity to pauses in speech.", - "minimum": 100, - "maximum": 5000 - }, - "segmentationMaximumTimeMs": { - "type": "number", - "description": "Maximum duration a segment can reach before being cut off when using time-based segmentation.", - "minimum": 20000, - "maximum": 70000 + "metadata": { + "type": "object", + "description": "This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. https://langfuse.com/docs/tracing-features/metadata\nBy default it includes the call metadata, assistant metadata, and assistant overrides." } }, "required": [ - "provider" + "provider", + "tags" ] }, - "FallbackCartesiaTranscriber": { + "TextContent": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", "enum": [ - "cartesia" + "text" ] }, - "model": { - "type": "string", - "enum": [ - "ink-whisper" - ] + "text": { + "type": "string" }, "language": { "type": "string", @@ -9044,1420 +8022,772 @@ } }, "required": [ - "provider" + "type", + "text", + "language" ] }, - "FallbackCustomTranscriber": { + "Condition": { "type": "object", "properties": { - "provider": { + "operator": { "type": "string", - "description": "This is the transcription provider that will be used. Use `custom-transcriber` for providers that are not natively supported.", + "description": "This is the operator you want to use to compare the parameter and value.", "enum": [ - "custom-transcriber" + "eq", + "neq", + "gt", + "gte", + "lt", + "lte" ] }, - "server": { - "description": "This is where the transcription request will be sent.\n\nUsage:\n1. Vapi will initiate a websocket connection with `server.url`.\n\n2. Vapi will send an initial text frame with the sample rate. Format:\n```\n {\n \"type\": \"start\",\n \"encoding\": \"linear16\", // 16-bit raw PCM format\n \"container\": \"raw\",\n \"sampleRate\": {{sampleRate}},\n \"channels\": 2 // customer is channel 0, assistant is channel 1\n }\n```\n\n3. Vapi will send the audio data in 16-bit raw PCM format as binary frames.\n\n4. You can read the messages something like this:\n```\nws.on('message', (data, isBinary) => {\n if (isBinary) {\n pcmBuffer = Buffer.concat([pcmBuffer, data]);\n console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`);\n } else {\n console.log('Received message:', JSON.parse(data.toString()));\n }\n});\n```\n\n5. You will respond with transcriptions as you have them. Format:\n```\n {\n \"type\": \"transcriber-response\",\n \"transcription\": \"Hello, world!\",\n \"channel\": \"customer\" | \"assistant\"\n }\n```", - "allOf": [ - { - "$ref": "#/components/schemas/Server" - } - ] + "param": { + "type": "string", + "description": "This is the name of the parameter that you want to check.", + "maxLength": 1000 + }, + "value": { + "type": "string", + "description": "This is the value you want to compare against the parameter.", + "maxLength": 1000 } }, "required": [ - "provider", - "server" + "operator", + "param", + "value" ] }, - "FallbackDeepgramTranscriber": { + "ToolMessageStart": { "type": "object", "properties": { - "provider": { - "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "deepgram" - ] - }, - "model": { - "description": "This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview", - "oneOf": [ - { - "type": "string", - "enum": [ - "nova-3", - "nova-3-general", - "nova-3-medical", - "nova-2", - "nova-2-general", - "nova-2-meeting", - "nova-2-phonecall", - "nova-2-finance", - "nova-2-conversationalai", - "nova-2-voicemail", - "nova-2-video", - "nova-2-medical", - "nova-2-drivethru", - "nova-2-automotive", - "nova", - "nova-general", - "nova-phonecall", - "nova-medical", - "enhanced", - "enhanced-general", - "enhanced-meeting", - "enhanced-phonecall", - "enhanced-finance", - "base", - "base-general", - "base-meeting", - "base-phonecall", - "base-finance", - "base-conversationalai", - "base-voicemail", - "base-video", - "whisper" - ] - }, - { - "type": "string" - } - ] + "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" + } + ] + } }, - "language": { + "type": { "type": "string", - "description": "This is the language that will be set for the transcription. The list of languages Deepgram supports can be found here: https://developers.deepgram.com/docs/models-languages-overview", "enum": [ - "ar", - "az", - "ba", - "bg", - "br", - "ca", - "cs", - "da", - "da-DK", - "de", - "de-CH", - "el", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-US", - "es", - "es-419", - "es-LATAM", - "et", - "eu", - "fi", - "fr", - "fr-CA", - "ha", - "haw", - "he", - "hi", - "hi-Latn", - "hu", - "id", - "is", - "it", - "ja", - "jw", - "kn", - "ko", - "ko-KR", - "ln", - "lt", - "lv", - "mk", - "ms", - "multi", - "nl", - "nl-BE", - "no", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sn", - "so", - "sr", - "su", - "sv", - "sv-SE", - "ta", - "taq", - "th", - "th-TH", - "tr", - "tt", - "uk", - "ur", - "vi", - "yo", - "zh", - "zh-CN", - "zh-HK", - "zh-Hans", - "zh-Hant", - "zh-TW" - ] - }, - "smartFormat": { - "type": "boolean", - "description": "This will be use smart format option provided by Deepgram. It's default disabled because it can sometimes format numbers as times but it's getting better.", - "example": false + "request-start" + ], + "description": "This message is triggered when the tool call starts.\n\nThis message is never triggered for async tools.\n\nIf this message is not provided, one of the default filler messages \"Hold on a sec\", \"One moment\", \"Just a sec\", \"Give me a moment\" or \"This'll just take a sec\" will be used." }, - "mipOptOut": { + "blocking": { "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", + "description": "This is an optional boolean that if true, the tool call will only trigger after the message is spoken. Default is false.\n\n@default false", "example": false, "default": false }, - "numerals": { - "type": "boolean", - "description": "If set to true, this will cause deepgram to convert spoken numbers to literal numerals. For example, \"my phone number is nine-seven-two...\" would become \"my phone number is 972...\"\n\n@default false", - "example": false - }, - "confidenceThreshold": { - "type": "number", - "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", - "minimum": 0, - "maximum": 1, - "example": 0.4 - }, - "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", - "items": { - "type": "string", - "pattern": "/^\\p{L}[\\p{L}\\d]*(?::[+-]?\\d+)?$/u" - } + "content": { + "type": "string", + "description": "This is the content that the assistant says when this message is triggered.", + "maxLength": 1000 }, - "keyterm": { - "description": "Keyterm Prompting allows you improve Keyword Recall Rate (KRR) for important keyterms or phrases up to 90%.", + "conditions": { + "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Condition" } - }, - "endpointing": { - "type": "number", - "description": "This is the timeout after which Deepgram will send transcription on user silence. You can read in-depth documentation here: https://developers.deepgram.com/docs/endpointing.\n\nHere are the most important bits:\n- Defaults to 10. This is recommended for most use cases to optimize for latency.\n- 10 can cause some missing transcriptions since because of the shorter context. This mostly happens for one-word utterances. For those uses cases, it's recommended to try 300. It will add a bit of latency but the quality and reliability of the experience will be better.\n- If neither 10 nor 300 work, contact support@vapi.ai and we'll find another solution.\n\n@default 10", - "minimum": 10, - "maximum": 500 } }, "required": [ - "provider" + "type" ] }, - "FallbackElevenLabsTranscriber": { + "ToolMessageComplete": { "type": "object", "properties": { - "provider": { + "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 the transcription provider that will be used.", + "description": "This message is triggered when the tool call is complete.\n\nThis message is triggered immediately without waiting for your server to respond for async tool calls.\n\nIf this message is not provided, the model will be requested to respond.\n\nIf this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.", "enum": [ - "11labs" + "request-complete" ] }, - "model": { + "role": { "type": "string", - "description": "This is the model that will be used for the transcription.", + "description": "This is optional and defaults to \"assistant\".\n\nWhen role=assistant, `content` is said out loud.\n\nWhen role=system, `content` is passed to the model in a system message. Example:\n system: default one\n assistant:\n user:\n assistant:\n user:\n assistant:\n user:\n assistant: tool called\n tool: your server response\n <--- system prompt as hint\n ---> model generates response which is spoken\nThis is useful when you want to provide a hint to the model about what to say next.", "enum": [ - "scribe_v1" + "assistant", + "system" ] }, - "language": { + "endCallAfterSpokenEnabled": { + "type": "boolean", + "description": "This is an optional boolean that if true, the call will end after the message is spoken. Default is false.\n\nThis is ignored if `role` is set to `system`.\n\n@default false", + "example": false + }, + "content": { "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": "This is the content that the assistant says when this message is triggered.", + "maxLength": 1000 + }, + "conditions": { + "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } } }, "required": [ - "provider" + "type" ] }, - "GladiaVocabularyItemDTO": { + "ToolMessageFailed": { "type": "object", "properties": { - "value": { - "type": "string", - "description": "The vocabulary word or phrase" - }, - "pronunciations": { - "description": "Alternative pronunciations for the vocabulary item", + "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": { - "type": "string" + "oneOf": [ + { + "$ref": "#/components/schemas/TextContent", + "title": "Text" + } + ] } }, - "intensity": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Intensity for this specific vocabulary item (0.0 to 1.0)" + "type": { + "type": "string", + "description": "This message is triggered when the tool call fails.\n\nThis message is never triggered for async tool calls.\n\nIf this message is not provided, the model will be requested to respond.\n\nIf this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.", + "enum": [ + "request-failed" + ] }, - "language": { + "endCallAfterSpokenEnabled": { + "type": "boolean", + "description": "This is an optional boolean that if true, the call will end after the message is spoken. Default is false.\n\n@default false", + "example": false + }, + "content": { "type": "string", - "description": "Language code for this vocabulary item (ISO 639-1)" + "description": "This is the content that the assistant says when this message is triggered.", + "maxLength": 1000 + }, + "conditions": { + "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } } }, "required": [ - "value" + "type" ] }, - "FallbackGladiaTranscriber": { + "ToolMessageDelayed": { "type": "object", "properties": { - "provider": { + "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 the transcription provider that will be used.", + "description": "This message is triggered when the tool call is delayed.\n\nThere are the two things that can trigger this message:\n1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\"\n2. The server doesn't respond within `timingMilliseconds`.\n\nThis message is never triggered for async tool calls.", "enum": [ - "gladia" + "request-response-delayed" ] }, - "model": { - "description": "This is the Gladia model that will be used. Default is 'fast'", - "oneOf": [ - { - "enum": [ - "fast", - "accurate", - "solaria-1" - ] - } - ] + "timingMilliseconds": { + "type": "number", + "minimum": 100, + "maximum": 120000, + "example": 1000, + "description": "The number of milliseconds to wait for the server response before saying this message." }, - "languageBehaviour": { - "description": "Defines how the transcription model detects the audio language. Default value is 'automatic single language'.", - "oneOf": [ - { - "type": "string", - "enum": [ - "manual", - "automatic single language", - "automatic multiple languages" - ] - } - ] + "content": { + "type": "string", + "description": "This is the content that the assistant says when this message is triggered.", + "maxLength": 1000 }, - "language": { + "conditions": { + "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } + } + }, + "required": [ + "type" + ] + }, + "MessageTarget": { + "type": "object", + "properties": { + "role": { "type": "string", - "description": "Defines the language to use for the transcription. Required when languageBehaviour is 'manual'.", + "description": "This is the role of the message to target.\n\nIf not specified, will find the position in the message history ignoring role (effectively `any`).", + "example": "user", "enum": [ - "af", - "sq", - "am", - "ar", - "hy", - "as", - "az", - "ba", - "eu", - "be", - "bn", - "bs", - "br", - "bg", - "ca", - "zh", - "hr", - "cs", - "da", - "nl", - "en", - "et", - "fo", - "fi", - "fr", - "gl", - "ka", - "de", - "el", - "gu", - "ht", - "ha", - "haw", - "he", - "hi", - "hu", - "is", - "id", - "it", - "ja", - "jv", - "kn", - "kk", - "km", - "ko", - "lo", - "la", - "lv", - "ln", - "lt", - "lb", - "mk", - "mg", - "ms", - "ml", - "mt", - "mi", - "mr", - "mn", - "my", - "ne", - "no", - "nn", - "oc", - "ps", - "fa", - "pl", - "pt", - "pa", - "ro", - "ru", - "sa", - "sr", - "sn", - "sd", - "si", - "sk", - "sl", - "so", - "es", - "su", - "sw", - "sv", - "tl", - "tg", - "ta", - "tt", - "te", - "th", - "bo", - "tr", - "tk", - "uk", - "ur", - "uz", - "vi", - "cy", - "yi", - "yo" + "user", + "assistant" ] }, - "languages": { + "position": { + "type": "number", + "description": "This is the position of the message to target.\n- Negative numbers: Count from end (-1 = most recent, -2 = second most recent)\n- 0: First/oldest message in history\n- Positive numbers: Specific position (0-indexed from start)\n\n@default -1 (most recent message)", + "example": -1 + } + } + }, + "RegexCondition": { + "type": "object", + "properties": { + "type": { "type": "string", - "description": "Defines the languages to use for the transcription. Required when languageBehaviour is 'manual'.", + "description": "This is the type discriminator for regex condition", + "example": "regex", "enum": [ - "af", - "sq", - "am", - "ar", - "hy", - "as", - "az", - "ba", - "eu", - "be", - "bn", - "bs", - "br", - "bg", - "ca", - "zh", - "hr", - "cs", - "da", - "nl", - "en", - "et", - "fo", - "fi", - "fr", - "gl", - "ka", - "de", - "el", - "gu", - "ht", - "ha", - "haw", - "he", - "hi", - "hu", - "is", - "id", - "it", - "ja", - "jv", - "kn", - "kk", - "km", - "ko", - "lo", - "la", - "lv", - "ln", - "lt", - "lb", - "mk", - "mg", - "ms", - "ml", - "mt", - "mi", - "mr", - "mn", - "my", - "ne", - "no", - "nn", - "oc", - "ps", - "fa", - "pl", - "pt", - "pa", - "ro", - "ru", - "sa", - "sr", - "sn", - "sd", - "si", - "sk", - "sl", - "so", - "es", - "su", - "sw", - "sv", - "tl", - "tg", - "ta", - "tt", - "te", - "th", - "bo", - "tr", - "tk", - "uk", - "ur", - "uz", - "vi", - "cy", - "yi", - "yo" + "regex" ] }, - "transcriptionHint": { + "regex": { "type": "string", - "description": "Provides a custom vocabulary to the model to improve accuracy of transcribing context specific words, technical terms, names, etc. If empty, this argument is ignored.\n⚠️ Warning ⚠️: Please be aware that the transcription_hint field has a character limit of 600. If you provide a transcription_hint longer than 600 characters, it will be automatically truncated to meet this limit.", - "maxLength": 600, - "example": "custom vocabulary" - }, - "prosody": { - "type": "boolean", - "description": "If prosody is true, you will get a transcription that can contain prosodies i.e. (laugh) (giggles) (malefic laugh) (toss) (music)… Default value is false.", - "example": false - }, - "audioEnhancer": { - "type": "boolean", - "description": "If true, audio will be pre-processed to improve accuracy but latency will increase. Default value is false.", - "example": false - }, - "confidenceThreshold": { - "type": "number", - "description": "Transcripts below this confidence threshold will be discarded.\n\n@default 0.4", - "minimum": 0, - "maximum": 1, - "example": 0.4 - }, - "endpointing": { - "type": "number", - "minimum": 0.01, - "maximum": 10, - "example": 0.05, - "description": "Endpointing time in seconds - time to wait before considering speech ended" - }, - "speechThreshold": { - "type": "number", - "minimum": 0, - "maximum": 1, - "example": 0.6, - "description": "Speech threshold - sensitivity configuration for speech detection (0.0 to 1.0)" - }, - "customVocabularyEnabled": { - "type": "boolean", - "example": false, - "description": "Enable custom vocabulary for improved accuracy" + "description": "This is the regular expression pattern to match against message content.\n\nNote:\n- This works by using the RegExp.test method in Node.JS. Eg. /hello/.test(\"hello there\") will return true.\n\nHot tips:\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, use anchors: /^cat$/ will only match exactly \"cat\".\n- Word boundaries \\b are useful for matching whole words: /\\bcat\\b/ matches \"cat\" but not \"cats\" or \"category\".\n- Use inline flags for portability: (?i) for case insensitive, (?m) for multiline", + "examples": [ + "\\\\b(cancel|stop|wait)\\\\b - Matches whole words", + "^yes$ - Matches exactly yes (full string match)", + "(?i)hello - Case insensitive match" + ] }, - "customVocabularyConfig": { - "description": "Custom vocabulary configuration", + "target": { + "description": "This is the target for messages to check against.\nIf not specified, the condition will run on the last message (position: -1).\nIf role is not specified, it will look at the last message regardless of role.\n@default { position: -1 }", "allOf": [ { - "$ref": "#/components/schemas/GladiaCustomVocabularyConfigDTO" + "$ref": "#/components/schemas/MessageTarget" } ] + }, + "negate": { + "type": "boolean", + "description": "This is the flag that when true, the condition matches if the pattern does NOT match.\nUseful for ensuring certain words/phrases are absent.\n\n@default false", + "example": "true - Reject if user hasn\"t said goodbye: { regex: \"\\\\b(bye|goodbye)\\\\b\", negate: true }" } }, "required": [ - "provider" + "type", + "regex" ] }, - "FallbackSpeechmaticsTranscriber": { + "LiquidCondition": { "type": "object", "properties": { - "provider": { - "type": "string", - "description": "This is the transcription provider that will be used.", - "enum": [ - "speechmatics" - ] - }, - "model": { + "type": { "type": "string", - "description": "This is the model that will be used for the transcription.", + "description": "This is the type discriminator for liquid condition", + "example": "liquid", "enum": [ - "default" + "liquid" ] }, - "language": { + "liquid": { "type": "string", - "enum": [ - "auto", - "ar", - "ba", - "eu", - "be", - "bn", - "bg", - "yue", - "ca", - "hr", - "cs", - "da", - "nl", - "en", - "eo", - "et", - "fi", - "fr", - "gl", - "de", - "el", - "he", - "hi", - "hu", - "id", - "ia", - "ga", - "it", - "ja", - "ko", - "lv", - "lt", - "ms", - "mt", - "cmn", - "mr", - "mn", - "no", - "fa", - "pl", - "pt", - "ro", - "ru", - "sk", - "sl", - "es", - "sw", - "sv", - "ta", - "th", - "tr", - "uk", - "ur", - "ug", - "vi", - "cy" + "description": "This is the Liquid template that must return exactly \"true\" or \"false\" as a string.\nThe template is evaluated and the entire output must be either \"true\" or \"false\" - nothing else.\n\nAvailable variables:\n- `messages`: Array of recent messages in OpenAI chat completions format (ChatCompletionMessageParam[])\n Each message has properties like: role ('user', 'assistant', 'system'), content (string), etc.\n- `now`: Current timestamp in milliseconds (built-in Liquid variable)\n- Any assistant variable values (e.g., `userName`, `accountStatus`)\n\nUseful Liquid filters for messages:\n- `messages | last: 5` - Get the 5 most recent messages\n- `messages | where: 'role', 'user'` - Filter to only user messages\n- `messages | reverse` - Reverse the order of messages", + "examples": [ + "{% if messages.last.content contains goodbye %}true{% else %}false{% endif %}", + "{% assign userMessages = messages | where: role, user %}{% if userMessages.size > 3 %}true{% else %}false{% endif %}" ] } }, "required": [ - "provider" + "type", + "liquid" ] }, - "FallbackTalkscriberTranscriber": { + "GroupCondition": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", - "description": "This is the transcription provider that will be used.", + "description": "This is the type discriminator for group condition", + "example": "group", "enum": [ - "talkscriber" + "group" ] }, - "model": { + "operator": { "type": "string", - "description": "This is the model that will be used for the transcription.", + "description": "This is the logical operator for combining conditions in this group", + "examples": [ + "AND", + "OR" + ], "enum": [ - "whisper" + "AND", + "OR" ] }, - "language": { - "type": "string", - "description": "This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py", - "enum": [ - "en", - "zh", - "de", - "es", - "ru", - "ko", - "fr", - "ja", - "pt", - "tr", - "pl", - "ca", - "nl", - "ar", - "sv", - "it", - "id", - "hi", - "fi", - "vi", - "he", - "uk", - "el", - "ms", - "cs", - "ro", - "da", - "hu", - "ta", - "no", - "th", - "ur", - "hr", - "bg", - "lt", - "la", - "mi", - "ml", - "cy", - "sk", - "te", - "fa", - "lv", - "bn", - "sr", - "az", - "sl", - "kn", - "et", - "mk", - "br", - "eu", - "is", - "hy", - "ne", - "mn", - "bs", - "kk", - "sq", - "sw", - "gl", - "mr", - "pa", - "si", - "km", - "sn", - "yo", - "so", - "af", - "oc", - "ka", - "be", - "tg", - "sd", - "gu", - "am", - "yi", - "lo", - "uz", - "fo", - "ht", - "ps", - "tk", - "nn", - "mt", - "sa", - "lb", - "my", - "bo", - "tl", - "mg", - "as", - "tt", - "haw", - "ln", - "ha", - "ba", - "jw", - "su", - "yue" - ] + "conditions": { + "type": "array", + "description": "This is the list of nested conditions to evaluate.\nSupports recursive nesting of groups for complex logic.", + "examples": [ + "[{ type: \"regex\", regex: \"(?i)stop\", target: { role: \"user\" } }]", + "[{ type: \"group\", operator: \"AND\", conditions: [...] }]" + ], + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/RegexCondition", + "title": "RegexCondition" + }, + { + "$ref": "#/components/schemas/LiquidCondition", + "title": "LiquidCondition" + }, + { + "$ref": "#/components/schemas/GroupCondition", + "title": "GroupCondition", + "description": "This is the GroupCondition object but Swagger does not display nested schemas correctly." + } + ] + } } }, "required": [ - "provider" + "type", + "operator", + "conditions" ] }, - "FallbackGoogleTranscriber": { + "ToolRejectionPlan": { "type": "object", "properties": { - "provider": { + "conditions": { + "type": "array", + "description": "This is the list of conditions that must be evaluated.\n\nUsage:\n- If all conditions match (AND logic), the tool call is rejected.\n- For OR logic at the top level, use a single 'group' condition with operator: 'OR'.\n\n@default [] - Empty array means tool always executes", + "examples": [ + "[{ type: \"regex\", regex: \"(?i)\\\\b(cancel|stop)\\\\b\", target: { role: \"user\" } }]", + "[{ type: \"group\", operator: \"OR\", conditions: [...] }]" + ], + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/RegexCondition", + "title": "RegexCondition" + }, + { + "$ref": "#/components/schemas/LiquidCondition", + "title": "LiquidCondition" + }, + { + "$ref": "#/components/schemas/GroupCondition", + "title": "GroupCondition", + "description": "This is the GroupCondition object but Swagger does not display nested schemas correctly." + } + ] + } + } + } + }, + "CreateDtmfToolDTO": { + "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 transcription provider that will be used.", "enum": [ - "google" + "dtmf" + ], + "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" + } + ] + } }, - "model": { + "type": { "type": "string", - "description": "This is the model that will be used for the transcription.", "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" + "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" + } + ] + } }, - "language": { + "type": { "type": "string", - "description": "This is the language that will be set for the transcription.", + "description": "The type of tool. \"voicemail\" for Voicemail tool.", "enum": [ - "Multilingual", - "Arabic", - "Bengali", - "Bulgarian", - "Chinese", - "Croatian", - "Czech", - "Danish", - "Dutch", - "English", - "Estonian", - "Finnish", - "French", - "German", - "Greek", - "Hebrew", - "Hindi", - "Hungarian", - "Indonesian", - "Italian", - "Japanese", - "Korean", - "Latvian", - "Lithuanian", - "Norwegian", - "Polish", - "Portuguese", - "Romanian", - "Russian", - "Serbian", - "Slovak", - "Slovenian", - "Spanish", - "Swahili", - "Swedish", - "Thai", - "Turkish", - "Ukrainian", - "Vietnamese" + "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": [ - "provider" + "type" ] }, - "FallbackOpenAITranscriber": { + "JsonSchema": { "type": "object", "properties": { - "provider": { + "type": { "type": "string", - "description": "This is the transcription provider that will be used.", + "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": [ - "openai" + "string", + "number", + "integer", + "boolean", + "array", + "object" ] }, - "model": { + "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 model that will be used for the transcription.", - "enum": [ - "gpt-4o-transcribe", - "gpt-4o-mini-transcribe" - ] + "description": "This is the description to help the model understand what it needs to output." }, - "language": { + "pattern": { "type": "string", - "description": "This is the language that will be set for the transcription.", + "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": [ - "af", - "ar", - "hy", - "az", - "be", - "bs", - "bg", - "ca", - "zh", - "hr", - "cs", - "da", - "nl", - "en", - "et", - "fi", - "fr", - "gl", - "de", - "el", - "he", - "hi", - "hu", - "is", - "id", - "it", - "ja", - "kn", - "kk", - "ko", - "lv", - "lt", - "mk", - "ms", - "mr", - "mi", - "ne", - "no", - "fa", - "pl", - "pt", - "ro", - "ru", - "sr", - "sk", - "sl", - "es", - "sw", - "sv", - "tl", - "ta", - "th", - "tr", - "uk", - "ur", - "vi", - "cy" + "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": [ - "provider", - "model" + "type" ] }, - "LangfuseObservabilityPlan": { + "OpenAIFunctionParameters": { "type": "object", "properties": { - "provider": { + "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": [ - "langfuse" + "object" ] }, - "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", + "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": { + "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 }, - "metadata": { - "type": "object", - "description": "This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. https://langfuse.com/docs/tracing-features/metadata\nBy default it includes the call metadata, assistant metadata, and assistant overrides." + "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": [ - "provider", - "tags" + "name" ] }, - "TextContent": { + "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": [ - "text" - ] + "function" + ], + "description": "The type of tool. \"function\" for Function tool." }, - "text": { - "type": "string" + "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`)." }, - "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" + "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": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } ] } }, "required": [ - "type", - "text", - "language" + "type" ] }, - "Condition": { + "GhlToolMetadata": { "type": "object", "properties": { - "operator": { - "type": "string", - "description": "This is the operator you want to use to compare the parameter and value.", - "enum": [ - "eq", - "neq", - "gt", - "gte", - "lt", - "lte" - ] - }, - "param": { - "type": "string", - "description": "This is the name of the parameter that you want to check.", - "maxLength": 1000 + "workflowId": { + "type": "string" }, - "value": { - "type": "string", - "description": "This is the value you want to compare against the parameter.", - "maxLength": 1000 + "locationId": { + "type": "string" } - }, - "required": [ - "operator", - "param", - "value" - ] + } }, - "ToolMessageStart": { + "CreateGhlToolDTO": { "type": "object", "properties": { - "contents": { + "messages": { "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.", + "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/TextContent", - "title": "Text" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" + }, + { + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } @@ -10465,130 +8795,90 @@ "type": { "type": "string", "enum": [ - "request-start" + "ghl" ], - "description": "This message is triggered when the tool call starts.\n\nThis message is never triggered for async tools.\n\nIf this message is not provided, one of the default filler messages \"Hold on a sec\", \"One moment\", \"Just a sec\", \"Give me a moment\" or \"This'll just take a sec\" will be used." - }, - "blocking": { - "type": "boolean", - "description": "This is an optional boolean that if true, the tool call will only trigger after the message is spoken. Default is false.\n\n@default false", - "example": false, - "default": false + "description": "The type of tool. \"ghl\" for GHL tool." }, - "content": { - "type": "string", - "description": "This is the content that the assistant says when this message is triggered.", - "maxLength": 1000 + "metadata": { + "$ref": "#/components/schemas/GhlToolMetadata" }, - "conditions": { - "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Condition" - } + "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" + "type", + "metadata" ] }, - "ToolMessageComplete": { + "MakeToolMetadata": { "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 message is triggered when the tool call is complete.\n\nThis message is triggered immediately without waiting for your server to respond for async tool calls.\n\nIf this message is not provided, the model will be requested to respond.\n\nIf this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.", - "enum": [ - "request-complete" - ] - }, - "role": { - "type": "string", - "description": "This is optional and defaults to \"assistant\".\n\nWhen role=assistant, `content` is said out loud.\n\nWhen role=system, `content` is passed to the model in a system message. Example:\n system: default one\n assistant:\n user:\n assistant:\n user:\n assistant:\n user:\n assistant: tool called\n tool: your server response\n <--- system prompt as hint\n ---> model generates response which is spoken\nThis is useful when you want to provide a hint to the model about what to say next.", - "enum": [ - "assistant", - "system" - ] - }, - "endCallAfterSpokenEnabled": { - "type": "boolean", - "description": "This is an optional boolean that if true, the call will end after the message is spoken. Default is false.\n\nThis is ignored if `role` is set to `system`.\n\n@default false", - "example": false - }, - "content": { - "type": "string", - "description": "This is the content that the assistant says when this message is triggered.", - "maxLength": 1000 + "scenarioId": { + "type": "number" }, - "conditions": { - "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Condition" - } + "triggerHookId": { + "type": "number" } - }, - "required": [ - "type" - ] + } }, - "ToolMessageFailed": { + "CreateMakeToolDTO": { "type": "object", "properties": { - "contents": { + "messages": { "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.", + "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/TextContent", - "title": "Text" + "$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 message is triggered when the tool call fails.\n\nThis message is never triggered for async tool calls.\n\nIf this message is not provided, the model will be requested to respond.\n\nIf this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.", "enum": [ - "request-failed" - ] - }, - "endCallAfterSpokenEnabled": { - "type": "boolean", - "description": "This is an optional boolean that if true, the call will end after the message is spoken. Default is false.\n\n@default false", - "example": false + "make" + ], + "description": "The type of tool. \"make\" for Make tool." }, - "content": { - "type": "string", - "description": "This is the content that the assistant says when this message is triggered.", - "maxLength": 1000 + "metadata": { + "$ref": "#/components/schemas/MakeToolMetadata" }, - "conditions": { - "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Condition" - } + "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" + "type", + "metadata" ] }, - "ToolMessageDelayed": { + "CustomMessage": { "type": "object", "properties": { "contents": { @@ -10605,204 +8895,173 @@ }, "type": { "type": "string", - "description": "This message is triggered when the tool call is delayed.\n\nThere are the two things that can trigger this message:\n1. The user talks with the assistant while your server is processing the request. Default is \"Sorry, a few more seconds.\"\n2. The server doesn't respond within `timingMilliseconds`.\n\nThis message is never triggered for async tool calls.", + "description": "This is a custom message.", "enum": [ - "request-response-delayed" + "custom-message" ] }, - "timingMilliseconds": { - "type": "number", - "minimum": 100, - "maximum": 120000, - "example": 1000, - "description": "The number of milliseconds to wait for the server response before saying this message." - }, "content": { "type": "string", - "description": "This is the content that the assistant says when this message is triggered.", + "description": "This is the content that the assistant will say when this message is triggered.", "maxLength": 1000 - }, - "conditions": { - "description": "This is an optional array of conditions that the tool call arguments must meet in order for this message to be triggered.", - "type": "array", - "items": { - "$ref": "#/components/schemas/Condition" - } } }, "required": [ "type" ] }, - "MessageTarget": { + "TransferDestinationAssistant": { "type": "object", "properties": { - "role": { + "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", - "description": "This is the role of the message to target.\n\nIf not specified, will find the position in the message history ignoring role (effectively `any`).", - "example": "user", "enum": [ - "user", "assistant" ] }, - "position": { - "type": "number", - "description": "This is the position of the message to target.\n- Negative numbers: Count from end (-1 = most recent, -2 = second most recent)\n- 0: First/oldest message in history\n- Positive numbers: Specific position (0-indexed from start)\n\n@default -1 (most recent message)", - "example": -1 - } - } - }, - "RegexCondition": { - "type": "object", - "properties": { - "type": { + "transferMode": { "type": "string", - "description": "This is the type discriminator for regex condition", - "example": "regex", + "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": [ - "regex" + "rolling-history", + "swap-system-message-in-history", + "swap-system-message-in-history-and-remove-transfer-tool-messages", + "delete-history" ] }, - "regex": { + "assistantName": { "type": "string", - "description": "This is the regular expression pattern to match against message content.\n\nNote:\n- This works by using the RegExp.test method in Node.JS. Eg. /hello/.test(\"hello there\") will return true.\n\nHot tips:\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, use anchors: /^cat$/ will only match exactly \"cat\".\n- Word boundaries \\b are useful for matching whole words: /\\bcat\\b/ matches \"cat\" but not \"cats\" or \"category\".\n- Use inline flags for portability: (?i) for case insensitive, (?m) for multiline", - "examples": [ - "\\\\b(cancel|stop|wait)\\\\b - Matches whole words", - "^yes$ - Matches exactly yes (full string match)", - "(?i)hello - Case insensitive match" - ] + "description": "This is the assistant to transfer the call to." }, - "target": { - "description": "This is the target for messages to check against.\nIf not specified, the condition will run on the last message (position: -1).\nIf role is not specified, it will look at the last message regardless of role.\n@default { position: -1 }", - "allOf": [ + "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", + "assistantName" + ] + }, + "TransferFallbackPlan": { + "type": "object", + "properties": { + "message": { + "description": "This is the message the assistant will deliver to the customer if the transfer fails.", + "oneOf": [ { - "$ref": "#/components/schemas/MessageTarget" + "type": "string" + }, + { + "$ref": "#/components/schemas/CustomMessage" } ] }, - "negate": { + "endCallEnabled": { "type": "boolean", - "description": "This is the flag that when true, the condition matches if the pattern does NOT match.\nUseful for ensuring certain words/phrases are absent.\n\n@default false", - "example": "true - Reject if user hasn\"t said goodbye: { regex: \"\\\\b(bye|goodbye)\\\\b\", negate: true }" + "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": [ - "type", - "regex" + "message" ] }, - "LiquidCondition": { + "TransferAssistantModel": { "type": "object", "properties": { - "type": { + "provider": { "type": "string", - "description": "This is the type discriminator for liquid condition", - "example": "liquid", + "description": "The model provider for the transfer assistant", "enum": [ - "liquid" + "openai", + "anthropic", + "google", + "custom-llm" ] }, - "liquid": { + "model": { "type": "string", - "description": "This is the Liquid template that must return exactly \"true\" or \"false\" as a string.\nThe template is evaluated and the entire output must be either \"true\" or \"false\" - nothing else.\n\nAvailable variables:\n- `messages`: Array of recent messages in OpenAI chat completions format (ChatCompletionMessageParam[])\n Each message has properties like: role ('user', 'assistant', 'system'), content (string), etc.\n- `now`: Current timestamp in milliseconds (built-in Liquid variable)\n- Any assistant variable values (e.g., `userName`, `accountStatus`)\n\nUseful Liquid filters for messages:\n- `messages | last: 5` - Get the 5 most recent messages\n- `messages | where: 'role', 'user'` - Filter to only user messages\n- `messages | reverse` - Reverse the order of messages", - "examples": [ - "{% if messages.last.content contains goodbye %}true{% else %}false{% endif %}", - "{% assign userMessages = messages | where: role, user %}{% if userMessages.size > 3 %}true{% else %}false{% endif %}" - ] + "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." + }, + "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", - "liquid" + "provider", + "model" ] }, - "GroupCondition": { + "TransferAssistant": { "type": "object", "properties": { - "type": { + "name": { "type": "string", - "description": "This is the type discriminator for group condition", - "example": "group", - "enum": [ - "group" + "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" + } ] }, - "operator": { + "firstMessage": { "type": "string", - "description": "This is the logical operator for combining conditions in this group", - "examples": [ - "AND", - "OR" - ], - "enum": [ - "AND", - "OR" - ] + "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." }, - "conditions": { - "type": "array", - "description": "This is the list of nested conditions to evaluate.\nSupports recursive nesting of groups for complex logic.", - "examples": [ - "[{ type: \"regex\", regex: \"(?i)stop\", target: { role: \"user\" } }]", - "[{ type: \"group\", operator: \"AND\", conditions: [...] }]" + "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" ], - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/RegexCondition", - "title": "RegexCondition" - }, - { - "$ref": "#/components/schemas/LiquidCondition", - "title": "LiquidCondition" - }, - { - "$ref": "#/components/schemas/GroupCondition", - "title": "GroupCondition", - "description": "This is the GroupCondition object but Swagger does not display nested schemas correctly." - } - ] - } + "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 + }, + "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": [ - "type", - "operator", - "conditions" + "model" ] }, - "ToolRejectionPlan": { - "type": "object", - "properties": { - "conditions": { - "type": "array", - "description": "This is the list of conditions that must be evaluated.\n\nUsage:\n- If all conditions match (AND logic), the tool call is rejected.\n- For OR logic at the top level, use a single 'group' condition with operator: 'OR'.\n\n@default [] - Empty array means tool always executes", - "examples": [ - "[{ type: \"regex\", regex: \"(?i)\\\\b(cancel|stop)\\\\b\", target: { role: \"user\" } }]", - "[{ type: \"group\", operator: \"OR\", conditions: [...] }]" - ], - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/RegexCondition", - "title": "RegexCondition" - }, - { - "$ref": "#/components/schemas/LiquidCondition", - "title": "LiquidCondition" - }, - { - "$ref": "#/components/schemas/GroupCondition", - "title": "GroupCondition", - "description": "This is the GroupCondition object but Swagger does not display nested schemas correctly." - } - ] - } - } - } - }, - "CreateDtmfToolDTO": { + "TransferCancelToolUserEditable": { "type": "object", "properties": { "messages": { @@ -10832,9 +9091,9 @@ "type": { "type": "string", "enum": [ - "dtmf" + "transferCancel" ], - "description": "The type of tool. \"dtmf\" for DTMF tool." + "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```", @@ -10849,7 +9108,7 @@ "type" ] }, - "CreateEndCallToolDTO": { + "TransferSuccessfulToolUserEditable": { "type": "object", "properties": { "messages": { @@ -10879,9 +9138,9 @@ "type": { "type": "string", "enum": [ - "endCall" + "transferSuccessful" ], - "description": "The type of tool. \"endCall\" for End Call 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```", @@ -10896,185 +9155,218 @@ "type" ] }, - "CreateVoicemailToolDTO": { + "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" } }, - "type": { - "type": "string", - "description": "The type of tool. \"voicemail\" for Voicemail tool.", - "enum": [ - "voicemail" - ] + "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" }, - "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" - } - ] + "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 } - }, - "required": [ - "type" - ] + } }, - "JsonSchema": { + "TransferPlan": { "type": "object", "properties": { - "type": { + "mode": { "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.", + "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": [ - "string", - "number", - "integer", - "boolean", - "array", - "object" + "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" ] }, - "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." + "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" + } + ] }, - "properties": { + "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 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": "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" + ] }, - "description": { + "holdAudioUrl": { "type": "string", - "description": "This is the description to help the model understand what it needs to output." + "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." }, - "pattern": { + "transferCompleteAudioUrl": { "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" + "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." }, - "format": { + "twiml": { "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" - ] + "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 }, - "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" - } + "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" + } + ] }, - "enum": { - "description": "This array specifies the allowed values that can be used to restrict the output of the model.", - "type": "array", - "items": { - "type": "string" - } + "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" }, - "title": { - "type": "string", - "description": "This is the title of the schema." + "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": [ - "type" + "mode" ] }, - "OpenAIFunctionParameters": { + "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", - "description": "This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.", "enum": [ - "object" + "number" ] }, - "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" - } + "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 }, - "required": { - "description": "This specifies the properties that are required by the function.", - "type": "array", - "items": { - "type": "string" - } + "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. 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": { + "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", - "properties" + "number" ] }, - "OpenAIFunction": { + "TransferDestinationSip": { "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 + "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" + } + ] }, - "name": { + "type": { "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}$/" + "enum": [ + "sip" + ] }, - "description": { + "sipUri": { "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 + "description": "This is the SIP URI to transfer the call to." }, - "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.", + "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/OpenAIFunctionParameters" + "$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": [ - "name" + "type", + "sipUri" ] }, - "CreateFunctionToolDTO": { + "CreateTransferCallToolDTO": { "type": "object", "properties": { "messages": { @@ -11104,92 +9396,29 @@ "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": [ - { - "$ref": "#/components/schemas/ToolRejectionPlan" - } + "transferCall" ] - } - }, - "required": [ - "type" - ] - }, - "GhlToolMetadata": { - "type": "object", - "properties": { - "workflowId": { - "type": "string" }, - "locationId": { - "type": "string" - } - } - }, - "CreateGhlToolDTO": { - "type": "object", - "properties": { - "messages": { + "destinations": { "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 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/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" }, { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "Sip" } ] } }, - "type": { - "type": "string", - "enum": [ - "ghl" - ], - "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```", "allOf": [ @@ -11200,137 +9429,147 @@ } }, "required": [ - "type", - "metadata" + "type" ] }, - "MakeToolMetadata": { + "ContextEngineeringPlanLastNMessages": { "type": "object", "properties": { - "scenarioId": { - "type": "number" + "type": { + "type": "string", + "enum": [ + "lastNMessages" + ] }, - "triggerHookId": { - "type": "number" - } - } + "maxMessages": { + "type": "number", + "description": "This is the maximum number of messages to include in the context engineering plan.", + "minimum": 0 + } + }, + "required": [ + "type", + "maxMessages" + ] }, - "CreateMakeToolDTO": { + "ContextEngineeringPlanNone": { "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": [ - "make" - ], - "description": "The type of tool. \"make\" for Make tool." - }, - "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/ToolRejectionPlan" - } + "none" ] } }, "required": [ - "type", - "metadata" + "type" ] }, - "CustomMessage": { + "ContextEngineeringPlanAll": { "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.", "enum": [ - "custom-message" + "all" ] + } + }, + "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_]*$/" }, - "content": { + "value": { "type": "string", - "description": "This is the content that the assistant will say when this message is triggered.", - "maxLength": 1000 + "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": [ - "type" + "key", + "value" ] }, - "TransferDestinationAssistant": { + "VariableExtractionPlan": { "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" - }, + "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/CustomMessage" + "$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": { + "type": "object", + "properties": { "type": { "type": "string", "enum": [ "assistant" ] }, - "transferMode": { - "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" + "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." + "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" + } + ] }, "description": { "type": "string", @@ -11338,118 +9577,178 @@ } }, "required": [ - "type", - "assistantName" + "type" ] }, - "TransferFallbackPlan": { + "HandoffDestinationDynamic": { "type": "object", "properties": { - "message": { - "description": "This is the message the assistant will deliver to the customer if the transfer fails.", - "oneOf": [ - { - "type": "string" - }, + "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/CustomMessage" + "$ref": "#/components/schemas/Server" } ] }, - "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 + "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": [ - "message" + "type" ] }, - "TransferAssistantModel": { + "CreateHandoffToolDTO": { "type": "object", "properties": { - "provider": { + "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 model provider for the transfer assistant", + "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": [ - "openai", - "anthropic", - "google", - "custom-llm" + "handoff" ] }, - "model": { - "type": "string", - "description": "The model name - must be compatible with the selected provider", - "example": "gpt-4o" - }, - "messages": { + "destinations": { "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": "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" + } + ] + } }, - "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." + "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", - "model" + "type" ] }, - "TransferAssistant": { + "CreateCustomKnowledgeBaseDTO": { "type": "object", "properties": { - "name": { + "provider": { "type": "string", - "description": "Optional name for the transfer assistant", - "maxLength": 100, - "default": "transfer-assistant", - "example": "Sales Transfer Assistant" + "description": "This knowledge base is bring your own knowledge base implementation.", + "enum": [ + "custom-knowledge-base" + ] }, - "model": { - "description": "Model configuration for the transfer assistant", + "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/TransferAssistantModel" + "$ref": "#/components/schemas/Server" } ] - }, - "firstMessage": { + } + }, + "required": [ + "provider", + "server" + ] + }, + "KnowledgeBase": { + "type": "object", + "properties": { + "name": { "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." + "description": "The name of the knowledge base", + "example": "My Knowledge Base" }, - "firstMessageMode": { + "provider": { "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'", + "description": "The provider of the knowledge base", "enum": [ - "assistant-speaks-first", - "assistant-speaks-first-with-model-generated-message", - "assistant-waits-for-user" + "google" ], - "example": "assistant-speaks-first" + "example": "google" }, - "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 + "model": { + "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" + ] }, - "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 + "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": [ - "model" + "name", + "provider", + "description", + "fileIds" ] }, - "TransferCancelToolUserEditable": { + "CreateQueryToolDTO": { "type": "object", "properties": { "messages": { @@ -11479,9 +9778,16 @@ "type": { "type": "string", "enum": [ - "transferCancel" + "query" ], - "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. \"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```", @@ -11496,7 +9802,7 @@ "type" ] }, - "TransferSuccessfulToolUserEditable": { + "CreateGoogleCalendarCreateEventToolDTO": { "type": "object", "properties": { "messages": { @@ -11526,9 +9832,9 @@ "type": { "type": "string", "enum": [ - "transferSuccessful" + "google.calendar.event.create" ], - "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. \"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```", @@ -11543,218 +9849,54 @@ "type" ] }, - "SummaryPlan": { + "CreateGoogleSheetsRowAppendToolDTO": { "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": { - "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 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": { "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" - ] - }, - "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": { - "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" + "google.sheets.row.append" + ], + "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." }, - "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.", + "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/TransferFallbackPlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "mode" + "type" ] }, - "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": [ - "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 - }, - "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. 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": { - "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", - "number" - ] - }, - "TransferDestinationSip": { - "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": [ - "sip" - ] - }, - "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/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", - "sipUri" - ] - }, - "CreateTransferCallToolDTO": { + "CreateGoogleCalendarCheckAvailabilityToolDTO": { "type": "object", "properties": { "messages": { @@ -11784,28 +9926,9 @@ "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/TransferDestinationAssistant", - "title": "Assistant" - }, - { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" - } - ] - } + "google.calendar.availability.check" + ], + "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```", @@ -11820,181 +9943,7 @@ "type" ] }, - "ContextEngineeringPlanLastNMessages": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "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" - ] - }, - "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" - } - } - } - }, - "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" - } - ] - }, - "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" - } - ] - }, - "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" - ] - }, - "CreateHandoffToolDTO": { + "CreateSlackSendMessageToolDTO": { "type": "object", "properties": { "messages": { @@ -12023,26 +9972,10 @@ }, "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": "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" - } - ] - } + "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```", @@ -12057,86 +9990,20 @@ "type" ] }, - "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": { + "McpToolMetadata": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the knowledge base", - "example": "My Knowledge Base" - }, - "provider": { + "protocol": { "type": "string", - "description": "The provider of the knowledge base", "enum": [ - "google" + "sse", + "shttp" ], - "example": "google" - }, - "model": { - "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": { - "type": "string", - "description": "A description of the knowledge base" - }, - "fileIds": { - "description": "The file IDs associated with this knowledge base", - "type": "array", - "items": { - "type": "string" - } + "description": "This is the protocol used for MCP communication. Defaults to Streamable HTTP." } - }, - "required": [ - "name", - "provider", - "description", - "fileIds" - ] + } }, - "CreateQueryToolDTO": { + "CreateMcpToolDTO": { "type": "object", "properties": { "messages": { @@ -12166,16 +10033,20 @@ "type": { "type": "string", "enum": [ - "query" + "mcp" ], - "description": "The type of tool. \"query\" for Query tool." + "description": "The type of tool. \"mcp\" for MCP tool." }, - "knowledgeBases": { - "description": "The knowledge bases to query", - "type": "array", - "items": { - "$ref": "#/components/schemas/KnowledgeBase" - } + "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```", @@ -12190,7 +10061,7 @@ "type" ] }, - "CreateGoogleCalendarCreateEventToolDTO": { + "CreateGoHighLevelCalendarAvailabilityToolDTO": { "type": "object", "properties": { "messages": { @@ -12220,9 +10091,9 @@ "type": { "type": "string", "enum": [ - "google.calendar.event.create" + "gohighlevel.calendar.availability.check" ], - "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." + "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```", @@ -12237,7 +10108,7 @@ "type" ] }, - "CreateGoogleSheetsRowAppendToolDTO": { + "CreateGoHighLevelCalendarEventCreateToolDTO": { "type": "object", "properties": { "messages": { @@ -12267,9 +10138,9 @@ "type": { "type": "string", "enum": [ - "google.sheets.row.append" + "gohighlevel.calendar.event.create" ], - "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." + "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```", @@ -12284,7 +10155,7 @@ "type" ] }, - "CreateGoogleCalendarCheckAvailabilityToolDTO": { + "CreateGoHighLevelContactCreateToolDTO": { "type": "object", "properties": { "messages": { @@ -12314,9 +10185,9 @@ "type": { "type": "string", "enum": [ - "google.calendar.availability.check" + "gohighlevel.contact.create" ], - "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." + "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```", @@ -12331,7 +10202,7 @@ "type" ] }, - "CreateSlackSendMessageToolDTO": { + "CreateGoHighLevelContactGetToolDTO": { "type": "object", "properties": { "messages": { @@ -12361,9 +10232,9 @@ "type": { "type": "string", "enum": [ - "slack.message.send" + "gohighlevel.contact.get" ], - "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." + "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```", @@ -12378,291 +10249,56 @@ "type" ] }, - "McpToolMetadata": { + "OpenAIMessage": { "type": "object", "properties": { - "protocol": { + "content": { + "type": "string", + "nullable": true, + "maxLength": 100000000 + }, + "role": { "type": "string", "enum": [ - "sse", - "shttp" - ], - "description": "This is the protocol used for MCP communication. Defaults to Streamable HTTP." + "assistant", + "function", + "user", + "system", + "tool" + ] } - } + }, + "required": [ + "content", + "role" + ] }, - "CreateMcpToolDTO": { + "AnyscaleModel": { "type": "object", "properties": { "messages": { + "description": "This is the starting state for the conversation.", "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/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/ToolMessageStart", - "title": "ToolMessageStart" + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" }, { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" }, { - "$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" - ] - }, - "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/CreateComputerToolDTO", - "title": "ComputerTool" + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" }, { "$ref": "#/components/schemas/CreateDtmfToolDTO", @@ -12751,10 +10387,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -12927,10 +10559,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.", @@ -13102,10 +10730,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", @@ -13261,10 +10885,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. Any service, including your own server, that is compatible with the OpenAI API can be used.", @@ -13447,10 +11067,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -13602,10 +11218,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", @@ -13830,10 +11442,6 @@ } ] }, - "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.", @@ -14009,10 +11617,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", @@ -14180,10 +11784,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", @@ -14338,10 +11938,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.", @@ -14371,6 +11967,7 @@ "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-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", @@ -14473,6 +12070,7 @@ "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-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", @@ -14577,6 +12175,7 @@ "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-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", @@ -14807,10 +12406,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -14962,10 +12557,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -15117,10 +12708,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -16138,6 +13725,100 @@ } } }, + "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" + ] + }, + "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 + }, + "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" + }, + "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/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 '/'" + } + } + }, "RegexOption": { "type": "object", "properties": { @@ -17094,6 +14775,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -17163,6 +14848,7 @@ "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", @@ -17394,10 +15080,6 @@ } ] }, - "knowledgeBaseId": { - "type": "string", - "description": "This is the ID of the knowledge base the model will use." - }, "provider": { "type": "string", "enum": [ @@ -17561,10 +15243,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", @@ -19084,7 +16762,9 @@ "fable", "onyx", "nova", - "shimmer" + "shimmer", + "marin", + "cedar" ], "title": "Preset Voice Options" }, @@ -21068,7 +18748,9 @@ "fable", "onyx", "nova", - "shimmer" + "shimmer", + "marin", + "cedar" ], "title": "Preset Voice Options" }, @@ -23363,20 +21045,24 @@ ] }, "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" + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" } } }, @@ -24898,6 +22584,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -24967,6 +22657,7 @@ "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", @@ -25107,7 +22798,7 @@ } } }, - "AssistantOverrides": { + "Assistant": { "type": "object", "properties": { "transcriber": { @@ -25690,6 +23381,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -25759,6 +23454,7 @@ "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", @@ -25800,10 +23496,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.", @@ -25900,119 +23592,96 @@ }, "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": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "SquadMemberDTO": { + "PaginationMeta": { "type": "object", "properties": { - "assistantDestinations": { - "type": "array", - "description": "These are the other assistants that this assistant can transfer or handoff to.\n\nSupports both:\n- TransferDestinationAssistant: For transfer call tool (legacy)\n- HandoffDestinationAssistant: For handoff tool (recommended)\n\nIf the assistant already has transfer call or handoff tools, these destinations are just appended to existing ones.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TransferDestinationAssistant", - "title": "Transfer Destination" - }, - { - "$ref": "#/components/schemas/HandoffDestinationAssistant", - "title": "Handoff Destination" - } - ] - } + "itemsPerPage": { + "type": "number" }, - "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." + "totalItems": { + "type": "number" }, - "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" - } - ] + "currentPage": { + "type": "number" }, - "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" - } - ] + "itemsBeyondRetention": { + "type": "boolean" } - } + }, + "required": [ + "itemsPerPage", + "totalItems", + "currentPage" + ] }, - "CreateSquadDTO": { + "AssistantPaginatedResponse": { "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.", + "results": { "type": "array", "items": { - "$ref": "#/components/schemas/SquadMemberDTO" + "$ref": "#/components/schemas/Assistant" } }, - "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" - } - ] + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "members" + "results", + "metadata" ] }, - "CreateWorkflowDTO": { + "AssistantVersionPaginatedResponse": { "type": "object", "properties": { - "nodes": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ConversationNode", - "title": "ConversationNode" - }, - { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" - } - ] - } + "results": { + "type": "array" }, - "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" - } - ] + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" }, + "nextPageState": { + "type": "string" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "UpdateAssistantDTO": { + "type": "object", + "properties": { "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", @@ -26060,8 +23729,69 @@ } ] }, + "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" + }, + { + "$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", @@ -26133,20 +23863,181 @@ } ] }, - "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].\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/LangfuseObservabilityPlan", - "title": "Langfuse" - } - ], - "allOf": [ + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" + }, { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" + "$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" + ], + "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" + ] + } + }, + "serverMessages": { + "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" + ] + } + }, + "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": [ @@ -26165,33 +24056,40 @@ } ] }, - "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\nDefault `false` while in beta.\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": [ { @@ -26362,6 +24260,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -26431,6 +24333,7 @@ "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", @@ -26448,38 +24351,71 @@ } } }, + "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" @@ -26487,7 +24423,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" @@ -26495,7 +24431,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" @@ -26503,7 +24439,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" @@ -26511,2011 +24447,860 @@ ] }, "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`.", "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" } ] - } - }, - "required": [ - "nodes", - "name", - "edges" - ] - }, - "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" + }, + "keypadInputPlan": { + "$ref": "#/components/schemas/KeypadInputPlan" } } }, - "TransferPhoneNumberHookAction": { + "AssistantOverrides": { "type": "object", "properties": { - "type": { - "type": "string", - "description": "This is the type of action - must be \"transfer\"", - "enum": [ - "transfer" + "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" + } ] }, - "destination": { - "description": "This is the destination details for the transfer - can be a phone number or SIP URI", + "model": { + "description": "These are the options for the assistant's LLM.", "oneOf": [ { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" + "$ref": "#/components/schemas/AnthropicModel", + "title": "Anthropic" }, { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$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" } ] - } - }, - "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" - ] - }, - "PhoneNumberHookCallRinging": { - "type": "object", - "properties": { - "on": { - "type": "string", - "description": "This is the event to trigger the hook on", - "enum": [ - "call.ringing" - ], - "maxLength": 1000 + "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" + } + ] }, - "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": { + "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": { - "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 + "firstMessageInterruptionsEnabled": { + "type": "boolean", + "default": false }, - "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": { + "firstMessageMode": { "type": "string", - "description": "This is the event to trigger the hook on", + "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.ending" + "assistant-speaks-first", + "assistant-speaks-first-with-model-generated-message", + "assistant-waits-for-user" ], - "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" - } + "example": "assistant-speaks-first" }, - "do": { - "description": "This is the action to perform when the hook triggers", + "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/TransferPhoneNumberHookAction", - "title": "TransferPhoneNumberHookAction" + "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", + "title": "Google" }, { - "$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/OpenAIVoicemailDetectionPlan", + "title": "OpenAI" + }, { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" + "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", + "title": "Twilio" }, { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", + "title": "Vapi" } ] }, - "hooks": { + "clientMessages": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "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": { - "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." + "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" + ] + } }, - "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." + "serverMessages": { + "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" + ] + } }, - "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." + "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 }, - "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": [ + "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/Server" + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" } ] - } - }, - "required": [ - "twilioPhoneNumber", - "twilioAccountSid" - ] - }, - "CreateCustomerDTO": { - "type": "object", - "properties": { - "numberE164CheckEnabled": { + }, + "modelOutputInMessagesEnabled": { "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 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 }, - "extension": { - "type": "string", - "description": "This is the extension that will be dialed after the call is answered.", - "maxLength": 10, - "example": null + "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" + } + ] + } }, - "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.", + "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/AssistantOverrides" + "$ref": "#/components/schemas/LangfuseObservabilityPlan" } ] }, - "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": { + "credentials": { "type": "array", - "description": "These are the costs of individual components of the call in USD.", + "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/TransportCost", - "title": "TransportCost" + "$ref": "#/components/schemas/CreateAnthropicCredentialDTO", + "title": "AnthropicCredential" }, { - "$ref": "#/components/schemas/TranscriberCost", - "title": "TranscriberCost" + "$ref": "#/components/schemas/CreateAnyscaleCredentialDTO", + "title": "AnyscaleCredential" }, { - "$ref": "#/components/schemas/ModelCost", - "title": "ModelCost" + "$ref": "#/components/schemas/CreateAssemblyAICredentialDTO", + "title": "AssemblyAICredential" }, { - "$ref": "#/components/schemas/VoiceCost", - "title": "VoiceCost" + "$ref": "#/components/schemas/CreateAzureCredentialDTO", + "title": "AzureCredential" }, { - "$ref": "#/components/schemas/VapiCost", - "title": "VapiCost" + "$ref": "#/components/schemas/CreateAzureOpenAICredentialDTO", + "title": "AzureOpenAICredential" }, { - "$ref": "#/components/schemas/VoicemailDetectionCost", - "title": "VoicemailDetectionCost" + "$ref": "#/components/schemas/CreateByoSipTrunkCredentialDTO", + "title": "ByoSipTrunkCredential" }, { - "$ref": "#/components/schemas/AnalysisCost", - "title": "AnalysisCost" + "$ref": "#/components/schemas/CreateCartesiaCredentialDTO", + "title": "CartesiaCredential" }, { - "$ref": "#/components/schemas/KnowledgeBaseCost", - "title": "KnowledgeBaseCost" - } - ] - } - }, - "messages": { - "type": "array", - "items": { - "oneOf": [ + "$ref": "#/components/schemas/CreateCerebrasCredentialDTO", + "title": "CerebrasCredential" + }, { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/CreateCloudflareCredentialDTO", + "title": "CloudflareCredential" }, { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" + "$ref": "#/components/schemas/CreateCustomLLMCredentialDTO", + "title": "CustomLLMCredential" }, { - "$ref": "#/components/schemas/BotMessage", - "title": "BotMessage" + "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", + "title": "DeepgramCredential" }, { - "$ref": "#/components/schemas/ToolCallMessage", - "title": "ToolCallMessage" + "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", + "title": "DeepInfraCredential" }, { - "$ref": "#/components/schemas/ToolCallResultMessage", - "title": "ToolCallResultMessage" + "$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/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" + } + ], + "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", + "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", + "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" } - ] - } - }, - "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" - ] - }, - "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-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-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", - "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-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-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", - "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", - "pipeline-error-eleven-labs-max-character-limit-exceeded", - "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", - "pipeline-error-eleven-labs-500-server-error", - "pipeline-error-eleven-labs-503-server-error", - "call.in-progress.error-vapifault-eleven-labs-voice-not-found", - "call.in-progress.error-vapifault-eleven-labs-quota-exceeded", - "call.in-progress.error-vapifault-eleven-labs-unauthorized-access", - "call.in-progress.error-vapifault-eleven-labs-unauthorized-to-access-model", - "call.in-progress.error-vapifault-eleven-labs-professional-voices-only-for-creator-plus", - "call.in-progress.error-vapifault-eleven-labs-blocked-free-plan-and-requested-upgrade", - "call.in-progress.error-vapifault-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", - "call.in-progress.error-vapifault-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", - "call.in-progress.error-vapifault-eleven-labs-system-busy-and-requested-upgrade", - "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned", - "call.in-progress.error-vapifault-eleven-labs-invalid-api-key", - "call.in-progress.error-vapifault-eleven-labs-invalid-voice-samples", - "call.in-progress.error-vapifault-eleven-labs-voice-disabled-by-owner", - "call.in-progress.error-vapifault-eleven-labs-blocked-account-in-probation", - "call.in-progress.error-vapifault-eleven-labs-blocked-content-against-their-policy", - "call.in-progress.error-vapifault-eleven-labs-missing-samples-for-voice-clone", - "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", - "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-500-server-error", - "call.in-progress.error-providerfault-eleven-labs-503-server-error", - "pipeline-error-playht-request-timed-out", - "pipeline-error-playht-invalid-voice", - "pipeline-error-playht-unexpected-error", - "pipeline-error-playht-out-of-credits", - "pipeline-error-playht-invalid-emotion", - "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri", - "pipeline-error-playht-401-unauthorized", - "pipeline-error-playht-403-forbidden-out-of-characters", - "pipeline-error-playht-403-forbidden-api-access-not-available", - "pipeline-error-playht-429-exceeded-quota", - "pipeline-error-playht-502-gateway-error", - "pipeline-error-playht-504-gateway-error", - "call.in-progress.error-vapifault-playht-request-timed-out", - "call.in-progress.error-vapifault-playht-invalid-voice", - "call.in-progress.error-vapifault-playht-unexpected-error", - "call.in-progress.error-vapifault-playht-out-of-credits", - "call.in-progress.error-vapifault-playht-invalid-emotion", - "call.in-progress.error-vapifault-playht-voice-must-be-a-valid-voice-manifest-uri", - "call.in-progress.error-vapifault-playht-401-unauthorized", - "call.in-progress.error-vapifault-playht-403-forbidden-out-of-characters", - "call.in-progress.error-vapifault-playht-403-forbidden-api-access-not-available", - "call.in-progress.error-vapifault-playht-429-exceeded-quota", - "call.in-progress.error-providerfault-playht-502-gateway-error", - "call.in-progress.error-providerfault-playht-504-gateway-error", - "pipeline-error-custom-transcriber-failed", - "call.in-progress.error-vapifault-custom-transcriber-failed", - "pipeline-error-eleven-labs-transcriber-failed", - "call.in-progress.error-vapifault-eleven-labs-transcriber-failed", - "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination", - "pipeline-error-deepgram-returning-401-invalid-credentials", - "pipeline-error-deepgram-returning-403-model-access-denied", - "pipeline-error-deepgram-returning-404-not-found", - "pipeline-error-deepgram-returning-500-invalid-json", - "pipeline-error-deepgram-returning-502-network-error", - "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach", - "pipeline-error-deepgram-returning-econnreset", - "call.in-progress.error-vapifault-deepgram-returning-400-no-such-model-language-tier-combination", - "call.in-progress.error-vapifault-deepgram-returning-401-invalid-credentials", - "call.in-progress.error-vapifault-deepgram-returning-404-not-found", - "call.in-progress.error-vapifault-deepgram-returning-403-model-access-denied", - "call.in-progress.error-providerfault-deepgram-returning-500-invalid-json", - "call.in-progress.error-providerfault-deepgram-returning-502-network-error", - "call.in-progress.error-providerfault-deepgram-returning-502-bad-gateway-ehostunreach", - "pipeline-error-google-transcriber-failed", - "call.in-progress.error-vapifault-google-transcriber-failed", - "pipeline-error-openai-transcriber-failed", - "call.in-progress.error-vapifault-openai-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", - "assistant-ended-call-after-message-spoken", - "assistant-forwarded-call", - "assistant-join-timed-out", - "call.in-progress.error-assistant-did-not-receive-customer-audio", - "call.in-progress.error-transfer-failed", - "customer-busy", - "customer-ended-call", - "customer-ended-call-after-warm-transfer-attempt", - "customer-did-not-answer", - "customer-did-not-give-microphone-permission", - "exceeded-max-duration", - "manually-canceled", - "phone-call-provider-closed-websocket", - "call.forwarding.operator-busy", - "silence-timed-out", - "call.in-progress.error-sip-inbound-call-failed-to-connect", - "call.in-progress.error-providerfault-outbound-sip-403-forbidden", - "call.in-progress.error-providerfault-outbound-sip-407-proxy-authentication-required", - "call.in-progress.error-providerfault-outbound-sip-503-service-unavailable", - "call.in-progress.error-providerfault-outbound-sip-480-temporarily-unavailable", - "call.in-progress.error-sip-outbound-call-failed-to-connect", - "call.ringing.hook-executed-say", - "call.ringing.hook-executed-transfer", - "call.ending.hook-executed-say", - "call.ending.hook-executed-transfer", - "call.ringing.sip-inbound-caller-hungup-before-call-connect", - "call.ringing.error-sip-inbound-call-failed-to-connect", - "twilio-failed-to-connect-call", - "twilio-reported-customer-misdialed", - "vonage-rejected", - "voicemail" - ] - }, - "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" - } - ] - }, - "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" - } - ] - }, - "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": { - "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" - } - ] - }, - "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" } - ] - } - } - }, - "PaginationMeta": { - "type": "object", - "properties": { - "itemsPerPage": { - "type": "number" - }, - "totalItems": { - "type": "number" - }, - "currentPage": { - "type": "number" - }, - "itemsBeyondRetention": { - "type": "boolean" - } - }, - "required": [ - "itemsPerPage", - "totalItems", - "currentPage" - ] - }, - "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.", + "hooks": { "type": "array", + "description": "This is a set of actions that will be performed on certain events.", "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" + "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 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": { + "variableValues": { "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" - } - ] - }, - "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" - } - ] + "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" }, - "phoneNumberId": { + "name": { "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 name of the assistant.\n\nThis is required when you want to transfer between assistants in a call.", + "maxLength": 40 }, - "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" - } - ] + "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 }, - "customerId": { + "endCallMessage": { "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": "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 }, - "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.", + "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/CreateCustomerDTO" + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" } ] - } - } - }, - "CreateWebCallDTO": { - "type": "object", - "properties": { - "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`", + "analysisPlan": { + "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", "allOf": [ { - "$ref": "#/components/schemas/CreateAssistantDTO" + "$ref": "#/components/schemas/AnalysisPlan" } ] }, - "assistantOverrides": { - "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "artifactPlan": { + "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", "allOf": [ { - "$ref": "#/components/schemas/AssistantOverrides" + "$ref": "#/components/schemas/ArtifactPlan" } ] }, - "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`", + "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/CreateSquadDTO" + "$ref": "#/components/schemas/StartSpeakingPlan" } ] }, - "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`", + "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/CreateWorkflowDTO" + "$ref": "#/components/schemas/StopSpeakingPlan" } ] }, - "workflowOverrides": { - "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "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`.", "allOf": [ { - "$ref": "#/components/schemas/WorkflowOverrides" + "$ref": "#/components/schemas/MonitorPlan" } ] - } - } - }, - "UpdateCallDTO": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "This is the name of the call. This is just for your own reference.", - "maxLength": 40 - } - } - }, - "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.", + "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" } }, - "originalMessage": { - "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": { - "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" - ] - }, - "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", + "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/ToolCallFunction" + "$ref": "#/components/schemas/Server" } ] - } - }, - "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 + "keypadInputPlan": { + "$ref": "#/components/schemas/KeypadInputPlan" } - }, - "required": [ - "arguments", - "name" - ] + } }, - "Chat": { + "SquadMemberDTO": { "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" - } - ] - }, - "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": { + "assistantDestinations": { "type": "array", - "description": "These are the costs of individual components of the chat in USD.", + "description": "These are the other assistants that this assistant can transfer or handoff to.\n\nSupports both:\n- TransferDestinationAssistant: For transfer call tool (legacy)\n- HandoffDestinationAssistant: For handoff tool (recommended)\n\nIf the assistant already has transfer call or handoff tools, these destinations are just appended to existing ones.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ModelCost", - "title": "ModelCost" + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Transfer Destination" }, { - "$ref": "#/components/schemas/ChatCost", - "title": "ChatCost" + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Handoff Destination" } ] } }, - "cost": { - "type": "number", - "description": "This is the cost of the chat in USD." - } - }, - "required": [ - "id", - "orgId", - "createdAt", - "updatedAt" - ] - }, - "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." + "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 chat. To use an existing assistant, use `assistantId` instead.", + "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" @@ -28523,1390 +25308,1339 @@ ] }, "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.", + "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 chat. This is just for your own reference.", - "maxLength": 40 + "description": "This is the name of the squad." }, - "sessionId": { - "type": "string", - "description": "This is the ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." + "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" + } }, - "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" - }, + "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": [ { - "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/AssistantOverrides" } - ], - "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." } }, "required": [ - "input" + "members" ] }, - "GetChatPaginatedDTO": { + "Squad": { "type": "object", "properties": { - "assistantId": { - "type": "string", - "description": "This is the unique identifier for the assistant that will be used for the chat." - }, - "workflowId": { - "type": "string", - "description": "This is the unique identifier for the workflow that will be used for the chat." - }, - "sessionId": { + "name": { "type": "string", - "description": "This is the unique identifier for the session that will be used for the chat." + "description": "This is the name of the squad." }, - "page": { - "type": "number", - "description": "This is the page number to return. Defaults to 1.", - "minimum": 1 + "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" + } }, - "sortOrder": { - "type": "string", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "enum": [ - "ASC", - "DESC" + "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" + } ] }, - "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", + "id": { "type": "string", - "description": "This will return items where the updatedAt is greater than the specified value." + "description": "This is the unique identifier for the squad." }, - "updatedAtLt": { - "format": "date-time", + "orgId": { "type": "string", - "description": "This will return items where the updatedAt is less than the specified value." + "description": "This is the unique identifier for the org that this squad belongs to." }, - "updatedAtGe": { + "createdAt": { "format": "date-time", "type": "string", - "description": "This will return items where the updatedAt is greater than or equal to the specified value." + "description": "This is the ISO 8601 date-time string of when the squad was created." }, - "updatedAtLe": { + "updatedAt": { "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" + "description": "This is the ISO 8601 date-time string of when the squad was last updated." } }, "required": [ - "results", - "metadata" + "members", + "id", + "orgId", + "createdAt", + "updatedAt" ] }, - "CreateChatStreamResponse": { + "UpdateSquadDTO": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "This is the unique identifier for the streaming response." - }, - "sessionId": { + "name": { "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 is the name of the squad." }, - "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" + "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" + } }, - "delta": { - "type": "string", - "description": "This is the incremental content chunk being streamed." + "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": [ - "id", - "path", - "delta" + "members" ] }, - "OpenAIResponsesRequest": { + "Workflow": { "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." + "nodes": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" + }, + { + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" + } + ] + } }, - "assistant": { - "description": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.", - "allOf": [ + "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/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/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, { - "$ref": "#/components/schemas/AssistantOverrides" + "$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 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.", + "transcriber": { + "description": "This is the transcriber for the workflow.\n\nThis can be overridden at node level using `nodes[n].transcriber`.", "oneOf": [ { - "type": "string", - "title": "String" + "$ref": "#/components/schemas/AssemblyAITranscriber", + "title": "AssemblyAITranscriber" }, { - "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." - } - }, - "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/AzureSpeechTranscriber", + "title": "AzureSpeechTranscriber" + }, { - "$ref": "#/components/schemas/ChatAssistantOverrides" + "$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" } ] }, - "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": "The assistant ID to use for this chat" - }, - "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." - }, - "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": [ + "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/ChatAssistantOverrides" + "$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" } ] }, - "customer": { - "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", + "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/CreateWebCustomerDTO" + "$ref": "#/components/schemas/LangfuseObservabilityPlan" } ] }, - "input": { - "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "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": "string", - "title": "String" + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" }, { - "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" + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" } - ], - "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" - ] - }, - "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": { + "hooks": { "type": "array", - "description": "This is the output messages generated by the system in response to the input.", + "description": "This is a set of actions that will be performed on certain events.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" - }, - { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" }, { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" }, { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" } ] } - } - }, - "required": [ - "id", - "output" - ] - }, - "OpenAIWebChatRequest": { - "type": "object", - "properties": { - "assistantId": { - "type": "string", - "description": "The assistant ID to use for this chat" - }, - "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." - }, - "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" - } - ] + "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" }, - "title": "MessageArray" - } - ], - "examples": [ - "Hello, how can you help me?", - [ { - "role": "user", - "content": "Hello, how can you help me?" + "$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/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" } - ] - ] - }, - "stream": { - "type": "boolean", - "description": "Whether to stream the response or not.", - "default": true - } - }, - "required": [ - "assistantId", - "input" - ] - }, - "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" + ], + "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", + "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", + "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" + } + } } }, - "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" + "type": "string" }, - "object": { - "type": "string", - "default": "response", - "description": "The object type", - "enum": [ - "response" - ] + "orgId": { + "type": "string" }, - "created_at": { - "type": "number", - "description": "Unix timestamp (in seconds) of when this Response was created" + "createdAt": { + "format": "date-time", + "type": "string" }, - "status": { - "type": "string", - "description": "Status of the response", - "enum": [ - "completed", - "failed", - "in_progress", - "incomplete" - ] + "updatedAt": { + "format": "date-time", + "type": "string" }, - "error": { + "name": { "type": "string", - "nullable": true, - "default": null, - "description": "Error message if the response failed" + "maxLength": 80 }, - "output": { - "description": "Output messages from the model", + "edges": { "type": "array", "items": { - "$ref": "#/components/schemas/ResponseOutputMessage" + "$ref": "#/components/schemas/Edge" } - } - }, - "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": { + "globalPrompt": { "type": "string", - "description": "ID of the output item" - }, - "output_index": { - "type": "number", - "description": "Index of the output item" + "maxLength": 5000 }, - "type": { - "type": "string", - "default": "response.output_text.delta", - "description": "Event type", - "enum": [ - "response.output_text.delta" + "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" + } ] - } - }, - "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", + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", "allOf": [ { - "$ref": "#/components/schemas/ResponseObject" + "$ref": "#/components/schemas/CompliancePlan" } ] }, - "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" + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } ] }, - "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" - ] - }, - "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" - }, - "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." - }, - "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." - }, - "phoneNumberId": { - "type": "string", - "description": "This is the phone number ID that will be used for the campaign calls." - }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.", + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", "allOf": [ { - "$ref": "#/components/schemas/SchedulePlan" + "$ref": "#/components/schemas/ArtifactPlan" } ] }, - "customers": { - "description": "These are the customers that will be called in the campaign.", - "type": "array", - "items": { - "$ref": "#/components/schemas/CreateCustomerDTO" - } - } - }, - "required": [ - "name", - "phoneNumberId", - "customers" - ] - }, - "Campaign": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "This is the status of the campaign.", - "enum": [ - "scheduled", - "in-progress", - "ended" + "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" + } ] }, - "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" + "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" + } ] }, - "name": { - "type": "string", - "description": "This is the name of the campaign. This is just for your own reference.", - "example": "Q2 Sales Campaign" - }, - "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." - }, - "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." - }, - "phoneNumberId": { - "type": "string", - "description": "This is the phone number ID that will be used for the campaign calls." + "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" + } + ] }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.", + "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/SchedulePlan" + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" } ] }, - "customers": { - "description": "These are the customers that will be called in the campaign.", + "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": { - "$ref": "#/components/schemas/CreateCustomerDTO" + "type": "string" } }, - "id": { - "type": "string", - "description": "This is the unique identifier for the campaign." - }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this campaign belongs to." - }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the campaign was created." - }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the campaign was last updated." - }, - "calls": { - "type": "object", - "description": "This is a map of call IDs to campaign call details." - }, - "callsCounterScheduled": { - "type": "number", - "description": "This is the number of calls that have been scheduled." - }, - "callsCounterQueued": { - "type": "number", - "description": "This is the number of calls that have been queued." - }, - "callsCounterInProgress": { - "type": "number", - "description": "This is the number of calls that have been in progress." - }, - "callsCounterEndedVoicemail": { - "type": "number", - "description": "This is the number of calls whose ended reason is 'voicemail'." - }, - "callsCounterEnded": { - "type": "number", - "description": "This is the number of calls that have ended." + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", + "allOf": [ + { + "$ref": "#/components/schemas/KeypadInputPlan" + } + ] } }, "required": [ - "status", - "name", - "phoneNumberId", - "customers", + "nodes", "id", "orgId", "createdAt", "updatedAt", - "calls", - "callsCounterScheduled", - "callsCounterQueued", - "callsCounterInProgress", - "callsCounterEndedVoicemail", - "callsCounterEnded" + "name", + "edges" ] }, - "CampaignPaginatedResponse": { + "CreateWorkflowDTO": { "type": "object", "properties": { - "results": { + "nodes": { "type": "array", "items": { - "$ref": "#/components/schemas/Campaign" + "oneOf": [ + { + "$ref": "#/components/schemas/ConversationNode", + "title": "ConversationNode" + }, + { + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" + } + ] } }, - "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." - }, - "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." - }, - "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." + "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" + } + ] }, - "phoneNumberId": { - "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." + "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" + } + ] }, - "schedulePlan": { - "description": "This is the schedule plan for the campaign.\nCan only be updated if campaign is not in progress or has ended.", - "allOf": [ + "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/SchedulePlan" + "$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" } ] }, - "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" - ] - } - } - }, - "Session": { - "type": "object", - "properties": { - "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." - }, - "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" + "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" + } ] }, - "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 ID of the assistant associated with this session. Use this when referencing an existing assistant." - }, - "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.", - "allOf": [ + "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/CreateAssistantDTO" + "type": "enum", + "enum": [ + "off", + "office" + ], + "example": "office" + }, + { + "type": "string", + "format": "uri", + "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" } ] }, - "messages": { + "hooks": { "type": "array", - "description": "This is an array of chat messages in the session.", + "description": "This is a set of actions that will be performed on certain events.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/SystemMessage", - "title": "SystemMessage" + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" }, { - "$ref": "#/components/schemas/UserMessage", - "title": "UserMessage" + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" }, { - "$ref": "#/components/schemas/AssistantMessage", - "title": "AssistantMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" }, { - "$ref": "#/components/schemas/ToolMessage", - "title": "ToolMessage" + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + } + ] + } + }, + "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/DeveloperMessage", - "title": "DeveloperMessage" + "$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/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" } - ] + ], + "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", + "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", + "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" + } + } } }, - "customer": { - "description": "This is the customer information associated with this session.", + "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/CreateCustomerDTO" + "$ref": "#/components/schemas/Server" } ] }, - "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.", + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", "allOf": [ { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + "$ref": "#/components/schemas/CompliancePlan" } ] - } - }, - "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.", - "maxLength": 40 }, - "status": { - "type": "string", - "description": "This is the current status of the session. Can be either 'active' or 'completed'.", - "enum": [ - "active", - "completed" + "analysisPlan": { + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "allOf": [ + { + "$ref": "#/components/schemas/AnalysisPlan" + } ] }, - "expirationSeconds": { - "type": "number", - "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", - "minimum": 60, - "maximum": 2592000, - "example": 86400 + "artifactPlan": { + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "allOf": [ + { + "$ref": "#/components/schemas/ArtifactPlan" + } + ] }, - "assistantId": { - "type": "string", - "description": "This is the ID of the assistant associated with this session. Use this when referencing an existing assistant." + "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" + } + ] }, - "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.", + "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/CreateAssistantDTO" + "$ref": "#/components/schemas/StopSpeakingPlan" } ] }, - "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" - } - ] - } + "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" + } + ] }, - "customer": { - "description": "This is the customer information associated with this session.", + "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/CreateCustomerDTO" + "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" } ] }, - "phoneNumberId": { - "type": "string", - "description": "This is the ID of the phone number associated with this session." + "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" + } }, - "phoneNumber": { - "description": "This is the phone number configuration for this session.", + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", "allOf": [ { - "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" + "$ref": "#/components/schemas/KeypadInputPlan" } ] } - } + }, + "required": [ + "nodes", + "name", + "edges" + ] }, - "UpdateSessionDTO": { + "UpdateWorkflowDTO": { "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": { + "nodes": { "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/ConversationNode", + "title": "ConversationNode" }, { - "$ref": "#/components/schemas/DeveloperMessage", - "title": "DeveloperMessage" + "$ref": "#/components/schemas/ToolNode", + "title": "ToolNode" } ] } - } - } - }, - "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": "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 - }, - "sortOrder": { - "type": "string", - "description": "This is the sort order for pagination. Defaults to 'DESC'.", - "enum": [ - "ASC", - "DESC" + "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" + } ] }, - "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." - } - } - }, - "SessionPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Session" - } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "Assistant": { - "type": "object", - "properties": { "transcriber": { - "description": "These are the options for the assistant's 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", @@ -29954,69 +26688,8 @@ } ] }, - "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" - }, - { - "$ref": "#/components/schemas/XaiModel", - "title": "XAI" - } - ] - }, "voice": { - "description": "These are the options for the assistant's 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", @@ -30088,181 +26761,20 @@ } ] }, - "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].\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.", + "observabilityPlan": { + "description": "This is the plan for observability of workflow's calls.\n\nCurrently, only Langfuse is supported.", "oneOf": [ { - "$ref": "#/components/schemas/GoogleVoicemailDetectionPlan", - "title": "Google" - }, - { - "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", - "title": "Twilio" - }, + "$ref": "#/components/schemas/LangfuseObservabilityPlan", + "title": "Langfuse" + } + ], + "allOf": [ { - "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", - "title": "Vapi" + "$ref": "#/components/schemas/LangfuseObservabilityPlan" } ] }, - "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" - ] - } - }, - "serverMessages": { - "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" - ] - } - }, - "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": [ @@ -30281,40 +26793,33 @@ } ] }, - "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 - }, - "transportConfigurations": { + "hooks": { "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": "This is a set of actions that will be performed on certain events.", "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/LangfuseObservabilityPlan", - "title": "Langfuse" - } - ], - "allOf": [ - { - "$ref": "#/components/schemas/LangfuseObservabilityPlan" - } - ] + "$ref": "#/components/schemas/CallHookCallEnding", + "title": "CallHookCallEnding" + }, + { + "$ref": "#/components/schemas/CallHookAssistantSpeechInterrupted", + "title": "CallHookAssistantSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechInterrupted", + "title": "CallHookCustomerSpeechInterrupted" + }, + { + "$ref": "#/components/schemas/CallHookCustomerSpeechTimeout", + "title": "CallHookCustomerSpeechTimeout" + } + ] + } }, "credentials": { "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 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": [ { @@ -30485,6 +26990,10 @@ "$ref": "#/components/schemas/CreateWebhookCredentialDTO", "title": "WebhookCredential" }, + { + "$ref": "#/components/schemas/CreateCustomCredentialDTO", + "title": "CustomCredential" + }, { "$ref": "#/components/schemas/CreateXAiCredentialDTO", "title": "XAiCredential" @@ -30554,6 +27063,7 @@ "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", @@ -30571,71 +27081,38 @@ } } }, - "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 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 + "maxLength": 80 }, - "endCallPhrases": { - "description": "This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.", + "edges": { "type": "array", "items": { - "type": "string", - "maxLength": 140, - "minLength": 2 + "$ref": "#/components/schemas/Edge" } }, - "compliancePlan": { - "$ref": "#/components/schemas/CompliancePlan" + "globalPrompt": { + "type": "string", + "maxLength": 5000 }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the assistant." + "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" + } + ] }, - "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", + "compliancePlan": { + "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", "allOf": [ { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + "$ref": "#/components/schemas/CompliancePlan" } ] }, "analysisPlan": { - "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", + "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", "allOf": [ { "$ref": "#/components/schemas/AnalysisPlan" @@ -30643,7 +27120,7 @@ ] }, "artifactPlan": { - "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", + "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", "allOf": [ { "$ref": "#/components/schemas/ArtifactPlan" @@ -30651,7 +27128,7 @@ ] }, "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.", + "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" @@ -30659,7 +27136,7 @@ ] }, "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.", + "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" @@ -30667,4658 +27144,5268 @@ ] }, "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 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 assistant 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 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" } }, - "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", + "keypadInputPlan": { + "description": "This is the plan for keypad input handling during workflow calls.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/KeypadInputPlan" } ] + } + } + }, + "AnalysisCostBreakdown": { + "type": "object", + "properties": { + "summary": { + "type": "number", + "description": "This is the cost to summarize the call." }, - "keypadInputPlan": { - "$ref": "#/components/schemas/KeypadInputPlan" + "summaryPromptTokens": { + "type": "number", + "description": "This is the number of prompt tokens used to summarize the call." }, - "id": { + "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" + } + ] + } + } + }, + "Analysis": { + "type": "object", + "properties": { + "summary": { "type": "string", - "description": "This is the unique identifier for the assistant." + "description": "This is the summary of the call. Customize by setting `assistant.analysisPlan.summaryPrompt`." }, - "orgId": { + "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 unique identifier for the org that this assistant belongs to." + "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`." }, - "createdAt": { - "format": "date-time", + "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." + } + } + }, + "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." + } + } + }, + "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 ISO 8601 date-time string of when the assistant was created." + "description": "This is the type of action - must be \"say\"", + "enum": [ + "say" + ] }, - "updatedAt": { - "format": "date-time", + "exact": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the assistant was last updated." + "description": "This is the message to say", + "maxLength": 4000 } }, "required": [ - "id", - "orgId", - "createdAt", - "updatedAt" + "type", + "exact" ] }, - "AssistantPaginatedResponse": { + "PhoneNumberHookCallRinging": { "type": "object", "properties": { - "results": { + "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": { - "$ref": "#/components/schemas/Assistant" + "oneOf": [ + { + "$ref": "#/components/schemas/TransferPhoneNumberHookAction", + "title": "TransferPhoneNumberHookAction" + }, + { + "$ref": "#/components/schemas/SayPhoneNumberHookAction", + "title": "SayPhoneNumberHookAction" + } + ] } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "results", - "metadata" + "on", + "do" ] }, - "AssistantVersionPaginatedResponse": { + "PhoneNumberCallEndingHookFilter": { "type": "object", "properties": { - "results": { - "type": "array" + "type": { + "type": "string", + "description": "This is the type of filter - currently only \"oneOf\" is supported", + "enum": [ + "oneOf" + ], + "maxLength": 1000 }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" + "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 }, - "nextPageState": { - "type": "string" + "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": [ - "results", - "metadata" + "type", + "key", + "oneOf" ] }, - "UpdateAssistantDTO": { + "PhoneNumberHookCallEnding": { "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" - } - ] + "on": { + "type": "string", + "description": "This is the event to trigger the hook on", + "enum": [ + "call.ending" + ], + "maxLength": 1000 }, - "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" - }, - { - "$ref": "#/components/schemas/XaiModel", - "title": "XAI" - } - ] + "filters": { + "type": "array", + "description": "Optional filters to decide when to trigger - restricted to assistant-request related ended reasons", + "items": { + "$ref": "#/components/schemas/PhoneNumberCallEndingHookFilter" + } }, - "voice": { - "description": "These are the options for the assistant's voice.", + "do": { + "description": "This is the action to perform when the hook triggers", "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/TransferPhoneNumberHookAction", + "title": "TransferPhoneNumberHookAction" }, { - "$ref": "#/components/schemas/MinimaxVoice", - "title": "MinimaxVoice" + "$ref": "#/components/schemas/SayPhoneNumberHookAction", + "title": "SayPhoneNumberHookAction" } ] - }, - "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].\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.", + } + }, + "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/GoogleVoicemailDetectionPlan", - "title": "Google" - }, - { - "$ref": "#/components/schemas/OpenAIVoicemailDetectionPlan", - "title": "OpenAI" - }, - { - "$ref": "#/components/schemas/TwilioVoicemailDetectionPlan", - "title": "Twilio" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "NumberTransferDestination" }, { - "$ref": "#/components/schemas/VapiVoicemailDetectionPlan", - "title": "Vapi" + "$ref": "#/components/schemas/TransferDestinationSip", + "title": "SipTransferDestination" } ] }, - "clientMessages": { + "hooks": { "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.", + "description": "This is the hooks that will be used for incoming calls to this phone number.", "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/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" + }, + { + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" + } ] } }, - "serverMessages": { - "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" - ] - } + "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." }, - "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 + "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." }, - "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": [ + "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": [ { - "type": "enum", - "enum": [ - "off", - "office" - ], - "example": "office" - }, + "$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": [ { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, - "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 + "number": { + "type": "string", + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 }, - "transportConfigurations": { + "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 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 costs of individual components of the call in USD.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/TransportConfigurationTwilio", - "title": "Twilio" + "$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" } ] } }, - "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" - } + "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" + ] + }, + "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-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-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", + "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-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-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", + "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", + "pipeline-error-eleven-labs-max-character-limit-exceeded", + "pipeline-error-eleven-labs-blocked-voice-potentially-against-terms-of-service-and-awaiting-verification", + "pipeline-error-eleven-labs-500-server-error", + "pipeline-error-eleven-labs-503-server-error", + "call.in-progress.error-vapifault-eleven-labs-voice-not-found", + "call.in-progress.error-vapifault-eleven-labs-quota-exceeded", + "call.in-progress.error-vapifault-eleven-labs-unauthorized-access", + "call.in-progress.error-vapifault-eleven-labs-unauthorized-to-access-model", + "call.in-progress.error-vapifault-eleven-labs-professional-voices-only-for-creator-plus", + "call.in-progress.error-vapifault-eleven-labs-blocked-free-plan-and-requested-upgrade", + "call.in-progress.error-vapifault-eleven-labs-blocked-concurrent-requests-and-requested-upgrade", + "call.in-progress.error-vapifault-eleven-labs-blocked-using-instant-voice-clone-and-requested-upgrade", + "call.in-progress.error-vapifault-eleven-labs-system-busy-and-requested-upgrade", + "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned", + "call.in-progress.error-vapifault-eleven-labs-invalid-api-key", + "call.in-progress.error-vapifault-eleven-labs-invalid-voice-samples", + "call.in-progress.error-vapifault-eleven-labs-voice-disabled-by-owner", + "call.in-progress.error-vapifault-eleven-labs-blocked-account-in-probation", + "call.in-progress.error-vapifault-eleven-labs-blocked-content-against-their-policy", + "call.in-progress.error-vapifault-eleven-labs-missing-samples-for-voice-clone", + "call.in-progress.error-vapifault-eleven-labs-voice-not-fine-tuned-and-cannot-be-used", + "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-500-server-error", + "call.in-progress.error-providerfault-eleven-labs-503-server-error", + "pipeline-error-playht-request-timed-out", + "pipeline-error-playht-invalid-voice", + "pipeline-error-playht-unexpected-error", + "pipeline-error-playht-out-of-credits", + "pipeline-error-playht-invalid-emotion", + "pipeline-error-playht-voice-must-be-a-valid-voice-manifest-uri", + "pipeline-error-playht-401-unauthorized", + "pipeline-error-playht-403-forbidden-out-of-characters", + "pipeline-error-playht-403-forbidden-api-access-not-available", + "pipeline-error-playht-429-exceeded-quota", + "pipeline-error-playht-502-gateway-error", + "pipeline-error-playht-504-gateway-error", + "call.in-progress.error-vapifault-playht-request-timed-out", + "call.in-progress.error-vapifault-playht-invalid-voice", + "call.in-progress.error-vapifault-playht-unexpected-error", + "call.in-progress.error-vapifault-playht-out-of-credits", + "call.in-progress.error-vapifault-playht-invalid-emotion", + "call.in-progress.error-vapifault-playht-voice-must-be-a-valid-voice-manifest-uri", + "call.in-progress.error-vapifault-playht-401-unauthorized", + "call.in-progress.error-vapifault-playht-403-forbidden-out-of-characters", + "call.in-progress.error-vapifault-playht-403-forbidden-api-access-not-available", + "call.in-progress.error-vapifault-playht-429-exceeded-quota", + "call.in-progress.error-providerfault-playht-502-gateway-error", + "call.in-progress.error-providerfault-playht-504-gateway-error", + "pipeline-error-custom-transcriber-failed", + "call.in-progress.error-vapifault-custom-transcriber-failed", + "pipeline-error-eleven-labs-transcriber-failed", + "call.in-progress.error-vapifault-eleven-labs-transcriber-failed", + "pipeline-error-deepgram-returning-400-no-such-model-language-tier-combination", + "pipeline-error-deepgram-returning-401-invalid-credentials", + "pipeline-error-deepgram-returning-403-model-access-denied", + "pipeline-error-deepgram-returning-404-not-found", + "pipeline-error-deepgram-returning-500-invalid-json", + "pipeline-error-deepgram-returning-502-network-error", + "pipeline-error-deepgram-returning-502-bad-gateway-ehostunreach", + "pipeline-error-deepgram-returning-econnreset", + "call.in-progress.error-vapifault-deepgram-returning-400-no-such-model-language-tier-combination", + "call.in-progress.error-vapifault-deepgram-returning-401-invalid-credentials", + "call.in-progress.error-vapifault-deepgram-returning-404-not-found", + "call.in-progress.error-vapifault-deepgram-returning-403-model-access-denied", + "call.in-progress.error-providerfault-deepgram-returning-500-invalid-json", + "call.in-progress.error-providerfault-deepgram-returning-502-network-error", + "call.in-progress.error-providerfault-deepgram-returning-502-bad-gateway-ehostunreach", + "pipeline-error-google-transcriber-failed", + "call.in-progress.error-vapifault-google-transcriber-failed", + "pipeline-error-openai-transcriber-failed", + "call.in-progress.error-vapifault-openai-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", + "assistant-ended-call-after-message-spoken", + "assistant-forwarded-call", + "assistant-join-timed-out", + "call.in-progress.error-assistant-did-not-receive-customer-audio", + "call.in-progress.error-transfer-failed", + "customer-busy", + "customer-ended-call", + "customer-ended-call-after-warm-transfer-attempt", + "customer-did-not-answer", + "customer-did-not-give-microphone-permission", + "exceeded-max-duration", + "manually-canceled", + "phone-call-provider-closed-websocket", + "call.forwarding.operator-busy", + "silence-timed-out", + "call.in-progress.error-sip-inbound-call-failed-to-connect", + "call.in-progress.error-providerfault-outbound-sip-403-forbidden", + "call.in-progress.error-providerfault-outbound-sip-407-proxy-authentication-required", + "call.in-progress.error-providerfault-outbound-sip-503-service-unavailable", + "call.in-progress.error-providerfault-outbound-sip-480-temporarily-unavailable", + "call.in-progress.error-sip-outbound-call-failed-to-connect", + "call.ringing.hook-executed-say", + "call.ringing.hook-executed-transfer", + "call.ending.hook-executed-say", + "call.ending.hook-executed-transfer", + "call.ringing.sip-inbound-caller-hungup-before-call-connect", + "call.ringing.error-sip-inbound-call-failed-to-connect", + "twilio-failed-to-connect-call", + "twilio-reported-customer-misdialed", + "vonage-rejected", + "voicemail" ] - }, - "credentials": { - "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.", - "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" - } + }, + "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" } - } + ] }, - "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" - } - ] - } + "id": { + "type": "string", + "description": "This is the unique identifier for the call." }, - "name": { + "orgId": { "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 org that this call belongs to." }, - "voicemailMessage": { + "createdAt": { + "format": "date-time", "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 ISO 8601 date-time string of when the call was created." }, - "endCallMessage": { + "updatedAt": { + "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 + "description": "This is the ISO 8601 date-time string of when the call was last updated." }, - "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 - } + "startedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was started." }, - "compliancePlan": { - "$ref": "#/components/schemas/CompliancePlan" + "endedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the call was ended." }, - "metadata": { - "type": "object", - "description": "This is for metadata you want to store on the assistant." + "cost": { + "type": "number", + "description": "This is the cost of the call in USD." }, - "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", + "costBreakdown": { + "description": "This is the cost of the call in USD.", "allOf": [ { - "$ref": "#/components/schemas/BackgroundSpeechDenoisingPlan" + "$ref": "#/components/schemas/CostBreakdown" } ] }, - "analysisPlan": { - "description": "This is the plan for analysis of assistant's calls. Stored in `call.analysis`.", + "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/AnalysisPlan" + "$ref": "#/components/schemas/ArtifactPlan" } ] }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.", + "analysis": { + "description": "This is the analysis of the call. Configure in `assistant.analysisPlan`.", "allOf": [ { - "$ref": "#/components/schemas/ArtifactPlan" + "$ref": "#/components/schemas/Analysis" } ] }, - "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.", + "monitor": { + "description": "This is to real-time monitor the call. Configure in `assistant.monitorPlan`.", "allOf": [ { - "$ref": "#/components/schemas/StartSpeakingPlan" + "$ref": "#/components/schemas/Monitor" } ] }, - "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.", + "artifact": { + "description": "These are the artifacts created from the call. Configure in `assistant.artifactPlan`.", "allOf": [ { - "$ref": "#/components/schemas/StopSpeakingPlan" + "$ref": "#/components/schemas/Artifact" } ] }, - "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`.", + "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/MonitorPlan" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "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.url\n2. phoneNumber.serverUrl\n3. org.serverUrl", + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, - "keypadInputPlan": { - "$ref": "#/components/schemas/KeypadInputPlan" - } - } - }, - "ByoPhoneNumber": { - "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" - }, + "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/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/CreateSquadDTO" } ] }, - "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": { + "workflowId": { "type": "string", - "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", - "enum": [ - "byo-phone-number" - ] + "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`" }, - "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 + "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" + } + ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the phone number." + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] }, - "orgId": { + "phoneNumberId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "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." }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "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" + } + ] }, - "updatedAt": { - "format": "date-time", + "customerId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "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." }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" + "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 phone number. This is just for your own reference.", + "description": "This is the name of the call. 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", + "schedulePlan": { + "description": "This is the schedule plan of the call.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/SchedulePlan" } ] }, - "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." + "transport": { + "type": "object", + "description": "This is the transport of the call." } }, "required": [ - "provider", "id", "orgId", "createdAt", - "updatedAt", - "credentialId" + "updatedAt" ] }, - "TwilioPhoneNumber": { + "CallBatchError": { "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" - } - ] + "customer": { + "$ref": "#/components/schemas/CreateCustomerDTO" }, - "hooks": { + "error": { + "type": "string" + } + }, + "required": [ + "customer", + "error" + ] + }, + "CallBatchResponse": { + "type": "object", + "properties": { + "results": { + "description": "This is the list of calls that were created.", "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" - } - ] + "$ref": "#/components/schemas/Call" } }, - "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 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" - ] - }, - "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" - } - ] - }, - "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." + "errors": { + "description": "This is the list of calls that failed to be created.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CallBatchError" + } } }, "required": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt", - "number", - "twilioAccountSid" + "results", + "errors" ] }, - "VonagePhoneNumber": { + "CreateCallDTO": { "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": { + "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", - "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" - } - ] + "$ref": "#/components/schemas/CreateCustomerDTO" } }, - "provider": { + "name": { "type": "string", - "description": "This is to use numbers bought on Vonage.", - "enum": [ - "vonage" + "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" + } ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the phone number." + "transport": { + "type": "object", + "description": "This is the transport of the call." }, - "orgId": { + "assistantId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "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`" }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "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" + } + ] }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] }, - "status": { + "squadId": { "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" + "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" + } ] }, - "name": { + "workflowId": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "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`" }, - "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." + "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" + } + ] }, - "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." + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/WorkflowOverrides" + } + ] }, - "squadId": { + "phoneNumberId": { "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 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." }, - "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", + "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/Server" + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" } ] }, - "number": { + "customerId": { "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." + "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." }, - "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." + "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" + } + ] } - }, - "required": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt", - "number", - "credentialId" - ] + } }, - "SipAuthentication": { + "CallPaginatedResponse": { "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 + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Call" + } }, - "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 + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "username", - "password" + "results", + "metadata" ] }, - "VapiPhoneNumber": { + "CreateOutboundCallDTO": { "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": { + "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", - "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" - } - ] + "$ref": "#/components/schemas/CreateCustomerDTO" } }, - "provider": { - "type": "string", - "description": "This is to create free SIP phone numbers on Vapi.", - "enum": [ - "vapi" - ] - }, - "id": { + "name": { "type": "string", - "description": "This is the unique identifier for the phone number." + "description": "This is the name of the call. This is just for your own reference.", + "maxLength": 40 }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "schedulePlan": { + "description": "This is the schedule plan of the call.", + "allOf": [ + { + "$ref": "#/components/schemas/SchedulePlan" + } + ] }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "transport": { + "type": "object", + "description": "This is the transport of the call." }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "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`" }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" + "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" + } ] }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you purchased from Vapi." + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] }, - "name": { + "squadId": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "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`" }, - "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." + "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" + } + ] }, "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": "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`" }, - "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." + "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" + } + ] }, - "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", + "workflowOverrides": { + "description": "These are the overrides for the `workflow` or `workflowId`'s settings and template variables.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/WorkflowOverrides" } ] }, - "numberDesiredAreaCode": { + "phoneNumberId": { "type": "string", - "description": "This is the area code of the phone number to purchase.", - "minLength": 3, - "maxLength": 3 + "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." }, - "sipUri": { + "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 SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.\n\nThis is case-insensitive." + "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." }, - "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.", + "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/SipAuthentication" + "$ref": "#/components/schemas/CreateCustomerDTO" } ] } - }, - "required": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + } }, - "TelnyxPhoneNumber": { + "CreateWebCallDTO": { "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" - }, + "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/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "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": "This is to use numbers bought on Telnyx.", - "enum": [ - "telnyx" + "assistantOverrides": { + "description": "These are the overrides for the `assistant` or `assistantId`'s settings and template variables.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the phone number." - }, - "orgId": { + "squadId": { "type": "string", - "description": "This is the unique identifier for the org that this phone number belongs to." + "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`" }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was created." + "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" + } + ] }, - "updatedAt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the phone number was last updated." + "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`" }, - "status": { - "type": "string", - "description": "This is the status of the phone number.", - "enum": [ - "active", - "activating", - "blocked" + "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 phone number. This is just for your own reference.", + "description": "This is the name of the call. This is just for your own reference.", "maxLength": 40 - }, - "assistantId": { + } + } + }, + "DeveloperMessage": { + "type": "object", + "properties": { + "role": { "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 role of the message author", + "default": "developer", + "enum": [ + "developer" + ] }, - "workflowId": { + "content": { "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 content of the developer message", + "maxLength": 10000 }, - "squadId": { + "name": { "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" - } - ] + "description": "This is an optional name for the participant", + "maxLength": 40 }, - "number": { + "metadata": { + "type": "object", + "description": "This is an optional metadata for the message" + } + }, + "required": [ + "role", + "content" + ] + }, + "SystemMessage": { + "type": "object", + "properties": { + "role": { "type": "string", - "description": "These are the digits of the phone number you own on your Telnyx." + "description": "The role of the system in the conversation." }, - "credentialId": { + "message": { "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." + "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": [ - "provider", - "id", - "orgId", - "createdAt", - "updatedAt", - "number", - "credentialId" + "role", + "message", + "time", + "secondsFromStart" ] }, - "CreateByoPhoneNumberDTO": { + "UserMessage": { "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" - } - ] - } + "role": { + "type": "string", + "description": "The role of the user in the conversation." }, - "provider": { + "message": { "type": "string", - "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", - "enum": [ - "byo-phone-number" - ] + "description": "The message content from the user." }, - "numberE164CheckEnabled": { + "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": "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": "Indicates if the message was filtered for security reasons." }, - "number": { - "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, - "maxLength": 40 + "detectedThreats": { + "description": "List of detected security threats if the message was filtered.", + "type": "array", + "items": { + "type": "string" + } }, - "credentialId": { + "originalMessage": { "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." + "description": "The original message before filtering (only included if content was filtered)." + } + }, + "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 phone number. This is just for your own reference.", + "description": "This is the name of the function to call", "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": { + } + }, + "required": [ + "arguments", + "name" + ] + }, + "ToolCall": { + "type": "object", + "properties": { + "id": { "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 ID of the tool call" }, - "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." + "description": "This is the 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", + "function": { + "description": "This is the function that was called", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/ToolCallFunction" } ] } }, "required": [ - "provider", - "credentialId" + "id", + "type", + "function" ] }, - "CreateTwilioPhoneNumberDTO": { + "AssistantMessage": { "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" - } - ] - } - }, - "provider": { + "role": { "type": "string", - "description": "This is to use numbers bought on Twilio.", + "description": "This is the role of the message author", + "default": "assistant", "enum": [ - "twilio" + "assistant" ] }, - "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": { + "content": { "type": "string", - "description": "This is the Twilio Auth Token for the phone number." + "description": "This is the content of the assistant message", + "maxLength": 10000 }, - "twilioApiKey": { + "refusal": { "type": "string", - "description": "This is the Twilio API Key for the phone number." + "description": "This is the refusal message generated by the model", + "maxLength": 10000 }, - "twilioApiSecret": { - "type": "string", - "description": "This is the Twilio API Secret for the phone number." + "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 the name of the phone number. This is just for your own reference.", + "description": "This is an optional name for the participant", "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" - } - ] + "metadata": { + "type": "object", + "description": "This is an optional metadata for the message" } }, "required": [ - "provider", - "number", - "twilioAccountSid" + "role" ] }, - "CreateVonagePhoneNumberDTO": { + "ToolMessage": { "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" - } - ] - } - }, - "provider": { + "role": { "type": "string", - "description": "This is to use numbers bought on Vonage.", + "description": "This is the role of the message author", + "default": "tool", "enum": [ - "vonage" + "tool" ] }, - "number": { + "content": { "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." + "description": "This is the content of the tool message", + "maxLength": 10000 }, - "credentialId": { + "tool_call_id": { "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." + "description": "This is the ID of the tool call this message is responding to" }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", + "description": "This is an optional name for the participant", "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": { + "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 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 arguments to call the function with" }, - "squadId": { + "name": { "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" - } - ] + "description": "This is the name of the function to call", + "maxLength": 40 } }, "required": [ - "provider", - "number", - "credentialId" + "arguments", + "name" ] }, - "CreateVapiPhoneNumberDTO": { + "Chat": { "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" - }, + "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/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "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": "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 - }, - "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.", + "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/SipAuthentication" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", + "description": "This is the name of the chat. 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": { + "sessionId": { "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 ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." }, - "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": [ - "provider" - ] - }, - "CreateTelnyxPhoneNumberDTO": { - "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.", + "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?" + } + ] ] }, - "hooks": { + "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 the hooks that will be used for incoming calls to this phone number.", + "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/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$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 Telnyx.", - "enum": [ - "telnyx" - ] - }, - "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." - }, - "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." + "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" + } + ] + } }, - "workflowId": { + "createdAt": { + "format": "date-time", "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 ISO 8601 date-time string of when the chat was created." }, - "squadId": { + "updatedAt": { + "format": "date-time", "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": [ - "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" - } - ] + "description": "This is the ISO 8601 date-time string of when the chat was last updated." }, - "hooks": { + "costs": { "type": "array", - "description": "This is the hooks that will be used for incoming calls to this phone number.", + "description": "These are the costs of individual components of the chat in USD.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/PhoneNumberHookCallRinging", - "title": "PhoneNumberHookCallRinging" + "$ref": "#/components/schemas/ModelCost", + "title": "ModelCost" }, { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "$ref": "#/components/schemas/ChatCost", + "title": "ChatCost" } ] } }, - "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 - }, + "cost": { + "type": "number", + "description": "This is the cost of the chat in USD." + } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "CreateChatDTO": { + "type": "object", + "properties": { "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": "This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead." }, - "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." + "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" + } + ] }, - "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", + "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/Server" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, - "number": { + "name": { "type": "string", - "description": "This is the number of the customer.", - "minLength": 3, + "description": "This is the name of the chat. This is just for your own reference.", "maxLength": 40 }, - "credentialId": { + "sessionId": { "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.", + "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": [ { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "NumberTransferDestination" + "type": "string", + "title": "String" }, { - "$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" + "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?", + [ { - "$ref": "#/components/schemas/PhoneNumberHookCallEnding", - "title": "PhoneNumberHookCallEnding" + "role": "user", + "content": "Hello, how can you help me?" } ] - } + ] }, - "smsEnabled": { + "stream": { "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 + "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 }, - "name": { + "previousChatId": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 - }, + "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" + ] + }, + "GetChatPaginatedDTO": { + "type": "object", + "properties": { "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." + "description": "This is the unique identifier for the assistant that will be used for the chat." }, "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": "This is the unique identifier for the workflow that will be used for the chat." }, - "squadId": { + "sessionId": { "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" - } - ] + "description": "This is the unique identifier for the session that will be used for the chat." }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Twilio." + "page": { + "type": "number", + "description": "This is the page number to return. Defaults to 1.", + "minimum": 1 }, - "twilioAccountSid": { + "sortOrder": { "type": "string", - "description": "This is the Twilio Account SID for the phone number." + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "enum": [ + "ASC", + "DESC" + ] }, - "twilioAuthToken": { - "type": "string", - "description": "This is the Twilio Auth Token for the phone number." + "limit": { + "type": "number", + "description": "This is the maximum number of items to return. Defaults to 100.", + "minimum": 0, + "maximum": 1000 }, - "twilioApiKey": { + "createdAtGt": { + "format": "date-time", "type": "string", - "description": "This is the Twilio API Key for the phone number." + "description": "This will return items where the createdAt is greater than the specified value." }, - "twilioApiSecret": { + "createdAtLt": { + "format": "date-time", "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": [ - { - "$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" - } - ] - } + "description": "This will return items where the createdAt is less than the specified value." }, - "name": { + "createdAtGe": { + "format": "date-time", "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "description": "This will return items where the createdAt is greater than or equal to the specified value." }, - "assistantId": { + "createdAtLe": { + "format": "date-time", "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 will return items where the createdAt is less than or equal to the specified value." }, - "workflowId": { + "updatedAtGt": { + "format": "date-time", "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 will return items where the updatedAt is greater than the specified value." }, - "squadId": { + "updatedAtLt": { + "format": "date-time", "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" - } - ] + "description": "This will return items where the updatedAt is less than the specified value." }, - "number": { + "updatedAtGe": { + "format": "date-time", "type": "string", - "description": "These are the digits of the phone number you own on your Vonage." + "description": "This will return items where the updatedAt is greater than or equal to the specified value." }, - "credentialId": { + "updatedAtLe": { + "format": "date-time", "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." + "description": "This will return items where the updatedAt is less than or equal to the specified value." } } }, - "UpdateVapiPhoneNumberDTO": { + "ChatPaginatedResponse": { "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": { + "results": { "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" - } - ] + "$ref": "#/components/schemas/Chat" } }, - "name": { + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateChatStreamResponse": { + "type": "object", + "properties": { + "id": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", - "maxLength": 40 + "description": "This is the unique identifier for the streaming response." }, - "assistantId": { + "sessionId": { "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 ID of the session that will be used for the chat.\nHelps track conversation context across multiple messages." }, - "workflowId": { + "path": { "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 path to the content being updated.\nFormat: `chat.output[{contentIndex}].content` where contentIndex identifies the specific content item.", + "example": "chat.output[0].content" }, - "squadId": { + "delta": { "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 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." }, - "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", + "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/Server" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] }, - "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.", + "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/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" + "$ref": "#/components/schemas/AssistantOverrides" } ] }, - "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" - } - ] - } - }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", + "description": "This is the name of the chat. 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": { + "sessionId": { "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 ID of the session that will be used for the chat.\nMutually exclusive with previousChatId." }, - "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": [ + "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": [ { - "$ref": "#/components/schemas/Server" + "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?" + } + ] ] }, - "number": { - "type": "string", - "description": "These are the digits of the phone number you own on your Telnyx." + "stream": { + "type": "boolean", + "description": "Whether to stream the response or not.", + "default": true }, - "credentialId": { + "previousChatId": { "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." + "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" + } } } }, - "ImportVonagePhoneNumberDTO": { + "CreateWebCustomerDTO": { "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" - }, + "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/TransferDestinationSip", - "title": "SipTransferDestination" + "$ref": "#/components/schemas/ChatAssistantOverrides" } ] }, - "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": { + "number": { "type": "string", - "description": "These are the digits of the phone number you own on your Vonage.", - "deprecated": true + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 }, - "credentialId": { + "sipUri": { "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." + "description": "This is the SIP URI of the customer." }, "name": { "type": "string", - "description": "This is the name of the phone number. This is just for your own reference.", + "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 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 assistant ID to use for this chat" }, - "workflowId": { + "sessionId": { "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 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." }, - "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." + "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" + } + ] }, - "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", + "customer": { + "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$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 } }, "required": [ - "vonagePhoneNumber", - "credentialId" + "assistantId", + "input" ] }, - "PhoneNumberPaginatedResponse": { + "WebChat": { "type": "object", "properties": { - "results": { + "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": "A list of phone numbers, which can be of any provider type.", + "description": "This is the output messages generated by the system in response to the input.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ByoPhoneNumber" + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" }, { - "$ref": "#/components/schemas/TwilioPhoneNumber" + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" }, { - "$ref": "#/components/schemas/VonagePhoneNumber" + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" }, { - "$ref": "#/components/schemas/VapiPhoneNumber" + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" }, { - "$ref": "#/components/schemas/TelnyxPhoneNumber" + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" } ] } - }, - "metadata": { - "description": "Metadata about the pagination.", - "allOf": [ - { - "$ref": "#/components/schemas/PaginationMeta" - } - ] } }, "required": [ - "results", - "metadata" + "id", + "output" ] }, - "ApiRequestTool": { + "OpenAIWebChatRequest": { "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": [ - "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", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "The assistant ID to use for this chat" }, - "updatedAt": { - "format": "date-time", + "sessionId": { "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 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." }, - "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": "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/ToolRejectionPlan" + "$ref": "#/components/schemas/ChatAssistantOverrides" } ] }, - "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.", + "customer": { + "description": "This is the customer information for the chat.\nUsed to automatically manage sessions for repeat customers.", "allOf": [ { - "$ref": "#/components/schemas/JsonSchema" + "$ref": "#/components/schemas/CreateWebCustomerDTO" } ] }, - "headers": { - "description": "These are the headers to send with the request.", - "allOf": [ + "input": { + "description": "This is the input text for the chat.\nCan be a string or an array of chat messages.", + "oneOf": [ { - "$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": [ + "type": "string", + "title": "String" + }, { - "$ref": "#/components/schemas/BackoffPlan" + "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?" + } + ] ] }, - "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" - } - ] + "stream": { + "type": "boolean", + "description": "Whether to stream the response or not.", + "default": true } }, "required": [ - "type", - "method", - "id", - "orgId", - "createdAt", - "updatedAt", - "url" + "assistantId", + "input" ] }, - "DtmfTool": { + "ResponseOutputText": { "type": "object", "properties": { - "messages": { + "annotations": { + "default": [], + "description": "Annotations in the text output", "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" } }, + "text": { + "type": "string", + "description": "The text output from the model" + }, "type": { "type": "string", + "default": "output_text", + "description": "The type of the output text", "enum": [ - "dtmf" - ], - "description": "The type of tool. \"dtmf\" for DTMF tool." - }, + "output_text" + ] + } + }, + "required": [ + "annotations", + "text", + "type" + ] + }, + "ResponseOutputMessage": { + "type": "object", + "properties": { "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "The unique ID of the output message" }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "content": { + "description": "Content of the output message", + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseOutputText" + } }, - "createdAt": { - "format": "date-time", + "role": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "default": "assistant", + "description": "The role of the output message", + "enum": [ + "assistant" + ] }, - "updatedAt": { - "format": "date-time", + "status": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "The status of the message", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] }, - "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" - } + "type": { + "type": "string", + "default": "message", + "description": "The type of the output message", + "enum": [ + "message" ] } }, "required": [ - "type", "id", - "orgId", - "createdAt", - "updatedAt" + "content", + "role", + "status", + "type" ] }, - "EndCallTool": { + "ResponseObject": { "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." - }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "Unique identifier for this Response" }, - "orgId": { + "object": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "default": "response", + "description": "The object type", + "enum": [ + "response" + ] }, - "createdAt": { - "format": "date-time", + "created_at": { + "type": "number", + "description": "Unix timestamp (in seconds) of when this Response was created" + }, + "status": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "Status of the response", + "enum": [ + "completed", + "failed", + "in_progress", + "incomplete" + ] }, - "updatedAt": { - "format": "date-time", + "error": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "nullable": true, + "default": null, + "description": "Error message if the response failed" }, - "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" - } - ] + "output": { + "description": "Output messages from the model", + "type": "array", + "items": { + "$ref": "#/components/schemas/ResponseOutputMessage" + } } }, "required": [ - "type", "id", - "orgId", - "createdAt", - "updatedAt" + "object", + "created_at", + "status", + "output" ] }, - "FunctionTool": { + "ResponseTextDeltaEvent": { "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" - } - ] - } + "content_index": { + "type": "number", + "description": "Index of the content part" + }, + "delta": { + "type": "string", + "description": "Text delta being added" }, - "type": { + "item_id": { "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool. \"function\" for Function tool." + "description": "ID of the output item" }, - "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`)." + "output_index": { + "type": "number", + "description": "Index of the output item" }, - "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" - } + "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" }, - "id": { + "item_id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "ID of the output item" }, - "orgId": { - "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "output_index": { + "type": "number", + "description": "Index of the output item" }, - "createdAt": { - "format": "date-time", + "text": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "Complete text content" }, - "updatedAt": { - "format": "date-time", + "type": { "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/ResponseObject" } ] }, - "function": { - "description": "This is the function definition of the tool.", - "allOf": [ - { - "$ref": "#/components/schemas/OpenAIFunction" - } + "type": { + "type": "string", + "default": "response.completed", + "description": "Event type", + "enum": [ + "response.completed" ] } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "response", + "type" ] }, - "GhlTool": { + "ResponseErrorEvent": { "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", + "default": "error", + "description": "Event type", "enum": [ - "ghl" - ], - "description": "The type of tool. \"ghl\" for GHL tool." - }, - "id": { - "type": "string", - "description": "This is the unique identifier for the tool." + "error" + ] }, - "orgId": { + "code": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "Error code", + "example": "ERR_SOMETHING" }, - "createdAt": { - "format": "date-time", + "message": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "Error message", + "example": "Something went wrong" }, - "updatedAt": { - "format": "date-time", + "param": { "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" - } - ] + "nullable": true, + "description": "Parameter that caused the error" }, - "metadata": { - "$ref": "#/components/schemas/GhlToolMetadata" + "sequence_number": { + "type": "number", + "description": "Sequence number of the event", + "example": 1 } }, "required": [ "type", - "id", - "orgId", - "createdAt", - "updatedAt", - "metadata" + "code", + "message", + "sequence_number" ] }, - "MakeTool": { + "CreateCampaignDTO": { "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": [ - "make" - ], - "description": "The type of tool. \"make\" for Make tool." - }, - "id": { + "name": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the name of the campaign. This is just for your own reference.", + "example": "Q2 Sales Campaign" }, - "orgId": { + "assistantId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "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." }, - "updatedAt": { - "format": "date-time", + "phoneNumberId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the phone number ID that will be used for the campaign calls." }, - "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```", + "schedulePlan": { + "description": "This is the schedule plan for the campaign.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SchedulePlan" } ] }, - "metadata": { - "$ref": "#/components/schemas/MakeToolMetadata" + "customers": { + "description": "These are the customers that will be called in the campaign.", + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateCustomerDTO" + } } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt", - "metadata" + "name", + "phoneNumberId", + "customers" ] }, - "TransferCallTool": { + "Campaign": { "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": { + "status": { "type": "string", + "description": "This is the status of the campaign.", "enum": [ - "transferCall" + "scheduled", + "in-progress", + "ended" ] }, - "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" - } - ] - } + "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" + ] }, - "id": { + "name": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the name of the campaign. This is just for your own reference.", + "example": "Q2 Sales Campaign" }, - "orgId": { + "assistantId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "workflowId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "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." }, - "updatedAt": { - "format": "date-time", + "phoneNumberId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the phone number ID that will be used for the campaign calls." }, - "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```", + "schedulePlan": { + "description": "This is the schedule plan for the campaign.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/SchedulePlan" } ] - } - }, - "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/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 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": { + "customers": { + "description": "These are the customers that will be called in the campaign.", "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/CreateCustomerDTO" } }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the campaign." }, "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 campaign 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 campaign 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 campaign 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" - } - ] + "calls": { + "type": "object", + "description": "This is a map of call IDs to campaign call details." + }, + "callsCounterScheduled": { + "type": "number", + "description": "This is the number of calls that have been scheduled." + }, + "callsCounterQueued": { + "type": "number", + "description": "This is the number of calls that have been queued." + }, + "callsCounterInProgress": { + "type": "number", + "description": "This is the number of calls that have been in progress." + }, + "callsCounterEndedVoicemail": { + "type": "number", + "description": "This is the number of calls whose ended reason is 'voicemail'." + }, + "callsCounterEnded": { + "type": "number", + "description": "This is the number of calls that have ended." } }, "required": [ - "type", + "status", + "name", + "phoneNumberId", + "customers", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "calls", + "callsCounterScheduled", + "callsCounterQueued", + "callsCounterInProgress", + "callsCounterEndedVoicemail", + "callsCounterEnded" ] }, - "OutputTool": { + "CampaignPaginatedResponse": { "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/Campaign" } }, - "type": { + "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." + }, + "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." + }, + "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." + }, + "phoneNumberId": { + "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." + }, + "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/SchedulePlan" + } + ] + }, + "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": [ - "output" - ], - "description": "The type of tool. \"output\" for Output tool." - }, + "ended" + ] + } + } + }, + "Session": { + "type": "object", + "properties": { "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the session." }, "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 organization that owns this session." }, "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 timestamp indicating when the session 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 timestamp indicating when the session 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 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 ID of the assistant associated with this session. Use this when referencing an existing assistant." + }, + "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.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/CreateAssistantDTO" } ] - } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] - }, - "BashTool": { - "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.", + "description": "This is an array of chat messages in the session.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" }, { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" }, { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" } ] } }, - "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.", + "customer": { + "description": "This is the customer information associated with this session.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/CreateCustomerDTO" } ] }, - "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", + "phoneNumberId": { "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 phone number associated with this session." }, - "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```", + "phoneNumber": { + "description": "This is the phone number configuration for this session.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" } ] - }, - "name": { - "type": "string", - "description": "The name of the tool, fixed to 'bash'", - "default": "bash", - "enum": [ - "bash" - ] } }, "required": [ - "type", - "subType", "id", "orgId", "createdAt", - "updatedAt", - "name" + "updatedAt" ] }, - "ComputerTool": { + "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 ID of the assistant associated with this session. Use this when referencing an existing assistant." + }, + "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.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateAssistantDTO" + } + ] + }, "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 an array of chat messages in the session.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" }, { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" }, { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" } ] } }, - "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.", + "customer": { + "description": "This is the customer information associated with this session.", "allOf": [ { - "$ref": "#/components/schemas/Server" + "$ref": "#/components/schemas/CreateCustomerDTO" } ] }, - "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", + "phoneNumberId": { "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 phone number associated with this session." }, - "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```", + "phoneNumber": { + "description": "This is the phone number configuration for this session.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/ImportTwilioPhoneNumberDTO" } ] - }, + } + } + }, + "UpdateSessionDTO": { + "type": "object", + "properties": { "name": { "type": "string", - "description": "The name of the tool, fixed to 'computer'", - "default": "computer", + "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": [ - "computer" + "active", + "completed" ] }, - "displayWidthPx": { - "type": "number", - "description": "The display width in pixels" - }, - "displayHeightPx": { + "expirationSeconds": { "type": "number", - "description": "The display height in pixels" + "description": "Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set.", + "minimum": 60, + "maximum": 2592000, + "example": 86400 }, - "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 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 updated array of chat messages.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" + "$ref": "#/components/schemas/SystemMessage", + "title": "SystemMessage" }, { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/UserMessage", + "title": "UserMessage" }, { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/AssistantMessage", + "title": "AssistantMessage" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/ToolMessage", + "title": "ToolMessage" + }, + { + "$ref": "#/components/schemas/DeveloperMessage", + "title": "DeveloperMessage" } ] } + } + } + }, + "GetSessionPaginatedDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the session to filter by." }, - "type": { + "assistantId": { "type": "string", - "enum": [ - "textEditor" - ], - "description": "The type of tool. \"textEditor\" for Text Editor tool." + "description": "This is the ID of the assistant to filter sessions by." }, - "subType": { + "workflowId": { "type": "string", - "enum": [ - "text_editor_20241022" - ], - "description": "The sub type of tool." + "description": "This is the ID of the workflow to filter sessions by." }, - "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" - } + "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" ] }, - "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 tool." + "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 that this tool belongs to." + "description": "This will return items where the createdAt is less than the specified value." }, - "createdAt": { + "createdAtGe": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This will return items where the createdAt is greater than or equal to the specified value." }, - "updatedAt": { + "createdAtLe": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This will return items where the createdAt is less than or equal to the specified value." }, - "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" - } - ] + "updatedAtGt": { + "format": "date-time", + "type": "string", + "description": "This will return items where the updatedAt is greater than the specified value." }, - "name": { + "updatedAtLt": { + "format": "date-time", "type": "string", - "description": "The name of the tool, fixed to 'str_replace_editor'", - "default": "str_replace_editor", - "enum": [ - "str_replace_editor" - ] + "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": { + "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "type", - "subType", - "id", - "orgId", - "createdAt", - "updatedAt", - "name" + "results", + "metadata" ] }, - "QueryTool": { + "ByoPhoneNumber": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ - "query" - ], - "description": "The type of tool. \"query\" for Query tool." + "byo-phone-number" + ] }, - "knowledgeBases": { - "description": "The knowledge bases to query", - "type": "array", - "items": { - "$ref": "#/components/schemas/KnowledgeBase" - } + "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 unique identifier for the tool." + "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." + }, + "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 }, - "orgId": { + "assistantId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool 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 tool 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 tool 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." }, - "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": "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "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": [ - "type", + "provider", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "credentialId" ] }, - "GoogleCalendarCreateEventTool": { + "TwilioPhoneNumber": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Twilio.", "enum": [ - "google.calendar.event.create" - ], - "description": "The type of tool. \"google.calendar.event.create\" for Google Calendar Create Event tool." + "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 tool." + "description": "This is the unique identifier for the phone number." }, "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 phone number 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 phone number 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 phone number 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```", + "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." + }, + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "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": [ - "type", + "provider", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "number", + "twilioAccountSid" ] }, - "GoogleSheetsRowAppendTool": { + "VonagePhoneNumber": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Vonage.", "enum": [ - "google.sheets.row.append" - ], - "description": "The type of tool. \"google.sheets.row.append\" for Google Sheets Row Append tool." + "vonage" + ] }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the phone number." }, "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 phone number 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 phone number 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 phone number 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```", + "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." + }, + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "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": [ - "type", + "provider", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "number", + "credentialId" ] }, - "GoogleCalendarCheckAvailabilityTool": { + "SipAuthentication": { "type": "object", "properties": { - "messages": { + "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" + ] + }, + "VapiPhoneNumber": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to create free SIP phone numbers on Vapi.", "enum": [ - "google.calendar.availability.check" - ], - "description": "The type of tool. \"google.calendar.availability.check\" for Google Calendar Check Availability tool." + "vapi" + ] }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the phone number." }, "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 phone number 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 phone number 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 phone number 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```", + "status": { + "type": "string", + "description": "This is the status of the phone number.", + "enum": [ + "active", + "activating", + "blocked" + ] + }, + "number": { + "type": "string", + "description": "These are the digits of the phone number you purchased from Vapi." + }, + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" + } + ] + }, + "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." + }, + "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/SipAuthentication" } ] } }, "required": [ - "type", + "provider", "id", "orgId", "createdAt", "updatedAt" ] }, - "SlackSendMessageTool": { + "TelnyxPhoneNumber": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Telnyx.", "enum": [ - "slack.message.send" - ], - "description": "The type of tool. \"slack.message.send\" for Slack Send Message tool." + "telnyx" + ] }, "id": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the unique identifier for the phone number." }, "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 phone number 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 phone number 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 phone number 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```", + "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." + }, + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "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": [ - "type", + "provider", "id", "orgId", "createdAt", - "updatedAt" + "updatedAt", + "number", + "credentialId" ] }, - "SmsTool": { + "CreateByoPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to bring your own phone numbers from your own SIP trunks or Carriers.", "enum": [ - "sms" - ], - "description": "The type of tool. \"sms\" for Twilio SMS sending tool." + "byo-phone-number" + ] }, - "id": { + "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 unique identifier for the tool." + "description": "This is the number of the customer.", + "minLength": 3, + "maxLength": 40 }, - "orgId": { + "credentialId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "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 phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool 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." }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "provider", + "credentialId" ] }, - "McpTool": { + "CreateTwilioPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Twilio.", "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" - } + "twilio" ] }, - "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 + }, + "number": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "These are the digits of the phone number you own on your Twilio." }, - "orgId": { + "twilioAccountSid": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "description": "This is the Twilio Account SID for the phone number." }, - "createdAt": { - "format": "date-time", + "twilioAuthToken": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was created." + "description": "This is the Twilio Auth Token for the phone number." }, - "updatedAt": { - "format": "date-time", + "twilioApiKey": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool was last updated." + "description": "This is the Twilio API Key for the phone 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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] - }, - "metadata": { - "$ref": "#/components/schemas/McpToolMetadata" } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "provider", + "number", + "twilioAccountSid" ] }, - "GoHighLevelCalendarAvailabilityTool": { + "CreateVonagePhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Vonage.", "enum": [ - "gohighlevel.calendar.availability.check" - ], - "description": "The type of tool. \"gohighlevel.calendar.availability.check\" for GoHighLevel Calendar Availability Check tool." + "vonage" + ] }, - "id": { + "number": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "These are the digits of the phone number you own on your Vonage." }, - "orgId": { + "credentialId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "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 phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool 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." }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "provider", + "number", + "credentialId" ] }, - "GoHighLevelCalendarEventCreateTool": { + "CreateVapiPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to create free SIP phone numbers on Vapi.", "enum": [ - "gohighlevel.calendar.event.create" - ], - "description": "The type of tool. \"gohighlevel.calendar.event.create\" for GoHighLevel Calendar Event Create tool." + "vapi" + ] }, - "id": { + "numberDesiredAreaCode": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "This is the area code of the phone number to purchase.", + "minLength": 3, + "maxLength": 3 }, - "orgId": { + "sipUri": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "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/SipAuthentication" + } + ] + }, + "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 phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool 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." }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "provider" ] }, - "GoHighLevelContactCreateTool": { + "CreateTelnyxPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "provider": { "type": "string", + "description": "This is to use numbers bought on Telnyx.", "enum": [ - "gohighlevel.contact.create" - ], - "description": "The type of tool. \"gohighlevel.contact.create\" for GoHighLevel Contact Create tool." + "telnyx" + ] }, - "id": { + "number": { "type": "string", - "description": "This is the unique identifier for the tool." + "description": "These are the digits of the phone number you own on your Telnyx." }, - "orgId": { + "credentialId": { "type": "string", - "description": "This is the unique identifier for the organization that this tool belongs to." + "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." }, - "createdAt": { - "format": "date-time", + "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 phone number. This is just for your own reference.", + "maxLength": 40 }, - "updatedAt": { - "format": "date-time", + "assistantId": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the tool 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." }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] } }, "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" + "provider", + "number", + "credentialId" ] }, - "GoHighLevelContactGetTool": { + "UpdateByoPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { - "type": "string", - "enum": [ - "gohighlevel.contact.get" - ], - "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." + "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": { + "name": { "type": "string", - "description": "This is the unique identifier for the tool." + "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 organization that this tool 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 tool 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 tool 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." }, - "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": "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] - } - }, - "required": [ - "type", - "id", - "orgId", - "createdAt", - "updatedAt" - ] + }, + "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." + } + } }, - "CreateApiRequestToolDTO": { + "UpdateTwilioPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { - "type": "string", - "enum": [ - "apiRequest" - ], - "description": "The type of tool. \"apiRequest\" for API request tool." + "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 }, - "method": { + "name": { "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 + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "name": { + "assistantId": { "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 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": { + "workflowId": { "type": "string", - "description": "This is the description of the tool. This will be passed to the model.", - "maxLength": 1000 + "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." }, - "url": { + "squadId": { "type": "string", - "description": "This is where the request will be sent." + "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.", + "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/JsonSchema" + "$ref": "#/components/schemas/Server" } ] }, - "headers": { - "description": "These are the headers to send with the request.", - "allOf": [ - { - "$ref": "#/components/schemas/JsonSchema" - } - ] + "number": { + "type": "string", + "description": "These are the digits of the phone number you own on your Twilio." }, - "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" - } - ] + "twilioAccountSid": { + "type": "string", + "description": "This is the Twilio Account SID for the phone number." }, - "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" - } - ] + "twilioAuthToken": { + "type": "string", + "description": "This is the Twilio Auth Token for the phone 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" - } - ] + "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." } - }, - "required": [ - "type", - "method", - "url" - ] + } }, - "CreateOutputToolDTO": { + "UpdateVonagePhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "name": { "type": "string", - "enum": [ - "output" - ], - "description": "The type of tool. \"output\" for Output tool." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] + }, + "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": [ - "type" - ] + } }, - "CreateBashToolDTO": { + "UpdateVapiPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "name": { "type": "string", - "enum": [ - "bash" - ], - "description": "The type of tool. \"bash\" for Bash tool." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "subType": { + "assistantId": { "type": "string", - "enum": [ - "bash_20241022" - ], - "description": "The sub type of tool." + "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": "\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.", + "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" } ] }, - "name": { + "sipUri": { "type": "string", - "description": "The name of the tool, fixed to 'bash'", - "default": "bash", - "enum": [ - "bash" - ] + "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." }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/SipAuthentication" } ] } - }, - "required": [ - "type", - "subType", - "name" - ] + } }, - "CreateComputerToolDTO": { + "UpdateTelnyxPhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "name": { "type": "string", - "enum": [ - "computer" - ], - "description": "The type of tool. \"computer\" for Computer tool." + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "subType": { + "assistantId": { "type": "string", - "enum": [ - "computer_20241022" - ], - "description": "The sub type of tool." + "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": "\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.", + "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" } ] }, - "name": { + "number": { "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" + "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." } - }, - "required": [ - "type", - "subType", - "name", - "displayWidthPx", - "displayHeightPx" - ] + } }, - "CreateTextEditorToolDTO": { + "ImportVonagePhoneNumberDTO": { "type": "object", "properties": { - "messages": { + "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": "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 hooks that will be used for incoming calls to this phone number.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" - }, - { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" - }, - { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/PhoneNumberHookCallRinging", + "title": "PhoneNumberHookCallRinging" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/PhoneNumberHookCallEnding", + "title": "PhoneNumberHookCallEnding" } ] } }, - "type": { + "vonagePhoneNumber": { "type": "string", - "enum": [ - "textEditor" - ], - "description": "The type of tool. \"textEditor\" for Text Editor tool." + "description": "These are the digits of the phone number you own on your Vonage.", + "deprecated": true }, - "subType": { + "credentialId": { "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" - } - ] + "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": "The name of the tool, fixed to 'str_replace_editor'", - "default": "str_replace_editor", - "enum": [ - "str_replace_editor" - ] + "description": "This is the name of the phone number. This is just for your own reference.", + "maxLength": 40 }, - "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```", + "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/ToolRejectionPlan" + "$ref": "#/components/schemas/Server" } ] } }, "required": [ - "type", - "subType", - "name" + "vonagePhoneNumber", + "credentialId" ] }, - "CreateSmsToolDTO": { + "PhoneNumberPaginatedResponse": { "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 phone numbers, which can be of any provider type.", "items": { "oneOf": [ { - "$ref": "#/components/schemas/ToolMessageStart", - "title": "ToolMessageStart" + "$ref": "#/components/schemas/ByoPhoneNumber" }, { - "$ref": "#/components/schemas/ToolMessageComplete", - "title": "ToolMessageComplete" + "$ref": "#/components/schemas/TwilioPhoneNumber" }, { - "$ref": "#/components/schemas/ToolMessageFailed", - "title": "ToolMessageFailed" + "$ref": "#/components/schemas/VonagePhoneNumber" }, { - "$ref": "#/components/schemas/ToolMessageDelayed", - "title": "ToolMessageDelayed" + "$ref": "#/components/schemas/VapiPhoneNumber" + }, + { + "$ref": "#/components/schemas/TelnyxPhoneNumber" } ] } }, - "type": { - "type": "string", - "enum": [ - "sms" - ], - "description": "The type of tool. \"sms\" for Twilio SMS sending 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```", + "metadata": { + "description": "Metadata about the pagination.", "allOf": [ { - "$ref": "#/components/schemas/ToolRejectionPlan" + "$ref": "#/components/schemas/PaginationMeta" } ] } }, "required": [ - "type" + "results", + "metadata" ] }, - "UpdateApiRequestToolDTO": { + "ApiRequestTool": { "type": "object", "properties": { "messages": { @@ -35345,6 +32432,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "apiRequest" + ], + "description": "The type of tool. \"apiRequest\" for API request tool." + }, "method": { "type": "string", "enum": [ @@ -35362,6 +32456,29 @@ "maximum": 300, "example": 20 }, + "credentialId": { + "type": "string", + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "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": [ @@ -35417,9 +32534,18 @@ } ] } - } + }, + "required": [ + "type", + "method", + "id", + "orgId", + "createdAt", + "updatedAt", + "url" + ] }, - "UpdateDtmfToolDTO": { + "DtmfTool": { "type": "object", "properties": { "messages": { @@ -35446,6 +32572,31 @@ ] } }, + "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." + }, "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": [ @@ -35454,9 +32605,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateEndCallToolDTO": { + "EndCallTool": { "type": "object", "properties": { "messages": { @@ -35483,6 +32641,31 @@ ] } }, + "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": [ @@ -35491,9 +32674,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateFunctionToolDTO": { + "FunctionTool": { "type": "object", "properties": { "messages": { @@ -35520,6 +32710,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool. \"function\" for Function tool." + }, "async": { "type": "boolean", "example": false, @@ -35533,6 +32730,24 @@ } ] }, + "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": [ @@ -35549,9 +32764,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGhlToolDTO": { + "GhlTool": { "type": "object", "properties": { "messages": { @@ -35578,6 +32800,31 @@ ] } }, + "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": [ @@ -35589,9 +32836,17 @@ "metadata": { "$ref": "#/components/schemas/GhlToolMetadata" } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt", + "metadata" + ] }, - "UpdateMakeToolDTO": { + "MakeTool": { "type": "object", "properties": { "messages": { @@ -35618,6 +32873,31 @@ ] } }, + "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": [ @@ -35629,9 +32909,17 @@ "metadata": { "$ref": "#/components/schemas/MakeToolMetadata" } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt", + "metadata" + ] }, - "UpdateHandoffToolDTO": { + "TransferCallTool": { "type": "object", "properties": { "messages": { @@ -35658,22 +32946,50 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "transferCall" + ] + }, "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.", + "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/HandoffDestinationAssistant", + "$ref": "#/components/schemas/TransferDestinationAssistant", "title": "Assistant" }, { - "$ref": "#/components/schemas/HandoffDestinationDynamic", - "title": "Dynamic" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" + }, + { + "$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": [ @@ -35682,9 +32998,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateTransferCallToolDTO": { + "HandoffTool": { "type": "object", "properties": { "messages": { @@ -35711,26 +33034,47 @@ ] } }, + "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": "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.", + "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/TransferDestinationAssistant", + "$ref": "#/components/schemas/HandoffDestinationAssistant", "title": "Assistant" }, { - "$ref": "#/components/schemas/TransferDestinationNumber", - "title": "Number" - }, - { - "$ref": "#/components/schemas/TransferDestinationSip", - "title": "Sip" + "$ref": "#/components/schemas/HandoffDestinationDynamic", + "title": "Dynamic" } ] } }, + "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": [ @@ -35739,9 +33083,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateOutputToolDTO": { + "OutputTool": { "type": "object", "properties": { "messages": { @@ -35768,6 +33119,31 @@ ] } }, + "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": [ @@ -35776,9 +33152,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateBashToolDTO": { + "BashTool": { "type": "object", "properties": { "messages": { @@ -35805,6 +33188,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "bash" + ], + "description": "The type of tool. \"bash\" for Bash tool." + }, "subType": { "type": "string", "enum": [ @@ -35820,6 +33210,24 @@ } ] }, + "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": [ @@ -35836,9 +33244,18 @@ "bash" ] } - } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name" + ] }, - "UpdateComputerToolDTO": { + "ComputerTool": { "type": "object", "properties": { "messages": { @@ -35865,6 +33282,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "computer" + ], + "description": "The type of tool. \"computer\" for Computer tool." + }, "subType": { "type": "string", "enum": [ @@ -35880,6 +33304,24 @@ } ] }, + "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": [ @@ -35908,9 +33350,20 @@ "type": "number", "description": "Optional display number" } - } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "displayWidthPx", + "displayHeightPx" + ] }, - "UpdateTextEditorToolDTO": { + "TextEditorTool": { "type": "object", "properties": { "messages": { @@ -35937,6 +33390,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "textEditor" + ], + "description": "The type of tool. \"textEditor\" for Text Editor tool." + }, "subType": { "type": "string", "enum": [ @@ -35952,6 +33412,24 @@ } ] }, + "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": [ @@ -35968,9 +33446,18 @@ "str_replace_editor" ] } - } + }, + "required": [ + "type", + "subType", + "id", + "orgId", + "createdAt", + "updatedAt", + "name" + ] }, - "UpdateQueryToolDTO": { + "QueryTool": { "type": "object", "properties": { "messages": { @@ -35997,6 +33484,13 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "query" + ], + "description": "The type of tool. \"query\" for Query tool." + }, "knowledgeBases": { "description": "The knowledge bases to query", "type": "array", @@ -36004,6 +33498,24 @@ "$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": [ @@ -36012,9 +33524,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoogleCalendarCreateEventToolDTO": { + "GoogleCalendarCreateEventTool": { "type": "object", "properties": { "messages": { @@ -36041,6 +33560,31 @@ ] } }, + "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": [ @@ -36049,9 +33593,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoogleSheetsRowAppendToolDTO": { + "GoogleSheetsRowAppendTool": { "type": "object", "properties": { "messages": { @@ -36078,6 +33629,31 @@ ] } }, + "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": [ @@ -36086,9 +33662,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoogleCalendarCheckAvailabilityToolDTO": { + "GoogleCalendarCheckAvailabilityTool": { "type": "object", "properties": { "messages": { @@ -36115,6 +33698,31 @@ ] } }, + "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": [ @@ -36123,9 +33731,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateSlackSendMessageToolDTO": { + "SlackSendMessageTool": { "type": "object", "properties": { "messages": { @@ -36152,6 +33767,31 @@ ] } }, + "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": [ @@ -36160,9 +33800,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateSmsToolDTO": { + "SmsTool": { "type": "object", "properties": { "messages": { @@ -36189,6 +33836,31 @@ ] } }, + "type": { + "type": "string", + "enum": [ + "sms" + ], + "description": "The type of tool. \"sms\" for Twilio SMS sending 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": [ @@ -36197,9 +33869,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateMcpToolDTO": { + "McpTool": { "type": "object", "properties": { "messages": { @@ -36226,6 +33905,13 @@ ] } }, + "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": [ @@ -36234,6 +33920,24 @@ } ] }, + "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": [ @@ -36245,9 +33949,16 @@ "metadata": { "$ref": "#/components/schemas/McpToolMetadata" } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoHighLevelCalendarAvailabilityToolDTO": { + "GoHighLevelCalendarAvailabilityTool": { "type": "object", "properties": { "messages": { @@ -36274,6 +33985,31 @@ ] } }, + "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": [ @@ -36282,9 +34018,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoHighLevelCalendarEventCreateToolDTO": { + "GoHighLevelCalendarEventCreateTool": { "type": "object", "properties": { "messages": { @@ -36311,6 +34054,31 @@ ] } }, + "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": [ @@ -36319,9 +34087,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoHighLevelContactCreateToolDTO": { + "GoHighLevelContactCreateTool": { "type": "object", "properties": { "messages": { @@ -36348,6 +34123,31 @@ ] } }, + "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": [ @@ -36356,9 +34156,16 @@ } ] } - } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] }, - "UpdateGoHighLevelContactGetToolDTO": { + "GoHighLevelContactGetTool": { "type": "object", "properties": { "messages": { @@ -36385,1623 +34192,2160 @@ ] } }, - "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": { "type": "string", "enum": [ - "file" - ] - }, - "status": { - "enum": [ - "processing", - "done", - "failed" + "gohighlevel.contact.get" ], - "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" + "description": "The type of tool. \"gohighlevel.contact.get\" for GoHighLevel Contact Get tool." }, "id": { "type": "string", - "description": "This is the unique identifier for the file." + "description": "This is the unique identifier for the tool." }, "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 that this tool belongs to." }, "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 tool was created." }, "updatedAt": { "format": "date-time", "type": "string", - "description": "This is the ISO 8601 date-time string of when the file 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" ] }, - "UpdateFileDTO": { + "CreateApiRequestToolDTO": { "type": "object", "properties": { - "name": { + "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 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." + "enum": [ + "apiRequest" + ], + "description": "The type of tool. \"apiRequest\" for API request tool." }, - "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." + "method": { + "type": "string", + "enum": [ + "POST", + "GET", + "PUT", + "PATCH", + "DELETE" + ] }, - "scoreThreshold": { + "timeoutSeconds": { "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." + "description": "This is the timeout in seconds for the request. Defaults to 20 seconds.\n\n@default 20", + "minimum": 1, + "maximum": 300, + "example": 20 }, - "searchType": { + "credentialId": { "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": { + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "name": { "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 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}$/" }, - "name": { + "description": { "type": "string", - "description": "This is the name of the knowledge base." + "description": "This is the description of the tool. This will be passed to the model.", + "maxLength": 1000 }, - "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.", + "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/TrieveKnowledgeBaseSearchPlan" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "createPlan": { - "description": "This is the plan if you want us to create/import a new vector store using Trieve.", - "oneOf": [ + "headers": { + "description": "These are the headers to send with the request.", + "allOf": [ { - "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", - "title": "Import" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "id": { - "type": "string", - "description": "This is the id of the knowledge base." + "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" + } + ] }, - "orgId": { - "type": "string", - "description": "This is the org id of the knowledge base." + "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": [ - "provider", - "id", - "orgId" + "type", + "method", + "url" ] }, - "CustomKnowledgeBase": { + "CreateOutputToolDTO": { "type": "object", "properties": { - "provider": { + "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 knowledge base is bring your own knowledge base implementation.", "enum": [ - "custom-knowledge-base" - ] + "output" + ], + "description": "The type of tool. \"output\" for Output tool." }, - "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```", + "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" } ] - }, - "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" + "type" ] }, - "CreateTrieveKnowledgeBaseDTO": { + "CreateBashToolDTO": { "type": "object", "properties": { - "provider": { + "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 knowledge base is provided by Trieve.\n\nTo learn more about Trieve, visit https://trieve.ai.", "enum": [ - "trieve" - ] + "bash" + ], + "description": "The type of tool. \"bash\" for Bash tool." }, - "name": { + "subType": { "type": "string", - "description": "This is the name of the knowledge base." + "enum": [ + "bash_20241022" + ], + "description": "The sub type of tool." }, - "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.", + "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/TrieveKnowledgeBaseSearchPlan" + "$ref": "#/components/schemas/Server" } ] }, - "createPlan": { - "description": "This is the plan if you want us to create/import a new vector store using Trieve.", - "oneOf": [ + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'bash'", + "default": "bash", + "enum": [ + "bash" + ] + }, + "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/TrieveKnowledgeBaseImport", - "title": "Import" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] } }, "required": [ - "provider" + "type", + "subType", + "name" ] }, - "UpdateTrieveKnowledgeBaseDTO": { + "CreateComputerToolDTO": { "type": "object", "properties": { - "name": { + "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 name of the knowledge base." + "enum": [ + "computer" + ], + "description": "The type of tool. \"computer\" for Computer tool." }, - "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" - } - ] + "subType": { + "type": "string", + "enum": [ + "computer_20241022" + ], + "description": "The sub type of tool." }, - "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```", + "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" } ] - } - } - }, - "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", - "items": { - "type": "string" - } }, - "websites": { - "description": "These are the websites that will be used to create the vector store.", - "type": "array", - "items": { - "type": "string" - } + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'computer'", + "default": "computer", + "enum": [ + "computer" + ] }, - "targetSplitsPerChunk": { + "displayWidthPx": { "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." + "description": "The display width in pixels" }, - "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" - } + "displayHeightPx": { + "type": "number", + "description": "The display height in pixels" }, - "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": [ - "create" - ] + "displayNumber": { + "type": "number", + "description": "Optional display number" }, - "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" + "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" + } ] - }, - "providerId": { - "type": "string", - "description": "This is the `datasetId` of the dataset on your Trieve account." } }, "required": [ "type", - "providerId" + "subType", + "name", + "displayWidthPx", + "displayHeightPx" ] }, - "Workflow": { + "CreateTextEditorToolDTO": { "type": "object", "properties": { - "nodes": { + "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/ConversationNode", - "title": "ConversationNode" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "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" - } - ] - }, - "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" - } - ] + "type": { + "type": "string", + "enum": [ + "textEditor" + ], + "description": "The type of tool. \"textEditor\" for Text Editor tool." }, - "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" - } + "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" + "$ref": "#/components/schemas/Server" } ] }, - "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" - }, + "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": [ { - "type": "string", - "format": "uri", - "example": "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] - }, - "hooks": { + } + }, + "required": [ + "type", + "subType", + "name" + ] + }, + "CreateSmsToolDTO": { + "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" } ] } }, - "credentials": { + "type": { + "type": "string", + "enum": [ + "sms" + ], + "description": "The type of tool. \"sms\" for Twilio SMS sending 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" + ] + }, + "UpdateApiRequestToolDTO": { + "type": "object", + "properties": { + "messages": { "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 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/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateDeepgramCredentialDTO", - "title": "DeepgramCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateDeepInfraCredentialDTO", - "title": "DeepInfraCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateDeepSeekCredentialDTO", - "title": "DeepSeekCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "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 + }, + "credentialId": { + "type": "string", + "description": "The credential ID for API request authentication", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "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 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.", + "allOf": [ + { + "$ref": "#/components/schemas/VariableExtractionPlan" + } + ] + } + } + }, + "UpdateDtmfToolDTO": { + "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/CreateElevenLabsCredentialDTO", - "title": "ElevenLabsCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateEndCallToolDTO": { + "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/CreateGoogleCredentialDTO", - "title": "GoogleCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateFunctionToolDTO": { + "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/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "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" + } + ] + }, + "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" + } + ] + } + } + }, + "UpdateGhlToolDTO": { + "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/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + }, + "metadata": { + "$ref": "#/components/schemas/GhlToolMetadata" + } + } + }, + "UpdateMakeToolDTO": { + "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/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" + } + ] + } + }, + "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" + } + } + }, + "UpdateHandoffToolDTO": { + "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" + } + ] + } + }, + "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/CreateTogetherAICredentialDTO", - "title": "TogetherAICredential" + "$ref": "#/components/schemas/HandoffDestinationAssistant", + "title": "Assistant" }, { - "$ref": "#/components/schemas/CreateTrieveCredentialDTO", - "title": "TrieveCredential" - }, + "$ref": "#/components/schemas/HandoffDestinationDynamic", + "title": "Dynamic" + } + ] + } + }, + "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" + } + ] + } + } + }, + "UpdateTransferCallToolDTO": { + "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/CreateTwilioCredentialDTO", - "title": "TwilioCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateVonageCredentialDTO", - "title": "VonageCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateWebhookCredentialDTO", - "title": "WebhookCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateXAiCredentialDTO", - "title": "XAiCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" + } + ] + } + }, + "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/CreateGoogleCalendarOAuth2ClientCredentialDTO", - "title": "GoogleCalendarOAuth2ClientCredential" + "$ref": "#/components/schemas/TransferDestinationAssistant", + "title": "Assistant" }, { - "$ref": "#/components/schemas/CreateGoogleCalendarOAuth2AuthorizationCredentialDTO", - "title": "GoogleCalendarOAuth2AuthorizationCredential" + "$ref": "#/components/schemas/TransferDestinationNumber", + "title": "Number" }, { - "$ref": "#/components/schemas/CreateGoogleSheetsOAuth2AuthorizationCredentialDTO", - "title": "GoogleSheetsOAuth2AuthorizationCredential" + "$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" + } + ] + } + } + }, + "UpdateOutputToolDTO": { + "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/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" } - } + ] } }, - "id": { - "type": "string" - }, - "orgId": { - "type": "string" - }, - "createdAt": { - "format": "date-time", - "type": "string" - }, - "updatedAt": { - "format": "date-time", - "type": "string" - }, - "name": { - "type": "string", - "maxLength": 80 - }, - "edges": { + "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" + } + ] + } + } + }, + "UpdateBashToolDTO": { + "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": { - "$ref": "#/components/schemas/Edge" + "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" + } + ] } }, - "globalPrompt": { + "subType": { "type": "string", - "maxLength": 5000 + "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. tool.server\n2. workflow.server / assistant.server\n3. phoneNumber.server\n4. 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" } ] }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", + "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/CompliancePlan" + "$ref": "#/components/schemas/ToolRejectionPlan" } ] }, - "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", - "allOf": [ - { - "$ref": "#/components/schemas/AnalysisPlan" - } + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'bash'", + "default": "bash", + "enum": [ + "bash" ] + } + } + }, + "UpdateComputerToolDTO": { + "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" + } + ] + } }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactPlan" - } - ] + "subType": { + "type": "string", + "enum": [ + "computer_20241022" + ], + "description": "The sub type of tool." }, - "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.", + "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/StartSpeakingPlan" + "$ref": "#/components/schemas/Server" } ] }, - "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.", + "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 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" - } + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'computer'", + "default": "computer", + "enum": [ + "computer" ] }, - "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" - } - ] + "displayWidthPx": { + "type": "number", + "description": "The display width in pixels" }, - "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" - } + "displayHeightPx": { + "type": "number", + "description": "The display height in pixels" }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", - "allOf": [ - { - "$ref": "#/components/schemas/KeypadInputPlan" - } - ] + "displayNumber": { + "type": "number", + "description": "Optional display number" } - }, - "required": [ - "nodes", - "id", - "orgId", - "createdAt", - "updatedAt", - "name", - "edges" - ] + } }, - "UpdateWorkflowDTO": { + "UpdateTextEditorToolDTO": { "type": "object", "properties": { - "nodes": { + "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/ConversationNode", - "title": "ConversationNode" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/ToolNode", - "title": "ToolNode" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" + }, + { + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" + }, + { + "$ref": "#/components/schemas/ToolMessageDelayed", + "title": "ToolMessageDelayed" } ] } }, - "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" - } - ] - }, - "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" - } - ] - }, - "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" - } + "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" + "$ref": "#/components/schemas/Server" } ] - }, - "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" - }, + }, + "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" } ] }, - "hooks": { + "name": { + "type": "string", + "description": "The name of the tool, fixed to 'str_replace_editor'", + "default": "str_replace_editor", + "enum": [ + "str_replace_editor" + ] + } + } + }, + "UpdateQueryToolDTO": { + "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" } ] } }, - "credentials": { + "knowledgeBases": { + "description": "The knowledge bases to query", "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": { + "$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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateGoogleCalendarCreateEventToolDTO": { + "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/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/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateGcpCredentialDTO", - "title": "GcpCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateGladiaCredentialDTO", - "title": "GladiaCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateGoHighLevelCredentialDTO", - "title": "GhlCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateGoogleSheetsRowAppendToolDTO": { + "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/CreateGoogleCredentialDTO", - "title": "GoogleCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateGroqCredentialDTO", - "title": "GroqCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateHumeCredentialDTO", - "title": "HumeCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateInflectionAICredentialDTO", - "title": "InflectionAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateGoogleCalendarCheckAvailabilityToolDTO": { + "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/CreateLangfuseCredentialDTO", - "title": "LangfuseCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateLmntCredentialDTO", - "title": "LmntCredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateMakeCredentialDTO", - "title": "MakeCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreateMistralCredentialDTO", - "title": "MistralCredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateSlackSendMessageToolDTO": { + "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/CreateNeuphonicCredentialDTO", - "title": "NeuphonicCredential" + "$ref": "#/components/schemas/ToolMessageStart", + "title": "ToolMessageStart" }, { - "$ref": "#/components/schemas/CreateOpenAICredentialDTO", - "title": "OpenAICredential" + "$ref": "#/components/schemas/ToolMessageComplete", + "title": "ToolMessageComplete" }, { - "$ref": "#/components/schemas/CreateOpenRouterCredentialDTO", - "title": "OpenRouterCredential" + "$ref": "#/components/schemas/ToolMessageFailed", + "title": "ToolMessageFailed" }, { - "$ref": "#/components/schemas/CreatePerplexityAICredentialDTO", - "title": "PerplexityAICredential" - }, + "$ref": "#/components/schemas/ToolMessageDelayed", + "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```", + "allOf": [ + { + "$ref": "#/components/schemas/ToolRejectionPlan" + } + ] + } + } + }, + "UpdateSmsToolDTO": { + "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/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" + } + ] + } + }, + "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" + } + ] + } + } + }, + "UpdateMcpToolDTO": { + "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" + } + ] + } + }, + "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" + } + ] + }, + "metadata": { + "$ref": "#/components/schemas/McpToolMetadata" + } + } + }, + "UpdateGoHighLevelCalendarAvailabilityToolDTO": { + "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" + } + ] + } + }, + "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" + } + ] + } + } + }, + "UpdateGoHighLevelCalendarEventCreateToolDTO": { + "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" + } + ] + } + }, + "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" + } + ] + } + } + }, + "UpdateGoHighLevelContactCreateToolDTO": { + "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" } + ] + } + }, + "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" } + ] + } + } + }, + "UpdateGoHighLevelContactGetToolDTO": { + "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" + } + ] } }, + "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": [ + "file" + ] + }, + "status": { + "enum": [ + "processing", + "done", + "failed" + ], + "type": "string" + }, "name": { "type": "string", - "maxLength": 80 + "description": "This is the name of the file. This is just for your own reference.", + "maxLength": 40 }, - "edges": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Edge" - } + "originalName": { + "type": "string" }, - "globalPrompt": { + "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", - "maxLength": 5000 + "description": "This is the unique identifier for the file." }, - "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", + "orgId": { + "type": "string", + "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 file was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "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." + }, + "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/Server" + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" } ] }, - "compliancePlan": { - "description": "This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings.", - "allOf": [ + "createPlan": { + "description": "This is the plan if you want us to create/import a new vector store using Trieve.", + "oneOf": [ { - "$ref": "#/components/schemas/CompliancePlan" + "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", + "title": "Import" } ] }, - "analysisPlan": { - "description": "This is the plan for analysis of workflow's calls. Stored in `call.analysis`.", + "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", + "id", + "orgId" + ] + }, + "CustomKnowledgeBase": { + "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/AnalysisPlan" + "$ref": "#/components/schemas/Server" } ] }, - "artifactPlan": { - "description": "This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`.", + "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/ArtifactPlan" + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" } ] }, - "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": [ + "createPlan": { + "description": "This is the plan if you want us to create/import a new vector store using Trieve.", + "oneOf": [ { - "$ref": "#/components/schemas/StartSpeakingPlan" + "$ref": "#/components/schemas/TrieveKnowledgeBaseImport", + "title": "Import" } ] + } + }, + "required": [ + "provider" + ] + }, + "UpdateTrieveKnowledgeBaseDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the knowledge base." }, - "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.", + "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/StopSpeakingPlan" + "$ref": "#/components/schemas/TrieveKnowledgeBaseSearchPlan" } ] }, - "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`.", + "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/MonitorPlan" + "$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", + "items": { + "type": "string" + } }, - "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": [ + "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": [ + "create" + ] + }, + "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": { + "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/BackgroundSpeechDenoisingPlan" + "$ref": "#/components/schemas/WorkflowOpenAIModel", + "title": "WorkflowOpenAIModel" + }, + { + "$ref": "#/components/schemas/WorkflowAnthropicModel", + "title": "WorkflowAnthropicModel" + }, + { + "$ref": "#/components/schemas/WorkflowGoogleModel", + "title": "WorkflowGoogleModel" + }, + { + "$ref": "#/components/schemas/WorkflowCustomModel", + "title": "WorkflowCustomModel" } ] }, - "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.", + "id": { + "type": "string", + "description": "This is the unique identifier for the structured output." + }, + "orgId": { + "type": "string", + "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 structured output 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." + }, + "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" } }, - "keypadInputPlan": { - "description": "This is the plan for keypad input handling during workflow calls.", + "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/KeypadInputPlan" + "$ref": "#/components/schemas/JsonSchema" + } + ] + } + }, + "required": [ + "id", + "orgId", + "createdAt", + "updatedAt", + "name", + "schema" + ] + }, + "StructuredOutputPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StructuredOutput" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "CreateStructuredOutputDTO": { + "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" } ] - } - } - }, - "Squad": { - "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" - } + "description": "This is the name of the structured output.", + "minLength": 1, + "maxLength": 40 }, - "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.", + "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/AssistantOverrides" + "$ref": "#/components/schemas/JsonSchema" } ] }, - "id": { - "type": "string", - "description": "This is the unique identifier for the squad." - }, - "orgId": { + "description": { "type": "string", - "description": "This is the unique identifier for the org that this squad belongs to." + "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." }, - "createdAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the squad was created." + "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" + } }, - "updatedAt": { - "format": "date-time", - "type": "string", - "description": "This is the ISO 8601 date-time string of when the squad was last updated." + "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": [ - "members", - "id", - "orgId", - "createdAt", - "updatedAt" + "name", + "schema" ] }, - "UpdateSquadDTO": { + "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 squad." + "description": "This is the name of the structured output.", + "minLength": 1, + "maxLength": 40 }, - "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.", + "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": { - "$ref": "#/components/schemas/SquadMemberDTO" + "type": "string" } }, - "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.", + "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/AssistantOverrides" + "$ref": "#/components/schemas/JsonSchema" } ] } - }, - "required": [ - "members" - ] + } }, "TesterPlan": { "type": "object", @@ -38544,781 +36888,244 @@ ], "maxLength": 100 }, - "rubric": { - "type": "string", - "description": "This is the rubric used by the AI scorer.", - "maxLength": 10000 - } - }, - "required": [ - "type", - "rubric" - ] - }, - "TestSuiteTestsPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "description": "A list of test suite tests.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/TestSuiteTestVoice" - }, - { - "$ref": "#/components/schemas/TestSuiteTestChat" - } - ] - } - }, - "metadata": { - "description": "Metadata about the pagination.", - "allOf": [ - { - "$ref": "#/components/schemas/PaginationMeta" - } - ] - } - }, - "required": [ - "results", - "metadata" - ] - }, - "TestSuiteRunScorerAI": { - "type": "object", - "properties": { - "type": { - "type": "string", - "description": "This is the type of the scorer, which must be AI.", - "enum": [ - "ai" - ], - "maxLength": 100 - }, - "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/Artifact" - } - ] - } - }, - "required": [ - "artifact" - ] - }, - "TestSuiteRunTestAttemptMetadata": { - "type": "object", - "properties": { - "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 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" - } - ] - }, - "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/TestSuiteRunTestAttemptMetadata" - } - ] - } - }, - "required": [ - "scorerResults" - ] - }, - "TestSuiteRunTestResult": { - "type": "object", - "properties": { - "test": { - "description": "This is the test that was run.", - "oneOf": [ - { - "$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" - ] - }, - "TestSuiteRun": { - "type": "object", - "properties": { - "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", - "items": { - "$ref": "#/components/schemas/TestSuiteRunTestResult" - } - }, - "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 - } - } - }, - "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", - "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" - ] - } - }, - "name": { + "rubric": { "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" - } + "description": "This is the rubric used by the AI scorer.", + "maxLength": 10000 } }, "required": [ - "table", - "name", - "operations" + "type", + "rubric" ] }, - "AnalyticsQueryDTO": { + "TestSuiteTestsPaginatedResponse": { "type": "object", "properties": { - "queries": { - "description": "This is the list of metric queries you want to perform.", + "results": { "type": "array", + "description": "A list of test suite tests.", "items": { - "$ref": "#/components/schemas/AnalyticsQuery" + "oneOf": [ + { + "$ref": "#/components/schemas/TestSuiteTestVoice" + }, + { + "$ref": "#/components/schemas/TestSuiteTestChat" + } + ] } - } - }, - "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.", + "metadata": { + "description": "Metadata about the pagination.", "allOf": [ { - "$ref": "#/components/schemas/TimeRange" + "$ref": "#/components/schemas/PaginationMeta" } ] - }, - "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" + "results", + "metadata" ] }, - "CallLogPrivileged": { + "TestSuiteRunScorerAI": { "type": "object", "properties": { - "callId": { - "type": "string", - "description": "This is the unique identifier for the call." - }, - "orgId": { + "type": { "type": "string", - "description": "This is the unique identifier for the org that this call log belongs to." + "description": "This is the type of the scorer, which must be AI.", + "enum": [ + "ai" + ], + "maxLength": 100 }, - "log": { + "result": { "type": "string", - "description": "This is the log message associated with the call." + "description": "This is the result of the test suite.", + "enum": [ + "pass", + "fail" + ], + "maxLength": 100 }, - "level": { + "reasoning": { "type": "string", - "description": "This is the level of the log message.", - "enum": [ - "INFO", - "LOG", - "WARN", - "ERROR", - "CHECKPOINT" - ] + "description": "This is the reasoning provided by the AI scorer.", + "maxLength": 10000 }, - "time": { - "format": "date-time", + "rubric": { "type": "string", - "description": "This is the ISO 8601 date-time string of when the log was created." + "description": "This is the rubric used by the AI scorer.", + "maxLength": 10000 } }, "required": [ - "callId", - "orgId", - "log", - "level", - "time" + "type", + "result", + "reasoning", + "rubric" ] }, - "CallLogsPaginatedResponse": { + "TestSuiteRunTestAttemptCall": { "type": "object", "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CallLogPrivileged" - } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" + "artifact": { + "description": "This is the artifact of the call.", + "allOf": [ + { + "$ref": "#/components/schemas/Artifact" + } + ] } }, "required": [ - "results", - "metadata" + "artifact" ] }, - "Error": { + "TestSuiteRunTestAttemptMetadata": { "type": "object", "properties": { - "message": { - "type": "string" + "sessionId": { + "type": "string", + "description": "This is the session ID for the test attempt." } }, "required": [ - "message" + "sessionId" ] }, - "Log": { + "TestSuiteRunTestAttempt": { "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." - }, - "resource": { - "type": "string", - "description": "This is the specific resource, relevant only to API logs.", - "enum": [ - "org", - "assistant", - "analytics", - "credential", - "phone-number", - "block", - "voice-library", - "provider", - "tool", - "token", - "template", - "squad", - "call", - "file", - "metric", - "log" - ] - }, - "requestDurationSeconds": { - "type": "number", - "description": "'This is how long the request took.", - "minimum": 0 - }, - "requestStartedAt": { - "type": "string", - "description": "This is the timestamp at which the request began." - }, - "requestFinishedAt": { - "type": "string", - "description": "This is the timestamp at which the request finished." - }, - "requestBody": { - "type": "object", - "description": "This is the body of the request." + "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" + } + ] + } }, - "requestHttpMethod": { - "type": "string", - "description": "This is the request method.", - "enum": [ - "POST", - "GET", - "PUT", - "PATCH", - "DELETE" + "call": { + "description": "This is the call made during the test attempt.", + "allOf": [ + { + "$ref": "#/components/schemas/TestSuiteRunTestAttemptCall" + } ] }, - "requestUrl": { - "type": "string", - "description": "This is the request URL." - }, - "requestPath": { - "type": "string", - "description": "This is the request path." - }, - "requestQuery": { - "type": "string", - "description": "This is the request query." - }, - "responseHttpCode": { - "type": "number", - "description": "This the HTTP status code of the response." - }, - "requestIpAddress": { - "type": "string", - "description": "This is the request IP address." - }, - "requestOrigin": { + "callId": { "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." + "description": "This is the call ID for the test attempt." }, - "error": { - "description": "This is the error, if one occurred.", + "metadata": { + "description": "This is the metadata for the test attempt.", "allOf": [ { - "$ref": "#/components/schemas/Error" + "$ref": "#/components/schemas/TestSuiteRunTestAttemptMetadata" } ] - }, - "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." - }, - "squadId": { - "type": "string", - "description": "This is the ID of the squad." - }, - "callId": { - "type": "string", - "description": "This is the ID of the call." } }, "required": [ - "time", - "orgId", - "type" + "scorerResults" ] }, - "LogsPaginatedResponse": { + "TestSuiteRunTestResult": { "type": "object", "properties": { - "results": { + "test": { + "description": "This is the test that was run.", + "oneOf": [ + { + "$ref": "#/components/schemas/TestSuiteTestVoice", + "title": "TestSuiteTestVoice" + } + ] + }, + "attempts": { + "description": "These are the attempts made for this test.", "type": "array", "items": { - "$ref": "#/components/schemas/Log" + "$ref": "#/components/schemas/TestSuiteRunTestAttempt" } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" } }, "required": [ - "results", - "metadata" + "test", + "attempts" ] }, - "StructuredOutput": { + "TestSuiteRun": { "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" - } + "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 structured output." + "description": "This is the unique identifier for the test suite run." }, "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 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 structured output was created." + "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 structured output was last updated." - }, - "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" - } + "description": "This is the ISO 8601 date-time string of when the test suite run was last updated." }, - "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.", + "testResults": { + "description": "These are the results of the tests in this test suite run.", "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/TestSuiteRunTestResult" } }, - "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" - } - ] + "name": { + "type": "string", + "description": "This is the name of the test suite run.", + "maxLength": 80 } }, "required": [ + "status", "id", "orgId", + "testSuiteId", "createdAt", "updatedAt", - "name", - "schema" + "testResults" ] }, - "StructuredOutputPaginatedResponse": { + "TestSuiteRunsPaginatedResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { - "$ref": "#/components/schemas/StructuredOutput" + "$ref": "#/components/schemas/TestSuiteRun" } }, "metadata": { @@ -39330,123 +37137,23 @@ "metadata" ] }, - "CreateStructuredOutputDTO": { + "CreateTestSuiteRunDto": { "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": { - "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" - } + "description": "This is the name of the test suite run.", + "maxLength": 80 } - }, - "required": [ - "name", - "schema" - ] + } }, - "UpdateStructuredOutputDTO": { + "UpdateTestSuiteRunDto": { "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.", - "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" - } - ] + "description": "This is the name of the test suite run.", + "maxLength": 80 } } }, @@ -42421,20 +40128,98 @@ ] }, "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" + } + } + }, + "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." + }, + "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.", + "minLength": 1, + "maxLength": 40 + } + }, + "required": [ + "provider", + "authenticationPlan", + "id", + "orgId", + "createdAt", + "updatedAt", + "authenticationSession" + ] + }, + "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" + "hmac": "#/components/schemas/HMACAuthenticationPlan", + "bearer": "#/components/schemas/BearerAuthenticationPlan" } } }, @@ -43019,6 +40804,49 @@ "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" + } + } + }, + "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": { @@ -43968,20 +41796,57 @@ "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" } } }, @@ -44286,6 +42151,33 @@ "algorithm" ] }, + "BearerAuthenticationPlan": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "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": [ + "type", + "token" + ] + }, "CredentialSessionDTO": { "type": "object", "properties": { @@ -45493,6 +43385,192 @@ "files" ] }, + "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", + "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" + ] + } + }, + "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": {