telnyx 6.34.0 → 6.36.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/ai/assistants/assistants.d.mts +16 -4
  11. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  12. package/resources/ai/assistants/assistants.d.ts +16 -4
  13. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  14. package/resources/ai/assistants/assistants.js.map +1 -1
  15. package/resources/ai/assistants/assistants.mjs.map +1 -1
  16. package/resources/enterprises/enterprises.d.mts +2 -2
  17. package/resources/enterprises/enterprises.d.mts.map +1 -1
  18. package/resources/enterprises/enterprises.d.ts +2 -2
  19. package/resources/enterprises/enterprises.d.ts.map +1 -1
  20. package/resources/enterprises/index.d.mts +1 -1
  21. package/resources/enterprises/index.d.mts.map +1 -1
  22. package/resources/enterprises/index.d.ts +1 -1
  23. package/resources/enterprises/index.d.ts.map +1 -1
  24. package/resources/enterprises/reputation/index.d.mts +2 -2
  25. package/resources/enterprises/reputation/index.d.mts.map +1 -1
  26. package/resources/enterprises/reputation/index.d.ts +2 -2
  27. package/resources/enterprises/reputation/index.d.ts.map +1 -1
  28. package/resources/enterprises/reputation/numbers.d.mts +43 -43
  29. package/resources/enterprises/reputation/numbers.d.mts.map +1 -1
  30. package/resources/enterprises/reputation/numbers.d.ts +43 -43
  31. package/resources/enterprises/reputation/numbers.d.ts.map +1 -1
  32. package/resources/enterprises/reputation/numbers.js +31 -31
  33. package/resources/enterprises/reputation/numbers.js.map +1 -1
  34. package/resources/enterprises/reputation/numbers.mjs +31 -31
  35. package/resources/enterprises/reputation/numbers.mjs.map +1 -1
  36. package/resources/enterprises/reputation/reputation.d.mts +45 -46
  37. package/resources/enterprises/reputation/reputation.d.mts.map +1 -1
  38. package/resources/enterprises/reputation/reputation.d.ts +45 -46
  39. package/resources/enterprises/reputation/reputation.d.ts.map +1 -1
  40. package/resources/enterprises/reputation/reputation.js +43 -44
  41. package/resources/enterprises/reputation/reputation.js.map +1 -1
  42. package/resources/enterprises/reputation/reputation.mjs +43 -44
  43. package/resources/enterprises/reputation/reputation.mjs.map +1 -1
  44. package/resources/index.d.mts +1 -1
  45. package/resources/index.d.mts.map +1 -1
  46. package/resources/index.d.ts +1 -1
  47. package/resources/index.d.ts.map +1 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +1 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/texml/accounts/calls/calls.d.mts +7 -0
  52. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  53. package/resources/texml/accounts/calls/calls.d.ts +7 -0
  54. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  55. package/resources/texml/accounts/calls/calls.js.map +1 -1
  56. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  57. package/resources/texml/index.d.mts +1 -1
  58. package/resources/texml/index.d.mts.map +1 -1
  59. package/resources/texml/index.d.ts +1 -1
  60. package/resources/texml/index.d.ts.map +1 -1
  61. package/resources/texml/index.js.map +1 -1
  62. package/resources/texml/index.mjs +1 -1
  63. package/resources/texml/index.mjs.map +1 -1
  64. package/resources/texml/texml.d.mts +219 -1
  65. package/resources/texml/texml.d.mts.map +1 -1
  66. package/resources/texml/texml.d.ts +219 -1
  67. package/resources/texml/texml.d.ts.map +1 -1
  68. package/resources/texml/texml.js +26 -0
  69. package/resources/texml/texml.js.map +1 -1
  70. package/resources/texml/texml.mjs +26 -0
  71. package/resources/texml/texml.mjs.map +1 -1
  72. package/src/client.ts +9 -1
  73. package/src/resources/ai/assistants/assistants.ts +18 -2
  74. package/src/resources/enterprises/enterprises.ts +6 -6
  75. package/src/resources/enterprises/index.ts +3 -3
  76. package/src/resources/enterprises/reputation/index.ts +6 -6
  77. package/src/resources/enterprises/reputation/numbers.ts +58 -54
  78. package/src/resources/enterprises/reputation/reputation.ts +60 -61
  79. package/src/resources/index.ts +7 -1
  80. package/src/resources/texml/accounts/calls/calls.ts +8 -0
  81. package/src/resources/texml/index.ts +7 -1
  82. package/src/resources/texml/texml.ts +279 -1
  83. package/src/version.ts +1 -1
  84. package/version.d.mts +1 -1
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/version.mjs +1 -1
@@ -8,6 +8,25 @@ import { RequestOptions } from "../../internal/request-options.mjs";
8
8
  */
9
9
  export declare class Texml extends APIResource {
10
10
  accounts: AccountsAPI.Accounts;
11
+ /**
12
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
13
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
14
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
15
+ * not allowed and will result in a 422 error.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const response = await client.texml.initiateAICall(
20
+ * 'connection_id',
21
+ * {
22
+ * AIAssistantId: 'ai-assistant-id-123',
23
+ * From: '+13120001234',
24
+ * To: '+13121230000',
25
+ * },
26
+ * );
27
+ * ```
28
+ */
29
+ initiateAICall(connectionID: string, params: TexmlInitiateAICallParams, options?: RequestOptions): APIPromise<TexmlInitiateAICallResponse>;
11
30
  /**
12
31
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
13
32
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -25,6 +44,12 @@ export declare class Texml extends APIResource {
25
44
  */
26
45
  secrets(body: TexmlSecretsParams, options?: RequestOptions): APIPromise<TexmlSecretsResponse>;
27
46
  }
47
+ export interface TexmlInitiateAICallResponse {
48
+ call_sid?: string;
49
+ from?: string;
50
+ status?: string;
51
+ to?: string;
52
+ }
28
53
  export interface TexmlSecretsResponse {
29
54
  data?: TexmlSecretsResponse.Data;
30
55
  }
@@ -34,6 +59,199 @@ export declare namespace TexmlSecretsResponse {
34
59
  value?: 'REDACTED';
35
60
  }
36
61
  }
62
+ export interface TexmlInitiateAICallParams {
63
+ /**
64
+ * The ID of the AI assistant to use for the call.
65
+ */
66
+ AIAssistantId: string;
67
+ /**
68
+ * The phone number of the party initiating the call. Phone numbers are formatted
69
+ * with a `+` and country code.
70
+ */
71
+ From: string;
72
+ /**
73
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
74
+ * country code.
75
+ */
76
+ To: string;
77
+ /**
78
+ * Key-value map of dynamic variables to pass to the AI assistant.
79
+ */
80
+ AIAssistantDynamicVariables?: {
81
+ [key: string]: string;
82
+ };
83
+ /**
84
+ * The version of the AI assistant to use.
85
+ */
86
+ AIAssistantVersion?: string;
87
+ /**
88
+ * Select whether to perform answering machine detection in the background. By
89
+ * default execution is blocked until Answering Machine Detection is completed.
90
+ */
91
+ AsyncAmd?: boolean;
92
+ /**
93
+ * URL destination for Telnyx to send AMD callback events to for the call.
94
+ */
95
+ AsyncAmdStatusCallback?: string;
96
+ /**
97
+ * HTTP request type used for `AsyncAmdStatusCallback`.
98
+ */
99
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
100
+ /**
101
+ * To be used as the caller id name (SIP From Display Name) presented to the
102
+ * destination (`To` number). The string should have a maximum of 128 characters,
103
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
104
+ * omitted, the display name will be the same as the number in the `From` field.
105
+ */
106
+ CallerId?: string;
107
+ /**
108
+ * URL destination for Telnyx to send conversation callback events to.
109
+ */
110
+ ConversationCallback?: string;
111
+ /**
112
+ * HTTP request type used for `ConversationCallback`.
113
+ */
114
+ ConversationCallbackMethod?: 'GET' | 'POST';
115
+ /**
116
+ * An array of URL destinations for conversation callback events.
117
+ */
118
+ ConversationCallbacks?: Array<string>;
119
+ /**
120
+ * Custom HTTP headers to be sent with the call. Each header should be an object
121
+ * with 'name' and 'value' properties.
122
+ */
123
+ CustomHeaders?: Array<TexmlInitiateAICallParams.CustomHeader>;
124
+ /**
125
+ * Allows you to choose between Premium and Standard detections.
126
+ */
127
+ DetectionMode?: 'Premium' | 'Regular';
128
+ /**
129
+ * Enables Answering Machine Detection.
130
+ */
131
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
132
+ /**
133
+ * If initial silence duration is greater than this value, consider it a machine.
134
+ * Ignored when `premium` detection is used.
135
+ */
136
+ MachineDetectionSilenceTimeout?: number;
137
+ /**
138
+ * Silence duration threshold after a greeting message or voice for it be
139
+ * considered human. Ignored when `premium` detection is used.
140
+ */
141
+ MachineDetectionSpeechEndThreshold?: number;
142
+ /**
143
+ * Maximum threshold of a human greeting. If greeting longer than this value,
144
+ * considered machine. Ignored when `premium` detection is used.
145
+ */
146
+ MachineDetectionSpeechThreshold?: number;
147
+ /**
148
+ * Maximum timeout threshold in milliseconds for overall detection.
149
+ */
150
+ MachineDetectionTimeout?: number;
151
+ /**
152
+ * A string of passport identifiers to associate with the call.
153
+ */
154
+ Passports?: string;
155
+ /**
156
+ * The list of comma-separated codecs to be offered on a call.
157
+ */
158
+ PreferredCodecs?: string;
159
+ /**
160
+ * Whether to record the entire participant's call leg. Defaults to `false`.
161
+ */
162
+ Record?: boolean;
163
+ /**
164
+ * The number of channels in the final recording. Defaults to `mono`.
165
+ */
166
+ RecordingChannels?: 'mono' | 'dual';
167
+ /**
168
+ * The URL the recording callbacks will be sent to.
169
+ */
170
+ RecordingStatusCallback?: string;
171
+ /**
172
+ * The changes to the recording's state that should generate a call to
173
+ * `RecordingStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
174
+ * Separate multiple values with a space. Defaults to `completed`.
175
+ */
176
+ RecordingStatusCallbackEvent?: string;
177
+ /**
178
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
179
+ */
180
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
181
+ /**
182
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
183
+ * silence is detected. The timer only starts when the speech is detected. The
184
+ * minimum value is 0. The default value is 0 (infinite).
185
+ */
186
+ RecordingTimeout?: number;
187
+ /**
188
+ * The audio track to record for the call. The default is `both`.
189
+ */
190
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
191
+ /**
192
+ * Whether to send RecordingUrl in webhooks.
193
+ */
194
+ SendRecordingUrl?: boolean;
195
+ /**
196
+ * The password to use for SIP authentication.
197
+ */
198
+ SipAuthPassword?: string;
199
+ /**
200
+ * The username to use for SIP authentication.
201
+ */
202
+ SipAuthUsername?: string;
203
+ /**
204
+ * Defines the SIP region to be used for the call.
205
+ */
206
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
207
+ /**
208
+ * URL destination for Telnyx to send status callback events to for the call.
209
+ */
210
+ StatusCallback?: string;
211
+ /**
212
+ * The call events for which Telnyx should send a webhook. Multiple events can be
213
+ * defined when separated by a space. Valid values: initiated, ringing, answered,
214
+ * completed.
215
+ */
216
+ StatusCallbackEvent?: string;
217
+ /**
218
+ * HTTP request type used for `StatusCallback`.
219
+ */
220
+ StatusCallbackMethod?: 'GET' | 'POST';
221
+ /**
222
+ * An array of URL destinations for Telnyx to send status callback events to for
223
+ * the call.
224
+ */
225
+ StatusCallbacks?: Array<string>;
226
+ /**
227
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
228
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
229
+ */
230
+ TimeLimit?: number;
231
+ /**
232
+ * The number of seconds to wait for the called party to answer the call before the
233
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
234
+ * is 30 seconds.
235
+ */
236
+ timeout_seconds?: number;
237
+ /**
238
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
239
+ * `trim-silence`.
240
+ */
241
+ Trim?: 'trim-silence' | 'do-not-trim';
242
+ }
243
+ export declare namespace TexmlInitiateAICallParams {
244
+ interface CustomHeader {
245
+ /**
246
+ * The name of the custom header
247
+ */
248
+ name: string;
249
+ /**
250
+ * The value of the custom header
251
+ */
252
+ value: string;
253
+ }
254
+ }
37
255
  export interface TexmlSecretsParams {
38
256
  /**
39
257
  * Name used as a reference for the secret, if the name already exists within the
@@ -46,7 +264,7 @@ export interface TexmlSecretsParams {
46
264
  value: string;
47
265
  }
48
266
  export declare namespace Texml {
49
- export { type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlSecretsParams as TexmlSecretsParams };
267
+ export { type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse, type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlInitiateAICallParams as TexmlInitiateAICallParams, type TexmlSecretsParams as TexmlSecretsParams, };
50
268
  export { Accounts as Accounts, type TexmlGetCallRecordingResponseBody as TexmlGetCallRecordingResponseBody, type TexmlRecordingSubresourcesUris as TexmlRecordingSubresourcesUris, type AccountRetrieveRecordingsJsonResponse as AccountRetrieveRecordingsJsonResponse, type AccountRetrieveTranscriptionsJsonResponse as AccountRetrieveTranscriptionsJsonResponse, type AccountRetrieveRecordingsJsonParams as AccountRetrieveRecordingsJsonParams, type AccountRetrieveTranscriptionsJsonParams as AccountRetrieveTranscriptionsJsonParams, };
51
269
  }
52
270
  //# sourceMappingURL=texml.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"texml.d.mts","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,mCAAmC,EACnC,qCAAqC,EACrC,uCAAuC,EACvC,yCAAyC,EACzC,QAAQ,EACR,iCAAiC,EACjC,8BAA8B,EAC/B;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG9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EG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEtC;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEhC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;CACvC;AAED,yBAAiB,yBAAyB,CAAC;IACzC,UAAiB,YAAY;QAC3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,uCAAuC,IAAI,uCAAuC,GACxF,CAAC;CACH"}
@@ -8,6 +8,25 @@ import { RequestOptions } from "../../internal/request-options.js";
8
8
  */
9
9
  export declare class Texml extends APIResource {
10
10
  accounts: AccountsAPI.Accounts;
11
+ /**
12
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
13
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
14
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
15
+ * not allowed and will result in a 422 error.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const response = await client.texml.initiateAICall(
20
+ * 'connection_id',
21
+ * {
22
+ * AIAssistantId: 'ai-assistant-id-123',
23
+ * From: '+13120001234',
24
+ * To: '+13121230000',
25
+ * },
26
+ * );
27
+ * ```
28
+ */
29
+ initiateAICall(connectionID: string, params: TexmlInitiateAICallParams, options?: RequestOptions): APIPromise<TexmlInitiateAICallResponse>;
11
30
  /**
12
31
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
13
32
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -25,6 +44,12 @@ export declare class Texml extends APIResource {
25
44
  */
26
45
  secrets(body: TexmlSecretsParams, options?: RequestOptions): APIPromise<TexmlSecretsResponse>;
27
46
  }
47
+ export interface TexmlInitiateAICallResponse {
48
+ call_sid?: string;
49
+ from?: string;
50
+ status?: string;
51
+ to?: string;
52
+ }
28
53
  export interface TexmlSecretsResponse {
29
54
  data?: TexmlSecretsResponse.Data;
30
55
  }
@@ -34,6 +59,199 @@ export declare namespace TexmlSecretsResponse {
34
59
  value?: 'REDACTED';
35
60
  }
36
61
  }
62
+ export interface TexmlInitiateAICallParams {
63
+ /**
64
+ * The ID of the AI assistant to use for the call.
65
+ */
66
+ AIAssistantId: string;
67
+ /**
68
+ * The phone number of the party initiating the call. Phone numbers are formatted
69
+ * with a `+` and country code.
70
+ */
71
+ From: string;
72
+ /**
73
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
74
+ * country code.
75
+ */
76
+ To: string;
77
+ /**
78
+ * Key-value map of dynamic variables to pass to the AI assistant.
79
+ */
80
+ AIAssistantDynamicVariables?: {
81
+ [key: string]: string;
82
+ };
83
+ /**
84
+ * The version of the AI assistant to use.
85
+ */
86
+ AIAssistantVersion?: string;
87
+ /**
88
+ * Select whether to perform answering machine detection in the background. By
89
+ * default execution is blocked until Answering Machine Detection is completed.
90
+ */
91
+ AsyncAmd?: boolean;
92
+ /**
93
+ * URL destination for Telnyx to send AMD callback events to for the call.
94
+ */
95
+ AsyncAmdStatusCallback?: string;
96
+ /**
97
+ * HTTP request type used for `AsyncAmdStatusCallback`.
98
+ */
99
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
100
+ /**
101
+ * To be used as the caller id name (SIP From Display Name) presented to the
102
+ * destination (`To` number). The string should have a maximum of 128 characters,
103
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
104
+ * omitted, the display name will be the same as the number in the `From` field.
105
+ */
106
+ CallerId?: string;
107
+ /**
108
+ * URL destination for Telnyx to send conversation callback events to.
109
+ */
110
+ ConversationCallback?: string;
111
+ /**
112
+ * HTTP request type used for `ConversationCallback`.
113
+ */
114
+ ConversationCallbackMethod?: 'GET' | 'POST';
115
+ /**
116
+ * An array of URL destinations for conversation callback events.
117
+ */
118
+ ConversationCallbacks?: Array<string>;
119
+ /**
120
+ * Custom HTTP headers to be sent with the call. Each header should be an object
121
+ * with 'name' and 'value' properties.
122
+ */
123
+ CustomHeaders?: Array<TexmlInitiateAICallParams.CustomHeader>;
124
+ /**
125
+ * Allows you to choose between Premium and Standard detections.
126
+ */
127
+ DetectionMode?: 'Premium' | 'Regular';
128
+ /**
129
+ * Enables Answering Machine Detection.
130
+ */
131
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
132
+ /**
133
+ * If initial silence duration is greater than this value, consider it a machine.
134
+ * Ignored when `premium` detection is used.
135
+ */
136
+ MachineDetectionSilenceTimeout?: number;
137
+ /**
138
+ * Silence duration threshold after a greeting message or voice for it be
139
+ * considered human. Ignored when `premium` detection is used.
140
+ */
141
+ MachineDetectionSpeechEndThreshold?: number;
142
+ /**
143
+ * Maximum threshold of a human greeting. If greeting longer than this value,
144
+ * considered machine. Ignored when `premium` detection is used.
145
+ */
146
+ MachineDetectionSpeechThreshold?: number;
147
+ /**
148
+ * Maximum timeout threshold in milliseconds for overall detection.
149
+ */
150
+ MachineDetectionTimeout?: number;
151
+ /**
152
+ * A string of passport identifiers to associate with the call.
153
+ */
154
+ Passports?: string;
155
+ /**
156
+ * The list of comma-separated codecs to be offered on a call.
157
+ */
158
+ PreferredCodecs?: string;
159
+ /**
160
+ * Whether to record the entire participant's call leg. Defaults to `false`.
161
+ */
162
+ Record?: boolean;
163
+ /**
164
+ * The number of channels in the final recording. Defaults to `mono`.
165
+ */
166
+ RecordingChannels?: 'mono' | 'dual';
167
+ /**
168
+ * The URL the recording callbacks will be sent to.
169
+ */
170
+ RecordingStatusCallback?: string;
171
+ /**
172
+ * The changes to the recording's state that should generate a call to
173
+ * `RecordingStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
174
+ * Separate multiple values with a space. Defaults to `completed`.
175
+ */
176
+ RecordingStatusCallbackEvent?: string;
177
+ /**
178
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
179
+ */
180
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
181
+ /**
182
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
183
+ * silence is detected. The timer only starts when the speech is detected. The
184
+ * minimum value is 0. The default value is 0 (infinite).
185
+ */
186
+ RecordingTimeout?: number;
187
+ /**
188
+ * The audio track to record for the call. The default is `both`.
189
+ */
190
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
191
+ /**
192
+ * Whether to send RecordingUrl in webhooks.
193
+ */
194
+ SendRecordingUrl?: boolean;
195
+ /**
196
+ * The password to use for SIP authentication.
197
+ */
198
+ SipAuthPassword?: string;
199
+ /**
200
+ * The username to use for SIP authentication.
201
+ */
202
+ SipAuthUsername?: string;
203
+ /**
204
+ * Defines the SIP region to be used for the call.
205
+ */
206
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
207
+ /**
208
+ * URL destination for Telnyx to send status callback events to for the call.
209
+ */
210
+ StatusCallback?: string;
211
+ /**
212
+ * The call events for which Telnyx should send a webhook. Multiple events can be
213
+ * defined when separated by a space. Valid values: initiated, ringing, answered,
214
+ * completed.
215
+ */
216
+ StatusCallbackEvent?: string;
217
+ /**
218
+ * HTTP request type used for `StatusCallback`.
219
+ */
220
+ StatusCallbackMethod?: 'GET' | 'POST';
221
+ /**
222
+ * An array of URL destinations for Telnyx to send status callback events to for
223
+ * the call.
224
+ */
225
+ StatusCallbacks?: Array<string>;
226
+ /**
227
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
228
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
229
+ */
230
+ TimeLimit?: number;
231
+ /**
232
+ * The number of seconds to wait for the called party to answer the call before the
233
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
234
+ * is 30 seconds.
235
+ */
236
+ timeout_seconds?: number;
237
+ /**
238
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
239
+ * `trim-silence`.
240
+ */
241
+ Trim?: 'trim-silence' | 'do-not-trim';
242
+ }
243
+ export declare namespace TexmlInitiateAICallParams {
244
+ interface CustomHeader {
245
+ /**
246
+ * The name of the custom header
247
+ */
248
+ name: string;
249
+ /**
250
+ * The value of the custom header
251
+ */
252
+ value: string;
253
+ }
254
+ }
37
255
  export interface TexmlSecretsParams {
38
256
  /**
39
257
  * Name used as a reference for the secret, if the name already exists within the
@@ -46,7 +264,7 @@ export interface TexmlSecretsParams {
46
264
  value: string;
47
265
  }
48
266
  export declare namespace Texml {
49
- export { type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlSecretsParams as TexmlSecretsParams };
267
+ export { type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse, type TexmlSecretsResponse as TexmlSecretsResponse, type TexmlInitiateAICallParams as TexmlInitiateAICallParams, type TexmlSecretsParams as TexmlSecretsParams, };
50
268
  export { Accounts as Accounts, type TexmlGetCallRecordingResponseBody as TexmlGetCallRecordingResponseBody, type TexmlRecordingSubresourcesUris as TexmlRecordingSubresourcesUris, type AccountRetrieveRecordingsJsonResponse as AccountRetrieveRecordingsJsonResponse, type AccountRetrieveTranscriptionsJsonResponse as AccountRetrieveTranscriptionsJsonResponse, type AccountRetrieveRecordingsJsonParams as AccountRetrieveRecordingsJsonParams, type AccountRetrieveTranscriptionsJsonParams as AccountRetrieveTranscriptionsJsonParams, };
51
269
  }
52
270
  //# sourceMappingURL=texml.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"texml.d.ts","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,mCAAmC,EACnC,qCAAqC,EACrC,uCAAuC,EACvC,yCAAyC,EACzC,QAAQ,EACR,iCAAiC,EACjC,8BAA8B,EAC/B;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;CAG9F;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,IAAI;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,KAAK,CAAC,EAAE,UAAU,CAAC;KACpB;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,oBAAoB,IAAI,oBAAoB,EAAE,KAAK,kBAAkB,I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;QAC3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,uCAAuC,IAAI,uCAAuC,GACxF,CAAC;CACH"}
@@ -6,6 +6,7 @@ const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
7
  const AccountsAPI = tslib_1.__importStar(require("./accounts/accounts.js"));
8
8
  const accounts_1 = require("./accounts/accounts.js");
9
+ const path_1 = require("../../internal/utils/path.js");
9
10
  /**
10
11
  * TeXML REST Commands
11
12
  */
@@ -14,6 +15,31 @@ class Texml extends resource_1.APIResource {
14
15
  super(...arguments);
15
16
  this.accounts = new AccountsAPI.Accounts(this._client);
16
17
  }
18
+ /**
19
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
20
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
21
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
22
+ * not allowed and will result in a 422 error.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response = await client.texml.initiateAICall(
27
+ * 'connection_id',
28
+ * {
29
+ * AIAssistantId: 'ai-assistant-id-123',
30
+ * From: '+13120001234',
31
+ * To: '+13121230000',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ initiateAICall(connectionID, params, options) {
37
+ const { timeout_seconds, ...body } = params;
38
+ return this._client.post((0, path_1.path) `/texml/ai_calls/${connectionID}`, {
39
+ body: { Timeout: timeout_seconds, ...body },
40
+ ...options,
41
+ });
42
+ }
17
43
  /**
18
44
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
19
45
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -1 +1 @@
1
- {"version":3,"file":"texml.js","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,4EAAmD;AACnD,qDAQ6B;AAI7B;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoB1E,CAAC;IAlBC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AArBD,sBAqBC;AA2BD,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
1
+ {"version":3,"file":"texml.js","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,4EAAmD;AACnD,qDAQ6B;AAG7B,uDAAiD;AAEjD;;GAEG;AACH,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkD1E,CAAC;IAhDC;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CACZ,YAAoB,EACpB,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,mBAAmB,YAAY,EAAE,EAAE;YAC9D,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AAnDD,sBAmDC;AA6QD,KAAK,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -2,6 +2,7 @@
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as AccountsAPI from "./accounts/accounts.mjs";
4
4
  import { Accounts, } from "./accounts/accounts.mjs";
5
+ import { path } from "../../internal/utils/path.mjs";
5
6
  /**
6
7
  * TeXML REST Commands
7
8
  */
@@ -10,6 +11,31 @@ export class Texml extends APIResource {
10
11
  super(...arguments);
11
12
  this.accounts = new AccountsAPI.Accounts(this._client);
12
13
  }
14
+ /**
15
+ * Initiate an outbound AI call with warm-up support. Validates parameters, builds
16
+ * an internal TeXML with an AI Assistant configuration, encodes instructions into
17
+ * client state, and calls the dial API. The Twiml, Texml, and Url parameters are
18
+ * not allowed and will result in a 422 error.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const response = await client.texml.initiateAICall(
23
+ * 'connection_id',
24
+ * {
25
+ * AIAssistantId: 'ai-assistant-id-123',
26
+ * From: '+13120001234',
27
+ * To: '+13121230000',
28
+ * },
29
+ * );
30
+ * ```
31
+ */
32
+ initiateAICall(connectionID, params, options) {
33
+ const { timeout_seconds, ...body } = params;
34
+ return this._client.post(path `/texml/ai_calls/${connectionID}`, {
35
+ body: { Timeout: timeout_seconds, ...body },
36
+ ...options,
37
+ });
38
+ }
13
39
  /**
14
40
  * Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML
15
41
  * when using Mustache Templates in your TeXML. In your TeXML you will be able to
@@ -1 +1 @@
1
- {"version":3,"file":"texml.mjs","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAKL,QAAQ,GAGT;AAID;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoB1E,CAAC;IAlBC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA2BD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"texml.mjs","sourceRoot":"","sources":["../../src/resources/texml/texml.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAKL,QAAQ,GAGT;OAGM,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkD1E,CAAC;IAhDC;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CACZ,YAAoB,EACpB,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,mBAAmB,YAAY,EAAE,EAAE;YAC9D,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;CACF;AA6QD,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
package/src/client.ts CHANGED
@@ -1496,7 +1496,13 @@ import {
1496
1496
  } from './resources/sim-cards/sim-cards';
1497
1497
  import { Storage, StorageListMigrationSourceCoverageResponse } from './resources/storage/storage';
1498
1498
  import { TermsOfService } from './resources/terms-of-service/terms-of-service';
1499
- import { Texml, TexmlSecretsParams, TexmlSecretsResponse } from './resources/texml/texml';
1499
+ import {
1500
+ Texml,
1501
+ TexmlInitiateAICallParams,
1502
+ TexmlInitiateAICallResponse,
1503
+ TexmlSecretsParams,
1504
+ TexmlSecretsResponse,
1505
+ } from './resources/texml/texml';
1500
1506
  import {
1501
1507
  StreamClientEvent,
1502
1508
  StreamServerEvent,
@@ -4487,7 +4493,9 @@ export declare namespace Telnyx {
4487
4493
 
4488
4494
  export {
4489
4495
  Texml as Texml,
4496
+ type TexmlInitiateAICallResponse as TexmlInitiateAICallResponse,
4490
4497
  type TexmlSecretsResponse as TexmlSecretsResponse,
4498
+ type TexmlInitiateAICallParams as TexmlInitiateAICallParams,
4491
4499
  type TexmlSecretsParams as TexmlSecretsParams,
4492
4500
  };
4493
4501
 
@@ -788,14 +788,30 @@ export namespace AssistantTool {
788
788
  /**
789
789
  * The send_message tool allows the assistant to send SMS or MMS messages to the
790
790
  * end user. The 'to' and 'from' addresses are automatically determined from the
791
- * conversation context, and the message text is generated by the assistant.
791
+ * conversation context, and the message text is generated by the assistant unless
792
+ * a message_template is provided for runtime variable substitution.
792
793
  */
793
794
  export interface SendMessage {
794
- send_message: { [key: string]: unknown };
795
+ send_message: SendMessage.SendMessage;
795
796
 
796
797
  type: 'send_message';
797
798
  }
798
799
 
800
+ export namespace SendMessage {
801
+ export interface SendMessage {
802
+ /**
803
+ * Optional message template with dynamic variable support using mustache syntax
804
+ * (e.g., {{variable_name}}). When set, the assistant will use this template for
805
+ * the SMS body instead of generating one. Dynamic variables like
806
+ * {{telnyx_end_user_target}}, {{telnyx_agent_target}}, and custom webhook-provided
807
+ * variables will be resolved at runtime.
808
+ */
809
+ message_template?: string | null;
810
+
811
+ [k: string]: unknown;
812
+ }
813
+ }
814
+
799
815
  export interface SkipTurn {
800
816
  skip_turn: SkipTurn.SkipTurn;
801
817