{"openapi":"3.1.0","info":{"title":"Kilevel External API","description":"## Welcome to the Kilevel API\n\nKilevel is an AI-powered communication platform that automates ai voice calls and manages business interactions.\nOur External API allows you to programmatically trigger call jobs, manage data storage, and retrieve call history\nto integrate Kilevel's capabilities into your own applications and workflows.\n\n### Key Features\n- **Automated Outbound Calls**: Create call jobs via JSON or CSV with customizable AI flows.\n- **Real-time Monitoring**: Track call status, results, and retrieve transcriptions.\n- **Storage & Data Management**: Access and manage structured business data (Customers, Appointments, etc.).\n- **Flexible Retries**: Configure automatic retry logic for busy lines or no-answers.\n\n### Authentication\nAll requests to the External API must be authenticated using an API Key.\nInclude your key in the `X-API-Key` header for every request.\n\n```http\nX-API-Key: your_api_key_here\n```\n\n### Base URL\nThe base URL for all v1 endpoints is: `https://api.kilevel.com/api/external/v1`\n","contact":{"name":"Kilevel Support","url":"https://kilevel.com","email":"info@kilevel.com"},"version":"v1.0.0"},"servers":[{"url":"https://api.kilevel.com","description":"Public API base URL"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Transcriptions","description":"Push recordings into a transcription job and read back their transcripts, analysis and attached details."},{"name":"External API","description":"API-key authenticated external endpoints"}],"paths":{"/api/external/v1/test/sync-echo":{"get":{"tags":["Test Endpoints","External API"],"summary":"Synchronous test echo endpoint","description":"A standing test target for a tool's synchronous API Call step. Responds immediately, echoing back\nthe method, headers, query parameters, and body it received - useful for confirming that\ntemplate placeholders (e.g. {{args.value}}) are resolving the way you expect before pointing\nthe step at a real downstream API.\n","operationId":"testSyncEcho","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Echoes back what was received","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"tags":["Test Endpoints","External API"],"summary":"Synchronous test echo endpoint","description":"A standing test target for a tool's synchronous API Call step. Responds immediately, echoing back\nthe method, headers, query parameters, and body it received - useful for confirming that\ntemplate placeholders (e.g. {{args.value}}) are resolving the way you expect before pointing\nthe step at a real downstream API.\n","operationId":"testSyncEcho_2","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Echoes back what was received","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Test Endpoints","External API"],"summary":"Synchronous test echo endpoint","description":"A standing test target for a tool's synchronous API Call step. Responds immediately, echoing back\nthe method, headers, query parameters, and body it received - useful for confirming that\ntemplate placeholders (e.g. {{args.value}}) are resolving the way you expect before pointing\nthe step at a real downstream API.\n","operationId":"testSyncEcho_1","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Echoes back what was received","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Test Endpoints","External API"],"summary":"Synchronous test echo endpoint","description":"A standing test target for a tool's synchronous API Call step. Responds immediately, echoing back\nthe method, headers, query parameters, and body it received - useful for confirming that\ntemplate placeholders (e.g. {{args.value}}) are resolving the way you expect before pointing\nthe step at a real downstream API.\n","operationId":"testSyncEcho_3","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Echoes back what was received","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"tags":["Test Endpoints","External API"],"summary":"Synchronous test echo endpoint","description":"A standing test target for a tool's synchronous API Call step. Responds immediately, echoing back\nthe method, headers, query parameters, and body it received - useful for confirming that\ntemplate placeholders (e.g. {{args.value}}) are resolving the way you expect before pointing\nthe step at a real downstream API.\n","operationId":"testSyncEcho_4","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Echoes back what was received","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/test/async-echo":{"get":{"tags":["Test Endpoints","External API"],"summary":"Asynchronous test echo endpoint","description":"Simulates a real downstream async API, for testing a tool's API Call step with \"Asynchronous\nRequest\" enabled end-to-end. Immediately acknowledges the request, then - after delaySeconds\n(default 10, max 120) - POSTs a test result back to the callback URL, using whatever\ntoolTaskId/secret it received (query params, X-Tool-Task-Id / X-Tool-Secret headers, or JSON\nbody fields - whichever your step sends). If no callbackUrl was included in the request,\nfalls back to Kilevel's own async-tool-task webhook endpoint.\n","operationId":"testAsyncEcho","parameters":[{"name":"delaySeconds","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"toolTaskId","in":"query","required":false,"schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Task-Id","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Secret","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Callback-Url","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"202":{"description":"Accepted - a callback will be sent after the delay","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"tags":["Test Endpoints","External API"],"summary":"Asynchronous test echo endpoint","description":"Simulates a real downstream async API, for testing a tool's API Call step with \"Asynchronous\nRequest\" enabled end-to-end. Immediately acknowledges the request, then - after delaySeconds\n(default 10, max 120) - POSTs a test result back to the callback URL, using whatever\ntoolTaskId/secret it received (query params, X-Tool-Task-Id / X-Tool-Secret headers, or JSON\nbody fields - whichever your step sends). If no callbackUrl was included in the request,\nfalls back to Kilevel's own async-tool-task webhook endpoint.\n","operationId":"testAsyncEcho_2","parameters":[{"name":"delaySeconds","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"toolTaskId","in":"query","required":false,"schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Task-Id","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Secret","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Callback-Url","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"202":{"description":"Accepted - a callback will be sent after the delay","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Test Endpoints","External API"],"summary":"Asynchronous test echo endpoint","description":"Simulates a real downstream async API, for testing a tool's API Call step with \"Asynchronous\nRequest\" enabled end-to-end. Immediately acknowledges the request, then - after delaySeconds\n(default 10, max 120) - POSTs a test result back to the callback URL, using whatever\ntoolTaskId/secret it received (query params, X-Tool-Task-Id / X-Tool-Secret headers, or JSON\nbody fields - whichever your step sends). If no callbackUrl was included in the request,\nfalls back to Kilevel's own async-tool-task webhook endpoint.\n","operationId":"testAsyncEcho_1","parameters":[{"name":"delaySeconds","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"toolTaskId","in":"query","required":false,"schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Task-Id","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Secret","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Callback-Url","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"202":{"description":"Accepted - a callback will be sent after the delay","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Test Endpoints","External API"],"summary":"Asynchronous test echo endpoint","description":"Simulates a real downstream async API, for testing a tool's API Call step with \"Asynchronous\nRequest\" enabled end-to-end. Immediately acknowledges the request, then - after delaySeconds\n(default 10, max 120) - POSTs a test result back to the callback URL, using whatever\ntoolTaskId/secret it received (query params, X-Tool-Task-Id / X-Tool-Secret headers, or JSON\nbody fields - whichever your step sends). If no callbackUrl was included in the request,\nfalls back to Kilevel's own async-tool-task webhook endpoint.\n","operationId":"testAsyncEcho_3","parameters":[{"name":"delaySeconds","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"toolTaskId","in":"query","required":false,"schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Task-Id","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Secret","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Callback-Url","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"202":{"description":"Accepted - a callback will be sent after the delay","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]},"patch":{"tags":["Test Endpoints","External API"],"summary":"Asynchronous test echo endpoint","description":"Simulates a real downstream async API, for testing a tool's API Call step with \"Asynchronous\nRequest\" enabled end-to-end. Immediately acknowledges the request, then - after delaySeconds\n(default 10, max 120) - POSTs a test result back to the callback URL, using whatever\ntoolTaskId/secret it received (query params, X-Tool-Task-Id / X-Tool-Secret headers, or JSON\nbody fields - whichever your step sends). If no callbackUrl was included in the request,\nfalls back to Kilevel's own async-tool-task webhook endpoint.\n","operationId":"testAsyncEcho_4","parameters":[{"name":"delaySeconds","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"toolTaskId","in":"query","required":false,"schema":{"type":"string"}},{"name":"secret","in":"query","required":false,"schema":{"type":"string"}},{"name":"callbackUrl","in":"query","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Task-Id","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Tool-Secret","in":"header","required":false,"schema":{"type":"string"}},{"name":"X-Callback-Url","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"202":{"description":"Accepted - a callback will be sent after the delay","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/tools/{toolId}":{"get":{"tags":["Custom Tools","External API"],"summary":"Get custom tool","description":"Retrieves the details of a specific tool definition by its unique UUID.\n","operationId":"getTool","parameters":[{"name":"toolId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Tool details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ToolDefinition"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"tags":["Custom Tools","External API"],"summary":"Update custom tool","description":"Updates an existing custom tool definition by merging the incoming fields. System tools cannot be updated.\n","operationId":"updateTool","parameters":[{"name":"X-Kilevel-Ai-Origin","in":"header","required":false,"schema":{"type":"string"}},{"name":"toolId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolDefinition"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Tool updated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ToolDefinition"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Custom Tools","External API"],"summary":"Delete custom tool","description":"Permanently deletes a custom tool definition. This action cannot be undone.\n","operationId":"deleteTool","parameters":[{"name":"toolId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Tool deleted successfully"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/structured-outputs/{id}":{"put":{"tags":["Structured Outputs","External API"],"summary":"Update structured output","description":"Updates an existing structured output definition by merging incoming fields.\n","operationId":"updateStructuredOutput","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredOutput"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Structured output updated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StructuredOutput"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Structured Outputs","External API"],"summary":"Delete structured output","description":"Permanently deletes a structured output definition. This action cannot be undone.\n","operationId":"deleteStructuredOutput","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Structured output deleted successfully"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/phone-numbers/{id}":{"put":{"tags":["External API","Account & Utility"],"summary":"Update a phone number","description":"Updates the configuration of an existing phone number.\n","operationId":"updatePhoneNumber","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePhoneNumberRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Updated phone number details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["External API","Account & Utility"],"summary":"Release/Delete a phone number","description":"Releases or deletes an existing phone number.\n","operationId":"deletePhoneNumber","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Phone number successfully released"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/flows/{flowId}":{"get":{"tags":["External API","AI Flows & Agents"],"summary":"Get AI flow","description":"Retrieves the configuration details of a specific AI flow (logic flow) by its unique UUID.\n","operationId":"getFlow","parameters":[{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Flow details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Flow"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"tags":["External API","AI Flows & Agents"],"summary":"Update AI flow","description":"Updates an existing AI flow. Only the fields present in the request body change; every\nfield left out keeps its current value. Each field you send is replaced as a whole (an\nobject or list field is not merged key by key), and an explicit null clears a field.\nSending back a whole flow as returned by GET works too: id, userId, version and timestamps\nin the body are ignored.\n","operationId":"updateFlow","parameters":[{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"The flow fields to change, by their JSON names.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Flow updated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Flow"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["External API","AI Flows & Agents"],"summary":"Delete AI flow","description":"Permanently deletes an AI flow by its unique UUID. This action cannot be undone.\n","operationId":"deleteFlow","parameters":[{"name":"flowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Flow deleted successfully"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/{recordId}":{"put":{"tags":["Data Stores","External API"],"summary":"Update custom data store record","description":"Replaces the custom-field payload for one record in a custom application data store.\nBuilt-in stores are read-only through this external endpoint.\n\nSend the full desired custom-field object. If `metadata` is present it replaces the record\nmetadata; if `customerId` is present it relinks the record to that application customer.\n","operationId":"updateCustomStoreRecord","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Replacement custom record payload.","content":{"application/json":{"schema":{"type":"object","description":"Custom store record fields"},"examples":{"Updated customer profile":{"description":"Updated customer profile","value":{"fullName":"Jane Customer","phoneNumber":"+15551234567","email":"jane@example.com","customerTier":"strategic","preferredLanguage":"en","metadata":{"source":"crm-sync","externalId":"crm-10042"}}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Custom store record updated","content":{"*/*":{"schema":{"type":"object","description":"Updated custom store record"},"examples":{"Updated profile":{"description":"Updated profile","value":{"id":"b321d532-5410-41c8-9b11-9071a71d8011","fullName":"Jane Customer","phoneNumber":"+15551234567","customerTier":"strategic","metadata":{"source":"crm-sync","externalId":"crm-10042"},"createdAt":"2026-06-26T09:30:00","updatedAt":"2026-06-26T10:15:00"}}}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Data Stores","External API"],"summary":"Delete custom data store record","description":"Deletes one record from a custom application data store. Built-in stores are read-only through\nthis external endpoint.\n","operationId":"deleteCustomStoreRecord","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Custom store record deleted"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/agents/{agentId}/knowledge-base/items/{itemId}":{"put":{"tags":["External API","Agent Knowledge Base"],"summary":"Update knowledge base item","description":"Updates an existing knowledge base item associated with the specified AI agent.\n","operationId":"updateAgentKnowledgeBaseItem","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Knowledge base item updated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseItemDto"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["External API","Agent Knowledge Base"],"summary":"Delete knowledge base item","description":"Permanently deletes a knowledge base item from the specified AI agent's knowledge base.\n","operationId":"deleteAgentKnowledgeBaseItem","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Knowledge base item deleted successfully"}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/transcriptions/jobs/{jobId}/recordings":{"post":{"tags":["Transcriptions"],"summary":"Push one recording by URL","description":"Hands one recording to a standing job, with what is already known about it.\n\nBody: `{ \"url\": \"...\", \"fileName\": \"...\", \"externalId\": \"...\", \"metadata\": {} }`.\nOnly `url` is required.\n\nThe URL is passed to the transcription provider as given and never copied here,\nwhich is what makes this the cheap path for audio that already sits in your own\nstorage: a presigned S3 or GCS link costs one small JSON request instead of moving\nthe file twice.\n\nSend `externalId`. It is what makes a retry safe - a repeat of an id already seen\nreturns the row that exists rather than transcribing, and billing for, the same\naudio again.\n\n`metadata` carries the details this recording should be filed under; call\n`GET /metadata/fields` for the keys this account uses. A key that is not recognised\nis still stored, and is named back in `unknownMetadataKeys` with a warning, so a\ntypo shows up on the first call rather than as an empty column days later. Where\nthe job also has a file-name pattern or a spreadsheet, those are applied first and\nthe values sent here win.\n","operationId":"pushRecording","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/api/external/v1/transcriptions/jobs/{jobId}/recordings/upload":{"post":{"tags":["Transcriptions"],"summary":"Push one recording as an upload","description":"The same ingestion as the URL form, for audio you hold rather than link to.\n\nTwo parts: `file` (the audio) and an optional `payload` - a JSON object with the\nsame `fileName`, `externalId` and `metadata` fields the URL form takes.\n\nMultipart rather than base64 inside JSON, which inflates an hour of audio by a\nthird and forces the whole thing through memory on both sides. The details travel\nas a JSON part rather than as form fields so that a list of tags or a nested value\nsurvives without an encoding convention both sides have to agree on.\n","operationId":"uploadRecording","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"payload":{"type":"string"}},"required":["file"]}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/api/external/v1/tools":{"get":{"tags":["Custom Tools","External API"],"summary":"List custom tools","description":"Returns a list of all custom tool definitions created by the user, as well as any accessible system tools.\n","operationId":"getTools","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of tools","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToolDefinition"}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Custom Tools","External API"],"summary":"Create custom tool","description":"Creates a new custom tool definition.\nThe created tool can be attached to flows to enable external API integrations, custom functions, or call forwarding.\n","operationId":"createTool","parameters":[{"name":"X-Kilevel-Ai-Origin","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolDefinition"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"201":{"description":"Tool created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ToolDefinition"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/structured-outputs":{"get":{"tags":["Structured Outputs","External API"],"summary":"List structured outputs","description":"Returns a list of all structured outputs defined by the user.\nStructured outputs define the JSON schemas that the AI agents must fill out during call or chat sessions.\n","operationId":"listStructuredOutputs","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of structured outputs","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StructuredOutput"}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Structured Outputs","External API"],"summary":"Create structured output","description":"Creates a new structured output definition.\nStructured outputs define JSON schemas that the AI agents must fill out during call or chat sessions.\n","operationId":"createStructuredOutput","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructuredOutput"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"201":{"description":"Structured output created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StructuredOutput"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/phone-numbers":{"get":{"tags":["External API","Account & Utility"],"summary":"List phone numbers","description":"Returns a list of all phone numbers assigned to the user associated with the API key.\nIncludes status, provider information, and current active call counts.\n","operationId":"listPhoneNumbers","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of phone numbers","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["External API","Account & Utility"],"summary":"Provision a phone number","description":"Provision a new phone number using Twilio, Telnyx, Vonage or BYO provider.\n","operationId":"createPhoneNumber","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePhoneNumberRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Provisioned phone number","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PhoneNumberResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/outbound/chats":{"post":{"tags":["External API","Outbound Triggers"],"summary":"Trigger an outbound chat","description":"Directly triggers an outbound interactive chat session with a contact.\nSupported channels:\n- `CHAT`: creates an API-managed chat session that can be fetched via the chat-session endpoints.\n- `SMS`: sends the opening assistant message over your configured SMS delivery channel.\n- `WHATSAPP`: sends the opening assistant message over your configured WhatsApp delivery channel.\n\n`contextData` is stored as session memory before the outbound chat starts.\nIf you configured flow-session webhooks globally or on the selected flow, those webhooks will also\nrun for the resulting outbound chat session (not applicable when using an inline `flow`).\n","operationId":"triggerOutboundChat","requestBody":{"description":"Request body for triggering one outbound chat session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalOutboundChatRequest"},"examples":{"Outbound WhatsApp chat":{"summary":"Start one WhatsApp session with an explicit opening message","description":"Outbound WhatsApp chat","value":{"flowApiId":"f_sales_whatsapp","channel":"WHATSAPP","assistantPhoneNumber":"+15557654321","contactPhone":"+15551234567","contactName":"Taylor Reed","contextData":{"crmLeadId":"lead_123","source":"n8n"},"initialMessage":"Hi Taylor, this is Alex from Acme."}},"Outbound API-managed chat":{"summary":"Start one CHAT session with a synthetic contact identifier","description":"Outbound API-managed chat","value":{"flowApiId":"f_sales_chat","channel":"CHAT","contactIdentifier":"lead_123","contactName":"Taylor Reed","contactEmail":"taylor@example.com","contextData":{"crmLeadId":"lead_123","source":"make"}}},"Inline/transient flow":{"summary":"Pass a one-off flow definition instead of flowId/flowApiId — nothing is saved to the flow library","description":"Inline/transient flow","value":{"flow":{"name":"One-off support chat","masterPrompt":"You are Alex from Acme support, helping {{contact.name}} with a billing question.","firstMessage":"Hi {{contact.name}}, I'm Alex from Acme support — how can I help?","channelMode":"CHAT"},"channel":"CHAT","contactIdentifier":"lead_123","contactName":"Taylor Reed"}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Outbound chat session created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundChatTriggerResponse"},"examples":{"Outbound chat response":{"description":"Outbound chat response","value":{"session":{"id":"bc2be9cc-13a5-4b80-9853-4f287872b60c","providerCallId":null,"provider":"WHATSAPP","status":"ACTIVE","mode":"FLOW","aiMode":"ACTIVE","flowId":"603db9a1-8a8a-4d74-90b0-e8084cbd2c2d","contactName":"Taylor Reed","contactPhone":"+15551234567"},"messages":[{"role":"ASSISTANT","content":"Hi Taylor, this is Alex from Acme."}]}}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/outbound/calls":{"post":{"tags":["External API","Outbound Triggers"],"summary":"Trigger an outbound call","description":"Directly triggers an outbound call to a destination phone number.\nThis is the lightweight API for starting one-off outbound call sessions without creating a full CSV/JSON call job.\n\nSelect the flow with exactly one of:\n- `flowId` / `flowApiId`: reference a flow you've built and saved in the dashboard. `flowId` accepts\n  either the internal UUID or the flow API ID; `flowApiId` is the explicit alias. If all three\n  (`flowId`, `flowApiId`, `flow`) are omitted, Kilevel falls back to your default manual-call flow.\n- `flow`: an inline/transient flow definition for one-off calls that don't need a reusable, dashboard-\n  managed flow — nothing is written to your flow library. See the `flow` field description for the\n  full supported shape and which fields are ignored.\n\n`rowData` becomes the call's contact/row payload, while `contextData` preloads session memory.\nIf you configured flow-session webhooks globally or on the selected flow, those webhooks will also\nrun for the resulting outbound call session (not applicable when using an inline `flow`).\n","operationId":"triggerOutboundCall","requestBody":{"description":"Request body for triggering one outbound call session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalOutboundCallRequest"},"examples":{"Basic outbound call":{"summary":"Queue one outbound call with rowData and contextData","description":"Basic outbound call","value":{"flowApiId":"f_sales_voice","customerNumber":"+15551234567","fromPhoneNumber":"+15557654321","contactName":"Taylor Reed","contactEmail":"taylor@example.com","rowData":{"company":"Acme","pipeline":"sales"},"contextData":{"crmLeadId":"lead_123","source":"zapier"}}},"Default manual-call flow fallback":{"summary":"Omit flowId, flowApiId, and flow to use the user's default manual-call flow","description":"Default manual-call flow fallback","value":{"customerNumber":"+15551234567","contactName":"Taylor Reed","rowData":{"campaign":"reactivation_q2"}}},"Inline/transient flow":{"summary":"Pass a one-off flow definition instead of flowId/flowApiId — nothing is saved to the flow library","description":"Inline/transient flow","value":{"flow":{"name":"One-off reactivation call","masterPrompt":"You are Alex from Acme, calling to check in on {{contact.name}}'s account.","firstMessage":"Hi {{contact.name}}, this is Alex from Acme — got a minute?","voiceId":"en-US-female-1","language":"en","localVariables":[{"variableName":"accountTier","type":"string"}]},"customerNumber":"+15551234567","contactName":"Taylor Reed","rowData":{"campaign":"reactivation_q2"}}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Outbound call was queued","content":{"*/*":{"schema":{"$ref":"#/components/schemas/OutboundCallTriggerResponse"},"examples":{"Queued outbound call response":{"description":"Queued outbound call response","value":{"queued":true,"rowId":"f8d4e0af-bf7c-457c-a784-5fe4c6f08f07","status":"TODO","jobId":"36425d5f-a0c8-4d29-bf12-5c318d2643ce","jobName":"Manual Calls","flowId":"603db9a1-8a8a-4d74-90b0-e8084cbd2c2d","flowApiId":"f_sales_voice","ephemeralFlowId":null,"targetPhoneNumber":"+15551234567"}}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/flows":{"get":{"tags":["External API","AI Flows & Agents"],"summary":"List AI flows (logic)","description":"Returns a paginated list of all AI flows available to the user.\nFlows contain the AI instructions and logic. Use the `apiId` in your job creation requests.\n","operationId":"listFlows","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 100)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated list of flows","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedFlowResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["External API","AI Flows & Agents"],"summary":"Create AI flow","description":"Creates a new AI flow (logic configuration) for call or chat personification.\n","operationId":"createFlow","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"201":{"description":"Flow created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Flow"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/chat-sessions/{sessionId}/inject":{"post":{"tags":["External API","Call & Chat Injections"],"summary":"Inject message into a chat session","description":"Injects a customer, assistant, or system message directly into an active chat session.\n","operationId":"injectChatMessage","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatInjectionRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Message successfully injected","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-rows/{rowId}/inject":{"post":{"tags":["External API","Call & Chat Injections"],"summary":"Inject speech into a call session","description":"Allows external systems to inject text-to-speech content or trigger response generation in an active call.\n","operationId":"injectVoiceMessage","parameters":[{"name":"rowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceInjectionRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Speech injection successfully triggered","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs/json":{"post":{"tags":["External API","Call Jobs"],"summary":"Create call job (JSON)","description":"Creates a call job from JSON content. This is preferred over CSV for many rows or complex data.\n\nTo assign one default flow for the whole job, provide either `flowId` (internal UUID or flow API ID)\nor `flowApiId` (preferred for external integrations). Do not send both.\n\nFor multi-flow jobs, omit the default flow fields and set `flowApiId` on each row instead.\n","operationId":"createCallJobJson","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCallingJobCreateJsonRequest"}}},"required":true},"responses":{"201":{"description":"Call job created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CallJobResponse"}}}},"400":{"description":"Invalid payload","content":{"*/*":{"schema":{"type":"string","example":{"error":"rows is required"}}}}},"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs/csv":{"post":{"tags":["External API","Call Jobs"],"summary":"Create call job (CSV)","description":"Creates a new call job by providing CSV content.\nThis is suitable for bulk uploads where data is already in a tabular format.\nThe first row of the CSV must contain the headers.\n\nTo assign one default flow for the whole job, provide either `flowId` (internal UUID or flow API ID)\nor `flowApiId` (preferred for external integrations). Do not send both.\n\nFor multi-flow jobs, omit the default flow fields and add a `flow` column containing each row's flow API ID.\n","operationId":"createCallJobCsv","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCallingJobCreateRequest"}}},"required":true},"responses":{"201":{"description":"Call job created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CallJobResponse"}}}},"400":{"description":"Invalid CSV content or missing required fields","content":{"*/*":{"schema":{"type":"string","example":{"error":"csvContent is required"}}}}},"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}":{"get":{"tags":["Data Stores","External API"],"summary":"Get data store records","description":"Retrieves all records from a specific storage table (built-in or custom).\nThe result structure depends on the schema of the requested store.\n\nBy default this endpoint keeps the legacy response shape and returns a plain JSON array.\nWhen `page`, `size`, `q`, `field`, or `field.<key>` is provided, it returns a paginated object:\n`{content, currentPage, pageSize, totalItems, totalPages}`.\n\nSearch/filter examples:\n- `?q=acme&page=0&size=25` searches across returned fields.\n- `?field=phoneNumber:+15551234567&page=0&size=1` filters by one exact field.\n- `?field.phoneNumber=+15551234567&page=0&size=1` is equivalent and easier for URL builders.\n- For massive custom stores, prefer `size=500` and pass the returned `nextCursor` as `cursor`\n  on the next request instead of incrementing `page`.\n\n**Built-in store keys and their record shapes**:\n- `customers` — `{id, name, email, phone, notes, createdAt, updatedAt, ...}`\n- `appointments` — `{id, customerId, serviceId, personnelId, startTime, endTime, status, notes, createdAt, ...}`\n- `services` — `{id, name, description, duration, price, createdAt, ...}`\n- `feedback` — `{id, customerId, rating, comment, callId, createdAt, ...}`\n- `personnel` — `{id, name, role, email, phone, createdAt, ...}`\n- `promotions` — `{id, name, description, discount, validFrom, validTo, createdAt, ...}`\n- `campaigns` — `{id, name, description, startDate, endDate, status, createdAt, ...}`\n- `time-slots` — `{id, dayOfWeek, startTime, endTime, maxCapacity, createdAt, ...}`\n- **custom keys** — `{id, createdAt, updatedAt, ...plus all custom fields defined in the store schema}`\n","operationId":"getStoreRecords","parameters":[{"name":"appId","in":"path","description":"The unique UUID of the application","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","description":"The unique key of the store (e.g., 'customers' or a custom key)","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number (0-indexed). When omitted, the legacy array response is returned.","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"size","in":"query","description":"Items per page (max 500)","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"cursor","in":"query","description":"Opaque cursor returned as `nextCursor` from a previous custom-store response","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive search across returned fields","required":false,"schema":{"type":"string"}},{"name":"field","in":"query","description":"Exact field filters as key:value. May be repeated.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"requestParams","in":"query","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Records from the requested store","content":{"*/*":{"schema":{"type":"object","description":"Legacy array response or paginated response depending on query parameters"},"examples":{"Legacy array response":{"description":"Legacy array response","value":[{"id":"b321d532-5410-41c8-9b11-9071a71d8011","fullName":"Jane Customer","phoneNumber":"+15551234567","email":"jane@example.com","metadata":{"source":"crm-import"},"createdAt":"2026-06-26T09:30:00","updatedAt":"2026-06-26T09:30:00"}]},"Paginated search response":{"description":"Paginated search response","value":{"content":[{"id":"b321d532-5410-41c8-9b11-9071a71d8011","fullName":"Jane Customer","phoneNumber":"+15551234567","customerTier":"enterprise","metadata":{"source":"crm-import"},"createdAt":"2026-06-26T09:30:00","updatedAt":"2026-06-26T09:30:00"}],"currentPage":0,"pageSize":1,"totalItems":1,"totalPages":1}}}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Data Stores","External API"],"summary":"Create custom data store record","description":"Inserts one record into a custom application data store. Built-in stores are read-only through\nthis external endpoint; use a custom store for integrator-managed customer datasets.\n\nSend custom fields at the top level. Reserved fields are handled specially:\n- `customerId` / `customer_id` links the record to an existing customer in the application.\n- `metadata` / `metaData` / `meta_data` stores machine-readable metadata beside the record.\n- `id`, `createdAt`, and `updatedAt` are ignored on write.\n","operationId":"createCustomStoreRecord","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Custom record payload. Top-level keys are stored as custom fields; `metadata` is stored separately.","content":{"application/json":{"schema":{"type":"object","description":"Custom store record fields"},"examples":{"Customer profile import":{"description":"Customer profile import","value":{"fullName":"Jane Customer","phoneNumber":"+15551234567","email":"jane@example.com","customerTier":"enterprise","preferredLanguage":"en","metadata":{"source":"crm-import","externalId":"crm-10042"}}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"201":{"description":"Custom store record created","content":{"*/*":{"schema":{"type":"object","description":"Created custom store record"},"examples":{"Created customer profile":{"description":"Created customer profile","value":{"id":"b321d532-5410-41c8-9b11-9071a71d8011","fullName":"Jane Customer","phoneNumber":"+15551234567","customerTier":"enterprise","metadata":{"source":"crm-import","externalId":"crm-10042"},"createdAt":"2026-06-26T09:30:00","updatedAt":"2026-06-26T09:30:00"}}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/records:upsert":{"post":{"tags":["Data Stores","External API"],"summary":"Upsert custom data store record","description":"Creates or updates one custom-store record by matching indexed custom fields in `where`.\nThis is the preferred enterprise ingestion endpoint for customer data keyed by phone number,\nexternal CRM id, membership id, or similar identifiers.\n\n`where` fields must be configured as indexed fields in the data-store settings.\nBy default the endpoint creates a record if no match exists and merges `data` into an existing\nrecord if one match exists. Multiple matches return 409 to protect data quality.\n","operationId":"upsertCustomStoreRecord","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Upsert request keyed by indexed custom fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCustomStoreUpsertRequest"},"examples":{"Upsert by phone number":{"description":"Upsert by phone number","value":{"where":{"phoneNumber":"+15551234567"},"data":{"fullName":"Jane Customer","phoneNumber":"+15551234567","customerTier":"enterprise","preferredLanguage":"en"},"metadata":{"source":"crm-sync","externalId":"crm-10042"},"createIfMissing":true,"merge":true}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/records:bulk-upsert":{"post":{"tags":["Data Stores","External API"],"summary":"Bulk upsert custom data store records","description":"Upserts many records into a custom data store. Use this for CRM/customer sync jobs instead of\nsending one HTTP request per row. Each row uses the same `where`/`data`/`metadata` shape as\nthe single-record upsert endpoint.\n\nMaximum batch size is 1000 records. The response includes created, updated, unchanged, and\nerror counts plus per-row errors.\n","operationId":"bulkUpsertCustomStoreRecords","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Bulk upsert request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCustomStoreBulkUpsertRequest"},"examples":{"Bulk customer sync":{"description":"Bulk customer sync","value":{"continueOnError":true,"records":[{"where":{"phoneNumber":"+15551234567"},"data":{"fullName":"Jane Customer","phoneNumber":"+15551234567","customerTier":"enterprise"},"metadata":{"externalId":"crm-10042"}},{"where":{"externalCustomerId":"crm-10043"},"data":{"fullName":"John Customer","externalCustomerId":"crm-10043"}}]}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/agents/{agentId}/knowledge-base/items":{"post":{"tags":["External API","Agent Knowledge Base"],"summary":"Create knowledge base item","description":"Creates a new knowledge base item and associates it with the specified AI agent.\nItems can be web scrapes, text snippets, or other sources.\n","operationId":"createAgentKnowledgeBaseItem","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemRequest"}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"201":{"description":"Knowledge base item created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseItemDto"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs/{jobId}":{"get":{"tags":["External API","Call Jobs"],"summary":"Get call job","description":"Retrieves the details of a specific call job by its unique UUID.\nIncludes configuration, status, and progress metrics.\n","operationId":"getCallJob","parameters":[{"name":"jobId","in":"path","description":"The unique UUID of the call job","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Call job details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CallJobResponse"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["External API","Call Jobs"],"summary":"Delete call job","description":"Permanently deletes a call job and all its associated call rows.\nThis action cannot be undone.\n","operationId":"deleteCallJob","parameters":[{"name":"jobId","in":"path","description":"The unique UUID of the call job","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"204":{"description":"Successfully deleted"}},"security":[{"ApiKeyAuth":[]}]},"patch":{"tags":["External API","Call Jobs"],"summary":"Update call job","description":"Updates editable fields of an existing call job.\nAllows modifying execution settings, scheduling, and retry configurations.\n\n**Patchable fields**: `executionMode`, `status`, `flowId`, `flowApiId`, `manualTriggerSecret`,\n`allowedCallWindowStart` (HH:mm:ss), `allowedCallWindowEnd` (HH:mm:ss), `allowedPhoneNumbers`,\n`scheduledAt` (ISO 8601), `maxConcurrentCalls`, `enableRetries`, `maxRetries`, `retryDelay`,\n`retryOnBusy`, `retryOnNoAnswer`, `retryOnVoicemail`.\n\n`flowId` accepts either the internal UUID or the flow API ID. `flowApiId` is an explicit alias for\nAPI-ID based updates. Provide at most one of them.\n","operationId":"updateCallJob","parameters":[{"name":"jobId","in":"path","description":"The unique UUID of the call job","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"description":"Map of fields to update","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Updated call job","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CallJobResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/records:patch":{"patch":{"tags":["Data Stores","External API"],"summary":"Patch custom data store records by filter","description":"Updates matching custom-store records without first retrieving their ids.\nUse this for operations such as: update rows where `phoneNumber = +15551234567`.\n\n`where` fields must be configured as indexed fields. `set` is merged into each matched record.\nUse `limit` to bound blast radius. Maximum limit is 1000. Set `dryRun: true` to count and sample\nmatches without writing.\n","operationId":"patchCustomStoreRecords","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Patch matching records by indexed field filters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCustomStorePatchRequest"},"examples":{"Patch by phone number":{"description":"Patch by phone number","value":{"where":{"phoneNumber":"+15551234567"},"set":{"lastCrmStatus":"active","customerTier":"strategic"},"metadata":{"lastSyncSource":"crm"},"limit":1}}}}},"required":true},"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/transcriptions/rows/{rowId}":{"get":{"tags":["Transcriptions"],"summary":"Read one recording's transcript, analysis and details","description":"One recording, with its transcript, its utterances, the summary and everything the\nanalysis outputs produced.\n\n`metadata` and `analysis` are returned as separate objects and are never merged.\nOne is what the caller told us, the other is what a model concluded; an\nintegration writing either into its own records needs to know which it is holding.\n\n`analysis` is keyed by output name - a metric pack writes under its own name - and\neach judgement field is accompanied by a `<field>_reason` while the job has\nexplanations switched on.\n","operationId":"getRow","parameters":[{"name":"rowId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/api/external/v1/transcriptions/metadata/fields":{"get":{"tags":["Transcriptions"],"summary":"List the detail fields a pushed recording can carry","description":"The keys accepted in a recording's `metadata`, including the ones this account\ndefined for itself.\n\nPublished so an integration can be written against the account's actual field\nkeys instead of a list copied out of the dashboard that goes stale the first time\nsomebody adds a field. Each descriptor carries its `key`, human `label`, `type`,\nthe `rule` used to parse it, an `example`, and whether it is `builtIn`.\n","operationId":"listMetadataFields","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"type":"object","additionalProperties":{}}}}}}}}},"/api/external/v1/transcriptions/jobs":{"get":{"tags":["Transcriptions"],"summary":"List transcription jobs that accept pushed recordings","description":"Returns the jobs this key may push into: API-sourced jobs only.\n\nA job built from a Drive folder, a bucket or an upload batch is deliberately\nabsent - its source already decides what belongs in it, and injecting rows would\nmean its row count no longer describes the thing the customer pointed at.\n\nEach entry carries the settings every recording in it is transcribed with\n(`languageMode`, `speakerMode`) and its progress (`totalRows`, `processedRows`),\nso an integration can confirm it is pushing into the job it meant to.\n","operationId":"listJobs","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":25}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/api/external/v1/transcriptions/jobs/{jobId}/rows":{"get":{"tags":["Transcriptions"],"summary":"List a job's recordings and their status","description":"One page of a job's recordings: status, duration, detected language, speaker\ncount, the details attached to each, and the failure reason where there is one.\n\nThe transcript and the analysis are left out of this view on purpose - poll this\nendpoint for progress and read the finished ones individually, rather than pulling\nevery transcript on every poll.\n","operationId":"listRows","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":25}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/api/external/v1/reports/tool-usage":{"get":{"tags":["Usage Reports"],"operationId":"getToolUsageReport","parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"toolName","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ToolUsageReportResponse"}}}}}}},"/api/external/v1/applications/{appId}/generated-calls":{"get":{"tags":["External API","Call & Chat History"],"summary":"List generated calls","description":"Returns a paginated list of generated-call rows.\nThis only includes rows that belong to Generated Calls system jobs (`GENERATED_CALLS*`).\nIf `appId` is provided, it only returns rows for that application.\n","operationId":"listApplicationGeneratedCalls","parameters":[{"name":"appId","in":"path","description":"Optional unique UUID of the application","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 200)","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"startDate","in":"query","description":"Filter by row creation start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"endDate","in":"query","description":"Filter by row creation end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"plannedStartDate","in":"query","description":"Filter by planned-call start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"plannedEndDate","in":"query","description":"Filter by planned-call end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sortBy","in":"query","description":"Field to sort by (createdAt, plannedCallDateTime, status, duration, etc.)","required":false,"schema":{"type":"string","default":"createdAt"}},{"name":"sortDir","in":"query","description":"Sort direction (asc, desc)","required":false,"schema":{"type":"string","default":"desc"}},{"name":"status","in":"query","description":"Optional list of row statuses to include","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"search","in":"query","description":"Simple search across destination and caller numbers","required":false,"schema":{"type":"string"}},{"name":"approved","in":"query","description":"Filter by approval state","required":false,"schema":{"type":"boolean"}},{"name":"approvalSource","in":"query","description":"Filter by approval source (AUTO, USER)","required":false,"schema":{"type":"string","enum":["USER","AUTO"]}},{"name":"excludeFinished","in":"query","description":"Exclude finished generated calls (DONE, DONE_WD, DONE_WC, ERROR)","required":false,"schema":{"type":"boolean","default":false}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated generated calls","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedCallHistoryResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/generated-calls":{"get":{"tags":["External API","Call & Chat History"],"summary":"List generated calls","description":"Returns a paginated list of generated-call rows.\nThis only includes rows that belong to Generated Calls system jobs (`GENERATED_CALLS*`).\nIf `appId` is provided, it only returns rows for that application.\n","operationId":"listApplicationGeneratedCalls_1","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 200)","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"startDate","in":"query","description":"Filter by row creation start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"endDate","in":"query","description":"Filter by row creation end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"plannedStartDate","in":"query","description":"Filter by planned-call start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"plannedEndDate","in":"query","description":"Filter by planned-call end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sortBy","in":"query","description":"Field to sort by (createdAt, plannedCallDateTime, status, duration, etc.)","required":false,"schema":{"type":"string","default":"createdAt"}},{"name":"sortDir","in":"query","description":"Sort direction (asc, desc)","required":false,"schema":{"type":"string","default":"desc"}},{"name":"status","in":"query","description":"Optional list of row statuses to include","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"search","in":"query","description":"Simple search across destination and caller numbers","required":false,"schema":{"type":"string"}},{"name":"approved","in":"query","description":"Filter by approval state","required":false,"schema":{"type":"boolean"}},{"name":"approvalSource","in":"query","description":"Filter by approval source (AUTO, USER)","required":false,"schema":{"type":"string","enum":["USER","AUTO"]}},{"name":"excludeFinished","in":"query","description":"Exclude finished generated calls (DONE, DONE_WD, DONE_WC, ERROR)","required":false,"schema":{"type":"boolean","default":false}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated generated calls","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedCallHistoryResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/chat-sessions/{sessionId}":{"get":{"tags":["External API","Call & Chat History"],"summary":"Get chat session","description":"Retrieves status and metadata for a specific chat session.\nIncludes status, duration, AI summary, and metadata.\n","operationId":"getChatSession","parameters":[{"name":"sessionId","in":"path","description":"The unique UUID of the chat session","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Chat session details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ChatSessionResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/chat-sessions/{sessionId}/messages":{"get":{"tags":["External API","Call & Chat History"],"summary":"List all chat session messages","description":"Returns chronological list of all messages (visitor, AI, agent, system, metadata) in a session.\nIncludes roles (USER, ASSISTANT, etc.) and message content.\n","operationId":"getChatSessionMessages","parameters":[{"name":"sessionId","in":"path","description":"The unique UUID of the chat session","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of messages","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageResponse"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/chat-history":{"get":{"tags":["External API","Call & Chat History"],"summary":"Chat history","description":"Searches and retrieves chat session history with advanced filtering, sorting, and pagination.\nThis endpoint allows querying across all widgets owned by the user associated with the API key.\n","operationId":"getChatHistory","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 200)","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"widgetId","in":"query","description":"Filter by specific widget UUID","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","description":"Filter by start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"endDate","in":"query","description":"Filter by end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sortBy","in":"query","description":"Field to sort by (createdAt, status, durationSeconds, etc.)","required":false,"schema":{"type":"string","default":"createdAt"}},{"name":"sortDir","in":"query","description":"Sort direction (asc, desc)","required":false,"schema":{"type":"string","default":"desc"}},{"name":"contactIdentifier","in":"query","description":"Filter by contact identifier","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by session status (STARTED, ENDED, etc.)","required":false,"schema":{"type":"string","enum":["STARTED","ENDED","ANALYSED"]}},{"name":"contactEmail","in":"query","description":"Filter by contact email","required":false,"schema":{"type":"string"}},{"name":"contactPhone","in":"query","description":"Filter by contact phone","required":false,"schema":{"type":"string"}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated chat history","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedChatSessionResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-rows/{rowId}":{"get":{"tags":["External API","Call & Chat History"],"summary":"Get call row","description":"Retrieves the details of a specific call row by its unique UUID.\nIncludes status, duration, recording URL, transcription, and outcome details.\n","operationId":"getCallRow","parameters":[{"name":"rowId","in":"path","description":"The unique UUID of the call row","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Call row details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CallRowResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs":{"get":{"tags":["External API","Call Jobs"],"summary":"List call jobs","description":"Retrieves a paginated list of all call jobs owned by the user associated with the API key.\nAllows filtering by application and ignoring system jobs.\n","operationId":"listCallJobs","parameters":[{"name":"applicationId","in":"query","description":"Filter by specific application UUID","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"ignoreSystemJobs","in":"query","description":"Exclude system call jobs (e.g. Generated Calls)","required":false,"schema":{"type":"boolean","default":false}},{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 100)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated list of call jobs","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedCallJobResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs/{jobId}/rows":{"get":{"tags":["External API","Call Jobs"],"summary":"Get rows for call job","description":"Returns all call rows associated with a specific call job.\nUseful for checking the status or individual results of a bulk upload.\n","operationId":"getCallJobRows","parameters":[{"name":"jobId","in":"path","description":"The unique UUID of the call job","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of call rows for this job","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CallRowResponse"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-jobs/rows":{"get":{"tags":["External API","Call & Chat History"],"summary":"List all call rows","description":"Returns a paginated list of all call rows across all jobs owned by the user associated with the API key.\nThis is a convenient alias for retrieving the full call history.\n","operationId":"listAllRows","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 200)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated call history","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedCallHistoryResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/call-history":{"get":{"tags":["External API","Call & Chat History"],"summary":"Call history","description":"Searches and retrieves call history with advanced filtering, sorting, and pagination.\nThis endpoint allows querying across all jobs and standalone outbound/inbound calls.\n","operationId":"getCallHistory","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 200)","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"jobId","in":"query","description":"Filter by specific job UUID","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","description":"Filter by start date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"endDate","in":"query","description":"Filter by end date (ISO 8601)","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"sortBy","in":"query","description":"Field to sort by (createdAt, status, duration, etc.)","required":false,"schema":{"type":"string","default":"createdAt"}},{"name":"sortDir","in":"query","description":"Sort direction (asc, desc)","required":false,"schema":{"type":"string","default":"desc"}},{"name":"inputKey","in":"query","description":"Filter by a key in the input rowData","required":false,"schema":{"type":"string"}},{"name":"inputValue","in":"query","description":"Value to match in input rowData","required":false,"schema":{"type":"string"}},{"name":"outputKey","in":"query","description":"Filter by a key in the output results","required":false,"schema":{"type":"string"}},{"name":"outputValue","in":"query","description":"Value to match in output results","required":false,"schema":{"type":"string"}},{"name":"flowId","in":"query","description":"Filter by flow (internal UUID)","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"agentId","in":"query","description":"Filter by agent (API ID or UUID)","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","description":"Filter by call direction (INBOUND, OUTBOUND)","required":false,"schema":{"type":"string"}},{"name":"flattenOutputs","in":"query","description":"Merge each structured output's fields flat onto the root, matching the API's original (pre-nesting) shape. Set to false to get the real object structure, grouped by output name.","required":false,"schema":{"type":"boolean","default":true}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated call history","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedCallHistoryResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/balance":{"get":{"tags":["External API","Account & Utility"],"summary":"Get wallet balance","description":"Returns the current wallet balance, free minutes, and pricing information for the user.\nUseful for monitoring credit status to ensure uninterrupted service.\n","operationId":"getBalance","responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Current balance details","content":{"*/*":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/automations/{automationId}/artifacts":{"get":{"tags":["Automation Artifacts"],"operationId":"listArtifacts","parameters":[{"name":"automationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedModelStoredFileView"}}}}}}},"/api/external/v1/artifacts/{id}":{"get":{"tags":["Automation Artifacts"],"operationId":"getArtifact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StoredFileView"}}}}}}},"/api/external/v1/applications":{"get":{"tags":["External API","Account & Utility"],"summary":"List applications","description":"Returns a paginated list of all workspace applications owned by the user.\nApplications represent the business context (e.g. ACME Dental) and contain data stores.\n","operationId":"listApplications","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 100)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated list of applications","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedApplicationResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores":{"get":{"tags":["Data Stores","External API"],"summary":"List data stores","description":"Returns a list of all data stores (tables) available for a specific application.\nThis includes built-in stores (customers, services, etc.) and any custom-defined schema tables.\n\nEach entry in the returned array contains at minimum `key` (string store identifier),\n`label` (human-readable name), and `fields` (list of field definitions).\nBuilt-in store keys: `customers`, `appointments`, `services`, `feedback`,\n`personnel`, `promotions`, `campaigns`, `time-slots`.\n","operationId":"getStores","parameters":[{"name":"appId","in":"path","description":"The unique UUID of the application","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"List of data store configurations","content":{"*/*":{"schema":{"type":"array","items":{"type":"object","example":{"key":"customers","label":"Customers","fields":[]}}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/schema":{"get":{"tags":["Data Stores","External API"],"summary":"Get data store schema","description":"Returns the detailed schema metadata for a specific store key.\nIncludes field definitions, types, and labels used for rendering data.\n\nEach schema object contains: `key` (string), `label` (string), and `fields` (array of field\ndefinitions, each with `key`, `label`, `type` — one of `text`, `number`, `boolean`, `date`,\n`select`, `multiselect`, `textarea`).\n","operationId":"getStoreSchema","parameters":[{"name":"appId","in":"path","description":"The unique UUID of the application","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","description":"The unique key of the store","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Store schema definition","content":{"*/*":{"schema":{"type":"object","example":{"key":"customers","label":"Customers","fields":[{"key":"name","label":"Name","type":"text"}]}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/ingestion-stats":{"get":{"tags":["Data Stores","External API"],"summary":"Get custom data store ingestion stats","description":"Returns ingestion counters and recent ingestion events for a custom data store. Use this to\nmonitor enterprise sync jobs and verify whether incoming customer-data feeds are creating,\nupdating, failing, or slowing down.\n","operationId":"getCustomStoreIngestionStats","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/applications/{appId}/stores/{storeKey}/indexes":{"get":{"tags":["Data Stores","External API"],"summary":"Get custom data store index status","description":"Returns the configured custom fields for a custom data store and whether the backing Postgres\nexpression index exists for fields marked `indexed`.\n","operationId":"getCustomStoreIndexes","parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"storeKey","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/agents":{"get":{"tags":["External API","AI Flows & Agents"],"summary":"List AI agents (personification)","description":"Returns a paginated list of all AI agent personification personas available to the user.\nAgents are personifications of flows with specific settings (voice, language, knowledge base).\n","operationId":"listAgents","parameters":[{"name":"page","in":"query","description":"Page number (0-indexed)","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Items per page (max 100)","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Paginated list of agents","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PagedAgentResponse"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/api/external/v1/agents/{agentId}/knowledge-base":{"get":{"tags":["External API","Agent Knowledge Base"],"summary":"Get agent knowledge base","description":"Retrieves the current knowledge base state, including all configured items, for a specific AI agent.\n","operationId":"getAgentKnowledgeBase","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"401":{"description":"Missing or invalid API key","content":{"*/*":{"schema":{"type":"string","example":{"error":"Unauthorized"}}}}},"403":{"description":"Key is valid but lacks access to this resource","content":{"*/*":{"schema":{"type":"string","example":{"error":"Forbidden"}}}}},"404":{"description":"Requested resource not found","content":{"*/*":{"schema":{"type":"string","example":{"error":"Not found"}}}}},"200":{"description":"Agent knowledge base state","content":{"*/*":{"schema":{"$ref":"#/components/schemas/FlowKnowledgeBaseStateDto"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"ConcurrencyControlConfig":{"type":"object","properties":{"enabled":{"type":"boolean"},"maxConcurrentCalls":{"type":"integer","format":"int32"},"varyByParameters":{"type":"boolean"},"concurrencyKeyParameterNames":{"type":"array","items":{"type":"string"}},"overflowBehavior":{"type":"string"},"waitTimeoutSeconds":{"type":"integer","format":"int32"}}},"ForwardCallConfig":{"type":"object","properties":{"mode":{"type":"string","enum":["SIP","PHONE_NUMBER","HANDOVER_TO_FLOW"]},"destination":{"type":"object","additionalProperties":{}},"handoverFlowApiId":{"type":"string"},"transferPlan":{"$ref":"#/components/schemas/ForwardCallTransferPlan"},"handoffTransferMode":{"type":"string","enum":["ROLLING_HISTORY","SWAP_SYSTEM_MESSAGE","DELETE_HISTORY","FULL_CLEANUP"]}}},"ForwardCallFallbackPlan":{"type":"object","properties":{"message":{"type":"string"},"endCallEnabled":{"type":"boolean"}}},"ForwardCallSummaryPlan":{"type":"object","properties":{"enabled":{"type":"boolean"},"instructions":{"type":"string"},"timeoutSeconds":{"type":"number","format":"double"}}},"ForwardCallTransferPlan":{"type":"object","properties":{"mode":{"type":"string","enum":["BLIND_TRANSFER","WARM_TRANSFER_WITH_SUMMARY","WARM_TRANSFER_WITH_MESSAGE","WARM_TRANSFER_WAIT_FOR_OPERATOR_TO_SPEAK_FIRST_AND_THEN_SAY_MESSAGE","WARM_TRANSFER_WAIT_FOR_OPERATOR_TO_SPEAK_FIRST_AND_THEN_SAY_SUMMARY","WARM_TRANSFER_WITH_TWIML","WARM_TRANSFER_EXPERIMENTAL","WARM_TRANSFER"]},"operatorMessage":{"type":"string"},"timeoutSeconds":{"type":"integer","format":"int32"},"dialTimeoutSeconds":{"type":"integer","format":"int32"},"sipVerb":{"type":"string"},"sipHeadersInReferToEnabled":{"type":"boolean"},"holdAudioUrl":{"type":"string"},"transferCompleteAudioUrl":{"type":"string"},"twiml":{"type":"string"},"summaryPlan":{"$ref":"#/components/schemas/ForwardCallSummaryPlan"},"fallbackPlan":{"$ref":"#/components/schemas/ForwardCallFallbackPlan"},"voicemailDetectionType":{"type":"string","enum":["AUDIO","TRANSCRIPT"]},"transferLanguage":{"type":"string"},"transferVoiceId":{"type":"string"}}},"ToolDefinition":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"groupName":{"type":"string"},"iconKey":{"type":"string"},"iconColor":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ToolParameter"}},"returnValue":{"$ref":"#/components/schemas/ToolReturnValue"},"toolType":{"type":"string","enum":["FUNCTION","EXTERNAL_API_CALL","FORWARD_CALL"]},"toolSubtype":{"type":"string","enum":["SYSTEM","APPLICATION","CUSTOM"]},"isAsync":{"type":"boolean"},"internalOnly":{"type":"boolean"},"asyncReturnType":{"type":"string","enum":["ACK_ONLY","CONFIRM_EXECUTION_ONLY","DIRECTLY_SAY_INTO_CONVERSATION","INDIRECTLY_ENRICH_CONVERSATION","SILENTLY_ENRICH_CONVERSATION"]},"messages":{"$ref":"#/components/schemas/ToolMessages"},"executionPlan":{"type":"array","items":{"type":"object","additionalProperties":{}}},"integrations":{"type":"array","items":{"type":"object","additionalProperties":{}}},"integrationCredentialLinks":{"type":"array","items":{"type":"object","additionalProperties":{}}},"forwardCallConfig":{"$ref":"#/components/schemas/ForwardCallConfig"},"aimetaHint":{"$ref":"#/components/schemas/ToolMetaHint"},"apiMethod":{"type":"string"},"apiUrl":{"type":"string"},"apiTimeoutSeconds":{"type":"integer","format":"int32"},"toolCallTimeoutSeconds":{"type":"integer","format":"int32"},"requiresConfirmedTranscript":{"type":"boolean"},"confirmedTranscriptTimeoutMs":{"type":"integer","format":"int32"},"proactiveLookupEnabled":{"type":"boolean"},"prompts":{"type":"array","items":{"$ref":"#/components/schemas/ToolPrompt"}},"toolResultCacheConfig":{"$ref":"#/components/schemas/ToolResultCacheConfig"},"toolConcurrencyConfig":{"$ref":"#/components/schemas/ConcurrencyControlConfig"},"concurrencyLimitFallbackMessage":{"type":"string"},"mockConfig":{"type":"object","additionalProperties":{}},"apiHeaders":{"type":"object","additionalProperties":{}},"apiBody":{"type":"object","additionalProperties":{}},"sourceBuiltinToolKey":{"type":"string"},"applicationType":{"type":"string"},"applicationId":{"type":"string","format":"uuid"},"requiresFollowUp":{"type":"boolean"},"hideFromChatTimeline":{"type":"boolean"},"discloseOutputSchema":{"type":"boolean"},"requiresSandbox":{"type":"boolean"},"anonymizeInChatTimeline":{"type":"boolean"},"haltOnStepError":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"catalogInclusionModes":{"type":"array","items":{"type":"string"}},"isSystem":{"type":"boolean"},"userId":{"type":"string","format":"uuid"},"version":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"createdByAi":{"type":"boolean"},"networkAllowList":{"type":"array","items":{"type":"string"}},"creatorAgentId":{"type":"string","format":"uuid"},"creatorFlowId":{"type":"string","format":"uuid"}}},"ToolMessages":{"type":"object","properties":{"requestStart":{"type":"string"},"requestStartMode":{"type":"string","enum":["NATURAL","EXACT","SILENT"]},"silentRequestStart":{"type":"boolean"},"requestStartBlocking":{"type":"boolean"},"requestDelayed":{"type":"string"},"silentRequestDelayed":{"type":"boolean"},"requestDelayedTimingMilliseconds":{"type":"integer","format":"int32"},"requestComplete":{"type":"string"},"silentRequestComplete":{"type":"boolean"},"requestFailed":{"type":"string"},"silentRequestFailed":{"type":"boolean"},"requestAcknowledgements":{"type":"array","items":{"type":"string"}},"requestAcknowledgementIntervalMilliseconds":{"type":"integer","format":"int32"},"silentRequestAcknowledgement":{"type":"boolean"},"sounds":{"$ref":"#/components/schemas/ToolSoundSet"},"requestStartSound":{"type":"string","deprecated":true},"requestStartSoundVolume":{"type":"integer","format":"int32","deprecated":true}}},"ToolMetaHint":{"type":"object","properties":{"usageDescription":{"type":"string"},"returnDescription":{"type":"string"}}},"ToolParameter":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"enumValues":{"type":"array","items":{"type":"string"}},"iconKey":{"type":"string"},"schema":{"type":"object","additionalProperties":{}}}},"ToolPrompt":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}}},"ToolResultCacheConfig":{"type":"object","properties":{"enabled":{"type":"boolean"},"ttlSeconds":{"type":"integer","format":"int32"},"refreshOnError":{"type":"boolean"},"varyByParameters":{"type":"boolean"},"cacheKeyParameterNames":{"type":"array","items":{"type":"string"}}}},"ToolReturnValue":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","additionalProperties":{}}}},"ToolSoundCue":{"type":"object","properties":{"sound":{"type":"string"},"volume":{"type":"integer","format":"int32"},"configured":{"type":"boolean"}}},"ToolSoundSet":{"type":"object","properties":{"preStart":{"$ref":"#/components/schemas/ToolSoundCue"},"start":{"$ref":"#/components/schemas/ToolSoundCue"},"during":{"$ref":"#/components/schemas/ToolSoundCue"},"delayed":{"$ref":"#/components/schemas/ToolSoundCue"},"acknowledgement":{"$ref":"#/components/schemas/ToolSoundCue"},"complete":{"$ref":"#/components/schemas/ToolSoundCue"},"failed":{"$ref":"#/components/schemas/ToolSoundCue"},"callback":{"$ref":"#/components/schemas/ToolSoundCue"},"duringIntervalMilliseconds":{"type":"integer","format":"int32"},"empty":{"type":"boolean"}}},"StructuredOutput":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"schema":{"type":"object","additionalProperties":{}},"remoteId":{"type":"string"},"userId":{"type":"string","format":"uuid"},"version":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"RingAgentsConfig":{"type":"object","properties":{"ringSeconds":{"type":"integer","format":"int32"},"whenNoAgentOnline":{"type":"string","enum":["AI","FORWARD","HANGUP","WAIT"]},"whenNoAnswer":{"type":"string","enum":["AI","FORWARD","HANGUP","WAIT"]},"whenAllDecline":{"type":"string","enum":["AI","FORWARD","HANGUP","WAIT"]},"forwardTarget":{"type":"string","enum":["AGENT","NUMBER"]},"forwardSubUserId":{"type":"string","format":"uuid"},"forwardNumber":{"type":"string"},"forwardRingSeconds":{"type":"integer","format":"int32"},"whenForwardFails":{"type":"string","enum":["AI","FORWARD","HANGUP","WAIT"]},"forwardShowsContactNumber":{"type":"boolean"}}},"UpdatePhoneNumberRequest":{"type":"object","properties":{"label":{"type":"string"},"poolLabel":{"type":"string"},"purpose":{"type":"string"},"voiceAiProvider":{"type":"string"},"sipServer":{"type":"string"},"sipPort":{"type":"integer","format":"int32"},"sipUsername":{"type":"string"},"sipPassword":{"type":"string"},"sipSoftphoneEnabled":{"type":"boolean"},"twilioAccountSid":{"type":"string"},"twilioAuthToken":{"type":"string"},"twilioVoiceApiKeySid":{"type":"string"},"twilioVoiceApiKeySecret":{"type":"string"},"twilioVoiceAppSid":{"type":"string"},"smsEnabled":{"type":"boolean"},"smsAutoReplyMode":{"type":"string"},"smsAutoReplyWindowStart":{"type":"string"},"smsAutoReplyWindowEnd":{"type":"string"},"whatsappEnabled":{"type":"boolean"},"whatsappProvider":{"type":"string"},"disconnectWhatsapp":{"type":"boolean"},"whatsappFlowId":{"type":"string","format":"uuid"},"whatsappMetaPhoneNumberId":{"type":"string"},"whatsappMetaAccessToken":{"type":"string"},"whatsappMetaVerifyToken":{"type":"string"},"whatsappMetaAppSecret":{"type":"string"},"whatsappAutoReplyMode":{"type":"string"},"whatsappAutoReplyWindowStart":{"type":"string"},"whatsappAutoReplyWindowEnd":{"type":"string"},"telnyxApiKey":{"type":"string"},"vonageApiKey":{"type":"string"},"vonageApiSecret":{"type":"string"},"assignedAgentId":{"type":"string","format":"uuid"},"unassignAgent":{"type":"boolean"},"assignedOutboundAgentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"clearOutboundAgents":{"type":"boolean"},"inboundBehavior":{"type":"string"},"forwardNumber":{"type":"string"},"ringAgentsConfig":{"$ref":"#/components/schemas/RingAgentsConfig"},"overrideConcurrencyLimits":{"type":"boolean"},"maxOutbound":{"type":"integer","format":"int32"},"maxInbound":{"type":"integer","format":"int32"},"releasePoolAssignment":{"type":"boolean"},"externalServerUrl":{"type":"string"},"externalServerSecretHeader":{"type":"string"},"externalServerSecretValue":{"type":"string"},"clearExternalServerSecret":{"type":"boolean"}}},"PhoneNumberResponse":{"type":"object","description":"A phone number assigned to the account, including provider details and current concurrency state","properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the phone number record","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"number":{"type":"string","description":"The phone number in E.164 format","example":"+15551234567"},"label":{"type":"string","description":"Optional human-readable label for this number","example":"Main Sales Line"},"poolLabel":{"type":"string","description":"Internal pool label, set by the number's owner and never exposed to the assigned user. Only populated for pool-managed numbers viewed by their owner or a platform admin.","example":"Carrier bundle DE-04"},"purpose":{"type":"string","description":"The purpose of this number — one of OUTBOUND, INBOUND, BOTH","example":"OUTBOUND"},"provider":{"type":"string","description":"Telephony provider identifier (e.g. twilio, telnyx, vonage, sip)","example":"twilio"},"providerDisplay":{"type":"string","description":"Display-oriented provider label for the current viewer"},"voiceAiProvider":{"type":"string","description":"Voice AI provider currently assigned to this number","example":"P_KITALK_LOCAL"},"poolManaged":{"type":"boolean","description":"Whether this phone number belongs to the managed pool inventory"},"credentialDetailsHidden":{"type":"boolean","description":"Whether provider credential details are hidden for the current viewer"},"poolSuggestBlockedUntil":{"type":"string","format":"date-time","description":"When set, the pool number should not be suggested before this timestamp"},"allowedClaimUserIds":{"type":"array","description":"Optional allowlist of user IDs that may claim this pool number; empty means everyone in scope","items":{"type":"string","format":"uuid"}},"frozen":{"type":"boolean","description":"When true, this number is temporarily locked and cannot initiate new calls"},"disabled":{"type":"boolean","description":"When true, this number is administratively disabled and will not be used"},"onCall":{"type":"boolean","description":"Whether this number currently has an active call in progress"},"activeOutbound":{"type":"integer","format":"int32","description":"Number of outbound calls currently active on this number"},"activeInbound":{"type":"integer","format":"int32","description":"Number of inbound calls currently active on this number"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when this number was added to the account"},"lastUsedAt":{"type":"string","format":"date-time","description":"Timestamp of the last call made or received on this number"},"assignedAgentId":{"type":"string","format":"uuid","description":"UUID of the AI agent assigned to handle inbound calls on this number"},"assignedAgentName":{"type":"string","description":"Display name of the inbound assigned agent"},"assignedOutboundAgentIds":{"type":"array","description":"UUIDs of agents assigned to make outbound calls from this number","items":{"type":"string","format":"uuid"}},"assignedOutboundAgentNames":{"type":"array","description":"Display names of agents assigned to make outbound calls from this number","items":{"type":"string"}},"assignedUserId":{"type":"string","format":"uuid","description":"UUID of the assigned user, when present"},"assignedUserEmail":{"type":"string","description":"Email of the assigned user, when present"},"assignedUserName":{"type":"string","description":"Display name of the assigned user, when present"},"ownerId":{"type":"string","format":"uuid","description":"UUID of the owner account"},"ownerEmail":{"type":"string","description":"Email of the owner account"},"ownerName":{"type":"string","description":"Display name of the owner account"},"inboundBehavior":{"type":"string","description":"How inbound calls are handled — one of: AGENT (route to AI), FORWARD (forward to another number)","example":"AGENT"},"forwardNumber":{"type":"string","description":"If inboundBehavior is FORWARD, the destination phone number to forward calls to","example":"+15559876543"},"ringAgentsConfig":{"$ref":"#/components/schemas/RingAgentsConfig","description":"If inboundBehavior is RING_AGENTS: how long the agents' softphones ring, and what happens when none of them takes the call (AI agent, forward to a phone, hang up)"},"externalServerUrl":{"type":"string","description":"External server URL to contact for inbound call routing"},"externalServerSecretHeader":{"type":"string","description":"HTTP header key to include in external webhook request for security verification"},"externalServerSecretValueSet":{"type":"boolean","description":"Whether a secret header value is configured"},"sipTrunkCredentialId":{"type":"string","format":"uuid","description":"UUID of the SIP trunk credential linked to this number (if SIP provider)"},"sipServer":{"type":"string","description":"SIP server hostname or IP for this trunk","example":"sip.example.com"},"sipCredentialAuth":{"type":"boolean","description":"True if SIP authentication uses username/password; false if IP-based authentication"},"sipRegistration":{"type":"boolean","description":"Whether SIP registration is enabled on this trunk"},"sipSoftphoneEnabled":{"type":"boolean","description":"Whether this SIP-trunk number is enabled for the browser softphone"},"outboundLeadingPlus":{"type":"boolean","description":"Whether outbound calls dial the destination with a leading + (E.164)"},"callerIdLeadingPlus":{"type":"boolean","description":"Whether the outbound caller-ID (From) carries a leading +"},"outboundSipServer":{"type":"string","description":"Separate outbound (termination) SIP server, if configured"},"outboundSipPort":{"type":"integer","format":"int32","description":"Separate outbound SIP port, if configured"},"outboundCredentialAuth":{"type":"boolean","description":"Whether a separate outbound username is set (password never returned)"},"useUsernameAsCallerId":{"type":"boolean","description":"Use the main SIP username 1-to-1 as the outbound caller-ID (From)"},"useOutboundUsernameAsCallerId":{"type":"boolean","description":"Use the outbound SIP username 1-to-1 as the outbound caller-ID (From)"},"sipRoutingProvider":{"type":"string","description":"Provider-specific SIP routing mode (NORMAL, SIPGATE, …)"},"sipUsernameHint":{"type":"string","description":"SIP auth username (plaintext index, non-sensitive — password is never returned)"},"twilioAccountSidHint":{"type":"string","description":"Masked Twilio Account SID hint (last 4 chars shown)","example":"****xxxx"},"twilioAuthTokenSet":{"type":"boolean","description":"Whether a Twilio Auth Token is configured for this number"},"twilioVoiceApiKeySid":{"type":"string","description":"Twilio Voice API Key SID (plaintext, not secret)","example":"SKxxxxxxxxxxxxxxxx"},"twilioVoiceApiKeySecretSet":{"type":"boolean","description":"Whether a Twilio Voice API Key Secret is configured for this number"},"twilioVoiceAppSid":{"type":"string","description":"Twilio TwiML App SID used for softphone outgoing calls","example":"APxxxxxxxxxxxxxxxx"},"smsEnabled":{"type":"boolean","description":"Whether SMS chat is enabled on this number"},"smsProvider":{"type":"string","description":"Associated SMS integration provider for this number"},"smsReady":{"type":"boolean","description":"Whether SMS routing is fully live and ready to receive messages on this number"},"smsAutoReplyMode":{"type":"string","description":"How SMS auto replies behave on this number"},"smsAutoReplyWindowStart":{"type":"string","description":"When SMS auto replies are paused by time window, the start time in HH:mm format"},"smsAutoReplyWindowEnd":{"type":"string","description":"When SMS auto replies are paused by time window, the end time in HH:mm format"},"whatsappEnabled":{"type":"boolean","description":"Whether WhatsApp chat is enabled on this number"},"whatsappProvider":{"type":"string","description":"Active WhatsApp integration provider for this number"},"whatsappReady":{"type":"boolean","description":"Whether WhatsApp routing is fully live and ready to receive messages on this number"},"whatsappAutoReplyMode":{"type":"string","description":"How WhatsApp auto replies behave on this number"},"whatsappAutoReplyWindowStart":{"type":"string","description":"When WhatsApp auto replies are paused by time window, the start time in HH:mm format"},"whatsappAutoReplyWindowEnd":{"type":"string","description":"When WhatsApp auto replies are paused by time window, the end time in HH:mm format"},"whatsappFlowId":{"type":"string","format":"uuid","description":"Flow UUID used for inbound WhatsApp chat on this number"},"whatsappFlowName":{"type":"string","description":"Flow name used for inbound WhatsApp chat on this number"},"whatsappMetaPhoneNumberId":{"type":"string","description":"Meta Cloud API phone number ID when direct Meta integration is configured"},"whatsappMetaWabaId":{"type":"string","description":"Meta WhatsApp Business Account ID captured during Embedded Signup"},"whatsappMetaBusinessId":{"type":"string","description":"Meta Business Portfolio ID captured during Embedded Signup"},"whatsappMetaVerifyToken":{"type":"string","description":"Meta Cloud API verify token used for webhook verification"},"whatsappMetaAccessTokenSet":{"type":"boolean","description":"Whether a Meta Cloud API access token is configured for this number"},"whatsappMetaAppSecretSet":{"type":"boolean","description":"Whether a Meta Cloud API app secret is configured for this number"},"telnyxApiKeyHint":{"type":"string","description":"Masked Telnyx API key hint (last 4 chars shown)","example":"****xxxx"},"vonageApiKeyHint":{"type":"string","description":"Masked Vonage API key hint (last 4 chars shown)","example":"****xxxx"},"vonageApiSecretHint":{"type":"string","description":"Masked Vonage API secret hint (last 4 chars shown)","example":"****xxxx"},"vonageApplicationId":{"type":"string","description":"Auto-managed Vonage Voice Application ID used for local voice routing"},"vonageApplicationPrivateKeySet":{"type":"boolean","description":"Whether an auto-managed Vonage Voice Application private key is stored"},"providerCredentialId":{"type":"string","description":"Internal provider credential identifier, if applicable"},"overrideConcurrencyLimits":{"type":"boolean","description":"When true, this number uses custom concurrency limits instead of the account defaults"},"maxOutbound":{"type":"integer","format":"int32","description":"Maximum simultaneous outbound calls allowed on this number (null = use account default)"},"maxInbound":{"type":"integer","format":"int32","description":"Maximum simultaneous inbound calls allowed on this number (null = use account default)"}}},"Flow":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer","format":"int32"},"name":{"type":"string"},"description":{"type":"string"},"iconKey":{"type":"string"},"iconColor":{"type":"string"},"apiId":{"type":"string"},"variableIds":{"type":"array","items":{"type":"string","format":"uuid"}},"structuredOutputIds":{"type":"array","items":{"type":"string","format":"uuid"}},"structuredInputIds":{"type":"array","items":{"type":"string","format":"uuid"}},"promptModuleIds":{"type":"array","items":{"type":"string","format":"uuid"}},"toolIds":{"type":"array","items":{"type":"string","format":"uuid"}},"dataSourceIds":{"type":"array","items":{"type":"string","format":"uuid"}},"pronunciationDictionaryIds":{"type":"array","items":{"type":"string","format":"uuid"}},"actionTriggerIds":{"type":"array","items":{"type":"string","format":"uuid"}},"localPronunciationDictionaries":{"type":"array","items":{"type":"object","additionalProperties":{}}},"localActionTriggers":{"type":"array","items":{"type":"object","additionalProperties":{}}},"actionTriggerStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"builtinToolIds":{"type":"array","items":{"type":"string"}},"localPromptModules":{"type":"array","items":{"type":"object","additionalProperties":{}}},"localTools":{"type":"array","items":{"type":"object","additionalProperties":{}}},"toolIntegrationCredentialLinks":{"type":"object","additionalProperties":{}},"toolActivationOverrides":{"type":"object","additionalProperties":{"type":"boolean"}},"toolMockModeOverrides":{"type":"object","additionalProperties":{"type":"boolean"}},"sessionStates":{"type":"array","items":{"type":"object","additionalProperties":{}}},"toolStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"toolExecutionGuards":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"toolAttachmentSettings":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Per attached tool, keyed like toolStateVisibilityRules: {runOnVoice, options}. runOnVoice: on the realtime speech engine, the voice model calls the tool itself instead of the brain (screen tools default to true). options: the tool's own settings."},"outputStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"promptModuleStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"evaluationIds":{"type":"array","items":{"type":"string","format":"uuid"}},"evaluationStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"stateGraph":{"type":"object","additionalProperties":{}},"evaluationEnforcement":{"type":"string"},"skillIds":{"type":"array","items":{"type":"string","format":"uuid"}},"builtinSkillIds":{"type":"array","items":{"type":"string"}},"localSkills":{"type":"array","items":{"type":"object","additionalProperties":{}}},"skillActivationOverrides":{"type":"object","additionalProperties":{"type":"boolean"}},"skillLoadingModeOverrides":{"type":"object","additionalProperties":{"type":"string"}},"skillRealtimeVoiceOverrides":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Realtime speech engine: per attached Skill, keyed like skillLoadingModeOverrides (global::<skillId>, local::<name>, sys::<name>), true puts a fully loaded Skill's content into the realtime voice's prompt too. Absent or false: the brain behind the voice holds it and the voice sees a catalog line."},"skillLifecycleOverrides":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"skillInclusionModeOverrides":{"type":"object","additionalProperties":{"type":"string"}},"skillChildInclusionModeOverrides":{"type":"object","additionalProperties":{"type":"string"}},"knowledgeBaseLifecycleOverrides":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"skillStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"mcpServerIds":{"type":"array","items":{"type":"string","format":"uuid"}},"localMcpServers":{"type":"array","items":{"type":"object","additionalProperties":{}}},"multimediaLinks":{"type":"array","items":{"type":"object","additionalProperties":{}}},"mcpActivationOverrides":{"type":"object","additionalProperties":{"type":"boolean"}},"mcpExposureModeOverrides":{"type":"object","additionalProperties":{"type":"string"}},"mcpToolFilterOverrides":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"mcpInclusionOverrides":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"mcpStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"smartMcpConfig":{"type":"object","additionalProperties":{}},"conversationMemoryConfig":{"type":"object","additionalProperties":{}},"contextAttachments":{"type":"array","items":{"type":"object","additionalProperties":{}}},"agenticConfig":{"type":"object","additionalProperties":{}},"artificialSkillCatalogEnabled":{"type":"boolean"},"skillLoadToolEnabled":{"type":"boolean"},"skillReadToolEnabled":{"type":"boolean"},"skillManagementToolsEnabled":{"type":"boolean"},"localVariables":{"type":"array","items":{"type":"object","additionalProperties":{}}},"localStructuredOutputs":{"type":"array","items":{"type":"object","additionalProperties":{}}},"localStructuredInputs":{"type":"array","items":{"type":"object","additionalProperties":{}}},"dataSources":{"type":"array","items":{"type":"object","additionalProperties":{}}},"knowledgeBase":{"type":"object","additionalProperties":{}},"apiConfig":{"type":"object","additionalProperties":{}},"infrastructurePreferences":{"type":"object","additionalProperties":{}},"workAutonomyConfig":{"type":"object","additionalProperties":{}},"automaticLearningConfig":{"type":"object","additionalProperties":{}},"workCompactionLearningConfig":{"type":"object","additionalProperties":{}},"sandboxConfig":{"type":"object","additionalProperties":{}},"sandboxDefinitionId":{"type":"string","format":"uuid"},"browserConfig":{"type":"object","additionalProperties":{}},"databaseConfig":{"type":"object","additionalProperties":{}},"databaseDefinitionId":{"type":"string","format":"uuid"},"workTaskMode":{"type":"string"},"knowledgeBaseRefs":{"type":"array","items":{"type":"object","additionalProperties":{}}},"knowledgeBaseStateVisibilityRules":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"masterPrompt":{"type":"string"},"realtimeMasterPrompt":{"type":"string","description":"Realtime speech engine, dual master prompt mode: the realtime voice model's own prompt. masterPrompt stays the prompt of the brain behind the voice (which runs every tool) and of every other engine and channel. Used only while infrastructurePreferences.speechEngine is \"realtime\" and infrastructurePreferences.realtimeDualMasterPrompt is true; blank falls back to masterPrompt."},"firstMessage":{"type":"string"},"aiDisclosureEnabled":{"type":"boolean"},"aiDisclosurePresetId":{"type":"string"},"aiDisclosurePlaceholderValues":{"type":"object","additionalProperties":{"type":"string"}},"aiDisclosureCustomText":{"type":"string"},"aiDisclosurePrependText":{"type":"string"},"aiDisclosureAppendText":{"type":"string"},"voicemailMessage":{"type":"string"},"voicemailDetectionEnabled":{"type":"boolean"},"voicemailDetectionMethod":{"type":"string","enum":["STANDARD","BEEP"]},"keypadInputEnabled":{"type":"boolean"},"keypadInputTimeoutSeconds":{"type":"number","format":"double"},"keypadInputDelimiters":{"type":"array","items":{"type":"string"}},"endSessionTriggerPhrase":{"type":"string"},"endSessionMessage":{"type":"string"},"masterPromptBackgroundSystemContextAutoAppended":{"type":"boolean"},"timeZone":{"type":"string"},"systemOutputEnabled":{"type":"boolean"},"stateContextMapEnabled":{"type":"boolean"},"stateContextJourneyEnabled":{"type":"boolean"},"stateContextConfig":{"type":"object","additionalProperties":{}},"backgroundContextInjectionToolRefs":{"type":"array","items":{"type":"string"}},"backgroundContextInjectionToolArgs":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},"language":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"voiceId":{"type":"string"},"channelMode":{"type":"string"},"hybridVoiceChatInteractionsEnabled":{"type":"boolean"},"firstMessageMode":{"type":"string"},"forwardingPhoneNumber":{"type":"string"},"userId":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"isTemplate":{"type":"boolean"},"referenceFlowId":{"type":"string","format":"uuid"},"bornFromTemplate":{"type":"boolean"},"templateDescription":{"type":"string"},"templatePublicTitle":{"type":"string"},"templateIcon":{"type":"string"},"templateImageUrl":{"type":"string"},"templateIllustrationUrl":{"type":"string"},"templateTags":{"type":"array","items":{"type":"string"}},"supportedLanguages":{"type":"array","items":{"type":"string"}},"templatePublished":{"type":"boolean"},"templatePublicationLabel":{"type":"string"},"templateOverrideState":{"$ref":"#/components/schemas/FlowTemplateOverrideState"},"templateDetachMode":{"type":"string"},"templateDetachSourceFlowId":{"type":"string","format":"uuid"},"defaultApplicationId":{"type":"string","format":"uuid"},"archived":{"type":"boolean"},"favorite":{"type":"boolean"},"backgroundSound":{"type":"string"},"silenceTimeoutSeconds":{"type":"integer","format":"int32"},"flowTriggers":{"type":"array","items":{"type":"object","additionalProperties":{}}},"maxDurationSeconds":{"type":"integer","format":"int32"},"chatSessionTimeoutSeconds":{"type":"integer","format":"int32"},"threadHistoryRememberingMode":{"type":"string"},"threadHistorySessionLimit":{"type":"integer","format":"int32"},"threadHistoryMessageLimit":{"type":"integer","format":"int32"},"backgroundDenoisingEnabled":{"type":"boolean"},"recordingEnabled":{"type":"boolean"},"transcriptStorageEnabled":{"type":"boolean"},"modelOutputInMessagesEnabled":{"type":"boolean"},"defaultTestCallPresetId":{"type":"string","format":"uuid"},"defaultTestCallPresetEnabled":{"type":"boolean"},"defaultTestChatPresetId":{"type":"string","format":"uuid"},"defaultTestChatPresetEnabled":{"type":"boolean"},"defaultTestCallSimulatedDirection":{"type":"string"},"defaultTestChatSimulatedDirection":{"type":"string"},"defaultTestCallFromPhoneNumber":{"type":"string"},"defaultTestCallToPhoneNumber":{"type":"string"},"confidenceThreshold":{"type":"number","format":"double"},"profanityFilterEnabled":{"type":"boolean"},"temperature":{"type":"number","format":"double"},"waitSeconds":{"type":"number","format":"double"},"onPunctuationSeconds":{"type":"number","format":"double"},"onNoPunctuationSeconds":{"type":"number","format":"double"},"onNumberSeconds":{"type":"number","format":"double"},"onNumberDictationOnly":{"type":"boolean"},"pitch":{"type":"number","format":"double"},"speed":{"type":"number","format":"double"},"volume":{"type":"number","format":"double"},"inputMinCharacters":{"type":"integer","format":"int32"},"voiceSeconds":{"type":"number","format":"double"},"backoffSeconds":{"type":"number","format":"double"},"numWords":{"type":"integer","format":"int32"},"acknowledgementPhrases":{"type":"array","items":{"type":"string"}},"interruptionPhrases":{"type":"array","items":{"type":"string"}},"interruptionTailGuardEnabled":{"type":"boolean"},"interruptionTailGuardMs":{"type":"integer","format":"int32"},"voiceToolTurnMaxTokens":{"type":"integer","format":"int32"},"voiceReplyMaxTokens":{"type":"integer","format":"int32"},"pageReadTrimEnabled":{"type":"boolean"},"pageReadTrimThresholdTokens":{"type":"integer","format":"int32"},"pronunciationDictionary":{"type":"array","items":{"type":"object","additionalProperties":{}}},"onCallBeginToolRefs":{"type":"array","items":{"type":"string"}},"onCallBeginToolId":{"type":"string","format":"uuid"},"onCallEndToolRefs":{"type":"array","items":{"type":"string"}},"onCallEndToolId":{"type":"string","format":"uuid"},"onCallFailedToolRefs":{"type":"array","items":{"type":"string"}},"onCallFailedToolId":{"type":"string","format":"uuid"},"onNoAnswerToolRefs":{"type":"array","items":{"type":"string"}},"onNoAnswerToolId":{"type":"string","format":"uuid"},"onCallAttemptToolRefs":{"type":"array","items":{"type":"string"}},"onCallAttemptToolId":{"type":"string","format":"uuid"},"onChatStartToolRefs":{"type":"array","items":{"type":"string"}},"onChatStartToolId":{"type":"string","format":"uuid"},"onChatEndToolRefs":{"type":"array","items":{"type":"string"}},"onChatEndToolId":{"type":"string","format":"uuid"},"onSessionBeginToolRefs":{"type":"array","items":{"type":"string"}},"onSessionBeginToolId":{"type":"string","format":"uuid"},"onSessionEndToolRefs":{"type":"array","items":{"type":"string"}},"onSessionEndToolId":{"type":"string","format":"uuid"},"onWorkBeginToolRefs":{"type":"array","items":{"type":"string"}},"onWorkEndToolRefs":{"type":"array","items":{"type":"string"}},"onWorkFailedToolRefs":{"type":"array","items":{"type":"string"}},"onWorkCancelledToolRefs":{"type":"array","items":{"type":"string"}},"onWorkNeedsAttentionToolRefs":{"type":"array","items":{"type":"string"}},"onAfterAiAnalysisToolRefs":{"type":"array","items":{"type":"string"}},"onAfterAiAnalysisToolId":{"type":"string","format":"uuid"},"onHumanSupportRequestedToolRefs":{"type":"array","items":{"type":"string"}},"onHumanSupportRequestedToolId":{"type":"string","format":"uuid"},"onStateChangeToolRefs":{"type":"array","items":{"type":"string"}},"onStateChangeToolId":{"type":"string","format":"uuid"},"onSessionStartActions":{"type":"array","items":{"type":"object","additionalProperties":{}}},"onStateAlignmentToolRefs":{"type":"array","items":{"type":"string"}},"onStateAlignmentToolId":{"type":"string","format":"uuid"},"mermaidCode":{"type":"string"},"mermaidStatus":{"type":"string","enum":["NOT_GENERATED","PENDING","READY","FAILED"]},"mermaidError":{"type":"string"},"mermaidRequestedAt":{"type":"string","format":"date-time"},"mermaidGeneratedAt":{"type":"string","format":"date-time"},"aiEditable":{"type":"boolean"},"createdByAi":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"templateConfigIds":{"type":"array","items":{"type":"string","format":"uuid"}},"localTemplateConfigs":{"type":"array","items":{"type":"object","additionalProperties":{}}},"templateConfigScopeEnabled":{"type":"boolean"}}},"FlowTemplateOverrideState":{"type":"object","properties":{"schemaVersion":{"type":"integer","format":"int32"},"masterPrompt":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"realtimeMasterPrompt":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"firstMessage":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"voicemailMessage":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"endSessionTriggerPhrase":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"endSessionMessage":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"channelMode":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"language":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"voiceId":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"firstMessageMode":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"knowledgeBase":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"api":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"eventTriggers":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"callAdvanced":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"chatAdvanced":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"},"promptModules":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"variables":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"toolCredentialLinks":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"pronunciationDictionaries":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"pronunciationDictionaryEntries":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"templateConfigParameters":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}},"templateConfigConditionalContents":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/FlowTemplateOverrideToggle"}}}},"FlowTemplateOverrideToggle":{"type":"object","properties":{"enabled":{"type":"boolean"},"owned":{"type":"boolean"}}},"ItemRequest":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"scope":{"type":"string"},"type":{"type":"string"},"sourceConfig":{"type":"object","additionalProperties":{}},"attachToFlow":{"type":"boolean"}}},"KnowledgeBaseItemDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"flowId":{"type":"string","format":"uuid"},"agentId":{"type":"string","format":"uuid"},"scope":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"sourceConfig":{"type":"object","additionalProperties":{}},"extractedArtifact":{"type":"object","additionalProperties":{}},"lastExtractedAt":{"type":"string","format":"date-time"},"lastError":{"type":"string"},"chunkCount":{"type":"integer","format":"int32"},"attached":{"type":"boolean"},"version":{"type":"integer","format":"int32"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreatePhoneNumberRequest":{"type":"object","properties":{"provider":{"type":"string"},"numbers":{"type":"string"},"label":{"type":"string"},"poolLabel":{"type":"string"},"purpose":{"type":"string"},"voiceAiProvider":{"type":"string"},"poolManaged":{"type":"boolean"},"poolPhoneNumberId":{"type":"string","format":"uuid"},"sipTrunkCredentialId":{"type":"string","format":"uuid"},"sipServer":{"type":"string"},"sipPort":{"type":"integer","format":"int32"},"sipUsername":{"type":"string"},"sipPassword":{"type":"string"},"sipRegistration":{"type":"boolean"},"registrationDomain":{"type":"string"},"registrationUsername":{"type":"string"},"registrationRealm":{"type":"string"},"usePublicIpInContact":{"type":"boolean"},"outboundLeadingPlus":{"type":"boolean"},"callerIdLeadingPlus":{"type":"boolean"},"outboundSipServer":{"type":"string"},"outboundSipPort":{"type":"integer","format":"int32"},"outboundSipUsername":{"type":"string"},"outboundSipPassword":{"type":"string"},"useUsernameAsCallerId":{"type":"boolean"},"useOutboundUsernameAsCallerId":{"type":"boolean"},"sipRoutingProvider":{"type":"string"},"sipSoftphoneEnabled":{"type":"boolean"},"allowNonE164":{"type":"boolean"},"twilioAccountSid":{"type":"string"},"twilioAuthToken":{"type":"string"},"twilioVoiceApiKeySid":{"type":"string"},"twilioVoiceApiKeySecret":{"type":"string"},"twilioVoiceAppSid":{"type":"string"},"smsEnabled":{"type":"boolean"},"whatsappEnabled":{"type":"boolean"},"whatsappProvider":{"type":"string"},"whatsappFlowId":{"type":"string","format":"uuid"},"whatsappMetaPhoneNumberId":{"type":"string"},"whatsappMetaAccessToken":{"type":"string"},"whatsappMetaVerifyToken":{"type":"string"},"whatsappMetaAppSecret":{"type":"string"},"telnyxApiKey":{"type":"string"},"vonageApiKey":{"type":"string"},"vonageApiSecret":{"type":"string"},"externalServerUrl":{"type":"string"},"externalServerSecretHeader":{"type":"string"},"externalServerSecretValue":{"type":"string"}}},"ExternalOutboundChatRequest":{"type":"object","properties":{"flowId":{"type":"string","description":"Flow reference. Accepts either the internal UUID or a flow API ID. Provide exactly one of flowId, flowApiId, or flow."},"flowApiId":{"type":"string","description":"Optional explicit flow API ID. Preferred for external integrations. Provide exactly one of flowId, flowApiId, or flow."},"flow":{"$ref":"#/components/schemas/Flow","description":"Optional inline/transient flow definition — an alternative to flowId/flowApiId for one-off calls/chats that don't need a reusable, dashboard-managed flow. Nothing is written to your flow library; the definition is stored only for the lifetime of this call/chat session (and its thread, for follow-up messages), not TTL'd or auto-deleted otherwise. Provide at most one of flowId, flowApiId, or flow.\n\nAccepts almost the same shape as a flow exported from the dashboard — master prompt, messages, voice/language/timing settings, tools, variables, structured outputs, pronunciation dictionaries, knowledge base, session states, and event-trigger tool refs all work. The following fields are ignored if present, since they don't apply to a one-shot/session-scoped definition: id, apiId, userId, archived, createdAt, updatedAt, projectId, iconKey, iconColor, mermaid* (diagram state), apiConfig (session webhooks — not applicable, this flow is never reused outside its own call/thread), isTemplate, templatePublished, templatePublicationLabel, templatePublicTitle, templateDescription, templateIcon, templateImageUrl, referenceFlowId, bornFromTemplate, templateOverrideState, templateDetachMode, templateDetachSourceFlowId, templateParameterScopeEnabled, supportedLanguages, and the defaultTestCall/Chat* preset fields."},"channel":{"type":"string","description":"Channel to start: CHAT, SMS, or WHATSAPP","example":"WHATSAPP"},"assistantPhoneNumber":{"type":"string","description":"Required for SMS/WHATSAPP. Your sending phone number in E.164 format.","example":"+15557654321"},"contactIdentifier":{"type":"string","description":"Optional external contact/session identifier. Used primarily for CHAT sessions."},"contactName":{"type":"string","description":"Optional contact name"},"contactEmail":{"type":"string","description":"Optional contact email"},"contactPhone":{"type":"string","description":"Required for SMS/WHATSAPP. Optional for CHAT.","example":"+15551234567"},"contextData":{"type":"object","additionalProperties":{},"description":"Optional session memory preloaded before the outbound chat starts. Accessible as contextData.* / sessionMemory.*"},"initialMessage":{"type":"string","description":"Optional explicit opening assistant message. If omitted, the flow's normal initial assistant message logic is used."}}},"ChatMessageResponse":{"type":"object","description":"A single message within a chat session","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of this message"},"role":{"type":"string","description":"Role of the sender (USER, ASSISTANT, SYSTEM, OPERATOR)","enum":["CUSTOMER","ASSISTANT","HUMAN","SYSTEM","TOOL_CALLS","TOOL_CALL_RESULT"]},"content":{"type":"string","description":"Text content of the message"},"messageType":{"type":"string","description":"Type of message (CHAT, EVENT, etc.)","enum":["CHAT","CALL_TRANSCRIPT","CALL_EVENT","SYSTEM"]},"visibility":{"type":"string","description":"Visibility of the message (PUBLIC, INTERNAL)","enum":["PUBLIC","INTERNAL"]},"metadata":{"type":"object","additionalProperties":{},"description":"Metadata associated with this specific message"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"}}},"ChatSessionResponse":{"type":"object","description":"Details of a single chat session","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of this chat session"},"widgetId":{"type":"string","format":"uuid","description":"UUID of the widget that initiated this chat"},"widgetName":{"type":"string","description":"Name of the widget"},"contactIdentifier":{"type":"string","description":"Contact identifier (e.g. cookie, phone, email)"},"status":{"type":"string","description":"Lifecycle status of this session","enum":["STARTED","ENDED","ANALYSED"]},"mode":{"type":"string","description":"Current interaction mode (CHAT, VOICE, HYBRID)","enum":["CHAT","VOICE","HYBRID"]},"aiMode":{"type":"string","description":"AI assistance mode","enum":["AI_ACTIVE","HUMAN_ACTIVE"]},"humanSupportRequested":{"type":"boolean","description":"Whether a human operator has been requested"},"operatorUserId":{"type":"string","format":"uuid","description":"UUID of the human operator assigned to this session (if any)"},"contactName":{"type":"string","description":"Contact name if provided"},"contactEmail":{"type":"string","description":"Contact email if provided"},"contactPhone":{"type":"string","description":"Contact phone if provided"},"summary":{"type":"string","description":"AI-generated summary of the conversation"},"totalMessages":{"type":"integer","format":"int64","description":"Total number of messages in this session"},"durationSeconds":{"type":"integer","format":"int64","description":"Duration of the session in seconds"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last modification"},"lastActivityAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last activity"},"endedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the session ended"},"sessionMemory":{"type":"object","additionalProperties":{},"description":"Session memory captured during the session"},"contextData":{"type":"object","additionalProperties":{},"description":"Legacy alias for session memory"},"metadata":{"type":"object","additionalProperties":{},"description":"Metadata associated with this session"},"outputData":{"type":"object","additionalProperties":{},"description":"Structured results extracted from the conversation"},"cost":{"type":"number","description":"Total cost of AI usage for this session"},"flowId":{"type":"string","format":"uuid","description":"Internal UUID of the flow that handled this session"},"publicShareEnabled":{"type":"boolean","description":"Whether a public share link is enabled for this chat"},"publicShareToken":{"type":"string","format":"uuid","description":"Unique token for the public share link"},"providerCallId":{"type":"string","description":"Public call ID if this session involved a voice call"}}},"OutboundChatTriggerResponse":{"type":"object","description":"Result of a single outbound-chat trigger","properties":{"session":{"$ref":"#/components/schemas/ChatSessionResponse","description":"Created or reused chat session"},"messages":{"type":"array","description":"Visible messages after the trigger, including the seeded assistant opening message when available","items":{"$ref":"#/components/schemas/ChatMessageResponse"}}}},"ExternalOutboundCallRequest":{"type":"object","properties":{"flowId":{"type":"string","description":"Optional flow reference. Accepts either the internal UUID or a flow API ID. If omitted (and `flow` is also omitted), Kilevel uses your default manual-call flow. Provide at most one of flowId, flowApiId, or flow."},"flowApiId":{"type":"string","description":"Optional explicit flow API ID. Preferred for external integrations. Provide at most one of flowId, flowApiId, or flow."},"flow":{"$ref":"#/components/schemas/Flow","description":"Optional inline/transient flow definition — an alternative to flowId/flowApiId for one-off calls/chats that don't need a reusable, dashboard-managed flow. Nothing is written to your flow library; the definition is stored only for the lifetime of this call/chat session (and its thread, for follow-up messages), not TTL'd or auto-deleted otherwise. Provide at most one of flowId, flowApiId, or flow.\n\nAccepts almost the same shape as a flow exported from the dashboard — master prompt, messages, voice/language/timing settings, tools, variables, structured outputs, pronunciation dictionaries, knowledge base, session states, and event-trigger tool refs all work. The following fields are ignored if present, since they don't apply to a one-shot/session-scoped definition: id, apiId, userId, archived, createdAt, updatedAt, projectId, iconKey, iconColor, mermaid* (diagram state), apiConfig (session webhooks — not applicable, this flow is never reused outside its own call/thread), isTemplate, templatePublished, templatePublicationLabel, templatePublicTitle, templateDescription, templateIcon, templateImageUrl, referenceFlowId, bornFromTemplate, templateOverrideState, templateDetachMode, templateDetachSourceFlowId, templateParameterScopeEnabled, supportedLanguages, and the defaultTestCall/Chat* preset fields."},"customerNumber":{"type":"string","description":"Required target phone number in E.164 format","example":"+15551234567"},"fromPhoneNumber":{"type":"string","description":"Optional fixed caller ID / sending phone number in E.164 format","example":"+15557654321"},"allowedPhoneNumbers":{"type":"array","description":"Optional allowlist of caller IDs to use for this row","items":{"type":"string"}},"contactName":{"type":"string","description":"Optional contact name mirrored into rowData.name and rowData.fullName"},"contactEmail":{"type":"string","description":"Optional contact email mirrored into rowData.email"},"rowData":{"type":"object","additionalProperties":{},"description":"Optional row payload made available to the flow as rowData"},"contextData":{"type":"object","additionalProperties":{},"description":"Optional session memory preloaded before the call starts. Accessible later as contextData.* / sessionMemory.*"},"language":{"type":"string","description":"Optional language override for this call"},"voiceId":{"type":"string","description":"Optional voice ID override for this call"},"firstMessageMode":{"type":"string","description":"Optional first-message mode override for this call"}}},"OutboundCallTriggerResponse":{"type":"object","description":"Result of a single outbound-call trigger","properties":{"queued":{"type":"boolean","description":"Whether the call row was accepted into the Manual Calls queue"},"rowId":{"type":"string","format":"uuid","description":"UUID of the created call row"},"status":{"type":"string","description":"Current status of the created call row","enum":["TODO","QUEUED","PLANNED","CALL_INITIATED","RINGING","CALL_STARTED","CALL_ENDED","ERROR","RETRY_PENDING","DONE","DONE_WD","DONE_WC","CANCELLED"]},"jobId":{"type":"string","format":"uuid","description":"UUID of the always-on Manual Calls job that will process this row"},"jobName":{"type":"string","description":"Name of the Manual Calls job"},"flowId":{"type":"string","format":"uuid","description":"UUID of the flow that will handle this call — null when an inline `flow` was used"},"flowApiId":{"type":"string","description":"Public API identifier of the flow that will handle this call — null when an inline `flow` was used"},"ephemeralFlowId":{"type":"string","format":"uuid","description":"Set only when an inline `flow` was provided — the id of the stored ephemeral definition"},"targetPhoneNumber":{"type":"string","description":"Dialed target phone number in E.164 format"}}},"ChatInjectionRequest":{"type":"object","properties":{"text":{"type":"string"},"role":{"type":"string"},"triggerResponse":{"type":"boolean"}}},"VoiceInjectionRequest":{"type":"object","properties":{"text":{"type":"string"},"mode":{"type":"string"}}},"ExternalCallRowData":{"type":"object","properties":{"targetPhoneNumber":{"type":"string","description":"Phone number in E.164 format","example":"+15551234567"},"flowApiId":{"type":"string","description":"Optional per-row flow API ID override. Required for each row when no default flow is provided.","example":"f_last_test_copy"},"allowedCallWindowBegin":{"type":"string","description":"Optional override for start of allowed call window (HH:mm:ss)"},"allowedCallWindowEnd":{"type":"string","description":"Optional override for end of allowed call window (HH:mm:ss)"},"plannedCallDateTime":{"type":"string","format":"date-time","description":"Optional exact timestamp after which this row may be dialed"},"allowedPhoneNumbers":{"type":"array","description":"Optional from-number allowlist for this row. Null/empty means all available.","items":{"type":"string"}},"rowData":{"type":"object","additionalProperties":{},"description":"Data to inject into the call flow"}}},"ExternalCallingJobCreateJsonRequest":{"type":"object","properties":{"flowId":{"type":"string","description":"Optional default flow reference. Accepts the internal UUID or the flow API ID exposed in API responses.","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"flowApiId":{"type":"string","description":"Optional default flow API ID. Preferred for external integrations. Provide either flowId or flowApiId, not both.","example":"f_last_test_copy"},"executionMode":{"type":"string","description":"How to execute the jobs","enum":["IN_PARALLEL","ONE_BY_ONE","ONE_BY_ONE_PAUSED"]},"initialStatus":{"type":"string","description":"The status the job starts in","enum":["ACTIVE","PAUSED","COMPLETED","COMPLETED_PARTIAL","FAILED","CANCELLED"]},"allowedCallWindowStart":{"type":"string","description":"Start of allowed call window (HH:mm:ss)"},"allowedCallWindowEnd":{"type":"string","description":"End of allowed call window (HH:mm:ss)"},"allowedPhoneNumbers":{"type":"array","description":"Optional from-number allowlist. Null/empty means all available.","items":{"type":"string"}},"scheduledAt":{"type":"string","format":"date-time","description":"Optional scheduled start time (ISO)"},"maxConcurrentCalls":{"type":"integer","format":"int32","description":"Max concurrent calls for this job"},"enableRetries":{"type":"boolean","description":"Whether to retry failed calls"},"maxRetries":{"type":"integer","format":"int32","description":"Max number of retries"},"retryDelay":{"type":"integer","format":"int32","description":"Delay between retries in seconds"},"retryOnBusy":{"type":"boolean","description":"Retry if the destination is busy"},"retryOnNoAnswer":{"type":"boolean","description":"Retry if there is no answer"},"retryOnVoicemail":{"type":"boolean","description":"Retry if the call reaches voicemail"},"applicationId":{"type":"string","format":"uuid","description":"Optional application UUID. If omitted, the user's default application is used."},"rows":{"type":"array","description":"The actual call rows. At least one row is required.","items":{"$ref":"#/components/schemas/ExternalCallRowData"}}}},"CallJobResponse":{"type":"object","description":"Summary of a call job","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of the job","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"name":{"type":"string","description":"Custom name assigned to the job","example":"Q1 Outreach"},"originalFileName":{"type":"string","description":"Name or filename used when the job was created","example":"january_leads.csv"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"},"status":{"type":"string","description":"Current lifecycle status of the job","enum":["ACTIVE","PAUSED","COMPLETED","COMPLETED_PARTIAL","FAILED","CANCELLED"]},"executionMode":{"type":"string","description":"How rows in this job are executed","enum":["IN_PARALLEL","ONE_BY_ONE","ONE_BY_ONE_PAUSED"]},"totalRows":{"type":"integer","format":"int32","description":"Total number of call rows in this job"},"processedRows":{"type":"integer","format":"int32","description":"Number of rows that have been processed (regardless of outcome)"},"completedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the last row was processed"},"completionWebhookAttemptCount":{"type":"integer","format":"int32","description":"How many completion webhook delivery attempts have been made for this job"},"completionWebhookLastAttemptAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the most recent completion webhook delivery attempt"},"completionWebhookDeliveredAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the completion webhook was acknowledged with a 2xx response"},"completionWebhookLastStatusCode":{"type":"integer","format":"int32","description":"Most recent HTTP status code returned by the completion webhook endpoint"},"completionWebhookLastError":{"type":"string","description":"Last recorded completion webhook delivery error, if any"},"manualTriggerSecret":{"type":"string","description":"Secret token required to manually trigger this job via webhook"},"allowedCallWindowStart":{"type":"string","description":"Earliest time of day (HH:mm:ss) calls may be placed","example":"09:00:00"},"allowedCallWindowEnd":{"type":"string","description":"Latest time of day (HH:mm:ss) after which no new calls will be placed","example":"18:00:00"},"allowedPhoneNumbers":{"type":"array","description":"If non-empty, only these phone numbers (E.164) may be used as the caller ID","items":{"type":"string"}},"forwardingPhoneNumber":{"type":"string","description":"Phone number to forward calls to if requested by the AI flow"},"inputDataKeys":{"type":"array","description":"Distinct keys found in the job's input rowData payloads, in first-seen order","items":{"type":"string"}},"scheduledAt":{"type":"string","format":"date-time","description":"ISO 8601 datetime at which the job is scheduled to start; null means start immediately"},"maxConcurrentCalls":{"type":"integer","format":"int32","description":"Maximum number of simultaneous outbound calls for this job","example":5},"enableRetries":{"type":"boolean","description":"Whether automatic retry logic is enabled for failed rows"},"maxRetries":{"type":"integer","format":"int32","description":"Maximum number of retry attempts per row","example":3},"retryDelay":{"type":"integer","format":"int32","description":"Delay in seconds between retry attempts","example":3600},"retryOnBusy":{"type":"boolean","description":"Retry the row if the destination was busy"},"retryOnNoAnswer":{"type":"boolean","description":"Retry the row if the call was not answered"},"retryOnVoicemail":{"type":"boolean","description":"Retry the row if the call reached voicemail"},"flowId":{"type":"string","format":"uuid","description":"Internal UUID of the assigned flow (if any). Useful for dashboard/internal APIs."},"flowName":{"type":"string","description":"Human-readable name of the assigned flow"},"flowApiId":{"type":"string","description":"Public API identifier of the assigned flow. Prefer this in external integrations."}}},"ExternalCallingJobCreateRequest":{"type":"object","properties":{"originalFileName":{"type":"string","description":"Internal name for the job (e.g., filename)","example":"january_outbound_leads.csv"},"csvContent":{"type":"string","description":"The full CSV content string"},"flowId":{"type":"string","description":"Optional default flow reference. Accepts the internal UUID or the flow API ID exposed in API responses.","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"flowApiId":{"type":"string","description":"Optional default flow API ID. Preferred for external integrations. Provide either flowId or flowApiId, not both.","example":"f_last_test_copy"},"executionMode":{"type":"string","description":"Concurrency mode (IN_PARALLEL, SERIAL)","enum":["IN_PARALLEL","ONE_BY_ONE","ONE_BY_ONE_PAUSED"]},"initialStatus":{"type":"string","description":"Initial status of the job","enum":["ACTIVE","PAUSED","COMPLETED","COMPLETED_PARTIAL","FAILED","CANCELLED"]},"allowedCallWindowStart":{"type":"string","description":"Local time to start making calls (HH:mm:ss)","example":"09:00:00"},"allowedCallWindowEnd":{"type":"string","description":"Local time to stop making calls (HH:mm:ss)","example":"18:00:00"},"allowedPhoneNumbers":{"type":"array","description":"Optional from-number allowlist. Null/empty means all available.","items":{"type":"string"}},"scheduledAt":{"type":"string","format":"date-time","description":"Scheduled date/time for the job (ISO 8601)"},"maxConcurrentCalls":{"type":"integer","format":"int32","description":"Maximum concurrent calls (default 1)","example":1},"enableRetries":{"type":"boolean","description":"Enable automatic retries for failed calls"},"maxRetries":{"type":"integer","format":"int32","description":"Maximum number of retries per row","example":3},"retryDelay":{"type":"integer","format":"int32","description":"Delay between retries in seconds","example":3600},"retryOnBusy":{"type":"boolean","description":"Retry if the destination is busy"},"retryOnNoAnswer":{"type":"boolean","description":"Retry if there is no answer"},"retryOnVoicemail":{"type":"boolean","description":"Retry if the call reaches voicemail"},"applicationId":{"type":"string","format":"uuid","description":"Optional application UUID. If omitted, the user's default application is used."}}},"ExternalCustomStoreUpsertRequest":{"type":"object","description":"Upsert request for a custom application data-store record","properties":{"where":{"type":"object","additionalProperties":{},"description":"Exact-match lookup fields. Every key must be configured as indexed in the custom data store.","example":{"phoneNumber":"+15551234567"}},"data":{"type":"object","additionalProperties":{},"description":"Custom fields to create or merge into the record.","example":{"fullName":"Jane Customer","customerTier":"enterprise"}},"metadata":{"type":"object","additionalProperties":{},"description":"Machine-readable metadata stored beside the record.","example":{"source":"crm-sync","externalId":"crm-10042"}},"createIfMissing":{"type":"boolean","description":"Create a new row when no row matches `where`. Defaults to true.","example":true},"merge":{"type":"boolean","description":"Merge data into existing records instead of replacing all custom fields. Defaults to true.","example":true}}},"ExternalCustomStoreBulkUpsertRequest":{"type":"object","description":"Bulk upsert request for custom application data-store records","properties":{"records":{"type":"array","description":"Upsert rows. Maximum 1000 records per request.","items":{"$ref":"#/components/schemas/ExternalCustomStoreUpsertRequest"}},"continueOnError":{"type":"boolean","description":"Continue processing rows after a row-level error. Defaults to true.","example":true}}},"ExternalCustomStorePatchRequest":{"type":"object","description":"Patch request for custom application data-store records matched by indexed fields","properties":{"where":{"type":"object","additionalProperties":{},"description":"Exact-match lookup fields. Every key must be configured as indexed.","example":{"phoneNumber":"+15551234567"}},"set":{"type":"object","additionalProperties":{},"description":"Custom fields to merge into every matched row.","example":{"customerTier":"strategic"}},"metadata":{"type":"object","additionalProperties":{},"description":"Metadata fields to merge into every matched row.","example":{"lastSyncSource":"crm"}},"limit":{"type":"integer","format":"int32","description":"Maximum rows to update. Defaults to 100, maximum 1000.","example":1},"dryRun":{"type":"boolean","description":"When true, returns matched count/sample without writing.","example":false}}},"ApiCallView":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"method":{"type":"string"},"url":{"type":"string"},"responseStatusCode":{"type":"integer","format":"int32"},"durationMs":{"type":"integer","format":"int64"},"errorMessage":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}},"ExecutionView":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"toolName":{"type":"string"},"triggerType":{"type":"string"},"status":{"type":"string"},"errorMessage":{"type":"string"},"latencyMs":{"type":"integer","format":"int64"},"createdAt":{"type":"string","format":"date-time"},"inputPayload":{"type":"object","additionalProperties":{}},"outputPayload":{"type":"object","additionalProperties":{}},"callerDetails":{"type":"object","additionalProperties":{}},"originatingExecutionId":{"type":"string","format":"uuid"},"callbackCount":{"type":"integer","format":"int64"},"apiCalls":{"type":"array","items":{"$ref":"#/components/schemas/ApiCallView"}}}},"ToolSummaryView":{"type":"object","properties":{"toolName":{"type":"string"},"total":{"type":"integer","format":"int64"},"success":{"type":"integer","format":"int64"},"error":{"type":"integer","format":"int64"},"timeout":{"type":"integer","format":"int64"},"avgLatencyMs":{"type":"integer","format":"int64"},"apiCallCount":{"type":"integer","format":"int64"}}},"ToolUsageReportResponse":{"type":"object","properties":{"date":{"type":"string"},"summary":{"type":"array","items":{"$ref":"#/components/schemas/ToolSummaryView"}},"executions":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionView"}}}},"CallMediaResponse":{"type":"object","description":"Provider-neutral media metadata for a call","properties":{"recordingUrl":{"type":"string","description":"Mono recording URL for the call"},"stereoRecordingUrl":{"type":"string","description":"Stereo recording URL for the call"},"assistantEndpoint":{"type":"string","description":"Assistant-channel media endpoint"},"customerEndpoint":{"type":"string","description":"Customer-channel media endpoint"}}},"CallRowResponse":{"type":"object","description":"Result of a single outbound or inbound call","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of this call row","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"applicationId":{"type":"string","format":"uuid","description":"Workspace application UUID associated with this row"},"callType":{"type":"string","description":"Type of call (TELEPHONY, WEB_CALL, etc.)","enum":["WEB","TELEPHONY","CHAT","WORK","AUTOMATION","ASSISTANT","DATABASE"]},"targetPhoneNumber":{"type":"string","description":"Destination phone number in E.164 format","example":"+15551234567"},"callerPhoneNumber":{"type":"string","description":"Source (caller) phone number in E.164 format","example":"+15559876543"},"status":{"type":"string","description":"Lifecycle status of this call","enum":["TODO","QUEUED","PLANNED","CALL_INITIATED","RINGING","CALL_STARTED","CALL_ENDED","ERROR","RETRY_PENDING","DONE","DONE_WD","DONE_WC","CANCELLED"]},"approvedForCalling":{"type":"boolean","description":"Whether this generated call is approved to be dialed"},"approvalSource":{"type":"string","description":"How the generated call was approved (AUTO or USER)","enum":["USER","AUTO"]},"approvedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the generated call was approved"},"providerCallId":{"type":"string","description":"Provider-assigned call ID (Twilio/Telnyx/Vonage call SID)"},"voiceAiProvider":{"type":"string","description":"AI provider that handled this call","enum":["P_KITALK_1","P_KITALK_2","P_KITALK_3","P_KITALK_LOCAL"]},"rowData":{"type":"object","additionalProperties":{},"description":"Input data associated with this row (from CSV or JSON payload)"},"outputData":{"type":"object","additionalProperties":{},"description":"Output data produced by the AI flow after the call (structured results)"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when this row was created"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the last status update"},"errorReason":{"type":"string","description":"Human-readable error message if status is ERROR"},"errorStage":{"type":"string","description":"Stage of the call lifecycle where the error occurred","enum":["PRE_CALL","MID_CALL","POST_CALL"]},"endedReason":{"type":"string","description":"Provider-reported reason the call ended (e.g. customer-ended-call, silence-timed-out)"},"callResult":{"type":"string","description":"High-level outcome classification of the call","enum":["PENDING","SUCCESS","NO_ANSWER","BUSY","VOICEMAIL","REJECTED","FAILED","CALLBACK_REQUESTED","NOT_INTERESTED","WRONG_NUMBER","TEMPORARILY_UNAVAILABLE"]},"transcription":{"type":"string","description":"Full transcript of the conversation"},"recordingUrl":{"type":"string","description":"URL of the mono audio recording of the call"},"stereoRecordingUrl":{"type":"string","description":"URL of the stereo audio recording of the call (agent on one channel, customer on the other)"},"assistantUrl":{"type":"string","description":"Real-time assistant audio stream URL (available during active call)"},"customerUrl":{"type":"string","description":"Real-time customer audio stream URL (available during active call)"},"media":{"$ref":"#/components/schemas/CallMediaResponse","description":"Provider-neutral media metadata for this call"},"listenUrl":{"type":"string","description":"Listen-only stream URL for monitoring the call"},"controlUrl":{"type":"string","description":"Control URL for modifying the call in real time (mute, end, etc.)"},"session":{"$ref":"#/components/schemas/CallSessionResponse","description":"Provider-neutral live session metadata for this call"},"duration":{"type":"number","format":"double","description":"Duration of the call in seconds","example":87.5},"startedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the call was answered"},"endedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when the call ended"},"platformUsageStartedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when platform-side usage tracking began"},"platformUsageEndedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp when platform-side usage tracking ended"},"summary":{"type":"string","description":"AI-generated summary of the conversation"},"retrievalStatus":{"type":"string","description":"Status of the post-call transcript/recording retrieval","enum":["PENDING","COMPLETED","FAILED"]},"retrievalAttempts":{"type":"integer","format":"int32","description":"Number of post-call retrieval attempts made"},"readyForRetrievalAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp after which post-call data was ready to be fetched"},"direction":{"type":"string","description":"Whether the call was inbound or outbound","enum":["INBOUND","OUTBOUND"]},"flowApiId":{"type":"string","description":"Public API identifier of the flow/agent that handled this call"},"language":{"type":"string","description":"Language configured for this specific call attempt"},"voiceId":{"type":"string","description":"Voice ID used for this specific call attempt"},"allowedCallWindowBegin":{"type":"string","description":"Earliest time of day this row was allowed to be called (HH:mm:ss)"},"allowedCallWindowEnd":{"type":"string","description":"Latest time of day this row was allowed to be called (HH:mm:ss)"},"plannedCallDateTime":{"type":"string","format":"date-time","description":"Exact timestamp after which this row may be dialed"},"allowedPhoneNumbers":{"type":"array","description":"Phone number allowlist for this specific row (null/empty = all numbers allowed)","items":{"type":"string"}},"jobId":{"type":"string","format":"uuid","description":"UUID of the parent call job (null for standalone calls)"},"jobName":{"type":"string","description":"Name of the parent call job"},"assignedPhoneNumber":{"type":"string","description":"Phone number (E.164) actually used to dial this call"},"transferCallerId":{"type":"string","description":"Caller ID to use when transferring this call to another number"},"agentId":{"type":"string","format":"uuid","description":"UUID of the agent/flow that handled this call"},"agentName":{"type":"string","description":"Name of the agent/flow that handled this call"},"generatedByCallRowId":{"type":"string","format":"uuid","description":"Call row UUID that generated this row, if any"},"subStatus":{"type":"string","description":"Optional sub-state within the current status for finer-grained tracking"},"publicShareEnabled":{"type":"boolean","description":"Whether a public share link is enabled for this call"},"publicShareToken":{"type":"string","format":"uuid","description":"Unique token for the public share link"},"publicShareUrl":{"type":"string","description":"Full URL to view the call's public summary and recording"},"userTerminated":{"type":"boolean","description":"Whether the call was explicitly terminated by a user or external request"},"dataCompleted":{"type":"boolean","description":"Whether Kilevel recovered missing post-call data for this row from live memory or derived timing"}}},"CallSessionResponse":{"type":"object","description":"Provider-neutral live session metadata for an active call","properties":{"listenEndpoint":{"type":"string","description":"Listen endpoint for monitoring the live call"},"controlEndpoint":{"type":"string","description":"Control endpoint for live call operations"}}},"PagedCallHistoryResponse":{"type":"object","description":"Paginated response for call history queries","properties":{"content":{"type":"array","description":"The call rows on this page","items":{"$ref":"#/components/schemas/CallRowResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching call rows across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"FlowResponse":{"type":"object","description":"Details of an AI flow (logic)","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of the flow"},"apiId":{"type":"string","description":"Public API identifier of the flow","example":"f_lead_gen"},"name":{"type":"string","description":"Human-readable name of the flow"},"language":{"type":"string","description":"Language configured for this flow (ISO 2-letter code)","example":"en"},"channelMode":{"type":"string","description":"Current channel mode (CHAT, CALL, HYBRID)"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last modification"},"archived":{"type":"boolean","description":"Whether this flow has been archived"}}},"PagedFlowResponse":{"type":"object","description":"Paginated response for flow queries","properties":{"content":{"type":"array","description":"The flows on this page","items":{"$ref":"#/components/schemas/FlowResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching flows across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"PagedChatSessionResponse":{"type":"object","description":"Paginated response for chat history queries","properties":{"content":{"type":"array","description":"The chat sessions on this page","items":{"$ref":"#/components/schemas/ChatSessionResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching chat sessions across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"PagedCallJobResponse":{"type":"object","description":"Paginated response for call job queries","properties":{"content":{"type":"array","description":"The call jobs on this page","items":{"$ref":"#/components/schemas/CallJobResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching call jobs across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"BalanceResponse":{"type":"object","description":"Current wallet balance and usage information","properties":{"balance":{"type":"number","description":"Current monetary balance in EUR"},"freeMinutesRemaining":{"type":"number","description":"Remaining monthly free minutes"},"longTermFreeMinutesBalance":{"type":"number","description":"Remaining long-term free minutes"},"pricePerMinute":{"type":"number","description":"Current price per minute for outbound calls"},"concurrencyLines":{"type":"integer","format":"int32","description":"Number of active concurrency lines"},"usageBlockedDueToBalance":{"type":"boolean","description":"Whether usage is currently blocked due to low balance"}}},"PageMetadata":{"type":"object","properties":{"size":{"type":"integer","format":"int64"},"number":{"type":"integer","format":"int64"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int64"}}},"PagedModelStoredFileView":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/StoredFileView"}},"page":{"$ref":"#/components/schemas/PageMetadata"}}},"StoredFileView":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"source":{"type":"string"},"ownerRefId":{"type":"string","format":"uuid"},"runRefId":{"type":"string","format":"uuid"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","format":"int64"},"status":{"type":"string"},"downloadUrl":{"type":"string"},"retentionDays":{"type":"integer","format":"int32"},"expiresAt":{"type":"string","format":"date-time"},"retentionPinned":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"label":{"type":"string"},"nodeId":{"type":"string"},"kind":{"type":"string"}}},"ApplicationResponse":{"type":"object","description":"Summary of a workspace application","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of the application","example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},"name":{"type":"string","description":"Human-readable name of the application","example":"ACME Dental Clinic"},"appType":{"type":"string","description":"Application type identifier","example":"medical"},"adminPanelSlug":{"type":"string","description":"Slug used to access the admin panel for this application","example":"acme-dental"},"customDomain":{"type":"string","description":"Custom domain configured for this application's end-user-facing interface","example":"app.acmedental.com"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last modification"},"dataStoreConfigs":{"type":"array","description":"List of data store configurations (key, label, fields) for this application","items":{"type":"object","additionalProperties":{}}}}},"PagedApplicationResponse":{"type":"object","description":"Paginated response for application queries","properties":{"content":{"type":"array","description":"The applications on this page","items":{"$ref":"#/components/schemas/ApplicationResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching applications across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"AgentResponse":{"type":"object","description":"Details of an AI agent (personification of a flow)","properties":{"id":{"type":"string","format":"uuid","description":"Unique UUID of the agent"},"name":{"type":"string","description":"Human-readable name of the agent"},"flowId":{"type":"string","format":"uuid","description":"UUID of the flow this agent is based on"},"flowApiId":{"type":"string","description":"Public API identifier of the flow this agent is based on"},"language":{"type":"string","description":"Language override for this agent"},"voiceId":{"type":"string","description":"Voice ID override for this agent"},"inboundMode":{"type":"string","description":"How inbound calls are handled (AI_FIRST, etc.)"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last modification"}}},"PagedAgentResponse":{"type":"object","description":"Paginated response for agent queries","properties":{"content":{"type":"array","description":"The agents on this page","items":{"$ref":"#/components/schemas/AgentResponse"}},"currentPage":{"type":"integer","format":"int32","description":"Zero-indexed current page number","example":0},"pageSize":{"type":"integer","format":"int32","description":"Number of items per page","example":20},"totalItems":{"type":"integer","format":"int64","description":"Total number of matching agents across all pages","example":1500},"totalPages":{"type":"integer","format":"int32","description":"Total number of pages","example":75}}},"FlowKnowledgeBaseStateDto":{"type":"object","properties":{"attachedRefs":{"type":"array","items":{"type":"object","additionalProperties":{}}},"attachedItems":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseItemDto"}},"reusableItems":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseItemDto"}},"automaticLearnedItems":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseItemDto"}}}}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"Your private API key for authentication.","name":"X-API-Key","in":"header"}}}}