{"openapi":"3.1.0","info":{"title":"Interactly API","description":"API for building interactly.ai services","version":"1.1.0","contact":{"name":"Interactly","url":"https://interactly.ai","email":"developers@interactly.ai"}},"servers":[{"url":"https://api-qa.interactly.ai","description":"API Server"}],"paths":{"/calls/v1/conversations":{"get":{"summary":"List Calls","description":"This API will return the list of calls based on the filter criteria.","operationId":"listCalls","tags":["Calls"],"parameters":[{"name":"startDate","description":"Filter the calls by start date. The date should be in ISO 8601 format, Ex: 2024-11-01T00:00:00.000Z","in":"query","required":true,"schema":{"type":"string","format":"date-time","example":"2024-11-01T00:00:00.000Z"}},{"name":"endDate","in":"query","description":"Filter the calls by end date. The date should be in ISO 8601 format, Ex: 2024-11-30T23:59:59.999Z","required":true,"schema":{"type":"string","format":"date-time","example":"2024-11-30T23:59:59.999Z"}},{"name":"page","in":"query","description":"To see the calls list of a particular page number.","required":false,"schema":{"type":"integer","example":1,"default":1}},{"name":"size","in":"query","description":"Number of calls per page.","required":false,"schema":{"type":"integer","example":10,"default":10}},{"name":"sort","in":"query","description":"Sort the calls by a field","required":false,"schema":{"type":"string","example":"startAt","enum":["startAt","endAt","status","conversationId"],"default":"startAt"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totalCount":{"type":"integer","description":"Total number of calls without applying pagination.","example":10},"conversations":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}}}}}}},"security":[{"bearer":[]}]},"post":{"summary":"Create Call","description":"This API will create a new call. The call will be initiated and the call details will be returned. Call will be outbound call from assistant to the user.","operationId":"createCall","tags":["Calls"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationDTO"}}},"required":true},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"sid":{"type":"string","description":"Unique identifier of the call","example":"a12f9c88-c155-461f-9771-4d240cdc9a04"}}}}}}},"security":[{"bearer":[]}]}},"/calls/v1/conversations/connect":{"post":{"summary":"Connect Call","description":"Connect your call with Interactly.","operationId":"connectCall","tags":["Calls"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectConversationDTO"}}},"required":true},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectConversationResponseDTO"}}}}},"security":[{"bearer":[]}]}},"/calls/v1/conversations/{id}":{"get":{"summary":"Get Call","description":"Get Call By ID. This API will return the call details along with the messages.","operationId":"getCall","tags":["Calls"],"parameters":[{"name":"id","in":"path","description":"Unique identifier of the call","required":true,"schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/Conversation"}],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"}}}}}}}},"security":[{"bearer":[]}]}},"/calls/v1/conversations/{id}/control":{"post":{"summary":"Control Call","description":"This API will allow you to control the call.","operationId":"controlCall","tags":["Calls"],"parameters":[{"name":"id","in":"path","description":"Unique identifier of the call","required":true,"schema":{"type":"string"},"example":"2665ba28-06aa-4d52-a223-1a89a81e0f44"}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ControlConversationSayDTO","title":"Say"},{"$ref":"#/components/schemas/ControlConversationEndDTO","title":"End"},{"$ref":"#/components/schemas/ControlConversationForwardDTO","title":"Forward"},{"$ref":"#/components/schemas/ControlConversationDTMFDTO","title":"DTMF"},{"$ref":"#/components/schemas/ControlConversationSMSDTO","title":"SMS"},{"$ref":"#/components/schemas/ControlConversationHandOverDTO","title":"Hand-over"},{"$ref":"#/components/schemas/ControlConversationSilenceTimerDTO","title":"Silence timer"},{"$ref":"#/components/schemas/ControlConversationResetSilenceTimerDTO","title":"Reset silence timer"}]}}},"required":true},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Call controlled successfully."},"data":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the call is controlled successfully.","example":true}}}}}}}}},"security":[{"bearer":[]}]}},"/calls/v1/stats/call-metrics":{"get":{"summary":"Get Call Metrics Stats","description":"Returns aggregated call metrics (TTS/LLM/STT latency, turns, barge-in, durations) for finished calls in a date range.\n\n- Default (no `teamId`): returns stats for the requester's team.\n- `teamId=all`: returns all-teams stats (super_admin only).\n- Date range (`start` to `end`) must not exceed 31 days.","operationId":"getCallMetricsStats","tags":["Calls"],"parameters":[{"name":"start","in":"query","description":"Start of the date range (ISO 8601). Defaults to start of the current month.","required":false,"schema":{"type":"string","format":"date-time","example":"2024-11-01T00:00:00.000Z"}},{"name":"end","in":"query","description":"End of the date range (ISO 8601). Defaults to end of the current month. Must be within 31 days of `start`.","required":false,"schema":{"type":"string","format":"date-time","example":"2024-11-30T23:59:59.999Z"}},{"name":"teamId","in":"query","description":"Team to query. Omit for the current team. Use `all` for all teams (super_admin only).","required":false,"schema":{"type":"string","example":"66bb3b489f7f0f58f7bcadbc"}},{"name":"assistantId","in":"query","description":"Filter metrics for a single assistant. Pass `temp-assistant` to include temporary assistants.","required":false,"schema":{"type":"string","example":"5b0a4a08-133c-4146-9315-0984f8c6be80"}},{"name":"assistantIds","in":"query","description":"Filter metrics for multiple assistants.","required":false,"schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallMetricsStatsResponse"}}}},"400":{"description":"Invalid request (missing team, invalid date range, or range longer than 31 days)"},"403":{"description":"Forbidden (requesting another team or teamId=all without super_admin)"}},"security":[{"bearer":[]}]}},"/assistants/v1/assistants":{"get":{"summary":"List Assistants","description":"List Assistants","operationId":"listAssistants","tags":["Assistants"],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Assistant"}}}}}},"security":[{"bearer":[]}]},"post":{"summary":"Create Assistant","description":"To create an assistant.","operationId":"createAssistant","tags":["Assistants"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssistantDTO"}}},"required":true},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/assistants/{id}":{"get":{"summary":"Get Assistant","description":"Get Assistant Details by ID","operationId":"getAssistant","tags":["Assistants"],"parameters":[{"name":"id","in":"path","description":"Assistant ID","required":true,"schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}}},"security":[{"bearer":[]}]},"delete":{"summary":"Delete Assistant","description":"Delete Assistant by ID","operationId":"deleteAssistant","tags":["Assistants"],"parameters":[{"name":"id","in":"path","description":"Assistant ID","required":true,"schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"1f7b1b1b1b1b1b1b1b1b1b1b"}}}}}}},"security":[{"bearer":[]}]},"patch":{"summary":"Update Assistant","description":"Update Assistant Details by ID","operationId":"updateAssistant","tags":["Assistants"],"parameters":[{"name":"id","in":"path","description":"Assistant ID","required":true,"schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssistantDTO"}}},"required":true},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/numbers/purchase-list":{"get":{"summary":"List Purchasable Numbers","description":"Retrieves a list of numbers available for purchase.","operationId":"purchaseList","tags":["Phone Numbers"],"parameters":[{"name":"countryCode","description":"Country code of the number to purchase. Ex: USA","in":"query","required":false,"example":"USA","schema":{"type":"string"}},{"name":"search","description":"Search for numbers by area code, example: 254","in":"query","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"Successfully retrieved the list of purchasable numbers.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PurchasableNumber"}}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/numbers/{provider}":{"post":{"summary":"Import Number","description":"Import number from provider. Please add provider credentials in the provider credentials section before you import an phone number.","operationId":"importNumber","parameters":[{"name":"provider","in":"path","description":"Give your provider name. Ex: twilio, Available providers: twilio","required":true,"schema":{"type":"string"},"example":"twilio"}],"tags":["Phone Numbers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number to import. Please provide in E.164 format, Ex: +1234567890","example":"+1234567890"},"label":{"type":"string","description":"Label for the number","example":"friendly-name-1"},"credentials":{"type":"object","description":"Credentials for the provider. If credentials are not provided, the default credentials from the provider credentials section will be used.","example":{"accountSid":"AC1234567890","authToken":"1234567890"},"oneOf":[{"$ref":"#/components/schemas/TwilioCredentials","title":"Twilio Credentials"}]}},"required":["number"]}}}},"responses":{"200":{"description":"Successfully imported the number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"404":{"description":"Number not found at provider","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Number not found at Twilio account"}}}}}},"406":{"description":"Provider credentials missing","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Twilio credits are missing in Provider credentials"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Failed to purchase number"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/numbers/purchase":{"post":{"summary":"Purchase Number","description":"Purchases a number.","operationId":"purchaseNumber","tags":["Phone Numbers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","description":"Phone number to purchase. Please provide in E.164 format, Ex: +1234567890","example":"+1234567890"}}}}}},"responses":{"200":{"description":"Successfully purchased the number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"400":{"description":"Invalid request body.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Not received valid inputs!"}}}}}},"409":{"description":"The number already purchased.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"number already sold"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Failed to purchase number"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/numbers":{"get":{"summary":"List Numbers","description":"Get list of Numbers purchased","operationId":"listNumbers","tags":["Phone Numbers"],"parameters":[{"name":"label","in":"query","required":false,"description":"Filter numbers by label","example":"my-number","schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the list of numbers.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Number"}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Failed to retrieve numbers"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/numbers/{id}":{"put":{"summary":"Update Number","description":"To attach or detach assistant to the number, or enable or disable the inbound/outbound call.","operationId":"updateNumber","tags":["Phone Numbers"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"The ID of the number to update."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assistantId":{"type":"string","description":"To attach assistant, give id of the assistant. To detach assistant, give empty string.","example":"a12f9c88-c155-461f-9771-4d240cdc9a04"},"inboundEnabled":{"type":"boolean","description":"To enable inbound call, set to true. To disable inbound call, set to false.","example":true},"outboundEnabled":{"type":"boolean","description":"To enable outbound call, set to true. To disable outbound call, set to false.","example":true}}}}}},"responses":{"200":{"description":"Successfully updated the number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"400":{"description":"Invalid request body.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Not received valid inputs!"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Failed to update number"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"security":[{"bearer":[]}]},"delete":{"summary":"Delete Number","description":"Deletes a number by its ID.","operationId":"deleteNumber","tags":["Phone Numbers"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"description":"The ID of the number to delete."}],"responses":{"204":{"description":"Successfully deleted the number."},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Failed to delete number"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"security":[{"bearer":[]}]}},"/assistants/v1/tools":{"post":{"operationId":"createTool","summary":"Create Tool","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CreateFunctionToolDTO","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/CreateFunctionToolDTO"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/FunctionTool"}}}}}},"409":{"description":"When the tool already exists with same name","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Tool already exists with the same name"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Something went wrong!"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"tags":["Tools"],"security":[{"bearer":[]}]},"get":{"operationId":"listTools","summary":"List Tools","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/FunctionTool"}}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Something went wrong!"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"tags":["Tools"],"security":[{"bearer":[]}]}},"/assistants/v1/tools/{id}":{"get":{"operationId":"getTool","summary":"Get Tool","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/FunctionTool"}}}}}},"404":{"description":"When the tool does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Tool not found!"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Something went wrong!"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"tags":["Tools"],"security":[{"bearer":[]}]},"patch":{"operationId":"updateTool","summary":"Update Tool","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateToolDTO"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/FunctionTool"}}}}}},"404":{"description":"When the tool does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Tool not found!"}}}}}},"409":{"description":"When the tool already exists with same name","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Tool already exists with the same name"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Something went wrong!"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"tags":["Tools"],"security":[{"bearer":[]}]},"delete":{"operationId":"deleteTool","summary":"Delete Tool","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/FunctionTool","title":"FunctionTool"}],"discriminator":{"propertyName":"type","mapping":{"function":"#/components/schemas/FunctionTool"}}}}}},"404":{"description":"When the tool does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Tool not found!"}}}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Something went wrong!"},"error":{"type":"string","example":"INTERNAL_ERROR"}}}}}}},"tags":["Tools"],"security":[{"bearer":[]}]}},"/kb/v1/files":{"get":{"summary":"List Files","description":"Lists the files available to upload in a knowledge base.","operationId":"listFiles","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}}}}}}}},"tags":["Files"],"security":[{"bearer":[]}]},"post":{"summary":"Upload File","description":"Upload File","operationId":"uploadFile","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateFileDTO"}}}},"responses":{"200":{"description":"File uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}}}},"tags":["Files"],"security":[{"bearer":[]}]}},"/kb/v1/files/{id}":{"get":{"summary":"Get File","description":"Get File","operationId":"getFile","parameters":[{"name":"id","description":"Unique ID of the file","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"The response is of type `file`","content":{"application/octet-stream":{}}}},"tags":["Files"],"security":[{"bearer":[]}]},"delete":{"summary":"Delete File","description":"Delete File","operationId":"deleteFile","parameters":[{"name":"id","description":"Unique ID of the file","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"202":{"description":"The file has been deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusAccepted"}}}},"409":{"description":"The file is attached to at least one knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"object","properties":{"message":{"type":"string","example":"File is still attached to knowledge bases. Please detach first to delete"},"attachedKnowledgeBases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}}}}}}}}}}}},"tags":["Files"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases":{"get":{"summary":"List Knowledge Bases","description":"List Knowledge Bases","operationId":"listKnowledgeBases","parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_bases":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"}}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]},"post":{"summary":"Create Knowledge Base","description":"Create Knowledge Base","operationId":"createKnowledgeBase","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"My Knowledge Base","description":"A descriptive and human-readable name for the knowledge base"},"description":{"type":"string"},"docs":{"$ref":"#/components/schemas/KnowledgeBaseDocs"},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}}}},"retrain_frequency_minutes":{"type":"integer","description":"Automatic retrain interval in minutes. Set retrain_frequency_minutes = 0 to disable automatic retraining. Allowed values: multiples of 60","default":0,"example":0}},"required":["title"]}}}},"tags":["Knowledge Bases"],"responses":{"201":{"description":"Knowledge Base created successfully"}},"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}":{"get":{"summary":"Get Knowledge Base","description":"Get Knowledge Base","operationId":"getKnowledgeBase","parameters":[{"name":"id","description":"Knowledge Base ID","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"status":{"type":"string","example":"trained","enum":["draft","created","queued","training","trained"]},"description":{"type":"string","example":"Knowledge Base Description"},"title":{"type":"string","example":"Knowledge Base Title","description":"A descriptive and human-readable name for the knowledge base"},"retrain_frequency_minutes":{"type":"integer","description":"Automatic retrain interval in minutes","example":1440},"docs":{"$ref":"#/components/schemas/KnowledgeBaseDocs"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileResponse"}}}}}}},"404":{"description":"The provided knowledge base ID does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","example":"Knowledge base not found"}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]},"put":{"summary":"Update Knowledge Base","description":"Update Knowledge Base","operationId":"updateKnowledgeBase","parameters":[{"name":"id","description":"Knowledge Base ID","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseUpdateDTO"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseDTO"}}}},"404":{"description":"The provided knowledge base ID does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","example":"Knowledge base not found"}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]},"delete":{"summary":"Delete Knowledge Base","description":"Delete Knowledge Base","operationId":"deleteKnowledgeBase","parameters":[{"name":"id","description":"Knowledge Base ID","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusAccepted"}}}},"404":{"description":"The provided knowledge base ID does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","example":"Knowledge base not found"}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}/status":{"get":{"summary":"Get Knowledge Base Status","description":"Get Knowledge Base Status","operationId":"getKnowledgeBaseStatus","parameters":[{"name":"id","description":"Knowledge Base ID","required":true,"in":"path","schema":{"type":"string"},"example":"5f7b1b1b1b1b1b1b1b1b1b1b"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"status":{"type":"string","example":"trained","enum":["draft","created","queued","training","trained"]},"description":{"type":"string","example":"Knowledge Base Description"},"title":{"type":"string","example":"Knowledge Base Title"}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}/query":{"post":{"summary":"Query Knowledge Base","description":"Send a question to the specified knowledge base and receive a response. Optionally pass a conversation history for the assistant to take into consideration while generating responses.","parameters":[{"name":"id","in":"path","required":true,"description":"The ID of the knowledge base to train.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Optional parameter - The GPT model to use for generating responses","default":"gpt-4o","enum":["gpt-4o","gpt-4o-mini"]},"prompt":{"type":"string","description":"[DEPRECATED. USE \"messages\" instead] The query prompt to send to the knowledge base.","deprecated":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseQueryMessageDTO"},"description":"A list of messages to query with. Note that \"messages\" and \"prompt\" cannot be used together. If both are found in the request, \"messages\" takes precedence and \"prompt\" is ignored."},"temperature":{"type":"number","minimum":0,"maximum":2,"example":0.1,"description":"Temperature controls the randomness in the output of the underlying language model; while lower values produce predictable and factual replies, higher values allow the model to be creative and reword the responses."},"seed":{"type":"integer","example":42,"description":"Seed initializes the random number generator in the underlying language model, ensuring reproducible outputs for the same prompt and settings."},"stream":{"type":"boolean","default":false,"description":"Determines whether to stream the generated response back instead of returning it all at once. When stream = true, the response is a list of JSON objects of the form {\"response\": string} separated by newline characters"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"string","example":"string","description":"The response from the knowledge base."}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"details":{"type":"string","description":"Error message."}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Authentication error message."},"message":{"type":"string","description":"Error message."}}}}}},"404":{"description":"Knowledge base not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message indicating the knowledge base was not found."}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}/train":{"post":{"summary":"Train Knowledge Base","description":"Send a trigger to train the knowledge base again","parameters":[{"name":"id","in":"path","required":true,"description":"The ID of the knowledge base to query.","schema":{"type":"string"}}],"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusAccepted"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"details":{"type":"string","description":"Error message."}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Authentication error message."},"message":{"type":"string","description":"Error message."}}}}}},"404":{"description":"Knowledge base not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message indicating the knowledge base was not found."}}}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}/faq-template":{"get":{"summary":"Fetch the FAQ template for a knowledge base","description":"Returns a list of frequently asked questions along with their answers","operationId":"getKnowledgeBaseFAQTemplate","parameters":[{"name":"id","in":"path","required":true,"description":"The unique ID of the knowledge base.","schema":{"type":"string"}}],"responses":{"200":{"description":"FAQ data exists for the queried knowledge base and is fetched successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFAQTemplateDTO"}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]},"post":{"summary":"Insert new questions and answers into FAQ template for a knowledge base","description":"Returns a list of frequently asked questions along with their answers","operationId":"insertKnowledgeBaseFAQEntries","parameters":[{"name":"id","in":"path","required":true,"description":"The unique ID of the knowledge base.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFAQTemplateCreateRequestDTO"}}}},"responses":{"200":{"description":"FAQ data exists for the queried knowledge base and is fetched successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFAQTemplateDTO"}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]},"put":{"summary":"Update questions and answers in FAQ template for a knowledge base","description":"Update a list of QnA entries in an FAQ by their unique ID","operationId":"updateKnowledgeBaseFAQEntries","parameters":[{"name":"id","in":"path","required":true,"description":"The unique ID of the knowledge base.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFAQTemplateDTO"}}}},"responses":{"200":{"description":"FAQ data exists for the queried knowledge base and is fetched successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFAQTemplateDTO"}}}}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/kb/v1/knowledge-bases/{id}/faq-template/questions":{"delete":{"summary":"Remove questions from FAQ","description":"Remove questions and answers from existing FAQ sheet. \nThe question IDs can be a sent in the query parameters.\n\nExample: `DELETE /kb/v1/knowledge-bases/{id}/faq-template/questions?faq_ids=abcd&faq_ids=efgh`\n\nAlternatively, the `faq_ids` can be sent as an array of strings in the `request body`. \n\nExample: `DELETE /kb/v1/knowledge-bases/{id}/faq-template/questions` with body = `{ \"faq_ids\": [ \"abcd\", \"efgh\"] }`","parameters":[{"name":"id","in":"path","required":true,"description":"The unique ID of the knowledge base.","schema":{"type":"string"}},{"name":"faq_ids","in":"query","required":true,"description":"The unique IDs of the questions to delete.","schema":{"type":"array","items":{"type":"string"}},"example":"DELETE /kb/v1/knowledge-bases/{id}/faq-template/questions?faq_ids=abcd&faq_ids=efgh"}],"responses":{"202":{"description":"accepted"}},"tags":["Knowledge Bases"],"security":[{"bearer":[]}]}},"/server":{"post":{"summary":"Server Message","description":"These are all the messages that can be sent to your server before, after and during the call. \n\nConfigure the messages you'd like to receive in `assistant.server.messages`. \n\n Set your server url via `assistant.server.url` parameter.","operationId":"serverMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerMessage"}}}},"responses":{"200":{"description":"This is the response that is expected from the server to the message.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Done"}}}}}}},"tags":["Webhooks"],"servers":[{"url":"https://your.server.com/v1","description":"Your server URL"}]}}},"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"Bearer","type":"http","description":"Retrieve your API Key from [Dashboard API Keys Section](https://dashboard-qa.interactly.ai/api-keys)."}},"schemas":{"BackgroundSoundNative":{"type":"string","enum":["enable","disable"],"example":"enable"},"BackgroundSoundCustom":{"type":"string","format":"uri","example":"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3"},"AssistantCommon":{"type":"object","properties":{"name":{"type":"string","description":"This is the name of the assistant.","example":"My Assistant"},"welcomeMessage":{"type":"string","description":"This is the welcome message of the assistant.","default":"hi","example":"Hello! How can I help you?"},"welcomeMessageMode":{"type":"string","description":"This is the mode of the welcome message. It can be one of the following: 'assistant-speaks-first', 'assistant-waits-for-user', 'automatic'.","example":"assistant-speaks-first","default":"automatic"},"welcomeMessageInterruptionsEnabled":{"type":"boolean","description":"This is a boolean that controls whether the interruptions are enabled during the welcome message. If set to false, the user can not interrupt the welcome message.","example":false,"default":false},"assistantProvider":{"type":"string","description":"This is the provider of the assistant.","enum":["openai","azure","gemini","deepseek","bedrock","custom-llm"],"default":"azure","example":"openai"},"assistantModel":{"type":"string","description":"The type of model used for the assistant depends on the provider.\n\n For openai - Available Options: `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-4`, `gpt-4o`, `gpt-4o-mini`, `gpt-3.5-turbo`. \n\nFor azure - Available Options:  `gpt-4`, `gpt-4o`, `gpt-4o-mini`. \n\nFor gemini - Available Options: `gemini-1.5-flash-latest`,`gemini-1.5-pro-latest`,`gemini-1.5-flash`. \n\nFor deepseek - Available Options: `V3`. \n\nFor bedrock - Available Options: `anthropic.claude-3-5-sonnet`, `anthropic.claude-3-5-haiku`, `meta.llama3-1-8b-instruct`.","example":"gpt-4o-mini","default":"gpt-4o-mini","discriminator":{"propertyName":"assistantProvider","mapping":{"openai":"#/components/schemas/OpenAIModels","azure":"#/components/schemas/AzureModels","gemini":"#/components/schemas/GeminiModels","deepseek":"#/components/schemas/DeepseekModels","bedrock":"#/components/schemas/BedrockModels","custom-llm":"#/components/schemas/CustomLLMModels"}}},"assistantLLMUrl":{"type":"string","description":"Provider your LLM Base URL here when `assistantProvider=custom-llm`.\n\nEx: `https://your-server.com/custom-llm`. \n\nPlease note that, we will append `/chat/completions` to your base URL before calling LLM endpoints.\nThe LLM URL should be accessible from the Interactly server.\nIf you are using a local server, you can use ngrok to expose your local server to the internet."},"assistantSystemPrompt":{"type":"string","description":"This system prompt guides the assistant's operations.","example":"You are AI assistant to help patients with their health care needs."},"assistantTemperature":{"type":"number","description":"This is the temperature of the assistant.","default":0,"example":0},"assistantMaxTokens":{"type":"integer","description":"This is the maximum number of tokens that the assistant can generate.","default":256,"example":256},"assistantReasoningEffort":{"type":"string","description":"Reasoning effort for GPT-5 / GPT-5.6 models. GPT-5.6 supports `none`, `low`, `medium` (model default), `high`, `xhigh`, and `max`. Omit or leave empty to use the model's own default.","enum":["none","low","medium","high","xhigh","max"],"example":"medium"},"assistantReasoningMode":{"type":"string","description":"Reasoning mode for GPT-5.6 models in the Responses API. `standard` is the model default. `pro` performs more model work for difficult tasks (higher latency and token usage). Independent of `assistantReasoningEffort`.","enum":["standard","pro"],"example":"standard"},"assistantResponseSplitter":{"type":"string","description":"Use this Delimiter to split the AI responses into separate lines.","example":","},"config":{"$ref":"#/components/schemas/AssistantConfig"},"hints":{"type":"array","description":"Provide keyword hints to help the assistant better recognize and transcribe important words or phrases.","items":{"type":"string"}},"backgroundSound":{"description":"This is the background sound in the call. Default is 'disable'. You can also provide a custom sound by providing a URL to an audio file. URL should be publicly accessible and should starts with https:// only. \n\nNote: Currently custom sound is not supported in `twilio` phone vendor.","maxLength":1000,"oneOf":[{"$ref":"#/components/schemas/BackgroundSoundNative","title":"Interactly Supported Sounds"},{"$ref":"#/components/schemas/BackgroundSoundCustom","title":"Custom Sound URL"}]},"backgroundSoundVolume":{"type":"number","description":"This is the volume of the background sound. It is a number between 1 and 100.","default":50,"example":50},"ttsCacheEnabled":{"type":"boolean","description":"This is the enabled flag of the tts cache.","example":false},"ttsAudioCacheScope":{"type":"string","description":"This is the storage scope of the tts audio cache. It can be one of the following: 'assistant', 'team', 'global'. 'global' is deprecated and will be removed in future.","enum":["assistant","team","global"]},"maxConsecutiveTtsFailures":{"type":"integer","description":"Maximum number of consecutive TTS turn failures before the call is ended automatically.","default":2,"example":2,"minimum":0},"recordingEnabled":{"type":"boolean","description":"Controls whether call recording is enabled for this assistant.","default":true,"example":true},"recordAfterTransfer":{"type":"boolean","description":"When enabled, call recording continues after the call is forwarded or warm-transferred to another party.","default":false,"example":false},"postCallTranscriptsEnabled":{"type":"boolean","description":"When enabled, a post-call transcript file is generated and stored alongside the call recording after the call ends.","default":false,"example":false},"assistantBackchannelingEnabled":{"type":"boolean","description":"This is the backchanneling enabled of the assistant.","example":false},"dtmfInputEnabled":{"type":"boolean","description":"This is a boolean that controls whether the DTMF input is enabled for the assistant.","example":false},"maxCallDuration":{"type":"integer","description":"This is the max call duration(in minutes) of the assistant.","example":15,"minimum":1,"maximum":120},"idleTimeout":{"type":"integer","description":"How long should the assistant wait in silence before confirming the user's presence and playing an idle message?","default":30,"example":20,"minimum":5,"maximum":600},"maxIdleMessagesInSequence":{"type":"integer","description":"Maximum number of times to repeat the idle message in sequence","example":3,"minimum":1,"maximum":5},"startSpeakingOptions":{"type":"object","description":"Configuration for when the assistant should start talking.","properties":{"waitSeconds":{"type":"number","description":"Number of seconds to wait before starting to process speech","default":0},"smartEndpointing":{"type":"string","description":"Controls the endpointing strategy for detecting when a user has finished speaking","enum":["Interactly","Off","LiveKit"],"default":"Interactly"},"onPunctuationSeconds":{"type":"number","description":"The minimum number of seconds to wait after transcription ending with punctuation before sending a request to the model. \n\nThis is only used if `smartEndpointing` is set to `Off`.","default":0},"onNoPunctuationSeconds":{"type":"number","description":"The minimum number of seconds to wait after transcription ending without punctuation before sending a request to the model. \n\nThis is only used if `smartEndpointing` is set to `Off`.","default":0},"onNumberSeconds":{"type":"number","description":"The minimum number of seconds to wait after transcription ending with a number before sending a request to the model. \n\nThis is only used if `smartEndpointing` is set to `Off`.","default":0},"LiveKitBaseValue":{"type":"number","description":"In the expression where X is the probability that the user is still speaking: \n`LiveKitBaseValue + (LiveKitScaleValue * X)`\n This is the base timeout value in milliseconds.\n\nThis is only used if `smartEndpointing` is set to `LiveKit`.","default":100},"LiveKitScaleValue":{"type":"number","description":"In the expression where X is the probability that the user is still speaking: \n`LiveKitBaseValue + (LiveKitScaleValue * X)`\n This is the scaling factor for LiveKit endpointing that adjusts based on speech probability.\n\nThis is only used if `smartEndpointing` is set to `LiveKit`.","default":1000}}},"stopSpeakingOptions":{"type":"object","description":"Configuration for detecting when when assistant should stop talking on customer interruption.","properties":{"numberOfWords":{"type":"number","description":"This is the number of words that the customer has to say before the assistant will stop talking.","default":3},"voiceSeconds":{"type":"number","description":"This is the seconds customer has to speak before the assistant stops talking. This uses the VAD (Voice Activity Detection) spike to determine if the customer has started speaking.","default":0}}},"userInterruptionAckPlan":{"type":"object","description":"This is the plan to respond to early interruptions by user with polite filler phrases.","properties":{"enabled":{"type":"boolean","description":"This is the enabled flag of the user interruption ack plan."},"count":{"type":"number","description":"This is the number of times the user will interrupt the assistant before responding with a polite filler phrase.","default":2},"words":{"type":"number","description":"This is the number of words that the user will interrupt the assistant","default":4},"phrases":{"type":"array","description":"This is the list of phrases that the assistant will use to respond to the user's early interruptions.","items":{"type":"string"},"example":["Please hold on while I check your account.","one moment please","let me just check that for you"]}}},"assistantToolIds":{"type":"array","items":{"type":"string"},"description":"This is the list of tool IDs of the assistant.","example":[]},"assistantPredefinedTools":{"type":"object","description":"Enable or disable specific tools that the assistant can use to improve its functionality.","properties":{"knowledgeBase":{"type":"boolean","description":"This will allow the assistant to end the call from its side.","default":false},"endCall":{"type":"boolean","description":"This will allow the assistant to end the call from its side.","default":false},"appointment":{"type":"boolean","description":"This will allow the assistant to manage appointments, including scheduling, rescheduling, and cancellations.","default":false},"volumeControl":{"type":"boolean","description":"This will allow the assistant to adjust the call volume.","default":false},"waitList":{"type":"boolean","description":"This will allow the assistant to access the wait list.","default":false},"callForward":{"type":"boolean","description":"This will allow the assistant to forward calls to the desired recipient or queue.","default":false},"sendSms":{"type":"boolean","description":"This will allow the assistant to send SMS messages during the call.","default":false},"interactionLookup":{"type":"boolean","description":"Enables interaction lookup (Dynamic Assistant). When enabled, callhook hits `interactionLookupData` to resolve an assistant or list of interactions.","default":false}}},"assistantType":{"type":"string","description":"This is the type of the assistant. It can be one of the following: 'single_prompt', 'workflow_based'.","enum":["single_prompt","workflow_based"],"default":"single_prompt"},"assistantKnowledgeBaseIds":{"type":"array","items":{"type":"string"},"description":"This is the list of knowledge base IDs of the assistant. Provide only when `assistantPredefinedTools.knowledgeBase` is enabled","example":[]},"endCallMessage":{"type":"string","description":"This is the message that the assistant will say if it ends the call. Provide only when `assistantPredefinedTools.endCall` is enabled","example":"Goodbye!"},"endCallToolDescription":{"type":"string","description":"This is the description of the tool that the assistant will use to end the call. Provide only when `assistantPredefinedTools.endCall` is enabled","example":"Trigger the end call only when the user is done with the conversation."},"endCallPhrases":{"type":"array","description":"List of phrases that the assistant will listen to end the call. Provide only when `assistantPredefinedTools.endCall` is enabled","items":{"type":"string"},"example":["goodbye","bye"]},"callForwardData":{"type":"array","items":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"Phone number used to forward the call.","example":"+1234567890"},"extension":{"type":"string","description":"This is the extension of the assistant. Leave it empty if there is no extension.","example":""},"name":{"type":"string","description":"This is a friendly name for the call forward.","example":"call-forward-name"},"onFailedMessage":{"type":"string","description":"This is the message that the assistant will say if the call forward fails.","example":"The call forward failed. Please try again later.","required":false}}},"description":"This is the call-forwarding data of the assistant.","example":{"phoneNumber":"+1234567890","extension":"","name":"call-forward-name"}},"interactionLookupData":{"type":"object","description":"API details for interaction lookup (Dynamic Assistant), used when `assistantPredefinedTools.interactionLookup` is enabled. Callhook POSTs `assistantNumber`, `userNumber`, and `assistantId` (plus optional user text / callSid). Expected response: `{ assistant: <assistant config|null>, interactions: <array> }`. If `assistant` is set it is used; if null, the caller is asked to pick from `interactions`.","properties":{"url":{"type":"string","description":"Customer endpoint URL for interaction lookup.","example":"https://example.com/interaction-lookup"},"timeoutSeconds":{"type":"number","description":"HTTP timeout in seconds for the lookup request.","default":20,"example":20},"secret":{"type":"string","description":"Optional shared secret sent with the lookup request.","example":""},"headers":{"type":"object","description":"Optional HTTP headers for the lookup request.","additionalProperties":{"type":"string"},"example":{"Authorization":"Bearer token"}},"method":{"type":"string","description":"HTTP method for the lookup request.","default":"POST","example":"POST"}},"example":{"url":"https://example.com/interaction-lookup","timeoutSeconds":20,"secret":"","headers":{},"method":"POST"}},"warmTransferEnabled":{"type":"boolean","description":"Enables warm transfer when forwarding calls. The receiving agent is connected before the caller is transferred, allowing a briefing before handoff. Requires `assistantPredefinedTools.callForward` to be enabled.","default":false,"example":false},"warmTransferConversational":{"type":"boolean","description":"When enabled with `warmTransferEnabled`, the assistant converses with the receiving agent before completing the transfer. When disabled, a pre-generated briefing message is played to the agent instead.","default":false,"example":false},"holdMusicUrl":{"type":"string","description":"URL of the hold music played to the caller while a conversational warm transfer is in progress. Must be a publicly accessible HTTPS URL.","default":"","example":"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3"},"warmTransferTimeout":{"type":"integer","description":"Maximum time in seconds to wait for the receiving agent to answer during a warm transfer before the transfer is considered failed.","default":300,"example":300,"minimum":1,"maximum":3600},"assistantAnalysis":{"$ref":"#/components/schemas/AssistantAnalysis"},"assistantOverrides":{"$ref":"#/components/schemas/AssistantOverrides"},"assistantServer":{"$ref":"#/components/schemas/AssistantServer"},"assistantOutcome":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the outcome."},"field":{"type":"string","description":"This is the field of the outcome."}}}},"smsConfiguration":{"type":"object","description":"Control how the assistant composes outbound SMS.","properties":{"enabled":{"type":"boolean","description":"This is the enabled flag of the sms configuration."},"sameAsAssistant":{"type":"boolean","description":"Use the same prompt as the assistant, or provide a custom SMS prompt."},"smsPrompt":{"type":"string","description":"This is the sms prompt for handling sms responses."}}},"persistHistory":{"type":"object","description":"Remember users and keep conversation history for follow-ups.","properties":{"enabled":{"type":"boolean","description":"This is the enabled flag of the persist history."},"call":{"type":"boolean","description":"Store metadata and transcripts of calls in persisted data for future personalization and context."},"sms":{"type":"boolean","description":"Keep outbound and inbound SMS content so follow-ups can reference earlier messages."},"retentionPeriod":{"type":"number","description":"This is, how long(in number of days) to retain persisted data. Set to 0 to keep nothing.","example":7}}}}},"Assistant":{"type":"object","properties":{"_id":{"type":"string","description":"This is the unique identifier of the assistant.","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"teamId":{"type":"string","description":"This is the unique identifier of the team that the assistant belongs to.","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"}},"allOf":[{"$ref":"#/components/schemas/AssistantCommon"}]},"CreateConversationDTO":{"type":"object","properties":{"userNumber":{"type":"string","description":"This is the phone number of the user.","example":"+1234567890"},"assistantNumber":{"type":"string","description":"This is the phone number of the assistant.","example":"+1234567890"},"metadata":{"type":"object","description":"This is the metadata of the conversation. You can add any additional information here.","example":{"key":"value"}},"assistant":{"type":"object","description":"This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nIf both `assistant` and `assistantId` are provided, only `assistant` will be used for this conversation. If both `assistant` and `assistantId` are not provided, the default assistant that is attached to phone number will be used for the call.","$ref":"#/components/schemas/AssistantCommon"},"assistantId":{"type":"string","description":"This is the ID of the assistant that will be used for the conversation. If you already have an assistant, you can use this field to specify the assistantId instead of giving all the assistant configuration in the `assistant` object.","example":"678a253ca6d866573043502e"},"assistantOverrides":{"$ref":"#/components/schemas/AssistantOverrides"}},"required":["userNumber","assistantNumber"]},"ConnectConversationDTO":{"type":"object","properties":{"direction":{"type":"string","description":"This is the direction of the conversation.\n\nInbound - The conversation is initiated by the user.\nOutbound - The conversation is initiated by the assistant.","enum":["inbound","outbound"],"default":"outbound","example":"outbound"},"phoneNumberId":{"type":"string","description":"Unique phone number ID. This is the phone number that will be used to make the call.","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"customer":{"type":"object","description":"This is the customer object. It contains all the information about the customer.","allOf":[{"$ref":"#/components/schemas/Customer"}]},"metadata":{"type":"object","description":"This is the metadata of the conversation. You can add any additional information here.","example":{"key":"value"}},"assistant":{"type":"object","description":"This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead.\n\nIf both `assistant` and `assistantId` are provided, only `assistant` will be used for this conversation. If both `assistant` and `assistantId` are not provided, the default assistant that is attached to phone number will be used for the call.","$ref":"#/components/schemas/AssistantCommon"},"assistantId":{"type":"string","description":"This is the ID of the assistant that will be used for the conversation. If you already have an assistant, you can use this field to specify the assistantId instead of giving all the assistant configuration in the `assistant` object.","example":"678a253ca6d866573043502e"},"assistantOverrides":{"$ref":"#/components/schemas/AssistantOverrides"}},"required":["phoneNumberId","direction","customer"]},"ConnectConversationResponseDTO":{"type":"object","properties":{"id":{"type":"string","description":"This is the unique identifier of the call.","example":"CC-897ee2d4-ea2f-4958-889f-df381bdfc939"},"teamId":{"type":"string","description":"This is the unique identifier of the team that the call belongs to.","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"assistantId":{"type":"string","description":"ID of the assistant that will be used for the call.","example":"678a253ca6d866573043502e"},"phoneNumberId":{"type":"string","description":"Unique phone number ID. This is the phone number that will be used to make the call.","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"direction":{"type":"string","description":"This is the direction of the conversation.\n\nInbound - The conversation is initiated by the user.\nOutbound - The conversation is initiated by the assistant.","enum":["inbound","outbound"],"default":"outbound","example":"outbound"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"},"customer":{"$ref":"#/components/schemas/Customer"},"status":{"type":"string","description":"This is the status of the call.","enum":["queued","ongoing","completed","forwarded"],"default":"queued","example":"queued"},"metadata":{"type":"object","description":"This is the metadata of the conversation. You can add any additional information here.","example":{"key":"value"}},"phoneVendor":{"type":"string","description":"This is the vendor of the phone number.","enum":["twilio","bandwidth"],"default":"twilio","example":"twilio"},"phoneVendorDetails":{"type":"object","description":"This is the vendor details of the phone number.","properties":{"from":{"type":"string","description":"This is the phone number of the sender.","example":"+1234567890"},"to":{"type":"string","description":"This is the phone number of the receiver.","example":"+1234567890"},"twiml":{"type":"string","description":"This is the twiml response to be given to twilio.","example":"twiml-response-tobe-given-to-twilio"},"responseType":{"type":"string","description":"This is the response type of the phone number.","example":"text/xml","enum":["text/xml","application/json"]},"statusCallback":{"type":"string","description":"This is status callback websocket URL. Using this URL you can get the status of the call.","example":"https://<domain>.interactly.ai/voice/twilio/call-status/<call-id>"},"statusCallbackEvent":{"type":"array","description":"This is the status callback event of the phone number.","items":{"type":"string","enum":["initiated","ringing","answered","completed"]}}}},"monitor":{"$ref":"#/components/schemas/ConversationMonitor"}}},"ControlConversationSayDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["say","end","forward","dtmf","sms","silence-timer","reset-silence-timer"],"example":"say"},"message":{"type":"string","description":"Provide the message to the assistant to say.","example":"hi there"}},"required":["type","message"]},"ControlConversationEndDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["say","end","forward","dtmf","sms","silence-timer","reset-silence-timer"],"example":"end"},"message":{"type":"string","description":"Provide a message to the assistant to say before ending the call. Leave it blank if you don't want to say anything.","example":"Bye. See you later!"}},"required":["type"]},"ControlConversationForwardDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["say","end","forward","dtmf","sms","silence-timer","reset-silence-timer"],"example":"forward"},"message":{"type":"string","description":"Provide an message to the assistant to say before forwarding the call. Leave it blank if you don't want to say anything.","example":"Forwarding your call to the agent. Please wait."},"number":{"type":"string","description":"This is the phone number to which the call will be forwarded. This field is required when `type=forward`.","example":"+1234567890"},"callerId":{"type":"string","description":"This is the phone number from which the call will be forwarded. By default, the callerId will be the phone number of the assistant if not provided. Use `callerId` to specify a different callerId for the forwarded call. This field is used when `type=forward`.","example":"+1234567890"},"extension":{"type":"string","description":"This is the extension number of the forward. Leave it blank if phone number is not having any extension. This field can be configured only when `type=forward`.","example":"106"},"sipUrl":{"type":"string","description":"This is the SIP URL to which the call will be forwarded. This field is used when `type=forward`. If sipUrl is provided, then number and extension fields will be ignored.","example":"sip:user@domain.com"}},"required":["type","number"]},"ControlConversationDTMFDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["say","end","forward","dtmf","sms","silence-timer","reset-silence-timer"],"example":"dtmf"},"dtmf":{"type":"string","description":"This is the DTMF of the control. This field is required when `type=dtmf`.","example":"106"}},"required":["type","dtmf"]},"ControlConversationSMSDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["say","end","forward","dtmf","sms","silence-timer","reset-silence-timer"],"example":"sms"},"smsData":{"type":"object","description":"This is the data of the sms. This field is required when `type=sms`.","example":"sms-data","properties":{"to":{"type":"string","description":"This is the phone number of the receiver.","example":"+1234567890"},"message":{"type":"string","description":"This is the message that will be sent to the receiver.","example":"Hello, how are you?"},"from":{"type":"string","description":"This is the phone number of the sender.","example":"+1234567890"}},"required":["to","message","from"]}},"required":["type","smsData"]},"ControlConversationHandOverDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call. Use `hand-over` to switch the live call onto a Dynamic Assistant (same media leg / callSid).","enum":["say","end","forward","dtmf","sms","hand-over","silence-timer","reset-silence-timer"],"example":"hand-over"},"assistantId":{"type":"string","description":"Target Dynamic Assistant id. Required when `interactionId` is not provided.","example":"ASST-billing-001"},"interactionId":{"type":"string","description":"Matched interaction id from the Case 2 catalog. Used when `assistantId` is not known; VE resolves via interactions[].assistantId or lookup #2.","example":"billing"},"message":{"type":"string","description":"Optional message to play before applying the Dynamic Assistant. Leave blank to switch immediately.","example":"I'll connect you with our billing specialist."},"reason":{"type":"string","description":"Optional short reason / matched user intent for logging and transcript system events.","example":"User asked about last invoice"}},"required":["type"]},"ControlConversationSilenceTimerDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["silence-timer"],"example":"silence-timer"},"value":{"type":"number","description":"Silence-timeout threshold in seconds, applied immediately on the live conversation. Typical outreach range is 30–1800 (default 180).","example":180,"minimum":1}},"required":["type","value"]},"ControlConversationResetSilenceTimerDTO":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the control you would like to make to the call.","enum":["reset-silence-timer"],"example":"reset-silence-timer"}},"required":["type"]},"CreateAssistantDTO":{"type":"object","allOf":[{"$ref":"#/components/schemas/AssistantCommon"}],"required":["name"]},"UpdateAssistantDTO":{"type":"object","allOf":[{"$ref":"#/components/schemas/AssistantCommon"}],"required":["name"]},"MicrosoftSTT":{"type":"object","properties":{"vendor":{"type":"string","description":"This is the vendor of the speech to text.","example":"microsoft","default":"microsoft","enum":["microsoft"]},"languages":{"type":"array","description":"This is the list of languages that the assistant can understand.","items":{"type":"string","enum":["en-US","en-IN","en-GB","es-US","es-MX","fr-FR","fr-CA","zh-CN","pt-BR","pt-PT","hi-IN"]},"example":"en-US","default":["en-US"]}}},"DeepgramSTT":{"type":"object","properties":{"vendor":{"type":"string","description":"This is the vendor of the speech to text.","example":"deepgram","default":"deepgram","enum":["deepgram"]},"languages":{"type":"array","description":"This is the list of languages that the assistant can understand.","items":{"type":"string","enum":["en-US"]},"example":"en-US","default":["en-US"]},"deepgramOptions":{"type":"object","description":"This is the configuration of the deepgram text to speech.","properties":{"model":{"type":"string","description":"This is the model of the deepgram speech to text.","example":"nova-3","enum":["nova-3","nova-3-medical","nova-2","nova-2-phonecall","nova-2-meeting","nova-2-conversationalai","nova-2-medical","flux-general-en"]},"punctuate":{"type":"boolean","description":"Enable punctuation in the transcription output. This is enabled by default.","example":true,"default":true},"endpointing":{"type":"number","description":"The number of seconds of silence after which the speech is considered to be ended. This is set to 10 seconds by default.","example":10,"default":10},"smart_format":{"type":"boolean","description":"Enable smart formatting in the transcription output. This is enabled by default.","example":true,"default":true},"no_delay":{"type":"boolean","description":"Enable no delay in the transcription output. This is enabled by default.","example":true,"default":true},"numerals":{"type":"boolean","description":"Enable numerals in the transcription output. This is enabled by default.","example":true,"default":true},"eagerEotThreshold":{"type":"number","description":"The threshold for the end of turn detection. This is set to 0.5 by default. Valid Values 0.3 - 0.9. Used for flux-general-en model.","example":0.5,"default":0.5},"eotThreshold":{"type":"number","description":"The threshold for the end of turn detection. This is set to 0.8 by default. Valid Values 0.5 - 0.9. Used for flux-general-en model.","example":0.8,"default":0.8},"eotTimeoutMs":{"type":"number","description":"The timeout for the end of turn detection. This is set to 5000 milliseconds by default. Valid Values 100 - 10000 milliseconds. Used for flux-general-en model.","example":5000,"default":5000}}}}},"ElevenLabsTTS":{"type":"object","properties":{"vendor":{"type":"string","example":"eleven-labs","enum":["eleven-labs"]},"language":{"type":"string","description":"This is the language of the text to speech.","example":"en-US","enum":["en-US","es-US","fr-FR","zh-CN","hi-IN"]},"voice":{"type":"string","description":"Provider voice ID. Ex: Voice ID will be `ZeK6O9RfGNGj0cJT2HoJ` for `Shanaya (female)-Customer Care Agent` voice.","example":"ZeK6O9RfGNGj0cJT2HoJ"},"config":{"type":"object","description":"This is the configuration of the eleven labs text to speech.","properties":{"modelId":{"type":"string","description":"This is the model id of the eleven labs text to speech.","example":"eleven_multilingual_v2","enum":["eleven_multilingual_v2","eleven_turbo_v2_5","eleven_flash_v2_5","eleven_turbo_v2","eleven_flash_v2"],"default":"eleven_turbo_v2"},"stability":{"type":"number","description":"This is the stability of the eleven labs text to speech.","example":0.7,"default":0.7,"minimum":0,"maximum":1},"similarityBoost":{"type":"number","description":"Determines how closely the AI should adhere to the original voice when attempting to replicate it.","example":0.85,"default":0.85,"minimum":0,"maximum":1},"speakerBoost":{"type":"boolean","description":"This is the speaker boost of the eleven labs text to speech.","example":true,"default":true},"styleExaggeration":{"type":"number","description":"Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0.","example":0.5,"default":0,"minimum":0,"maximum":1},"seed":{"type":"number","description":"If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.","example":42,"default":null},"speed":{"type":"number","description":"Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up.","example":1,"default":1,"minimum":0.5,"maximum":2},"applyTextNormalization":{"type":"boolean","description":"This is the apply text normalization of the eleven labs text to speech.","example":true,"default":false}}}}},"DeepgramTTS":{"type":"object","properties":{"vendor":{"type":"string","example":"deepgram","enum":["deepgram"]},"language":{"type":"string","description":"This is the language of the text to speech.","example":"en-US","enum":["en-US","en-UK"]},"voice":{"type":"string","description":"Provider voice ID. Ex: Voice ID will be `aura-luna-en` for `Luna (US) Female` voice.","example":"aura-luna-en"}}},"MicrosoftTTS":{"type":"object","properties":{"vendor":{"type":"string","example":"microsoft","enum":["microsoft"]},"language":{"type":"string","description":"This is the language of the text to speech.","example":"en-US","enum":["en-US","es-ES","fr-FR","hi-In"]},"voice":{"type":"string","description":"Provider voice ID. Ex: Voice ID will be `en-US-JennyNeural` for `Jenny (Female)` voice.","example":"en-US-JennyNeural"}}},"CartesiaTTS":{"type":"object","properties":{"vendor":{"type":"string","example":"cartesia","enum":["cartesia"]},"language":{"type":"string","description":"This is the language of the text to speech.","example":"en","enum":["en","es","fr","zh","hi"]},"voice":{"type":"string","description":"Provider voice ID. Ex: Voice ID will be `79f8b5fb-2cc8-479a-80df-29f7a7cf1a3e` for `Nonfiction Man` voice.","example":"79f8b5fb-2cc8-479a-80df-29f7a7cf1a3e"}}},"AssistantConfig":{"type":"object","description":"This is the stt and tts configuration of the assistant. You can add one stt and multiple tts configurations. check [here](/vendors) for the list of supported vendors and models.","properties":{"speech":{"type":"object","properties":{"stt":{"description":"This section allows you to configure the transcription settings for the assistant.","oneOf":[{"$ref":"#/components/schemas/MicrosoftSTT","title":"Microsoft STT"},{"$ref":"#/components/schemas/DeepgramSTT","title":"Deepgram STT"}]},"sttFallback":{"description":"This is the fallback speech to text configuration of the assistant. When the main stt configuration fails, the fallback stt configuration will be used. You can enable or disable the fallback stt configuration with `enabled` field.","allOf":[{"type":"object","description":"This flag can enable or disable the fallback stt configuration.","properties":{"enabled":{"type":"boolean","default":true}}},{"oneOf":[{"$ref":"#/components/schemas/MicrosoftSTT","title":"Microsoft STT"},{"$ref":"#/components/schemas/DeepgramSTT","title":"Deepgram STT"}]}]},"ttsData":{"description":"This is the text to speech configuration of the assistant. You can add multiple tts configurations.","type":"array","items":{"allOf":[{"type":"object","properties":{"enabled":{"description":"If you want to use multiple voices for multiple languages, you can add multiple tts configurations and set the `enabled` flag to true for only one of the desired tts configuration that will be used as main tts configuration. If the language of assistant is not present in the tts configuration, the `default` tts configuration will be used.","type":"boolean","default":true,"example":true}}},{"oneOf":[{"$ref":"#/components/schemas/ElevenLabsTTS","title":"Eleven Labs TTS"},{"$ref":"#/components/schemas/DeepgramTTS","title":"Deepgram TTS"},{"$ref":"#/components/schemas/MicrosoftTTS","title":"Microsoft TTS"},{"$ref":"#/components/schemas/CartesiaTTS","title":"Cartesia TTS"}]}]}}}}}},"Number":{"type":"object","required":["_id","teamId","number","provider"],"properties":{"_id":{"type":"string","format":"objectId","description":"Unique identifier of the number","example":"a12f9c88-c155-461f-9771-4d240cdc9a04"},"teamId":{"type":"string","format":"objectId","description":"This is unique identifier of the team.","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"number":{"type":"string","description":"Phone number associated with the team","example":"+1234567890"},"provider":{"type":"object","properties":{"name":{"type":"string","description":"Name of the provider","example":"twilio"}}},"assistantId":{"type":"string","description":"ID of the associated assistant (if any)","example":"a12f9c88-c155-461f-9771-4d240cdc9a04"},"inboundEnabled":{"type":"boolean","description":"If true, inbound call is enabled. If false, inbound call is disabled.","example":true},"outboundEnabled":{"type":"boolean","description":"If true, outbound call is enabled. If false, outbound call is disabled.","example":true},"label":{"type":"string","description":"Label for the number","example":"friendly-name-1"}}},"PurchasableNumber":{"type":"object","properties":{"number":{"type":"string","description":"Phone number of the purchasable number"},"countryCode":{"type":"string","description":"Country code of the purchasable number"},"stateId":{"type":"string","description":"State ID of the purchasable number"},"cityName":{"type":"string","description":"City name of the purchasable number"}}},"Conversation":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the call","example":"a12f9c88-c155-461f-9771-4d240cdc9a04"},"teamId":{"type":"string","description":"Unique identifier of the team","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"assistantId":{"type":"string","description":"Unique identifier of the assistant","example":"3f7b1b1b1b1b1b1b1b1b1b1b"},"callType":{"type":"string","description":"This is the type of the call.","example":"web","enum":["web","phone"]},"direction":{"type":"string","example":"inbound","enum":["inbound","outbound"]},"startAt":{"$ref":"#/components/schemas/StartAt"},"endAt":{"$ref":"#/components/schemas/EndAt"},"userNumber":{"type":"string","description":"Phone number of the user","example":"+919867543210"},"assistantNumber":{"type":"string","description":"Phone number of the assistant","example":"+19867543211"},"status":{"type":"string","description":"This field indicates the status of the call.","example":"finished","enum":["queued","ongoing","forwarded","finished"]},"phoneCallStatus":{"type":"string","description":"Status of the phone call.\n\nA call can have one of the following statuses:\n\n- `trying`: The call has been initiated.\n- `early-media`: The call is playing an early media message or tone.\n- `ringing`: The recipient's phone is ringing.\n- `in-progress`: The call is currently active.\n- `busy`: The recipient is unavailable to answer.\n- `no-answer`: The call was not answered.\n- `failed`: The call attempt was unsuccessful.\n- `completed`: The call has ended.","example":"ringing","enum":["trying","early-media","ringing","in-progress","busy","no-answer","failed","completed"]},"callEndTriggerBy":{"type":"string","description":"This is the trigger of the call end.","example":"user","enum":["user","assistant"]},"monitor":{"$ref":"#/components/schemas/ConversationMonitor"},"analysis":{"$ref":"#/components/schemas/ConversationAnalysis"}}},"ConversationMonitor":{"type":"object","description":"To monitor and control the conversation","properties":{"controlUrl":{"type":"string","description":"The URL to control the conversation","example":"https://<domain>.interactly.ai/calls/v1/conversations/<random-id>/control"}}},"ConversationAnalysis":{"type":"object","properties":{"summary":{"type":"string","example":"The user called Dentistry to schedule an appointment.","description":"This is the summary of the call. Customize by setting `assistant.analysis.summary`."},"successEvaluation":{"type":"string","example":"success","description":"This is the evaluation of the call. Customize by setting `assistant.analysis.successEvaluation.prompt` and/or `assistant.analysis.successEvaluation.rubric`."},"structuredData":{"type":"object","example":{},"description":"This is the structured data extracted from the call. Customize by setting `assistant.analysis.structuredData.prompt `and/or `assistant.analysisPlan.structuredData.schema`."}}},"ConversationMessage":{"type":"object","properties":{"messageId":{"type":"string","description":"The unique identifier of the message","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"role":{"type":"string","description":"The role of the sender of the message","example":"user","enum":["user","assistant"]},"text":{"type":"string","description":"The text content of the message","example":"Hello! How can I help you?"},"timestamp":{"$ref":"#/components/schemas/DateTime"}}},"File":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b","description":"This is the unique identifier of the file."},"name":{"type":"string","example":"some_file.json","description":"This is the name of the file."},"type":{"type":"string","example":"file"},"teamId":{"type":"string","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"}}},"FileResponse":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"name":{"type":"string","example":"some_file.json"},"type":{"type":"string","example":"file"},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"}}},"CreateFileDTO":{"type":"object","properties":{"file":{"type":"string","description":"This is the File you want to upload for use with the Knowledge Base.","format":"binary"}},"required":["file"]},"KnowledgeBase":{"type":"object","properties":{"title":{"type":"string","example":"Knowledge Base Title"},"description":{"type":"string","example":"Knowledge Base Description"},"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"status":{"type":"string","example":"trained","enum":["draft","created","queued","training","trained"]},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"}}},"KnowledgeBaseUrl":{"type":"object","properties":{"url":{"type":"string","description":"This is the URL of the Knowledge Base.","format":"uri"},"subpaths_only":{"type":"boolean","description":"If subpaths_only is enabled, the crawler only processes URLs that are subpaths of the parent URL, ignoring links outside the specified path hierarchy.","default":false},"recursive":{"type":"boolean","description":"If recursive is enabled, the crawler recursively scrapes all URLs found on the page, including links to external domains.","default":false}}},"KnowledgeBaseDocs":{"type":"array","description":"Here you can upload URLs","items":{"type":"object","properties":{"type":{"type":"string","enum":["url"]},"payload":{"type":"object","description":"Here you can upload URLs","properties":{"urls_to_include":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseUrl"}},"urls_to_exclude":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseUrl"}}}}}}},"KnowledgeBaseCreateDTO":{"type":"object","properties":{"title":{"type":"string","example":"Knowledge Base Title","description":"This is the title of the Knowledge Base."},"retrain_frequency_minutes":{"type":"integer","description":"Automatic retrain interval in minutes. Set retrain_frequency_minutes = 0 to disable automatic retraining. Allowed values: multiples of 60","default":0,"example":1440},"docs":{"type":"array","items":{"type":"object"}},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}}}}}},"KnowledgeBaseUpdateDTO":{"type":"object","properties":{"title":{"type":"string","example":"Knowledge Base Title","description":"This is the title of the Knowledge Base."},"description":{"type":"string","example":"Knowledge Base Description"},"retrain_frequency_minutes":{"type":"integer","description":"Automatic retrain interval in minutes. Set retrain_frequency_minutes = 0 to disable automatic retraining. Allowed values: multiples of 60","default":0,"example":1440},"docs":{"$ref":"#/components/schemas/KnowledgeBaseDocs"},"files":{"type":"array","description":"List of Files to be associated with the Knowledge Base.","items":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"}}}}}},"KnowledgeBaseDTO":{"type":"object","properties":{"id":{"type":"string","example":"5f7b1b1b1b1b1b1b1b1b1b1b"},"title":{"type":"string","example":"Knowledge Base Title","description":"This is the title of the Knowledge Base."},"description":{"type":"string","example":"Knowledge Base Description"},"status":{"type":"string","example":"trained","enum":["draft","created","queued","training","trained"]},"docs":{"$ref":"#/components/schemas/KnowledgeBaseDocs"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileResponse"}}}},"KnowledgeBaseQueryMessageDTO":{"type":"object","description":"An input message to the knowledge base model. At least one message with \"role\"=\"user\" is required. A snapshot of the past questions and answers can be passed to allow the model to infer the context of the conversation. The messages are expected to appear in the array in their chronological order.","properties":{"role":{"type":"string","example":"user","description":"Use \"role\" = \"user\" for incoming queries, and \"role\" = \"assistant\" to provide the past responses from the knowledge base assistant","enum":["user","assistant"]},"content":{"type":"string","example":"What are the services offered?"}},"required":["role","content"]},"KnowledgeBaseQNADTO":{"type":"object","properties":{"id":{"type":"string","example":"6789abcdef01234567890abc","description":"A unique identifier for the QnA entry"},"question":{"type":"string","example":"What is the address of your clinic?","description":"A question in the FAQ collection"},"answer":{"type":"string","example":"12345 Elm Street, Springfield, CA 12345, USA","description":"A short, human-readable answer to the corresponding question"},"category":{"type":"string","example":"General Enquiry","default":"","description":"An optional, human-readable string denoting the category of the question."},"updatable":{"type":"boolean","default":true,"description":"A boolean flag denoting whether the crawler should try to find an updated answer to the question from the crawled web pages and documents."}},"required":["id","question","answer"]},"KnowledgeBaseFAQTemplateDTO":{"type":"object","properties":{"faq":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseQNADTO"}}}},"KnowledgeBaseQNACreateRequestDTO":{"type":"object","properties":{"question":{"type":"string","example":"What is the address of your clinic?","description":"A question in the FAQ collection"},"answer":{"type":"string","example":"12345 Elm Street, Springfield, CA 12345, USA","description":"A short, human-readable answer to the corresponding question"},"category":{"type":"string","example":"General Enquiry","default":"","description":"An optional, human-readable string denoting the category of the question."},"updatable":{"type":"boolean","default":true,"description":"A boolean flag denoting whether the crawler should try to find an updated answer to the question from the crawled web pages and documents."}},"required":["question","answer"]},"KnowledgeBaseFAQTemplateCreateRequestDTO":{"type":"object","properties":{"faq":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseQNACreateRequestDTO"}}}},"CreatedAt":{"type":"string","format":"date-time","description":"This is the ISO 8601 date-time string of when the record was created.","example":"2020-10-05T00:00:00.000Z"},"UpdatedAt":{"type":"string","format":"date-time","description":"This is the ISO 8601 date-time string of when the record was last updated.","example":"2020-10-05T00:00:00.000Z"},"StartAt":{"type":"string","format":"date-time","description":"This is the ISO 8601 date-time string indicating when the record was initiated.","example":"2020-10-05T00:00:00.000Z"},"EndAt":{"type":"string","format":"date-time","description":"This is the ISO 8601 date-time string of when the record was ended.","example":"2020-10-05T00:00:00.000Z"},"DateTime":{"type":"string","format":"date-time","description":"This is the ISO 8601 date-time string. Ex: 2020-10-05T00:00:00.000Z","example":"2020-10-05T00:00:00.000Z"},"StatusAccepted":{"type":"object","properties":{"message":{"type":"string","example":"accepted"}}},"CreateFunctionToolDTO":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"description":"The type of tool. \"function\" for Function tool."},"async":{"type":"boolean","description":"This determines if the tool is async.\n\nIf async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\nIf sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\nDefaults to synchronous (`false`).","example":false},"function":{"description":"This is the function definition of the tool.","allOf":[{"$ref":"#/components/schemas/OpenAIFunction"}]},"messages":{"type":"array","description":"These are the messages that will be spoken to the user as the tool is running.","items":{"oneOf":[{"$ref":"#/components/schemas/ToolMessageStart","title":"ToolMessageStart"},{"$ref":"#/components/schemas/ToolMessageComplete","title":"ToolMessageComplete"},{"$ref":"#/components/schemas/ToolMessageFailed","title":"ToolMessageFailed"},{"$ref":"#/components/schemas/ToolMessageDelayed","title":"ToolMessageDelayed"}]}},"server":{"description":"This is the server that will be hit when this tool is requested by the model.\n\nAll requests will be sent with the call object among other things.","allOf":[{"$ref":"#/components/schemas/Server"}]}},"required":["type","function.name"]},"FunctionTool":{"type":"object","properties":{"_id":{"type":"string","description":"This is the unique identifier for the tool.","example":"1f7b1b1b1b1b1b1b1b1b1b1b"},"teamId":{"type":"string","description":"This is the unique identifier for the organization that this tool belongs to.","example":"3f7b1b1b1b1b1b1b1b1b1b1b"},"type":{"type":"string","enum":["function"],"description":"The type of tool. \"function\" for Function tool.","example":"function"},"async":{"type":"boolean","description":"This determines if the tool is async.\n\nIf async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\nIf sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\nDefaults to synchronous (`false`).","example":false},"function":{"description":"This is the function definition of the tool.","allOf":[{"$ref":"#/components/schemas/OpenAIFunction"}]},"messages":{"type":"array","description":"These are the messages that will be spoken to the user as the tool is running.","items":{"oneOf":[{"$ref":"#/components/schemas/ToolMessageStart","title":"ToolMessageStart"},{"$ref":"#/components/schemas/ToolMessageComplete","title":"ToolMessageComplete"},{"$ref":"#/components/schemas/ToolMessageFailed","title":"ToolMessageFailed"},{"$ref":"#/components/schemas/ToolMessageDelayed","title":"ToolMessageDelayed"}]}},"server":{"description":"This is the server that will be hit when this tool is requested by the model.\n\nAll requests will be sent with the call object among other things.","allOf":[{"$ref":"#/components/schemas/Server"}]},"createdAt":{"$ref":"#/components/schemas/CreatedAt"},"updatedAt":{"$ref":"#/components/schemas/UpdatedAt"}},"required":["type","_id","teamId","function.name"]},"UpdateToolDTO":{"type":"object","properties":{"async":{"type":"boolean","description":"This determines if the tool is async.\n\nIf async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.\n\nIf sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.\n\nDefaults to synchronous (`false`).","example":false},"function":{"description":"This is the function definition of the tool.","allOf":[{"$ref":"#/components/schemas/OpenAIFunction"}]},"messages":{"type":"array","description":"These are the messages that will be spoken to the user as the tool is running.","items":{"oneOf":[{"$ref":"#/components/schemas/ToolMessageStart","title":"ToolMessageStart"},{"$ref":"#/components/schemas/ToolMessageComplete","title":"ToolMessageComplete"},{"$ref":"#/components/schemas/ToolMessageFailed","title":"ToolMessageFailed"},{"$ref":"#/components/schemas/ToolMessageDelayed","title":"ToolMessageDelayed"}]}},"server":{"description":"This is the server that will be hit when this tool is requested by the model.","allOf":[{"$ref":"#/components/schemas/Server"}]}}},"ToolMessageStart":{"type":"object","properties":{"type":{"type":"string","enum":["request-start"],"description":"This message is triggered when the tool call starts.\n\nThis message is never triggered for async tools.\n\nIf this message is not provided, one of the default filler messages \"Hold on a sec\", \"One moment\", \"Just a sec\", \"Give me a moment\" or \"This'll just take a sec\" will be used."},"content":{"type":"string","description":"This is the content that the assistant says when this message is triggered.","maxLength":1000,"example":"Please wait while I fetch the details."}},"required":["type"]},"ToolMessageComplete":{"type":"object","properties":{"type":{"type":"string","description":"This message is triggered when the tool call is complete.\n\nThis message is triggered immediately without waiting for your server to respond for async tool calls.\n\nIf this message is not provided, the model will be requested to respond.\n\nIf this message is provided, only this message will be spoken and the model will not be requested to come up with a response. It's an exclusive OR.","enum":["request-complete"]},"content":{"type":"string","description":"This is the content that the assistant says when this message is triggered.","maxLength":1000,"example":"Here are the details you requested."}},"required":["type"]},"ToolMessageFailed":{"type":"object","properties":{"type":{"type":"string","description":"This message is triggered when the tool call fails.","enum":["request-failed"]},"content":{"type":"string","description":"This is the content that the assistant says when this message is triggered.","maxLength":1000,"example":"I'm sorry, I couldn't fetch the details."}},"required":["type"]},"ToolMessageDelayed":{"type":"object","properties":{"type":{"type":"string","description":"This message is triggered when the tool call is delayed.","enum":["request-response-delayed"]},"content":{"type":"string","description":"This is the content that the assistant says when this message is triggered.","maxLength":1000,"example":"I'm still fetching the details."}},"required":["type"]},"OpenAIFunction":{"type":"object","properties":{"name":{"type":"string","description":"This is the the name of the function to be called.\n\nMust be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.","maxLength":64,"pattern":"/^[a-zA-Z0-9_-]{1,64}$/","example":"getUserDetailsByPhoneNumber"},"description":{"type":"string","description":"This is the description of what the function does, used by the AI to choose when and how to call the function.","maxLength":1000,"example":"Get user details by phone number, Run this tool when you want user details like name, dob etc by their phone number"},"parameters":{"description":"These are the parameters the functions accepts, described as a JSON Schema object.\n\nSee the [OpenAI guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format.\n\nOmitting parameters defines a function with an empty parameter list.","allOf":[{"$ref":"#/components/schemas/OpenAIFunctionParameters"}]},"strict":{"type":"boolean","description":"This is a boolean that controls whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is true. Learn more about Structured Outputs in the [OpenAI guide](https://openai.com/index/introducing-structured-outputs-in-the-api/).\n\n@default false","default":false}},"required":["name"]},"OpenAIFunctionParameters":{"type":"object","properties":{"type":{"type":"string","description":"This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties.","enum":["object"],"example":"object"},"properties":{"type":"object","description":"This provides a description of the properties required by the function.\nJSON Schema can be used to specify expectations for each property.\nRefer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.","additionalProperties":{"$ref":"#/components/schemas/JsonSchema"},"example":{"dob":{"type":"string","format":"date","description":"This is the date of birth of the user.","example":"1990-03-08"},"phoneNumber":{"type":"string","description":"This is the phone number of the user.","example":"+919867543210"}}},"required":{"description":"This specifies the properties that are required by the function.","type":"array","items":{"type":"string"},"example":["phoneNumber"]},"additionalProperties":{"type":"boolean","description":"This is a boolean that controls whether additional properties are allowed in the function call. If set to false, the model will only accept the properties defined in the parameters field.\n\n@default false","default":false}},"required":["type","properties"]},"AssistantAnalysis":{"type":"object","properties":{"summary":{"description":"This is the plan for generating the summary of the call. This outputs to `call.analysis.summary`.","allOf":[{"$ref":"#/components/schemas/AssistantAnalysisSummary"}]},"successEvaluation":{"description":"This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`.","allOf":[{"$ref":"#/components/schemas/AssistantAnalysisSuccessEvaluation"}]},"structuredData":{"description":"This is the plan for generating the structured data from the call. This outputs to `call.analysis.structuredData`.","allOf":[{"$ref":"#/components/schemas/AssistantAnalysisStructuredData"}]}}},"AssistantAnalysisLlmOptions":{"type":"object","properties":{"temperature":{"type":"number","description":"This is the temperature for the analysis LLM request.","default":0,"example":0,"minimum":0,"maximum":2},"maxTokens":{"type":"integer","description":"This is the maximum number of tokens that the analysis LLM can generate.","default":256,"example":256,"minimum":1},"thinkingBudget":{"type":"integer","description":"This is the thinking budget for models that support extended reasoning.","default":0,"example":0,"minimum":0},"reasoningEffort":{"type":"string","description":"Reasoning effort for GPT-5 / GPT-5.6 analysis models. GPT-5.6 supports `none`, `low`, `medium` (model default), `high`, `xhigh`, and `max`. Omit or leave empty to use `low`.","enum":["none","low","medium","high","xhigh","max"],"default":"low","example":"low"},"reasoningMode":{"type":"string","description":"Reasoning mode for GPT-5.6 analysis models. `standard` is the default. `pro` performs more model work (higher latency and token usage). Independent of `reasoningEffort`.","enum":["standard","pro"],"default":"standard","example":"standard"}}},"AssistantAnalysisSummary":{"allOf":[{"$ref":"#/components/schemas/AssistantAnalysisLlmOptions"},{"type":"object","properties":{"enabled":{"type":"boolean","description":"This is a boolean that controls whether the summary is generated. If set to false, the model will not generate a summary of the call.\n\n@default false","example":false},"prompt":{"type":"string","description":"This is the prompt that the model will use to generate the summary of the call.","example":"Generate a summary of the call."},"timeoutSeconds":{"type":"number","description":"This is how long the request is tried before giving up. When request times out, `call.analysis.summary` will be empty. \n Usage: \n- To guarantee the summary is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. \n @default 5 seconds","minimum":1,"maximum":60,"example":30}}}]},"AssistantAnalysisSuccessEvaluation":{"allOf":[{"$ref":"#/components/schemas/AssistantAnalysisLlmOptions"},{"type":"object","properties":{"enabled":{"type":"boolean","description":"This is a boolean that controls whether the success evaluation is generated. If set to false, the model will not generate a success evaluation of the call.\n\n@default false","example":false},"prompt":{"type":"string","description":"This is the prompt that the model will use to generate the success evaluation of the call.","example":"Evaluate the success of the call."},"rubric":{"type":"string","enum":["NumericScale","DescriptiveScale","Checklist","Matrix","PercentageScale","LikertScale","AutomaticRubric","PassFail"],"description":"This enforces the rubric of the evaluation. The output is stored in `call.analysis.successEvaluation`.\n\nOptions include:\n- 'NumericScale': A scale of 1 to 10.\n- 'DescriptiveScale': A scale of Excellent, Good, Fair, Poor.\n- 'Checklist': A checklist of criteria and their status.\n- 'Matrix': A grid that evaluates multiple criteria across different performance levels.\n- 'PercentageScale': A scale of 0% to 100%.\n- 'LikertScale': A scale of Strongly Agree, Agree, Neutral, Disagree, Strongly Disagree.\n- 'AutomaticRubric': Automatically break down evaluation into several criteria, each with its own score.\n- 'PassFail': A simple 'true' if call passed, 'false' if not.\n\nDefault is 'PassFail'."},"timeoutSeconds":{"type":"number","description":"This is how long the request is tried before giving up. When request times out, `call.analysis.summary` will be empty. \n Usage: \n- To guarantee the summary is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond. \n @default 5 seconds","minimum":1,"maximum":60,"example":30}}}]},"AssistantAnalysisStructuredData":{"allOf":[{"$ref":"#/components/schemas/AssistantAnalysisLlmOptions"},{"type":"object","properties":{"enabled":{"type":"boolean","description":"This determines whether structured data is generated and stored in `call.analysis.structuredData`. Defaults to false.\n\nUsage:\n- If you want to extract structured data, set this to true and provide a `schema`.\n\n@default false","default":false},"prompt":{"type":"string","description":"This is the prompt that the model will use to generate the structured data of the call.","example":"Extract structured data from the call."},"timeoutSeconds":{"type":"number","description":"This is how long the request is tried before giving up. When request times out, `call.analysis.structuredData` will be empty.\n\nUsage:\n- To guarantee the structured data is generated, set this value high. Note, this will delay the end of call report in cases where model is slow to respond.\n\n@default 5 seconds","minimum":1,"maximum":60,"example":30},"schema":{"description":"This is the schema of the structured data. The output is stored in `call.analysis.structuredData`.\n\nComplete guide on JSON Schema can be found [here](https://ajv.js.org/json-schema.html#json-data-type).","allOf":[{"$ref":"#/components/schemas/JsonSchema"}],"example":{"type":"object","properties":{"name":{"type":"string","description":"This is the name of the user.","example":"John Doe"},"dob":{"type":"string","format":"date","description":"This is the date of birth of the user.","example":"1990-03-08"}}}}}}]},"AssistantServer":{"type":"object","description":"This is where Interactly will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema.","properties":{"enabled":{"type":"boolean","description":"This is a boolean that controls whether the server is enabled. If set to false, the model will not send webhooks to the server.\n\n@default false","example":false},"messages":{"type":"array","enum":["status-update","conversation-update","hang","end-of-call-report","error"],"example":["status-update","conversation-update","hang","end-of-call-report","error"],"description":"These are the messages that will be sent to your Server URL.","items":{"type":"string","enum":["status-update","conversation-update","hang","end-of-call-report","error"]}}},"allOf":[{"$ref":"#/components/schemas/Server"}]},"AssistantOverrides":{"type":"object","description":"This is where you can override the default behavior of the assistant.","properties":{"welcomeMessage":{"type":"string","description":"This is the message that the assistant will say when the call starts.","example":"Hello, how can I help you today?"},"welcomeMessageMode":{"type":"string","description":"This is the mode of the welcome message. It can be one of the following: 'assistant-speaks-first', 'assistant-waits-for-user', 'automatic'.","example":"assistant-speaks-first","default":"automatic"},"welcomeMessageInterruptionsEnabled":{"type":"boolean","description":"This is a boolean that controls whether the interruptions are enabled during the welcome message. If set to false, the user can not interrupt the welcome message.","example":false,"default":false},"recordingEnabled":{"type":"boolean","description":"This is a boolean that controls whether the recording is enabled. If set to false, the model will not record the call.\n\n@default true","default":true,"example":true},"recordAfterTransfer":{"type":"boolean","description":"When enabled, call recording continues after the call is forwarded or warm-transferred to another party.","default":false,"example":false},"postCallTranscriptsEnabled":{"type":"boolean","description":"When enabled, a post-call transcript file is generated and stored alongside the call recording after the call ends.","default":false,"example":false},"maxConsecutiveTtsFailures":{"type":"integer","description":"Maximum number of consecutive TTS turn failures before the call is ended automatically.","default":2,"example":2,"minimum":0},"warmTransferEnabled":{"type":"boolean","description":"Enables warm transfer when forwarding calls. The receiving agent is connected before the caller is transferred.","default":false,"example":false},"warmTransferConversational":{"type":"boolean","description":"When enabled with `warmTransferEnabled`, the assistant converses with the receiving agent via WebSocket before completing the transfer.","default":false,"example":false},"holdMusicUrl":{"type":"string","description":"URL of the hold music played to the caller while a conversational warm transfer is in progress.","default":"","example":"https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3"},"warmTransferTimeout":{"type":"integer","description":"Maximum time in seconds to wait for the receiving agent to answer during a warm transfer.","default":300,"example":300,"minimum":1,"maximum":3600},"recordingPath":{"type":"string","description":"This is the path where the recording will be stored. If not provided, the recording will be stored in the default path.","example":"/recordings"},"dynamicVariables":{"type":"object","description":"This is the dynamic variables of the conversation. Values in this object will be replaced in the assistant system prompt, welcome message, end call message. If your dynamic variable is `user_name`, you can use it in the system prompt message as `Hello, {{user_name}}`.","example":{"user_name":"John Doe"}}}},"Server":{"type":"object","properties":{"timeoutSeconds":{"type":"number","description":"This is the timeout in seconds for the request to your server. Defaults to 20 seconds.\n\n@default 20","minimum":1,"maximum":120,"example":20},"url":{"type":"string","description":"API endpoint to send requests to.","example":"https://api.example.com/v1/getUserDetails"},"secret":{"type":"string","description":"This is the secret you can set that Interactly will send with every request to your server. Will be sent as a header called x-interactly-secret.","example":"my-secret"},"headers":{"type":"object","description":"These are the custom headers to include in the request sent to your server.\n\nEach key-value pair represents a header name and its value.","example":{}}},"required":["url"]},"JsonSchema":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of output you'd like.\n\n`string`, `number`, `integer`, `boolean` are the primitive types and should be obvious.\n\n`array` and `object` are more interesting and quite powerful. They allow you to define nested structures.\n\nFor `array`, you can define the schema of the items in the array using the `items` property.\n\nFor `object`, you can define the properties of the object using the `properties` property.","enum":["string","number","integer","boolean","array","object"]},"items":{"type":"object","description":"This is required if the type is \"array\". This is the schema of the items in the array.\n\nThis is of type JsonSchema. However, Swagger doesn't support circular references."},"properties":{"type":"object","description":"This is required if the type is \"object\". This specifies the properties of the object.\n\nThis is a map of string to JsonSchema. However, Swagger doesn't support circular references."},"description":{"type":"string","description":"This is the description to help the model understand what it needs to output."},"required":{"description":"This is a list of properties that are required.\n\nThis only makes sense if the type is \"object\".","type":"array","items":{"type":"string"}}},"required":["type"]},"OpenAIModels":{"type":"string","description":"List of OpenAI models that can be used for the assistant.","enum":["gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-4","gpt-4o","gpt-4o-mini","gpt-3.5-turbo"],"example":"gpt-4"},"AzureModels":{"type":"string","description":"List of Azure models that can be used for the assistant.","enum":["gpt-4","gpt-4o","gpt-4o-mini"],"example":"gpt-4"},"GeminiModels":{"type":"string","description":"List of Gemini models that can be used for the assistant.","enum":["gemini-1.5-flash-latest","gemini-1.5-pro-latest","gemini-1.5-flash"],"example":"gemini-1.5-flash-latest"},"DeepseekModels":{"type":"string","description":"List of Deepseek models that can be used for the assistant.","enum":["V3"],"example":"V3"},"BedrockModels":{"type":"string","description":"List of Bedrock models that can be used for the assistant.","enum":["anthropic.claude-3-5-sonnet","anthropic.claude-3-5-haiku","meta.llama3-1-8b-instruct"],"example":"anthropic.claude-3-5-sonnet"},"CustomLLMModels":{"type":"string","description":"List of Custom LLM models that can be used for the assistant."},"ServerMessage":{"type":"object","properties":{"message":{"description":"These are all the messages that can be sent to your server before, after and during the call. Configure the messages you'd like to receive in `assistant.server.messages`.","oneOf":[{"$ref":"#/components/schemas/ServerMessageStatusUpdate","title":"StatusUpdate"},{"$ref":"#/components/schemas/ServerMessageConversationUpdate","title":"ConversationUpdate"},{"$ref":"#/components/schemas/ServerMessageHang","title":"Hang"},{"$ref":"#/components/schemas/ServerMessageEndOfCallReport","title":"EndOfCallReport"}]}},"required":["message"]},"Customer":{"type":"object","properties":{"number":{"type":"string","description":"This is the number of the customer."},"name":{"type":"string","description":"This is the name of the customer. This is just for your own reference."}}},"ServerMessageCommon":{"type":"object","properties":{"call":{"type":"object","description":"This is the call object that is sent to your server. It contains all the information about the call.","allOf":[{"$ref":"#/components/schemas/Conversation"}]},"assistant":{"type":"object","description":"This is the assistant object that is sent to your server. It contains all the information about the assistant.","allOf":[{"$ref":"#/components/schemas/Assistant"}]},"phone":{"type":"object","description":"This is the phone object that is sent to your server. It contains all the information about the phone.","allOf":[{"$ref":"#/components/schemas/Number"}]},"customer":{"type":"object","description":"This is the customer object that is sent to your server. It contains all the information about the customer.","allOf":[{"$ref":"#/components/schemas/Customer"}]},"analysis":{"type":"object","description":"This is the analysis object that is sent to your server. It contains all the information about the analysis.","allOf":[{"$ref":"#/components/schemas/ConversationAnalysis"}]},"messages":{"type":"array","description":"This is the list of messages that are sent to your server. It contains all the information about the messages.","items":{"$ref":"#/components/schemas/ConversationMessage"}}}},"ServerMessageStatusUpdate":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the message. \"status-update\" is sent whenever the `call.status` changes.","enum":["status-update"]}},"allOf":[{"$ref":"#/components/schemas/ServerMessageCommon"}],"required":["type","status"]},"ServerMessageConversationUpdate":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the message. \"conversation-update\" is sent when an update is committed to the conversation history.","enum":["conversation-update"]}},"allOf":[{"$ref":"#/components/schemas/ServerMessageCommon"}],"required":["type"]},"ServerMessageHang":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the message. \"hang\" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as:\n- the model is too slow to respond\n- the voice is too slow to respond\n- the tool call is still waiting for a response from your server\n- etc.","enum":["hang"]}},"allOf":[{"$ref":"#/components/schemas/ServerMessageCommon"}],"required":["type"]},"ServerMessageEndOfCallReport":{"type":"object","properties":{"type":{"type":"string","description":"This is the type of the message. \"end-of-call-report\" is sent when the call ends and post-processing is complete.","enum":["end-of-call-report"]}},"allOf":[{"$ref":"#/components/schemas/ServerMessageCommon"}],"required":["type"]},"TwilioCredentials":{"type":"object","description":"The credentials for the Twilio account. You can get these from the Twilio console. If you don't have an `authToken`, you can use the `apiKeySid` and `apiSecret` instead.","properties":{"accountSid":{"type":"string","description":"This is the account sid of the Twilio account."},"authToken":{"type":"string","description":"This is the auth token of the Twilio account. If you don't have an `authToken`, you can use the `apiKeySid` and `apiSecret` instead."},"apiKeySid":{"type":"string","description":"This is the api key sid of the Twilio account."},"apiSecret":{"type":"string","description":"This is the api secret of the Twilio account."}}},"CallMetricsStatsResponse":{"type":"object","properties":{"message":{"type":"string","example":"Team call metrics retrieved successfully"},"data":{"oneOf":[{"$ref":"#/components/schemas/CallMetricsStats"},{"type":"array","description":"Returned when teamId=all (super_admin).","items":{"$ref":"#/components/schemas/CallMetricsStats"}}]}}},"CallMetricsStats":{"type":"object","properties":{"teamId":{"type":"string","nullable":true,"example":"66bb3b489f7f0f58f7bcadbc"},"totalCalls":{"type":"integer","example":174},"totalCallDuration":{"type":"number","description":"Total call duration in milliseconds","example":4847802},"assistantCallDuration":{"type":"number","description":"Total assistant call duration in milliseconds","example":4801118},"avgCallDuration":{"type":"number","example":27860.93},"ttsStats":{"type":"object","properties":{"totalRequests":{"type":"number"},"totalLatency":{"type":"number"},"avgLatency":{"type":"number"},"errors":{"type":"number"},"retries":{"type":"number"},"apiRequests":{"type":"number"},"cacheRequests":{"type":"number"},"apiLatencyTotal":{"type":"number"},"cacheLatencyTotal":{"type":"number"},"apiLatencyAvg":{"type":"number"},"cacheLatencyAvg":{"type":"number"}}},"llmStats":{"type":"object","properties":{"responseCount":{"type":"number"},"responseLatencyTotal":{"type":"number"},"responseLatencyAvg":{"type":"number"},"errors":{"type":"number"},"hangups":{"type":"number"},"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"inputTokensAvg":{"type":"number"},"outputTokensAvg":{"type":"number"}}},"sttStats":{"type":"object","properties":{"count":{"type":"number"},"latencyTotal":{"type":"number"},"latencyAvg":{"type":"number"},"errors":{"type":"number"}}},"turnsStats":{"type":"object","properties":{"bargeInCount":{"type":"number"},"bargeInTimeAvg":{"type":"number"},"userTurns":{"type":"number"},"assistantTurns":{"type":"number"},"playedTurns":{"type":"number"},"interruptedTurns":{"type":"number"},"skippedTurns":{"type":"number"}}}}}}}}