telnyx-mcp 6.62.0 → 6.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +21 -15
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +21 -15
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/local-docs-search.ts +21 -16
- package/src/server.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAmq1DF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAmq1DF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
package/local-docs-search.js
CHANGED
|
@@ -3071,12 +3071,12 @@ const EMBEDDED_METHODS = [
|
|
|
3071
3071
|
endpoint: '/ai/responses',
|
|
3072
3072
|
httpMethod: 'post',
|
|
3073
3073
|
summary: 'Create a response',
|
|
3074
|
-
description:
|
|
3074
|
+
description: '**Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is compatible with the [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview) and may be used with the OpenAI JS or Python SDK. Response id parameter is not supported at the moment. Use the `conversation` parameter with a Telnyx Conversation ID to leverage persistent conversations.',
|
|
3075
3075
|
stainlessPath: '(resource) ai > (method) create_response',
|
|
3076
3076
|
qualified: 'client.ai.createResponse',
|
|
3077
3077
|
params: ['body: object;'],
|
|
3078
3078
|
response: 'object',
|
|
3079
|
-
markdown: "## create_response\n\n`client.ai.createResponse(body: object): object`\n\n**post** `/ai/responses`\n\n**Deprecated**: Use `POST /v2/ai/openai/responses` instead.
|
|
3079
|
+
markdown: "## create_response\n\n`client.ai.createResponse(body: object): object`\n\n**post** `/ai/responses`\n\n**Deprecated**: Use `POST /v2/ai/openai/responses` instead. This endpoint is compatible with the [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview) and may be used with the OpenAI JS or Python SDK. Response id parameter is not supported at the moment. Use the `conversation` parameter with a Telnyx Conversation ID to leverage persistent conversations.\n\n### Parameters\n\n- `body: object`\n\n### Returns\n\n- `object`\n\n### Example\n\n```typescript\nimport Telnyx from 'telnyx';\n\nconst client = new Telnyx();\n\nconst response = await client.ai.createResponse({ body: { model: 'bar', input: 'bar' } });\n\nconsole.log(response);\n```",
|
|
3080
3080
|
perLanguage: {
|
|
3081
3081
|
typescript: {
|
|
3082
3082
|
method: 'client.ai.createResponse',
|
|
@@ -9297,43 +9297,49 @@ const EMBEDDED_METHODS = [
|
|
|
9297
9297
|
endpoint: '/ai/openai/responses',
|
|
9298
9298
|
httpMethod: 'post',
|
|
9299
9299
|
summary: 'Create an OpenAI-compatible response',
|
|
9300
|
-
description: "
|
|
9300
|
+
description: "Create a response using Telnyx's OpenAI-compatible Responses API. This endpoint is compatible with the [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview) and may be used with the OpenAI JS or Python SDK by setting the base URL to `https://api.telnyx.com/v2/ai/openai`.\n\nThe `conversation` parameter refers to a Telnyx Conversation rather than an OpenAI-hosted conversation object. To persist a thread across turns, first [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation) with `POST /ai/conversations`, then pass that conversation's `id` in the Responses request as `conversation`. The endpoint appends the new input, assistant output, reasoning, and tool-call messages to that conversation. Reuse the same `conversation` id on subsequent Responses requests, including tool-result followups, so the model receives the prior context.\n\nIf `conversation` is omitted, the request is processed without persisting messages to a Telnyx conversation. Use the Conversations API to manage history: [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations) (optionally filtered by metadata), [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages) for a conversation, and optionally [add messages](https://developers.telnyx.com/api-reference/conversations/create-message) outside the Responses flow.\n\nYou can attach arbitrary metadata when creating a conversation (for example to tag the conversation's source, channel, or user) and later filter by it when listing conversations.",
|
|
9301
9301
|
stainlessPath: '(resource) ai.openai > (method) create_response',
|
|
9302
9302
|
qualified: 'client.ai.openai.createResponse',
|
|
9303
|
-
params: [
|
|
9303
|
+
params: [
|
|
9304
|
+
'conversation?: string;',
|
|
9305
|
+
'input?: object;',
|
|
9306
|
+
'instructions?: string;',
|
|
9307
|
+
'model?: string;',
|
|
9308
|
+
'stream?: boolean;',
|
|
9309
|
+
],
|
|
9304
9310
|
response: 'object',
|
|
9305
|
-
markdown: "## create_response\n\n`client.ai.openai.createResponse(
|
|
9311
|
+
markdown: "## create_response\n\n`client.ai.openai.createResponse(conversation?: string, input?: object, instructions?: string, model?: string, stream?: boolean): object`\n\n**post** `/ai/openai/responses`\n\nCreate a response using Telnyx's OpenAI-compatible Responses API. This endpoint is compatible with the [OpenAI Responses API](https://developers.openai.com/api/reference/responses/overview) and may be used with the OpenAI JS or Python SDK by setting the base URL to `https://api.telnyx.com/v2/ai/openai`.\n\nThe `conversation` parameter refers to a Telnyx Conversation rather than an OpenAI-hosted conversation object. To persist a thread across turns, first [create a conversation](https://developers.telnyx.com/api-reference/conversations/create-a-conversation) with `POST /ai/conversations`, then pass that conversation's `id` in the Responses request as `conversation`. The endpoint appends the new input, assistant output, reasoning, and tool-call messages to that conversation. Reuse the same `conversation` id on subsequent Responses requests, including tool-result followups, so the model receives the prior context.\n\nIf `conversation` is omitted, the request is processed without persisting messages to a Telnyx conversation. Use the Conversations API to manage history: [list conversations](https://developers.telnyx.com/api-reference/conversations/list-conversations) (optionally filtered by metadata), [fetch messages](https://developers.telnyx.com/api-reference/conversations/get-conversation-messages) for a conversation, and optionally [add messages](https://developers.telnyx.com/api-reference/conversations/create-message) outside the Responses flow.\n\nYou can attach arbitrary metadata when creating a conversation (for example to tag the conversation's source, channel, or user) and later filter by it when listing conversations.\n\n### Parameters\n\n- `conversation?: string`\n Optional Telnyx Conversation ID from `POST /ai/conversations`. When provided, Telnyx stores this turn on that conversation and uses the conversation's prior messages as context. Reuse the same ID for subsequent turns and tool-result followups. Omit it for a non-persisted, stateless response.\n\n- `input?: object`\n The input items for this turn, using the OpenAI Responses API input format.\n\n- `instructions?: string`\n Optional system/developer instructions for the model. When used with a persisted `conversation`, send these on the first request that creates the thread; subsequent turns can rely on the stored history.\n\n- `model?: string`\n Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or another model available from the Telnyx OpenAI-compatible models endpoint.\n\n- `stream?: boolean`\n Set to `true` to stream Server-Sent Events, matching OpenAI's Responses streaming format.\n\n### Returns\n\n- `object`\n\n### Example\n\n```typescript\nimport Telnyx from 'telnyx';\n\nconst client = new Telnyx();\n\nconst response = await client.ai.openai.createResponse();\n\nconsole.log(response);\n```",
|
|
9306
9312
|
perLanguage: {
|
|
9307
9313
|
typescript: {
|
|
9308
9314
|
method: 'client.ai.openai.createResponse',
|
|
9309
|
-
example: "import Telnyx from 'telnyx';\n\nconst client = new Telnyx({\n apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.openai.createResponse({
|
|
9315
|
+
example: "import Telnyx from 'telnyx';\n\nconst client = new Telnyx({\n apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.ai.openai.createResponse({\n conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',\n input: [{ role: 'user', content: [{ type: 'input_text', text: 'Hello, world!' }] }],\n instructions: 'You are a friendly chatbot.',\n model: 'zai-org/GLM-5.1-FP8',\n stream: true,\n});\n\nconsole.log(response);",
|
|
9310
9316
|
},
|
|
9311
9317
|
python: {
|
|
9312
9318
|
method: 'ai.openai.create_response',
|
|
9313
|
-
example: 'import os\nfrom telnyx import Telnyx\n\nclient = Telnyx(\n api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.ai.openai.create_response(\n
|
|
9319
|
+
example: 'import os\nfrom telnyx import Telnyx\n\nclient = Telnyx(\n api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.ai.openai.create_response(\n conversation="6a09cdc3-8948-47f0-aa62-74ac943d6c58",\n input=[{\n "role": "user",\n "content": [{\n "type": "input_text",\n "text": "Hello, world!",\n }],\n }],\n instructions="You are a friendly chatbot.",\n model="zai-org/GLM-5.1-FP8",\n stream=True,\n)\nprint(response)',
|
|
9314
9320
|
},
|
|
9315
9321
|
java: {
|
|
9316
9322
|
method: 'ai().openai().createResponse',
|
|
9317
|
-
example: 'package com.telnyx.sdk.example;\n\nimport com.telnyx.sdk.client.TelnyxClient;\nimport com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;\nimport com.telnyx.sdk.
|
|
9323
|
+
example: 'package com.telnyx.sdk.example;\n\nimport com.telnyx.sdk.client.TelnyxClient;\nimport com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;\nimport com.telnyx.sdk.models.ai.openai.OpenAICreateResponseParams;\nimport com.telnyx.sdk.models.ai.openai.OpenAICreateResponseResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n TelnyxClient client = TelnyxOkHttpClient.fromEnv();\n\n OpenAICreateResponseResponse response = client.ai().openai().createResponse();\n }\n}',
|
|
9318
9324
|
},
|
|
9319
9325
|
go: {
|
|
9320
9326
|
method: 'client.AI.OpenAI.NewResponse',
|
|
9321
|
-
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/team-telnyx/telnyx-go"\n\t"github.com/team-telnyx/telnyx-go/option"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.AI.OpenAI.NewResponse(context.TODO(), telnyx.AIOpenAINewResponseParams{\n\t\
|
|
9327
|
+
example: 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/team-telnyx/telnyx-go"\n\t"github.com/team-telnyx/telnyx-go/option"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.AI.OpenAI.NewResponse(context.TODO(), telnyx.AIOpenAINewResponseParams{\n\t\tConversation: telnyx.String("6a09cdc3-8948-47f0-aa62-74ac943d6c58"),\n\t\tInput: []any{\n\t\t\tmap[string]any{\n\t\t\t\t"role": "user",\n\t\t\t\t"content": []any{\n\t\t\t\t\tmap[string]any{\n\t\t\t\t\t\t"type": "input_text",\n\t\t\t\t\t\t"text": "Hello, world!",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tInstructions: telnyx.String("You are a friendly chatbot."),\n\t\tModel: telnyx.String("zai-org/GLM-5.1-FP8"),\n\t\tStream: telnyx.Bool(true),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n',
|
|
9322
9328
|
},
|
|
9323
9329
|
ruby: {
|
|
9324
9330
|
method: 'ai.openai.create_response',
|
|
9325
|
-
example: 'require "telnyx"\n\ntelnyx = Telnyx::Client.new(api_key: "My API Key")\n\nresponse = telnyx.ai.openai.create_response
|
|
9331
|
+
example: 'require "telnyx"\n\ntelnyx = Telnyx::Client.new(api_key: "My API Key")\n\nresponse = telnyx.ai.openai.create_response\n\nputs(response)',
|
|
9326
9332
|
},
|
|
9327
9333
|
cli: {
|
|
9328
9334
|
method: 'openai create_response',
|
|
9329
|
-
example: "telnyx ai:openai create-response \\\n --api-key 'My API Key'
|
|
9335
|
+
example: "telnyx ai:openai create-response \\\n --api-key 'My API Key'",
|
|
9330
9336
|
},
|
|
9331
9337
|
php: {
|
|
9332
9338
|
method: 'ai->openai->createResponse',
|
|
9333
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->ai->openai->createResponse(\n
|
|
9339
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->ai->openai->createResponse(\n conversation: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',\n input: [\n [\n 'role' => 'user',\n 'content' => [['type' => 'input_text', 'text' => 'Hello, world!']],\n ],\n ],\n instructions: 'You are a friendly chatbot.',\n model: 'zai-org/GLM-5.1-FP8',\n stream: true,\n);\n\nvar_dump($response);",
|
|
9334
9340
|
},
|
|
9335
9341
|
http: {
|
|
9336
|
-
example: 'curl https://api.telnyx.com/v2/ai/openai/responses \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $TELNYX_API_KEY" \\\n -d \'{\n "
|
|
9342
|
+
example: 'curl https://api.telnyx.com/v2/ai/openai/responses \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $TELNYX_API_KEY" \\\n -d \'{\n "conversation": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",\n "input": [\n {\n "role": "user",\n "content": [\n {\n "type": "input_text",\n "text": "Hello, world!"\n }\n ]\n }\n ],\n "instructions": "You are a friendly chatbot.",\n "model": "zai-org/GLM-5.1-FP8",\n "stream": true\n }\'',
|
|
9337
9343
|
},
|
|
9338
9344
|
},
|
|
9339
9345
|
},
|
|
@@ -38551,7 +38557,7 @@ const EMBEDDED_METHODS = [
|
|
|
38551
38557
|
endpoint: '/texml/ai_calls/{connection_id}',
|
|
38552
38558
|
httpMethod: 'post',
|
|
38553
38559
|
summary: 'Initiate an outbound AI call',
|
|
38554
|
-
description: 'Initiate an outbound AI call with warm-up support. Validates parameters, builds an internal TeXML with an AI Assistant configuration, encodes instructions into client state, and calls the dial API. The Twiml, Texml, and Url parameters are not allowed and will result in a 422 error
|
|
38560
|
+
description: 'Initiate an outbound AI call with warm-up support. Validates parameters, builds an internal TeXML with an AI Assistant configuration, encodes instructions into client state, and calls the dial API. The Twiml, Texml, and Url parameters are not allowed and will result in a 422 error.\n\n**Expected callback events:**\n\nStatus callbacks: `initiated`, `ringing`, `answered`, one terminal status (`completed`, `no-answer`, `busy`, `canceled`, or `failed`), then `analyzed` after post-call processing completes.\n\nConversation callbacks: `conversation_created` and `conversation_ended`.\n\nRecording, AMD, transcription, and deepfake detection callbacks are only sent when those features are enabled.\n',
|
|
38555
38561
|
stainlessPath: '(resource) texml > (method) initiate_ai_call',
|
|
38556
38562
|
qualified: 'client.texml.initiateAICall',
|
|
38557
38563
|
params: [
|
|
@@ -38597,7 +38603,7 @@ const EMBEDDED_METHODS = [
|
|
|
38597
38603
|
"Trim?: 'trim-silence' | 'do-not-trim';",
|
|
38598
38604
|
],
|
|
38599
38605
|
response: '{ call_sid?: string; from?: string; status?: string; to?: string; }',
|
|
38600
|
-
markdown: "## initiate_ai_call\n\n`client.texml.initiateAICall(connection_id: string, AIAssistantId: string, From: string, To: string, AIAssistantDynamicVariables?: object, AIAssistantVersion?: string, AsyncAmd?: boolean, AsyncAmdStatusCallback?: string, AsyncAmdStatusCallbackMethod?: 'GET' | 'POST', CallerId?: string, ConversationCallback?: string, ConversationCallbackMethod?: 'GET' | 'POST', ConversationCallbacks?: string[], CustomHeaders?: { name: string; value: string; }[], DetectionMode?: 'Premium' | 'Regular', MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd', MachineDetectionSilenceTimeout?: number, MachineDetectionSpeechEndThreshold?: number, MachineDetectionSpeechThreshold?: number, MachineDetectionTimeout?: number, Passports?: string, PreferredCodecs?: string, Record?: boolean, RecordingChannels?: 'mono' | 'dual', RecordingStatusCallback?: string, RecordingStatusCallbackEvent?: string, RecordingStatusCallbackMethod?: 'GET' | 'POST', RecordingTimeout?: number, RecordingTrack?: 'inbound' | 'outbound' | 'both', SendRecordingUrl?: boolean, SipAuthPassword?: string, SipAuthUsername?: string, SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East', StatusCallback?: string, StatusCallbackEvent?: string, StatusCallbackMethod?: 'GET' | 'POST', StatusCallbacks?: string[], TimeLimit?: number, Timeout?: number, Trim?: 'trim-silence' | 'do-not-trim'): { call_sid?: string; from?: string; status?: string; to?: string; }`\n\n**post** `/texml/ai_calls/{connection_id}`\n\nInitiate an outbound AI call with warm-up support. Validates parameters, builds an internal TeXML with an AI Assistant configuration, encodes instructions into client state, and calls the dial API. The Twiml, Texml, and Url parameters are not allowed and will result in a 422 error.\n\n### Parameters\n\n- `connection_id: string`\n\n- `AIAssistantId: string`\n The ID of the AI assistant to use for the call.\n\n- `From: string`\n The phone number of the party initiating the call. Phone numbers are formatted with a `+` and country code.\n\n- `To: string`\n The phone number of the called party. Phone numbers are formatted with a `+` and country code.\n\n- `AIAssistantDynamicVariables?: object`\n Key-value map of dynamic variables to pass to the AI assistant.\n\n- `AIAssistantVersion?: string`\n The version of the AI assistant to use.\n\n- `AsyncAmd?: boolean`\n Select whether to perform answering machine detection in the background. By default execution is blocked until Answering Machine Detection is completed.\n\n- `AsyncAmdStatusCallback?: string`\n URL destination for Telnyx to send AMD callback events to for the call.\n\n- `AsyncAmdStatusCallbackMethod?: 'GET' | 'POST'`\n HTTP request type used for `AsyncAmdStatusCallback`.\n\n- `CallerId?: string`\n To be used as the caller id name (SIP From Display Name) presented to the destination (`To` number). The string should have a maximum of 128 characters, containing only letters, numbers, spaces, and `-_~!.+` special characters. If omitted, the display name will be the same as the number in the `From` field.\n\n- `ConversationCallback?: string`\n URL destination for Telnyx to send conversation callback events
|
|
38606
|
+
markdown: "## initiate_ai_call\n\n`client.texml.initiateAICall(connection_id: string, AIAssistantId: string, From: string, To: string, AIAssistantDynamicVariables?: object, AIAssistantVersion?: string, AsyncAmd?: boolean, AsyncAmdStatusCallback?: string, AsyncAmdStatusCallbackMethod?: 'GET' | 'POST', CallerId?: string, ConversationCallback?: string, ConversationCallbackMethod?: 'GET' | 'POST', ConversationCallbacks?: string[], CustomHeaders?: { name: string; value: string; }[], DetectionMode?: 'Premium' | 'Regular', MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd', MachineDetectionSilenceTimeout?: number, MachineDetectionSpeechEndThreshold?: number, MachineDetectionSpeechThreshold?: number, MachineDetectionTimeout?: number, Passports?: string, PreferredCodecs?: string, Record?: boolean, RecordingChannels?: 'mono' | 'dual', RecordingStatusCallback?: string, RecordingStatusCallbackEvent?: string, RecordingStatusCallbackMethod?: 'GET' | 'POST', RecordingTimeout?: number, RecordingTrack?: 'inbound' | 'outbound' | 'both', SendRecordingUrl?: boolean, SipAuthPassword?: string, SipAuthUsername?: string, SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East', StatusCallback?: string, StatusCallbackEvent?: string, StatusCallbackMethod?: 'GET' | 'POST', StatusCallbacks?: string[], TimeLimit?: number, Timeout?: number, Trim?: 'trim-silence' | 'do-not-trim'): { call_sid?: string; from?: string; status?: string; to?: string; }`\n\n**post** `/texml/ai_calls/{connection_id}`\n\nInitiate an outbound AI call with warm-up support. Validates parameters, builds an internal TeXML with an AI Assistant configuration, encodes instructions into client state, and calls the dial API. The Twiml, Texml, and Url parameters are not allowed and will result in a 422 error.\n\n**Expected callback events:**\n\nStatus callbacks: `initiated`, `ringing`, `answered`, one terminal status (`completed`, `no-answer`, `busy`, `canceled`, or `failed`), then `analyzed` after post-call processing completes.\n\nConversation callbacks: `conversation_created` and `conversation_ended`.\n\nRecording, AMD, transcription, and deepfake detection callbacks are only sent when those features are enabled.\n\n\n### Parameters\n\n- `connection_id: string`\n\n- `AIAssistantId: string`\n The ID of the AI assistant to use for the call.\n\n- `From: string`\n The phone number of the party initiating the call. Phone numbers are formatted with a `+` and country code.\n\n- `To: string`\n The phone number of the called party. Phone numbers are formatted with a `+` and country code.\n\n- `AIAssistantDynamicVariables?: object`\n Key-value map of dynamic variables to pass to the AI assistant.\n\n- `AIAssistantVersion?: string`\n The version of the AI assistant to use.\n\n- `AsyncAmd?: boolean`\n Select whether to perform answering machine detection in the background. By default execution is blocked until Answering Machine Detection is completed.\n\n- `AsyncAmdStatusCallback?: string`\n URL destination for Telnyx to send AMD callback events to for the call.\n\n- `AsyncAmdStatusCallbackMethod?: 'GET' | 'POST'`\n HTTP request type used for `AsyncAmdStatusCallback`.\n\n- `CallerId?: string`\n To be used as the caller id name (SIP From Display Name) presented to the destination (`To` number). The string should have a maximum of 128 characters, containing only letters, numbers, spaces, and `-_~!.+` special characters. If omitted, the display name will be the same as the number in the `From` field.\n\n- `ConversationCallback?: string`\n URL destination for Telnyx to send AI conversation callback events for this call. Events include `conversation_created` and `conversation_ended`.\n\n- `ConversationCallbackMethod?: 'GET' | 'POST'`\n HTTP request type used for `ConversationCallback` and `ConversationCallbacks`.\n\n- `ConversationCallbacks?: string[]`\n Array of URL destinations for AI conversation callback events for this call. Events include `conversation_created` and `conversation_ended`.\n\n- `CustomHeaders?: { name: string; value: string; }[]`\n Custom HTTP headers to be sent with the call. Each header should be an object with 'name' and 'value' properties.\n\n- `DetectionMode?: 'Premium' | 'Regular'`\n Allows you to choose between Premium and Standard detections.\n\n- `MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd'`\n Enables Answering Machine Detection.\n\n- `MachineDetectionSilenceTimeout?: number`\n If initial silence duration is greater than this value, consider it a machine. Ignored when `premium` detection is used.\n\n- `MachineDetectionSpeechEndThreshold?: number`\n Silence duration threshold after a greeting message or voice for it be considered human. Ignored when `premium` detection is used.\n\n- `MachineDetectionSpeechThreshold?: number`\n Maximum threshold of a human greeting. If greeting longer than this value, considered machine. Ignored when `premium` detection is used.\n\n- `MachineDetectionTimeout?: number`\n Maximum timeout threshold in milliseconds for overall detection.\n\n- `Passports?: string`\n A string of passport identifiers to associate with the call.\n\n- `PreferredCodecs?: string`\n The list of comma-separated codecs to be offered on a call.\n\n- `Record?: boolean`\n Whether to record the entire participant's call leg. Defaults to `false`.\n\n- `RecordingChannels?: 'mono' | 'dual'`\n The number of channels in the final recording. Defaults to `mono`.\n\n- `RecordingStatusCallback?: string`\n The URL the recording callbacks will be sent to.\n\n- `RecordingStatusCallbackEvent?: string`\n The changes to the recording's state that should generate a call to `RecordingStatusCallback`. Can be: `in-progress`, `completed` and `absent`. Separate multiple values with a space. Defaults to `completed`.\n\n- `RecordingStatusCallbackMethod?: 'GET' | 'POST'`\n HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.\n\n- `RecordingTimeout?: number`\n The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected. The timer only starts when the speech is detected. The minimum value is 0. The default value is 0 (infinite).\n\n- `RecordingTrack?: 'inbound' | 'outbound' | 'both'`\n The audio track to record for the call. The default is `both`.\n\n- `SendRecordingUrl?: boolean`\n Whether to send RecordingUrl in webhooks.\n\n- `SipAuthPassword?: string`\n The password to use for SIP authentication.\n\n- `SipAuthUsername?: string`\n The username to use for SIP authentication.\n\n- `SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East'`\n Defines the SIP region to be used for the call.\n\n- `StatusCallback?: string`\n URL destination for Telnyx to send status callback events for this AI call. When provided, this per-call value overrides the status callback URL configured on the TeXML application/connection.\n\n- `StatusCallbackEvent?: string`\n The status callback events for which Telnyx should send a webhook for this AI call. Multiple events can be defined when separated by a space. Valid values: initiated, ringing, answered, completed, no-answer, busy, canceled, failed, analyzed. When provided, this per-call value overrides the status callback events configured on the TeXML application/connection.\n\n- `StatusCallbackMethod?: 'GET' | 'POST'`\n HTTP request type used for `StatusCallback` and `StatusCallbacks` for this AI call. When provided, this per-call value overrides the status callback method configured on the TeXML application/connection.\n\n- `StatusCallbacks?: string[]`\n Array of URL destinations for Telnyx to send status callback events for this AI call. When provided, these per-call values override the status callback URL configured on the TeXML application/connection.\n\n- `TimeLimit?: number`\n The maximum duration of the call in seconds. The minimum value is 30 and the maximum value is 14400 (4 hours). Default is 14400 seconds.\n\n- `Timeout?: number`\n The number of seconds to wait for the called party to answer the call before the call is canceled. The minimum value is 5 and the maximum value is 120. Default is 30 seconds.\n\n- `Trim?: 'trim-silence' | 'do-not-trim'`\n Whether to trim any leading and trailing silence from the recording. Defaults to `trim-silence`.\n\n### Returns\n\n- `{ call_sid?: string; from?: string; status?: string; to?: string; }`\n\n - `call_sid?: string`\n - `from?: string`\n - `status?: string`\n - `to?: string`\n\n### Example\n\n```typescript\nimport Telnyx from 'telnyx';\n\nconst client = new Telnyx();\n\nconst response = await client.texml.initiateAICall('connection_id', {\n AIAssistantId: 'ai-assistant-id-123',\n From: '+13120001234',\n To: '+13121230000',\n});\n\nconsole.log(response);\n```",
|
|
38601
38607
|
perLanguage: {
|
|
38602
38608
|
typescript: {
|
|
38603
38609
|
method: 'client.texml.initiateAICall',
|