From 91cd6c1790ee1f2302f18b3bb5e56a6b040f146c Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 3 Nov 2025 00:29:12 +0000 Subject: [PATCH] Update API specifications with fern api update --- fern/apis/api/openapi.json | 3126 ++++++++++++++++++++++++++++++++---- 1 file changed, 2793 insertions(+), 333 deletions(-) diff --git a/fern/apis/api/openapi.json b/fern/apis/api/openapi.json index 7cb93551..60918d74 100644 --- a/fern/apis/api/openapi.json +++ b/fern/apis/api/openapi.json @@ -786,6 +786,24 @@ "type": "string" } }, + { + "name": "squadId", + "required": false, + "in": "query", + "description": "This will return calls with the specified squadId.", + "schema": { + "type": "string" + } + }, + { + "name": "squadName", + "required": false, + "in": "query", + "description": "This will return calls where the transient squad name exactly matches the specified value (case-insensitive).", + "schema": { + "type": "string" + } + }, { "name": "id", "required": false, @@ -870,41 +888,7 @@ "in": "query", "schema": { "additionalProperties": { - "type": "object", - "properties": { - "eq": { - "type": "string", - "description": "Equal to" - }, - "neq": { - "type": "string", - "description": "Not equal to" - }, - "gt": { - "type": "string", - "description": "Greater than" - }, - "gte": { - "type": "string", - "description": "Greater than or equal to" - }, - "lt": { - "type": "string", - "description": "Less than" - }, - "lte": { - "type": "string", - "description": "Less than or equal to" - }, - "contains": { - "type": "string", - "description": "Contains" - }, - "notContains": { - "type": "string", - "description": "Not contains" - } - } + "$ref": "#/components/schemas/StructuredOutputFilterDTO" }, "example": { "c9dddda4-d70a-4dad-aa5c-aaf117f85cea": { @@ -916,42 +900,20 @@ } }, { + "name": "score", "required": false, "description": "Filter calls by the first scorecard's normalized score.", - "name": "score", + "allOf": [ + { + "$ref": "#/components/schemas/StructuredOutputFilterDTO" + } + ], "in": "query", "schema": { - "properties": { - "eq": { - "type": "string", - "description": "Equal to" - }, - "neq": { - "type": "string", - "description": "Not equal to" - }, - "gt": { - "type": "string", - "description": "Greater than" - }, - "gte": { - "type": "string", - "description": "Greater than or equal to" - }, - "lt": { - "type": "string", - "description": "Less than" - }, - "lte": { - "type": "string", - "description": "Less than or equal to" - } - }, "example": { "gte": 80, "lt": 100 - }, - "type": "object" + } } }, { @@ -4424,17 +4386,43 @@ ] } }, - "/eval": { + "/reporting/insight": { "post": { - "operationId": "EvalController_create", - "summary": "Create Eval", + "operationId": "InsightController_create", + "summary": "Create Insight", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEvalDTO" + "oneOf": [ + { + "$ref": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "title": "CreateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "title": "CreatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "title": "CreateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateTextInsightFromCallTableDTO", + "title": "CreateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "line": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "text": "#/components/schemas/CreateTextInsightFromCallTableDTO" + } + } } } } @@ -4445,14 +4433,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Eval" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4461,8 +4471,8 @@ ] }, "get": { - "operationId": "EvalController_getPaginated", - "summary": "List Evals", + "operationId": "InsightController_findAll", + "summary": "Get Insights", "parameters": [ { "name": "id", @@ -4593,14 +4603,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalPaginatedResponse" + "$ref": "#/components/schemas/InsightPaginatedResponse" } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4609,10 +4619,10 @@ ] } }, - "/eval/{id}": { + "/reporting/insight/{id}": { "patch": { - "operationId": "EvalController_update", - "summary": "Update Eval", + "operationId": "InsightController_update", + "summary": "Update Insight", "parameters": [ { "name": "id", @@ -4628,7 +4638,33 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateEvalDTO" + "oneOf": [ + { + "$ref": "#/components/schemas/UpdateBarInsightFromCallTableDTO", + "title": "UpdateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdatePieInsightFromCallTableDTO", + "title": "UpdatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdateLineInsightFromCallTableDTO", + "title": "UpdateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/UpdateTextInsightFromCallTableDTO", + "title": "UpdateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/UpdateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/UpdatePieInsightFromCallTableDTO", + "line": "#/components/schemas/UpdateLineInsightFromCallTableDTO", + "text": "#/components/schemas/UpdateTextInsightFromCallTableDTO" + } + } } } } @@ -4639,14 +4675,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Eval" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4654,9 +4712,9 @@ } ] }, - "delete": { - "operationId": "EvalController_remove", - "summary": "Delete Eval", + "get": { + "operationId": "InsightController_findOne", + "summary": "Get Insight", "parameters": [ { "name": "id", @@ -4673,14 +4731,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Eval" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4688,9 +4768,9 @@ } ] }, - "get": { - "operationId": "EvalController_get", - "summary": "Get Eval", + "delete": { + "operationId": "InsightController_remove", + "summary": "Delete Insight", "parameters": [ { "name": "id", @@ -4707,14 +4787,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Eval" + "oneOf": [ + { + "$ref": "#/components/schemas/BarInsight" + }, + { + "$ref": "#/components/schemas/PieInsight" + }, + { + "$ref": "#/components/schemas/LineInsight" + }, + { + "$ref": "#/components/schemas/TextInsight" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/BarInsight", + "pie": "#/components/schemas/PieInsight", + "line": "#/components/schemas/LineInsight", + "text": "#/components/schemas/TextInsight" + } + } } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4723,10 +4825,10 @@ ] } }, - "/eval/run/{id}": { - "delete": { - "operationId": "EvalController_removeRun", - "summary": "Delete Eval Run", + "/reporting/insight/{id}/run": { + "post": { + "operationId": "InsightController_run", + "summary": "Run Insight", "parameters": [ { "name": "id", @@ -4737,54 +4839,113 @@ } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightRunDTO" + } + } + } + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalRun" + "$ref": "#/components/schemas/InsightRunResponse" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightRunResponse" } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { "bearer": [] } ] - }, - "get": { - "operationId": "EvalController_getRun", - "summary": "Get Eval Run", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" + } + }, + "/reporting/insight/preview": { + "post": { + "operationId": "InsightController_preview", + "summary": "Preview Insight", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "title": "CreateBarInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "title": "CreatePieInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "title": "CreateLineInsightFromCallTableDTO" + }, + { + "$ref": "#/components/schemas/CreateTextInsightFromCallTableDTO", + "title": "CreateTextInsightFromCallTableDTO" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "bar": "#/components/schemas/CreateBarInsightFromCallTableDTO", + "pie": "#/components/schemas/CreatePieInsightFromCallTableDTO", + "line": "#/components/schemas/CreateLineInsightFromCallTableDTO", + "text": "#/components/schemas/CreateTextInsightFromCallTableDTO" + } + } + } } } - ], + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalRun" + "$ref": "#/components/schemas/InsightRunResponse" + } + } + } + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InsightRunResponse" } } } } }, "tags": [ - "Eval" + "Insight" ], "security": [ { @@ -4793,31 +4954,28 @@ ] } }, - "/eval/run": { + "/eval": { "post": { - "operationId": "EvalController_run", - "summary": "Create Eval Run", + "operationId": "EvalController_create", + "summary": "Create Eval", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateEvalRunDTO" + "$ref": "#/components/schemas/CreateEvalDTO" } } } }, "responses": { - "200": { - "description": "" - }, "201": { "description": "", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/Eval" } } } @@ -4833,8 +4991,8 @@ ] }, "get": { - "operationId": "EvalController_getRunsPaginated", - "summary": "List Eval Runs", + "operationId": "EvalController_getPaginated", + "summary": "List Evals", "parameters": [ { "name": "id", @@ -4965,7 +5123,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EvalRunPaginatedResponse" + "$ref": "#/components/schemas/EvalPaginatedResponse" } } } @@ -4981,10 +5139,10 @@ ] } }, - "/observability/scorecard/{id}": { - "get": { - "operationId": "ScorecardController_get", - "summary": "Get Scorecard", + "/eval/{id}": { + "patch": { + "operationId": "EvalController_update", + "summary": "Update Eval", "parameters": [ { "name": "id", @@ -4995,20 +5153,30 @@ } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateEvalDTO" + } + } + } + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Scorecard" + "$ref": "#/components/schemas/Eval" } } } } }, "tags": [ - "Observability/Scorecard" + "Eval" ], "security": [ { @@ -5016,9 +5184,9 @@ } ] }, - "patch": { - "operationId": "ScorecardController_update", - "summary": "Update Scorecard", + "delete": { + "operationId": "EvalController_remove", + "summary": "Delete Eval", "parameters": [ { "name": "id", @@ -5029,30 +5197,90 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateScorecardDTO" + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "get": { + "operationId": "EvalController_get", + "summary": "Get Eval", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } } } } }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/eval/run/{id}": { + "delete": { + "operationId": "EvalController_removeRun", + "summary": "Delete Eval Run", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Scorecard" + "$ref": "#/components/schemas/EvalRun" } } } } }, "tags": [ - "Observability/Scorecard" + "Eval" ], "security": [ { @@ -5060,9 +5288,9 @@ } ] }, - "delete": { - "operationId": "ScorecardController_remove", - "summary": "Delete Scorecard", + "get": { + "operationId": "EvalController_getRun", + "summary": "Get Eval Run", "parameters": [ { "name": "id", @@ -5079,14 +5307,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Scorecard" + "$ref": "#/components/schemas/EvalRun" } } } } }, "tags": [ - "Observability/Scorecard" + "Eval" ], "security": [ { @@ -5095,10 +5323,312 @@ ] } }, - "/observability/scorecard": { + "/eval/run": { + "post": { + "operationId": "EvalController_run", + "summary": "Create Eval Run", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEvalRunDTO" + } + } + } + }, + "responses": { + "200": { + "description": "" + }, + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + }, "get": { - "operationId": "ScorecardController_getPaginated", - "summary": "List Scorecards", + "operationId": "EvalController_getRunsPaginated", + "summary": "List Eval Runs", + "parameters": [ + { + "name": "id", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "description": "This is the page number to return. Defaults to 1.", + "schema": { + "minimum": 1, + "type": "number" + } + }, + { + "name": "sortOrder", + "required": false, + "in": "query", + "description": "This is the sort order for pagination. Defaults to 'DESC'.", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "description": "This is the maximum number of items to return. Defaults to 100.", + "schema": { + "minimum": 0, + "maximum": 1000, + "type": "number" + } + }, + { + "name": "createdAtGt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLt", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtGe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "createdAtLe", + "required": false, + "in": "query", + "description": "This will return items where the createdAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLt", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtGe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is greater than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "name": "updatedAtLe", + "required": false, + "in": "query", + "description": "This will return items where the updatedAt is less than or equal to the specified value.", + "schema": { + "format": "date-time", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvalRunPaginatedResponse" + } + } + } + } + }, + "tags": [ + "Eval" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/observability/scorecard/{id}": { + "get": { + "operationId": "ScorecardController_get", + "summary": "Get Scorecard", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scorecard" + } + } + } + } + }, + "tags": [ + "Observability/Scorecard" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "patch": { + "operationId": "ScorecardController_update", + "summary": "Update Scorecard", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateScorecardDTO" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scorecard" + } + } + } + } + }, + "tags": [ + "Observability/Scorecard" + ], + "security": [ + { + "bearer": [] + } + ] + }, + "delete": { + "operationId": "ScorecardController_remove", + "summary": "Delete Scorecard", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Scorecard" + } + } + } + } + }, + "tags": [ + "Observability/Scorecard" + ], + "security": [ + { + "bearer": [] + } + ] + } + }, + "/observability/scorecard": { + "get": { + "operationId": "ScorecardController_getPaginated", + "summary": "List Scorecards", "parameters": [ { "name": "id", @@ -10997,6 +11527,23 @@ "type": "string", "description": "This is the URL to an audio file played after the warm transfer message or summary is delivered to the destination party.\nIt can be used to play a custom sound like 'beep' to notify that the transfer is complete.\n\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- Used when transferring calls to play hold audio for the destination party.\n- Must be a publicly accessible URL to an audio file.\n- Supported formats: MP3 and WAV." }, + "contextEngineeringPlan": { + "description": "This is the plan for manipulating the message context before initiating the warm transfer.\nUsage:\n- Used only when `mode` is `warm-transfer-experimental`.\n- These messages will automatically be added to the transferAssistant's system message.\n- If 'none', we will not add any transcript to the transferAssistant's system message.\n- If you want to provide your own messages, use transferAssistant.model.messages instead.\n\n@default { type: 'all' }", + "oneOf": [ + { + "$ref": "#/components/schemas/ContextEngineeringPlanLastNMessages", + "title": "Last N Messages" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanNone", + "title": "None" + }, + { + "$ref": "#/components/schemas/ContextEngineeringPlanAll", + "title": "All" + } + ] + }, "twiml": { "type": "string", "description": "This is the TwiML instructions to execute on the destination call leg before connecting the customer.\n\nUsage:\n- Used only when `mode` is `warm-transfer-twiml`.\n- Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs.\n- Maximum length is 4096 characters.\n\nExample:\n```\nHello, transferring a customer to you.\n\nThey called about billing questions.\n```", @@ -11338,6 +11885,14 @@ } ] }, + "assistantOverrides": { + "description": "These are the assistant overrides to apply to the destination assistant.", + "allOf": [ + { + "$ref": "#/components/schemas/AssistantOverrides" + } + ] + }, "description": { "type": "string", "description": "This is the description of the destination, used by the AI to choose when and how to transfer the call." @@ -24419,7 +24974,7 @@ "regex" ] }, - "CreateAssistantDTO": { + "AssistantOverrides": { "type": "object", "properties": { "transcriber": { @@ -25130,6 +25685,97 @@ ] } }, + "tools:append": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateApiRequestToolDTO", + "title": "ApiRequestTool" + }, + { + "$ref": "#/components/schemas/CreateBashToolDTO", + "title": "BashTool" + }, + { + "$ref": "#/components/schemas/CreateComputerToolDTO", + "title": "ComputerTool" + }, + { + "$ref": "#/components/schemas/CreateDtmfToolDTO", + "title": "DtmfTool" + }, + { + "$ref": "#/components/schemas/CreateEndCallToolDTO", + "title": "EndCallTool" + }, + { + "$ref": "#/components/schemas/CreateFunctionToolDTO", + "title": "FunctionTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", + "title": "GoHighLevelCalendarAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", + "title": "GoHighLevelCalendarEventCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", + "title": "GoHighLevelContactCreateTool" + }, + { + "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", + "title": "GoHighLevelContactGetTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", + "title": "GoogleCalendarCheckAvailabilityTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", + "title": "GoogleCalendarCreateEventTool" + }, + { + "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", + "title": "GoogleSheetsRowAppendTool" + }, + { + "$ref": "#/components/schemas/CreateHandoffToolDTO", + "title": "HandoffTool" + }, + { + "$ref": "#/components/schemas/CreateMcpToolDTO", + "title": "McpTool" + }, + { + "$ref": "#/components/schemas/CreateQueryToolDTO", + "title": "QueryTool" + }, + { + "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", + "title": "SlackSendMessageTool" + }, + { + "$ref": "#/components/schemas/CreateSmsToolDTO", + "title": "SmsTool" + }, + { + "$ref": "#/components/schemas/CreateTextEditorToolDTO", + "title": "TextEditorTool" + }, + { + "$ref": "#/components/schemas/CreateTransferCallToolDTO", + "title": "TransferCallTool" + } + ] + } + }, + "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.", @@ -25229,7 +25875,7 @@ } } }, - "Assistant": { + "CreateAssistantDTO": { "type": "object", "properties": { "transcriber": { @@ -26036,100 +26682,10 @@ }, "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" - ] - }, - "PaginationMeta": { - "type": "object", - "properties": { - "itemsPerPage": { - "type": "number" - }, - "totalItems": { - "type": "number" - }, - "currentPage": { - "type": "number" - }, - "itemsBeyondRetention": { - "type": "boolean" - }, - "createdAtLe": { - "format": "date-time", - "type": "string" - }, - "createdAtGe": { - "format": "date-time", - "type": "string" } - }, - "required": [ - "itemsPerPage", - "totalItems", - "currentPage" - ] - }, - "AssistantPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Assistant" - } - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - } - }, - "required": [ - "results", - "metadata" - ] - }, - "AssistantVersionPaginatedResponse": { - "type": "object", - "properties": { - "results": { - "type": "array" - }, - "metadata": { - "$ref": "#/components/schemas/PaginationMeta" - }, - "nextPageState": { - "type": "string" - } - }, - "required": [ - "results", - "metadata" - ] + } }, - "UpdateAssistantDTO": { + "Assistant": { "type": "object", "properties": { "transcriber": { @@ -26936,10 +27492,100 @@ }, "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" + ] }, - "AssistantOverrides": { + "PaginationMeta": { + "type": "object", + "properties": { + "itemsPerPage": { + "type": "number" + }, + "totalItems": { + "type": "number" + }, + "currentPage": { + "type": "number" + }, + "itemsBeyondRetention": { + "type": "boolean" + }, + "createdAtLe": { + "format": "date-time", + "type": "string" + }, + "createdAtGe": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "itemsPerPage", + "totalItems", + "currentPage" + ] + }, + "AssistantPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Assistant" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "AssistantVersionPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array" + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + }, + "nextPageState": { + "type": "string" + } + }, + "required": [ + "results", + "metadata" + ] + }, + "UpdateAssistantDTO": { "type": "object", "properties": { "transcriber": { @@ -27650,97 +28296,6 @@ ] } }, - "tools:append": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/CreateApiRequestToolDTO", - "title": "ApiRequestTool" - }, - { - "$ref": "#/components/schemas/CreateBashToolDTO", - "title": "BashTool" - }, - { - "$ref": "#/components/schemas/CreateComputerToolDTO", - "title": "ComputerTool" - }, - { - "$ref": "#/components/schemas/CreateDtmfToolDTO", - "title": "DtmfTool" - }, - { - "$ref": "#/components/schemas/CreateEndCallToolDTO", - "title": "EndCallTool" - }, - { - "$ref": "#/components/schemas/CreateFunctionToolDTO", - "title": "FunctionTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarAvailabilityToolDTO", - "title": "GoHighLevelCalendarAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelCalendarEventCreateToolDTO", - "title": "GoHighLevelCalendarEventCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactCreateToolDTO", - "title": "GoHighLevelContactCreateTool" - }, - { - "$ref": "#/components/schemas/CreateGoHighLevelContactGetToolDTO", - "title": "GoHighLevelContactGetTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCheckAvailabilityToolDTO", - "title": "GoogleCalendarCheckAvailabilityTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleCalendarCreateEventToolDTO", - "title": "GoogleCalendarCreateEventTool" - }, - { - "$ref": "#/components/schemas/CreateGoogleSheetsRowAppendToolDTO", - "title": "GoogleSheetsRowAppendTool" - }, - { - "$ref": "#/components/schemas/CreateHandoffToolDTO", - "title": "HandoffTool" - }, - { - "$ref": "#/components/schemas/CreateMcpToolDTO", - "title": "McpTool" - }, - { - "$ref": "#/components/schemas/CreateQueryToolDTO", - "title": "QueryTool" - }, - { - "$ref": "#/components/schemas/CreateSlackSendMessageToolDTO", - "title": "SlackSendMessageTool" - }, - { - "$ref": "#/components/schemas/CreateSmsToolDTO", - "title": "SmsTool" - }, - { - "$ref": "#/components/schemas/CreateTextEditorToolDTO", - "title": "TextEditorTool" - }, - { - "$ref": "#/components/schemas/CreateTransferCallToolDTO", - "title": "TransferCallTool" - } - ] - } - }, - "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.", @@ -30149,6 +30704,14 @@ "turnLatencyAverage": { "type": "number", "description": "This is the average latency for complete turns." + }, + "numUserInterrupted": { + "type": "number", + "description": "This is the number of times the user was interrupted by the assistant during the call." + }, + "numAssistantInterrupted": { + "type": "number", + "description": "This is the number of times the assistant was interrupted by the user during the call." } } }, @@ -31623,6 +32186,43 @@ } } }, + "StructuredOutputFilterDTO": { + "type": "object", + "properties": { + "eq": { + "type": "string", + "description": "Equal to" + }, + "neq": { + "type": "string", + "description": "Not equal to" + }, + "gt": { + "type": "string", + "description": "Greater than" + }, + "gte": { + "type": "string", + "description": "Greater than or equal to" + }, + "lt": { + "type": "string", + "description": "Less than" + }, + "lte": { + "type": "string", + "description": "Less than or equal to" + }, + "contains": { + "type": "string", + "description": "Contains" + }, + "notContains": { + "type": "string", + "description": "Not contains" + } + } + }, "CallPaginatedResponse": { "type": "object", "properties": { @@ -32733,6 +33333,12 @@ "type": "string", "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." }, + "sessionExpirationSeconds": { + "type": "number", + "description": "This is the expiration time for the session. This can ONLY be set if starting a new chat and therefore a new session is created.\nIf session already exists, this will be ignored and NOT be updated for the existing session. Use PATCH /session/:id to update the session expiration time.", + "minimum": 60, + "maximum": 2592000 + }, "assistantOverrides": { "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", "allOf": [ @@ -32867,6 +33473,12 @@ "type": "string", "description": "This is the ID of the session that will be used for the chat.\nIf provided, the conversation will continue from the previous state.\nIf not provided or expired, a new session will be created." }, + "sessionExpirationSeconds": { + "type": "number", + "description": "This is the expiration time for the session. This can ONLY be set if starting a new chat and therefore a new session is created.\nIf session already exists, this will be ignored and NOT be updated for the existing session. Use PATCH /session/:id to update the session expiration time.", + "minimum": 60, + "maximum": 2592000 + }, "assistantOverrides": { "description": "These are the variable values that will be used to replace template variables in the assistant messages.\nOnly variable substitution is supported in web chat - other assistant properties cannot be overridden.", "allOf": [ @@ -40128,6 +40740,1854 @@ } } }, + "BarInsightMetadata": { + "type": "object", + "properties": { + "xAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisMin": { + "type": "number" + }, + "yAxisMax": { + "type": "number" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 40 + } + } + }, + "InsightTimeRangeWithStep": { + "type": "object", + "properties": { + "step": { + "type": "string", + "description": "This is the group by step for aggregation.\n\nIf not provided, defaults to group by day.", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "start": { + "type": "object", + "description": "This is the start date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to the 7 days ago.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"-7d\" or \"now\"" + }, + "end": { + "type": "object", + "description": "This is the end date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to now.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"now\"" + }, + "timezone": { + "type": "string", + "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." + } + } + }, + "BarInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/BarInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "InsightTimeRange": { + "type": "object", + "properties": { + "start": { + "type": "object", + "description": "This is the start date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to the 7 days ago.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"-7d\" or \"now\"" + }, + "end": { + "type": "object", + "description": "This is the end date for the time range.\n\nShould be a valid ISO 8601 date-time string or relative time string.\nIf not provided, defaults to now.\n\nRelative time strings of the format \"-{number}{unit}\" are allowed.\n\nValid units are:\n- d: days\n- h: hours\n- w: weeks\n- m: months\n- y: years", + "example": "\"2025-01-01\" or \"now\"" + }, + "timezone": { + "type": "string", + "description": "This is the timezone you want to set for the query.\n\nIf not provided, defaults to UTC." + } + } + }, + "PieInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "LineInsightMetadata": { + "type": "object", + "properties": { + "xAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisLabel": { + "type": "string", + "minLength": 1, + "maxLength": 40 + }, + "yAxisMin": { + "type": "number" + }, + "yAxisMax": { + "type": "number" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 40 + } + } + }, + "LineInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/LineInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "TextInsight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "queries", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "UpdateBarInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/BarInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + } + }, + "UpdatePieInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + } + }, + "UpdateLineInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/LineInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + } + }, + "UpdateTextInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + } + }, + "CreateBarInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/BarInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreatePieInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreateLineInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/LineInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "CreateTextInsightFromCallTableDTO": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "JSONQueryOnCallTableWithStringTypeColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "id", + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the selected table.\nAvailable columns depend on the selected table.\nString Type columns are columns where the rows store String data", + "example": "id" + }, + "operation": { + "type": "string", + "enum": [ + "count" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a string type, the operation must be \"count\".", + "example": "count" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "JSONQueryOnCallTableWithNumberTypeColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "cost", + "duration", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency", + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the selected table.\nAvailable columns depend on the selected table.\nNumber Type columns are columns where the rows store Number data", + "example": "duration" + }, + "operation": { + "type": "string", + "enum": [ + "average", + "sum", + "min", + "max" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a number type, the operation must be one of the following:\n- average\n- sum\n- min\n- max", + "example": "sum" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "JSONQueryOnCallTableWithStructuredOutputColumn": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is the type of query. Only allowed type is \"vapiql-json\".", + "example": "vapiql-json", + "enum": [ + "vapiql-json" + ] + }, + "table": { + "type": "string", + "description": "This is the table that will be queried.", + "enum": [ + "call" + ] + }, + "filters": { + "type": "array", + "description": "This is the filters to apply to the insight.\nThe discriminator automatically selects the correct filter type based on column and operator.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/FilterStringTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStringArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterNumberArrayTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterDateTypeColumnOnCallTable" + }, + { + "$ref": "#/components/schemas/FilterStructuredOutputColumnOnCallTable" + } + ] + } + }, + "column": { + "type": "string", + "enum": [ + "artifact.structuredOutputs[OutputID]" + ], + "description": "This is the column that will be queried in the call table.\nStructured Output Type columns are only to query on artifact.structuredOutputs[OutputID] column.", + "example": "artifact.structuredOutputs[OutputID]" + }, + "operation": { + "type": "string", + "enum": [ + "average", + "count", + "sum", + "min", + "max" + ], + "description": "This is the aggregation operation to perform on the column.\nWhen the column is a structured output type, the operation depends on the value of the structured output.\nIf the structured output is a string or boolean, the operation must be \"count\".\nIf the structured output is a number, the operation can be \"average\", \"sum\", \"min\", or \"max\".", + "example": "count" + }, + "name": { + "type": "string", + "description": "This is the name of the query.\nIt will be used to label the query in the insight board on the UI.", + "example": "Total Calls" + } + }, + "required": [ + "type", + "table", + "column", + "operation" + ] + }, + "FilterStringTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nString Type columns are columns where the rows store data as a string.\nMust be a valid column for the selected table.", + "example": "assistant_id", + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "customerNumber", + "status", + "endedReason", + "forwardedPhoneNumber", + "campaignId" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor string type columns, the operator must be \"=\", \"!=\", \"contains\", \"not contains\"", + "example": "\"=\" or \"!=\"", + "enum": [ + "=", + "!=", + "contains", + "not_contains" + ] + }, + "value": { + "type": "string", + "description": "This is the value to filter on." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterNumberTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nNumber Type columns are columns where the rows store data as a number.\nMust be a valid column for the selected table.", + "example": "duration", + "enum": [ + "duration", + "cost", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor number type columns, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"", + "example": "\"=\" or \">\" or \"<\" or \">=\" or \"<=\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ] + }, + "value": { + "type": "number", + "description": "This is the value to filter on." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterDateTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nDate Type columns are columns where the rows store data as a date.\nMust be a valid column for the selected table.", + "example": "created_at", + "enum": [ + "startedAt", + "endedAt" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nFor date type columns, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"", + "example": "\"=\" or \">\" or \"<\" or \">=\" or \"<=\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=" + ] + }, + "value": { + "type": "string", + "description": "This is the value to filter on.\nMust be a valid ISO 8601 date-time string.", + "example": "2025-01-01T00:00:00Z" + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterStructuredOutputColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nStructured Output Type columns are only to filter on artifact.structuredOutputs[OutputID] column.", + "example": "artifact.structuredOutputs[OutputID]", + "enum": [ + "artifact.structuredOutputs[OutputID]" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator depends on the value type of the structured output.\nIf the structured output is a string or boolean, the operator must be \"=\", \"!=\"\nIf the structured output is a number, the operator must be \"=\", \">\", \"<\", \">=\", \"<=\"\nIf the structured output is an array, the operator must be \"in\" or \"not_in\"", + "example": "\"=\" or \">\" or \"<\" or \"in\" or \"not_in\"", + "enum": [ + "=", + "!=", + ">", + "<", + ">=", + "<=", + "in", + "not_in", + "contains", + "not_contains" + ] + }, + "value": { + "type": "object", + "description": "This is the value to filter on.\nThe value type depends on the structured output type being filtered." + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterStringArrayTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nString Array Type columns are the same as String Type columns, but provides the ability to filter on multiple values provided as an array.\nMust be a valid column for the selected table.", + "example": "assistant_id", + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "customerNumber", + "status", + "endedReason", + "forwardedPhoneNumber", + "campaignId" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator must be `in` or `not_in`.", + "example": "\"in\" or \"not_in\"", + "enum": [ + "in", + "not_in" + ] + }, + "value": { + "description": "These are the values to filter on.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "FilterNumberArrayTypeColumnOnCallTable": { + "type": "object", + "properties": { + "column": { + "type": "string", + "description": "This is the column in the call table that will be filtered on.\nNumber Array Type columns are the same as Number Type columns, but provides the ability to filter on multiple values provided as an array.\nMust be a valid column for the selected table.", + "example": "duration", + "enum": [ + "duration", + "cost", + "averageModelLatency", + "averageVoiceLatency", + "averageTranscriberLatency", + "averageTurnLatency", + "averageEndpointingLatency" + ] + }, + "operator": { + "type": "string", + "description": "This is the operator to use for the filter.\nThe operator must be `in` or `not_in`.", + "example": "\"in\" or \"not_in\"", + "enum": [ + "in", + "not_in" + ] + }, + "value": { + "description": "This is the value to filter on.", + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "column", + "operator", + "value" + ] + }, + "BarInsightFromCallTable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `bar` to create a bar insight.", + "enum": [ + "bar" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/BarInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "PieInsightFromCallTable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `pie` to create a pie insight.", + "enum": [ + "pie" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "LineInsightFromCallTable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `line` to create a line insight.", + "enum": [ + "line" + ] + }, + "formulas": { + "type": "array", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "metadata": { + "description": "This is the metadata for the insight.", + "allOf": [ + { + "$ref": "#/components/schemas/LineInsightMetadata" + } + ] + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + }, + "groupBy": { + "type": "string", + "description": "This is the group by column for the insight when table is `call`.\nThese are the columns to group the results by.\nAll results are grouped by the time range step by default.", + "example": [ + "assistant_id" + ], + "enum": [ + "assistantId", + "workflowId", + "squadId", + "phoneNumberId", + "type", + "endedReason", + "campaignId", + "artifact.structuredOutputs[OutputID]" + ] + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "TextInsightFromCallTable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.\nIt is required to be `text` to create a text insight.", + "enum": [ + "text" + ] + }, + "formula": { + "type": "object", + "description": "Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.\nThe formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html\nA formula is created by using the query names as the variable.\nThe formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nFor example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:\n```\n{{['Query 1']}} / {{['Query 2']}} * 100\n```\n\n```\n({{[Query 1]}} * 10) + {{[Query 2]}}\n```\nThis will take the\n\nYou can also use the query names as the variable in the formula.", + "items": { + "$ref": "#/components/schemas/InsightFormula" + } + }, + "timeRange": { + "$ref": "#/components/schemas/InsightTimeRange" + }, + "queries": { + "type": "array", + "description": "These are the queries to run to generate the insight.\nFor Text Insights, we only allow a single query, or require a formula if multiple queries are provided", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStringTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithNumberTypeColumn" + }, + { + "$ref": "#/components/schemas/JSONQueryOnCallTableWithStructuredOutputColumn" + } + ] + } + } + }, + "required": [ + "type", + "queries" + ] + }, + "InsightFormula": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the formula.\nIt will be used to label the formula in the insight board on the UI.", + "example": "Booking Rate", + "minLength": 1, + "maxLength": 40 + }, + "formula": { + "type": "string", + "description": "This is the formula to calculate the insight from the queries.\nThe formula needs to be a valid mathematical expression.\nThe formula must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.\nAny MathJS formula is allowed - https://mathjs.org/docs/expressions/syntax.html\n\nCommon valid math operations are +, -, *, /, %", + "minLength": 1, + "maxLength": 1000 + } + }, + "required": [ + "formula" + ] + }, + "InsightRunFormatPlan": { + "type": "object", + "properties": { + "format": { + "type": "string", + "description": "This is the format of the data to return.\nIf not provided, defaults to \"raw\".\nRaw provides the data as fetched from the database, with formulas evaluated.\nRecharts provides the data in a format that can is ready to be used by recharts.js to render charts.", + "example": "raw", + "enum": [ + "raw", + "recharts" + ] + } + } + }, + "InsightRunDTO": { + "type": "object", + "properties": { + "formatPlan": { + "$ref": "#/components/schemas/InsightRunFormatPlan" + }, + "timeRangeOverride": { + "description": "This is the optional time range override for the insight.\nIf provided, overrides every field in the insight's timeRange.\nIf this is provided with missing fields, defaults will be used, not the insight's timeRange.\nstart default - \"-7d\"\nend default - \"now\"\nstep default - \"day\"\nFor Pie and Text Insights, step will be ignored even if provided.", + "example": "{ start: \"2025-01-01\", end: \"2025-01-07\", step: \"day\" }", + "allOf": [ + { + "$ref": "#/components/schemas/InsightTimeRangeWithStep" + } + ] + } + } + }, + "InsightRunResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "insightId": { + "type": "string" + }, + "orgId": { + "type": "string" + }, + "createdAt": { + "format": "date-time", + "type": "string" + }, + "updatedAt": { + "format": "date-time", + "type": "string" + } + }, + "required": [ + "id", + "insightId", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "Insight": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "This is the name of the Insight.", + "minLength": 1, + "maxLength": 40 + }, + "type": { + "type": "string", + "description": "This is the type of the Insight.", + "enum": [ + "bar", + "line", + "pie", + "text" + ] + }, + "id": { + "type": "string", + "description": "This is the unique identifier for the Insight." + }, + "orgId": { + "type": "string", + "description": "This is the unique identifier for the org that this Insight belongs to." + }, + "createdAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was created." + }, + "updatedAt": { + "format": "date-time", + "type": "string", + "description": "This is the ISO 8601 date-time string of when the Insight was last updated." + } + }, + "required": [ + "type", + "id", + "orgId", + "createdAt", + "updatedAt" + ] + }, + "InsightPaginatedResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Insight" + } + }, + "metadata": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "required": [ + "results", + "metadata" + ] + }, "CreateEvalDTO": { "type": "object", "properties": {