telnyx 7.1.0 → 7.3.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 (102) hide show
  1. package/CHANGELOG.md +100 -2
  2. package/package.json +1 -1
  3. package/resources/ai/ai.d.mts +27 -47
  4. package/resources/ai/ai.d.mts.map +1 -1
  5. package/resources/ai/ai.d.ts +27 -47
  6. package/resources/ai/ai.d.ts.map +1 -1
  7. package/resources/ai/ai.js +12 -13
  8. package/resources/ai/ai.js.map +1 -1
  9. package/resources/ai/ai.mjs +12 -13
  10. package/resources/ai/ai.mjs.map +1 -1
  11. package/resources/calls/actions.d.mts +27 -0
  12. package/resources/calls/actions.d.mts.map +1 -1
  13. package/resources/calls/actions.d.ts +27 -0
  14. package/resources/calls/actions.d.ts.map +1 -1
  15. package/resources/dir/dir.d.mts +8 -0
  16. package/resources/dir/dir.d.mts.map +1 -1
  17. package/resources/dir/dir.d.ts +8 -0
  18. package/resources/dir/dir.d.ts.map +1 -1
  19. package/resources/dir/dir.js +8 -0
  20. package/resources/dir/dir.js.map +1 -1
  21. package/resources/dir/dir.mjs +8 -0
  22. package/resources/dir/dir.mjs.map +1 -1
  23. package/resources/dir/index.d.mts +2 -0
  24. package/resources/dir/index.d.mts.map +1 -1
  25. package/resources/dir/index.d.ts +2 -0
  26. package/resources/dir/index.d.ts.map +1 -1
  27. package/resources/dir/index.js +5 -1
  28. package/resources/dir/index.js.map +1 -1
  29. package/resources/dir/index.mjs +2 -0
  30. package/resources/dir/index.mjs.map +1 -1
  31. package/resources/dir/references.d.mts +231 -0
  32. package/resources/dir/references.d.mts.map +1 -0
  33. package/resources/dir/references.d.ts +231 -0
  34. package/resources/dir/references.d.ts.map +1 -0
  35. package/resources/dir/references.js +96 -0
  36. package/resources/dir/references.js.map +1 -0
  37. package/resources/dir/references.mjs +92 -0
  38. package/resources/dir/references.mjs.map +1 -0
  39. package/resources/dir/verify-email.d.mts +90 -0
  40. package/resources/dir/verify-email.d.mts.map +1 -0
  41. package/resources/dir/verify-email.d.ts +90 -0
  42. package/resources/dir/verify-email.d.ts.map +1 -0
  43. package/resources/dir/verify-email.js +65 -0
  44. package/resources/dir/verify-email.js.map +1 -0
  45. package/resources/dir/verify-email.mjs +61 -0
  46. package/resources/dir/verify-email.mjs.map +1 -0
  47. package/resources/documents.js +1 -1
  48. package/resources/documents.js.map +1 -1
  49. package/resources/documents.mjs +1 -1
  50. package/resources/documents.mjs.map +1 -1
  51. package/resources/messaging-10dlc/messaging-10dlc.d.mts +1 -1
  52. package/resources/messaging-10dlc/messaging-10dlc.d.mts.map +1 -1
  53. package/resources/messaging-10dlc/messaging-10dlc.d.ts +1 -1
  54. package/resources/messaging-10dlc/messaging-10dlc.d.ts.map +1 -1
  55. package/resources/texml/accounts/calls/calls.d.mts +3 -3
  56. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  57. package/resources/texml/accounts/calls/calls.d.ts +3 -3
  58. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  59. package/resources/whatsapp/index.d.mts +1 -1
  60. package/resources/whatsapp/index.d.mts.map +1 -1
  61. package/resources/whatsapp/index.d.ts +1 -1
  62. package/resources/whatsapp/index.d.ts.map +1 -1
  63. package/resources/whatsapp/index.js.map +1 -1
  64. package/resources/whatsapp/index.mjs.map +1 -1
  65. package/resources/whatsapp/phone-numbers/index.d.mts +1 -1
  66. package/resources/whatsapp/phone-numbers/index.d.mts.map +1 -1
  67. package/resources/whatsapp/phone-numbers/index.d.ts +1 -1
  68. package/resources/whatsapp/phone-numbers/index.d.ts.map +1 -1
  69. package/resources/whatsapp/phone-numbers/index.js.map +1 -1
  70. package/resources/whatsapp/phone-numbers/index.mjs.map +1 -1
  71. package/resources/whatsapp/phone-numbers/phone-numbers.d.mts +45 -1
  72. package/resources/whatsapp/phone-numbers/phone-numbers.d.mts.map +1 -1
  73. package/resources/whatsapp/phone-numbers/phone-numbers.d.ts +45 -1
  74. package/resources/whatsapp/phone-numbers/phone-numbers.d.ts.map +1 -1
  75. package/resources/whatsapp/phone-numbers/phone-numbers.js +20 -0
  76. package/resources/whatsapp/phone-numbers/phone-numbers.js.map +1 -1
  77. package/resources/whatsapp/phone-numbers/phone-numbers.mjs +20 -0
  78. package/resources/whatsapp/phone-numbers/phone-numbers.mjs.map +1 -1
  79. package/resources/whatsapp/whatsapp.d.mts +2 -2
  80. package/resources/whatsapp/whatsapp.d.mts.map +1 -1
  81. package/resources/whatsapp/whatsapp.d.ts +2 -2
  82. package/resources/whatsapp/whatsapp.d.ts.map +1 -1
  83. package/resources/whatsapp/whatsapp.js.map +1 -1
  84. package/resources/whatsapp/whatsapp.mjs.map +1 -1
  85. package/src/resources/ai/ai.ts +28 -51
  86. package/src/resources/calls/actions.ts +31 -0
  87. package/src/resources/dir/dir.ts +32 -0
  88. package/src/resources/dir/index.ts +14 -0
  89. package/src/resources/dir/references.ts +285 -0
  90. package/src/resources/dir/verify-email.ts +114 -0
  91. package/src/resources/documents.ts +1 -1
  92. package/src/resources/messaging-10dlc/messaging-10dlc.ts +1 -1
  93. package/src/resources/texml/accounts/calls/calls.ts +3 -3
  94. package/src/resources/whatsapp/index.ts +2 -0
  95. package/src/resources/whatsapp/phone-numbers/index.ts +2 -0
  96. package/src/resources/whatsapp/phone-numbers/phone-numbers.ts +62 -0
  97. package/src/resources/whatsapp/whatsapp.ts +4 -0
  98. package/src/version.ts +1 -1
  99. package/version.d.mts +1 -1
  100. package/version.d.ts +1 -1
  101. package/version.js +1 -1
  102. package/version.mjs +1 -1
@@ -1114,6 +1114,13 @@ export interface DeepgramNova2Config {
1114
1114
 
1115
1115
  transcription_model: 'deepgram/nova-2';
1116
1116
 
1117
+ /**
1118
+ * Nova-2 keyword biasing without intensifiers. Up to 100 terms to bias recognition
1119
+ * toward. For weighted biasing, use `keywords_boosting` instead. Nova-2-only; use
1120
+ * `keyterms` on Nova-3.
1121
+ */
1122
+ hints?: Array<string>;
1123
+
1117
1124
  /**
1118
1125
  * Whether to send also interim results. If set to false, only final results will
1119
1126
  * be sent.
@@ -1176,6 +1183,15 @@ export interface DeepgramNova2Config {
1176
1183
  | 'vi'
1177
1184
  | 'auto_detect';
1178
1185
 
1186
+ /**
1187
+ * Enable Deepgram's smart formatting (capitalization, punctuation, and digit
1188
+ * normalization). Note: Telnyx defaults this to `true`, overriding Deepgram's
1189
+ * underlying default of `false` — omit the field to get a smart-formatted
1190
+ * transcript, or set it to `false` to receive the raw lowercase transcript without
1191
+ * punctuation.
1192
+ */
1193
+ smart_format?: boolean;
1194
+
1179
1195
  /**
1180
1196
  * Number of milliseconds of silence to consider an utterance ended. Ranges from 0
1181
1197
  * to 5000 ms.
@@ -1194,6 +1210,12 @@ export interface DeepgramNova3Config {
1194
1210
  */
1195
1211
  interim_results?: boolean;
1196
1212
 
1213
+ /**
1214
+ * Nova-3 keyterm prompting. Up to 100 domain-specific terms or brand names to bias
1215
+ * recognition toward. Nova-3-only; use `hints` on Nova-2.
1216
+ */
1217
+ keyterms?: Array<string>;
1218
+
1197
1219
  /**
1198
1220
  * Keywords and their respective intensifiers (boosting values) to improve
1199
1221
  * transcription accuracy for specific words or phrases. The intensifier should be
@@ -1222,6 +1244,15 @@ export interface DeepgramNova3Config {
1222
1244
  | 'pt-PT'
1223
1245
  | 'auto_detect';
1224
1246
 
1247
+ /**
1248
+ * Enable Deepgram's smart formatting (capitalization, punctuation, and digit
1249
+ * normalization). Note: Telnyx defaults this to `true`, overriding Deepgram's
1250
+ * underlying default of `false` — omit the field to get a smart-formatted
1251
+ * transcript, or set it to `false` to receive the raw lowercase transcript without
1252
+ * punctuation.
1253
+ */
1254
+ smart_format?: boolean;
1255
+
1225
1256
  /**
1226
1257
  * Number of milliseconds of silence to consider an utterance ended. Ranges from 0
1227
1258
  * to 5000 ms.
@@ -36,6 +36,18 @@ import {
36
36
  PhoneNumbers,
37
37
  RejectionReason,
38
38
  } from './phone-numbers';
39
+ import * as ReferencesAPI from './references';
40
+ import {
41
+ Reference,
42
+ ReferenceCreateParams,
43
+ ReferenceInput,
44
+ ReferenceList,
45
+ ReferenceUpdateParams,
46
+ ReferenceUpdateResponse,
47
+ References,
48
+ } from './references';
49
+ import * as VerifyEmailAPI from './verify-email';
50
+ import { EmailVerificationStatusWrapped, VerifyEmail, VerifyEmailConfirmParams } from './verify-email';
39
51
  import * as LoaAPI from '../enterprises/reputation/loa';
40
52
  import { APIPromise } from '../../core/api-promise';
41
53
  import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from '../../core/pagination';
@@ -49,6 +61,8 @@ export class DirResource extends APIResource {
49
61
  this._client,
50
62
  );
51
63
  phoneNumbers: PhoneNumbersAPI.PhoneNumbers = new PhoneNumbersAPI.PhoneNumbers(this._client);
64
+ references: ReferencesAPI.References = new ReferencesAPI.References(this._client);
65
+ verifyEmail: VerifyEmailAPI.VerifyEmail = new VerifyEmailAPI.VerifyEmail(this._client);
52
66
 
53
67
  /**
54
68
  * Returns a single DIR by id. The enterprise is resolved server-side from the DIR
@@ -639,6 +653,8 @@ export interface DirUpdateInfringementParams {
639
653
  DirResource.Comments = Comments;
640
654
  DirResource.PhoneNumberBatches = PhoneNumberBatches;
641
655
  DirResource.PhoneNumbers = PhoneNumbers;
656
+ DirResource.References = References;
657
+ DirResource.VerifyEmail = VerifyEmail;
642
658
 
643
659
  export declare namespace DirResource {
644
660
  export {
@@ -687,6 +703,22 @@ export declare namespace DirResource {
687
703
  type PhoneNumberAddParams as PhoneNumberAddParams,
688
704
  type PhoneNumberRemoveParams as PhoneNumberRemoveParams,
689
705
  };
706
+
707
+ export {
708
+ References as References,
709
+ type Reference as Reference,
710
+ type ReferenceInput as ReferenceInput,
711
+ type ReferenceList as ReferenceList,
712
+ type ReferenceUpdateResponse as ReferenceUpdateResponse,
713
+ type ReferenceCreateParams as ReferenceCreateParams,
714
+ type ReferenceUpdateParams as ReferenceUpdateParams,
715
+ };
716
+
717
+ export {
718
+ VerifyEmail as VerifyEmail,
719
+ type EmailVerificationStatusWrapped as EmailVerificationStatusWrapped,
720
+ type VerifyEmailConfirmParams as VerifyEmailConfirmParams,
721
+ };
690
722
  }
691
723
 
692
724
  export { type InfringementClaimsDefaultFlatPagination };
@@ -44,3 +44,17 @@ export {
44
44
  type PhoneNumberRemoveParams,
45
45
  type DirPhoneNumbersDefaultFlatPagination,
46
46
  } from './phone-numbers';
47
+ export {
48
+ References,
49
+ type Reference,
50
+ type ReferenceInput,
51
+ type ReferenceList,
52
+ type ReferenceUpdateResponse,
53
+ type ReferenceCreateParams,
54
+ type ReferenceUpdateParams,
55
+ } from './references';
56
+ export {
57
+ VerifyEmail,
58
+ type EmailVerificationStatusWrapped,
59
+ type VerifyEmailConfirmParams,
60
+ } from './verify-email';
@@ -0,0 +1,285 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * Submit and manage the two business references and one financial reference that vouch for a DIR. References are contacted to confirm the business identity during vetting.
10
+ */
11
+ export class References extends APIResource {
12
+ /**
13
+ * Submit the two business references and one financial reference for a DIR.
14
+ *
15
+ * The DIR's authorizer email must be verified first (see the email-verification
16
+ * endpoint). Until it is, this returns `409` and no references are stored.
17
+ *
18
+ * The request body carries exactly two business references plus one financial
19
+ * reference. On success the references are stored and the response echoes them in
20
+ * the same shape as the GET. Submitting again converges on the already-stored
21
+ * references rather than erroring.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const referenceList = await client.dir.references.create(
26
+ * '16635d38-75a6-4481-82e8-69af60e05011',
27
+ * {
28
+ * business_references: [
29
+ * {
30
+ * email: 'dana.reyes@example.com',
31
+ * full_name: 'Dana Reyes',
32
+ * phone_e164: '+14155550123',
33
+ * timezone: 'America/New_York',
34
+ * },
35
+ * {
36
+ * email: 'dana.reyes@example.com',
37
+ * full_name: 'Dana Reyes',
38
+ * phone_e164: '+14155550123',
39
+ * timezone: 'America/New_York',
40
+ * },
41
+ * ],
42
+ * financial_reference: {
43
+ * email: 'dana.reyes@example.com',
44
+ * full_name: 'Dana Reyes',
45
+ * phone_e164: '+14155550123',
46
+ * timezone: 'America/New_York',
47
+ * },
48
+ * },
49
+ * );
50
+ * ```
51
+ */
52
+ create(dirID: string, body: ReferenceCreateParams, options?: RequestOptions): APIPromise<ReferenceList> {
53
+ return this._client.post(path`/dir/${dirID}/references`, { body, ...options });
54
+ }
55
+
56
+ /**
57
+ * Partially update one reference, addressed by the DIR id plus the reference's
58
+ * type (business or financial) and slot.
59
+ *
60
+ * Cosmetic fields (full name, job title, organization, relationship, email) are
61
+ * always editable. The phone number and timezone may only be changed while a
62
+ * scheduled call has not yet been dialed; if a call is in progress or all attempts
63
+ * are complete, those fields are locked. Changing the timezone reschedules any
64
+ * pending call into the new local calling window.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const reference = await client.dir.references.update(0, {
69
+ * dir_id: '16635d38-75a6-4481-82e8-69af60e05011',
70
+ * ref_type: 'business',
71
+ * });
72
+ * ```
73
+ */
74
+ update(
75
+ slot: number,
76
+ params: ReferenceUpdateParams,
77
+ options?: RequestOptions,
78
+ ): APIPromise<ReferenceUpdateResponse> {
79
+ const { dir_id, ref_type, ...body } = params;
80
+ return this._client.patch(path`/dir/${dir_id}/references/${ref_type}/${slot}`, { body, ...options });
81
+ }
82
+
83
+ /**
84
+ * List the business and financial references submitted for a DIR.
85
+ *
86
+ * Returns the two business references (slots 0 and 1) followed by the single
87
+ * financial reference. Each entry carries only the customer-supplied details
88
+ * (name, title, organization, relationship, phone, email, timezone). Returns an
89
+ * empty list when no references were submitted.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const referenceList = await client.dir.references.list(
94
+ * '16635d38-75a6-4481-82e8-69af60e05011',
95
+ * );
96
+ * ```
97
+ */
98
+ list(dirID: string, options?: RequestOptions): APIPromise<ReferenceList> {
99
+ return this._client.get(path`/dir/${dirID}/references`, options);
100
+ }
101
+ }
102
+
103
+ /**
104
+ * A reference (business or financial) on a DIR, in the customer-facing shape. No
105
+ * internal identifiers are exposed.
106
+ */
107
+ export interface Reference {
108
+ /**
109
+ * Full name of the reference contact.
110
+ */
111
+ full_name: string;
112
+
113
+ /**
114
+ * Reference phone number in E.164 format.
115
+ */
116
+ phone_e164: string;
117
+
118
+ /**
119
+ * Always `dir_reference`.
120
+ */
121
+ record_type: 'dir_reference';
122
+
123
+ /**
124
+ * Whether this is a business reference or the financial reference.
125
+ */
126
+ ref_type: 'business' | 'financial';
127
+
128
+ /**
129
+ * Position within the reference type. Business references occupy slots 0 and 1;
130
+ * the financial reference occupies slot 0.
131
+ */
132
+ slot: number;
133
+
134
+ /**
135
+ * IANA timezone id for the reference. Calls are only placed within the reference's
136
+ * local 8am-9pm window.
137
+ */
138
+ timezone: string;
139
+
140
+ /**
141
+ * Reference contact email address.
142
+ */
143
+ email?: string | null;
144
+
145
+ /**
146
+ * Job title of the reference contact.
147
+ */
148
+ job_title?: string | null;
149
+
150
+ /**
151
+ * Organization the reference contact belongs to.
152
+ */
153
+ organization?: string | null;
154
+
155
+ /**
156
+ * How the reference contact is related to the registering business.
157
+ */
158
+ relationship_to_registrant?: string | null;
159
+ }
160
+
161
+ /**
162
+ * One reference supplied at submit. The reference type is implied by the field
163
+ * that carries it (business_references vs financial_reference).
164
+ */
165
+ export interface ReferenceInput {
166
+ /**
167
+ * Reference contact email address. Required: the reference is emailed scheduling
168
+ * and dial-in notices.
169
+ */
170
+ email: string;
171
+
172
+ /**
173
+ * Full name of the reference contact.
174
+ */
175
+ full_name: string;
176
+
177
+ /**
178
+ * Reference phone number in E.164 format, e.g. +14155550123.
179
+ */
180
+ phone_e164: string;
181
+
182
+ /**
183
+ * IANA timezone id for the reference (e.g. America/New_York). Required: calls are
184
+ * only placed within the reference's local 8am-9pm window.
185
+ */
186
+ timezone: string;
187
+
188
+ /**
189
+ * Job title of the reference contact.
190
+ */
191
+ job_title?: string | null;
192
+
193
+ /**
194
+ * Organization the reference contact belongs to.
195
+ */
196
+ organization?: string | null;
197
+
198
+ /**
199
+ * How the reference contact is related to the registering business.
200
+ */
201
+ relationship_to_registrant?: string | null;
202
+ }
203
+
204
+ export interface ReferenceList {
205
+ data: Array<Reference>;
206
+ }
207
+
208
+ export interface ReferenceUpdateResponse {
209
+ /**
210
+ * A reference (business or financial) on a DIR, in the customer-facing shape. No
211
+ * internal identifiers are exposed.
212
+ */
213
+ data: Reference;
214
+ }
215
+
216
+ export interface ReferenceCreateParams {
217
+ /**
218
+ * Exactly two business references.
219
+ */
220
+ business_references: Array<ReferenceInput>;
221
+
222
+ /**
223
+ * One reference supplied at submit. The reference type is implied by the field
224
+ * that carries it (business_references vs financial_reference).
225
+ */
226
+ financial_reference: ReferenceInput;
227
+ }
228
+
229
+ export interface ReferenceUpdateParams {
230
+ /**
231
+ * Path param: The DIR id. Lowercase UUID.
232
+ */
233
+ dir_id: string;
234
+
235
+ /**
236
+ * Path param: Reference type to address.
237
+ */
238
+ ref_type: 'business' | 'financial';
239
+
240
+ /**
241
+ * Body param: Reference contact email address.
242
+ */
243
+ email?: string;
244
+
245
+ /**
246
+ * Body param: Full name of the reference contact.
247
+ */
248
+ full_name?: string;
249
+
250
+ /**
251
+ * Body param: Job title of the reference contact.
252
+ */
253
+ job_title?: string | null;
254
+
255
+ /**
256
+ * Body param: Organization the reference contact belongs to.
257
+ */
258
+ organization?: string | null;
259
+
260
+ /**
261
+ * Body param: Reference phone number in E.164 format.
262
+ */
263
+ phone_e164?: string;
264
+
265
+ /**
266
+ * Body param: How the reference contact is related to the registering business.
267
+ */
268
+ relationship_to_registrant?: string | null;
269
+
270
+ /**
271
+ * Body param: IANA timezone id for the reference.
272
+ */
273
+ timezone?: string;
274
+ }
275
+
276
+ export declare namespace References {
277
+ export {
278
+ type Reference as Reference,
279
+ type ReferenceInput as ReferenceInput,
280
+ type ReferenceList as ReferenceList,
281
+ type ReferenceUpdateResponse as ReferenceUpdateResponse,
282
+ type ReferenceCreateParams as ReferenceCreateParams,
283
+ type ReferenceUpdateParams as ReferenceUpdateParams,
284
+ };
285
+ }
@@ -0,0 +1,114 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * Verify ownership of a DIR's authorizer email. A short code is emailed and confirmed; the email must be verified before references can be submitted.
10
+ */
11
+ export class VerifyEmail extends APIResource {
12
+ /**
13
+ * Email a 6-digit code to the DIR's authorizer email to confirm ownership of that
14
+ * address.
15
+ *
16
+ * The code expires in 15 minutes. Requesting a new code invalidates any previous
17
+ * one. Resends are rate limited (a short cooldown plus a daily cap). Submit the
18
+ * code to `POST /dir/{dir_id}/verify_email/confirm`.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const emailVerificationStatusWrapped =
23
+ * await client.dir.verifyEmail.create(
24
+ * '16635d38-75a6-4481-82e8-69af60e05011',
25
+ * );
26
+ * ```
27
+ */
28
+ create(dirID: string, options?: RequestOptions): APIPromise<EmailVerificationStatusWrapped> {
29
+ return this._client.post(path`/dir/${dirID}/verify_email`, options);
30
+ }
31
+
32
+ /**
33
+ * Whether the DIR's current authorizer email has been verified.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const emailVerificationStatusWrapped =
38
+ * await client.dir.verifyEmail.list(
39
+ * '16635d38-75a6-4481-82e8-69af60e05011',
40
+ * );
41
+ * ```
42
+ */
43
+ list(dirID: string, options?: RequestOptions): APIPromise<EmailVerificationStatusWrapped> {
44
+ return this._client.get(path`/dir/${dirID}/verify_email`, options);
45
+ }
46
+
47
+ /**
48
+ * Submit the 6-digit code that was emailed to the DIR's authorizer email. On
49
+ * success the authorizer email is marked verified.
50
+ *
51
+ * For security, any failure (wrong, expired, already-used, or too many attempts)
52
+ * returns the same generic message.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const emailVerificationStatusWrapped =
57
+ * await client.dir.verifyEmail.confirm(
58
+ * '16635d38-75a6-4481-82e8-69af60e05011',
59
+ * { code: '482915' },
60
+ * );
61
+ * ```
62
+ */
63
+ confirm(
64
+ dirID: string,
65
+ body: VerifyEmailConfirmParams,
66
+ options?: RequestOptions,
67
+ ): APIPromise<EmailVerificationStatusWrapped> {
68
+ return this._client.post(path`/dir/${dirID}/verify_email/confirm`, { body, ...options });
69
+ }
70
+ }
71
+
72
+ export interface EmailVerificationStatusWrapped {
73
+ /**
74
+ * Verification state for a DIR's authorizer email.
75
+ */
76
+ data: EmailVerificationStatusWrapped.Data;
77
+ }
78
+
79
+ export namespace EmailVerificationStatusWrapped {
80
+ /**
81
+ * Verification state for a DIR's authorizer email.
82
+ */
83
+ export interface Data {
84
+ /**
85
+ * Whether the DIR's authorizer email has been confirmed.
86
+ */
87
+ email_verified: boolean;
88
+
89
+ /**
90
+ * Always `email_verification`.
91
+ */
92
+ record_type: 'email_verification';
93
+
94
+ /**
95
+ * `sent` after a code is emailed; `verified` after a successful confirm;
96
+ * `unverified` when no verification is in progress.
97
+ */
98
+ status: 'sent' | 'verified' | 'unverified';
99
+ }
100
+ }
101
+
102
+ export interface VerifyEmailConfirmParams {
103
+ /**
104
+ * The 6-digit code sent to the authorizer email.
105
+ */
106
+ code: string;
107
+ }
108
+
109
+ export declare namespace VerifyEmail {
110
+ export {
111
+ type EmailVerificationStatusWrapped as EmailVerificationStatusWrapped,
112
+ type VerifyEmailConfirmParams as VerifyEmailConfirmParams,
113
+ };
114
+ }
@@ -96,7 +96,7 @@ export class Documents extends APIResource {
96
96
  download(id: string, options?: RequestOptions): APIPromise<Response> {
97
97
  return this._client.get(path`/documents/${id}/download`, {
98
98
  ...options,
99
- headers: buildHeaders([{ Accept: '*' }, options?.headers]),
99
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
100
100
  __binaryResponse: true,
101
101
  });
102
102
  }
@@ -129,7 +129,7 @@ export class Messaging10dlc extends APIResource {
129
129
  export type Messaging10dlcGetEnumResponse =
130
130
  | Array<string>
131
131
  | Array<{ [key: string]: unknown }>
132
- | { [key: string]: unknown }
132
+ | { [key: string]: string }
133
133
  | { [key: string]: unknown }
134
134
  | Messaging10dlcGetEnumResponse.EnumPaginatedResponse;
135
135
 
@@ -700,7 +700,7 @@ export declare namespace CallCallsParams {
700
700
  * The call events for which Telnyx should send a webhook. Multiple events can be
701
701
  * defined when separated by a space.
702
702
  */
703
- StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
703
+ StatusCallbackEvent?: string;
704
704
 
705
705
  /**
706
706
  * HTTP request type used for `StatusCallback`.
@@ -976,7 +976,7 @@ export declare namespace CallCallsParams {
976
976
  * The call events for which Telnyx should send a webhook. Multiple events can be
977
977
  * defined when separated by a space.
978
978
  */
979
- StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
979
+ StatusCallbackEvent?: string;
980
980
 
981
981
  /**
982
982
  * HTTP request type used for `StatusCallback`.
@@ -1246,7 +1246,7 @@ export declare namespace CallCallsParams {
1246
1246
  * The call events for which Telnyx should send a webhook. Multiple events can be
1247
1247
  * defined when separated by a space.
1248
1248
  */
1249
- StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
1249
+ StatusCallbackEvent?: string;
1250
1250
 
1251
1251
  /**
1252
1252
  * HTTP request type used for `StatusCallback`.
@@ -10,8 +10,10 @@ export {
10
10
  export {
11
11
  PhoneNumbers,
12
12
  type PhoneNumberListResponse,
13
+ type PhoneNumberRetrieveConversationWindowResponse,
13
14
  type PhoneNumberListParams,
14
15
  type PhoneNumberResendVerificationParams,
16
+ type PhoneNumberRetrieveConversationWindowParams,
15
17
  type PhoneNumberVerifyParams,
16
18
  type PhoneNumberListResponsesDefaultFlatPagination,
17
19
  } from './phone-numbers/index';
@@ -10,8 +10,10 @@ export {
10
10
  export {
11
11
  PhoneNumbers,
12
12
  type PhoneNumberListResponse,
13
+ type PhoneNumberRetrieveConversationWindowResponse,
13
14
  type PhoneNumberListParams,
14
15
  type PhoneNumberResendVerificationParams,
16
+ type PhoneNumberRetrieveConversationWindowParams,
15
17
  type PhoneNumberVerifyParams,
16
18
  type PhoneNumberListResponsesDefaultFlatPagination,
17
19
  } from './phone-numbers';
@@ -93,6 +93,31 @@ export class PhoneNumbers extends APIResource {
93
93
  });
94
94
  }
95
95
 
96
+ /**
97
+ * Returns whether the 24-hour conversation window is currently open for a given
98
+ * source/destination pair. If window_active is false, only template messages may
99
+ * be sent.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response =
104
+ * await client.whatsapp.phoneNumbers.retrieveConversationWindow(
105
+ * 'phone_number',
106
+ * { destination_number: '+353894650851' },
107
+ * );
108
+ * ```
109
+ */
110
+ retrieveConversationWindow(
111
+ phoneNumber: string,
112
+ query: PhoneNumberRetrieveConversationWindowParams,
113
+ options?: RequestOptions,
114
+ ): APIPromise<PhoneNumberRetrieveConversationWindowResponse> {
115
+ return this._client.get(path`/v2/whatsapp/phone_numbers/${phoneNumber}/conversation_window`, {
116
+ query,
117
+ ...options,
118
+ });
119
+ }
120
+
96
121
  /**
97
122
  * Submit verification code for a phone number
98
123
  *
@@ -153,12 +178,47 @@ export interface PhoneNumberListResponse {
153
178
  waba_id?: string;
154
179
  }
155
180
 
181
+ export interface PhoneNumberRetrieveConversationWindowResponse {
182
+ data?: PhoneNumberRetrieveConversationWindowResponse.Data;
183
+ }
184
+
185
+ export namespace PhoneNumberRetrieveConversationWindowResponse {
186
+ export interface Data {
187
+ /**
188
+ * Timestamp of the last inbound message that opened the window
189
+ */
190
+ last_user_message_at?: string;
191
+
192
+ /**
193
+ * Whether the 24-hour conversation window is currently open
194
+ */
195
+ window_active?: boolean;
196
+
197
+ /**
198
+ * When the window closes. Null if no active window.
199
+ */
200
+ window_expires_at?: string;
201
+
202
+ /**
203
+ * Window type. Currently always 24h when present.
204
+ */
205
+ window_type?: string;
206
+ }
207
+ }
208
+
156
209
  export interface PhoneNumberListParams extends DefaultFlatPaginationParams {}
157
210
 
158
211
  export interface PhoneNumberResendVerificationParams {
159
212
  verification_method?: 'sms' | 'voice';
160
213
  }
161
214
 
215
+ export interface PhoneNumberRetrieveConversationWindowParams {
216
+ /**
217
+ * Destination phone number in E.164 format
218
+ */
219
+ destination_number: string;
220
+ }
221
+
162
222
  export interface PhoneNumberVerifyParams {
163
223
  code: string;
164
224
  }
@@ -169,9 +229,11 @@ PhoneNumbers.Profile = Profile;
169
229
  export declare namespace PhoneNumbers {
170
230
  export {
171
231
  type PhoneNumberListResponse as PhoneNumberListResponse,
232
+ type PhoneNumberRetrieveConversationWindowResponse as PhoneNumberRetrieveConversationWindowResponse,
172
233
  type PhoneNumberListResponsesDefaultFlatPagination as PhoneNumberListResponsesDefaultFlatPagination,
173
234
  type PhoneNumberListParams as PhoneNumberListParams,
174
235
  type PhoneNumberResendVerificationParams as PhoneNumberResendVerificationParams,
236
+ type PhoneNumberRetrieveConversationWindowParams as PhoneNumberRetrieveConversationWindowParams,
175
237
  type PhoneNumberVerifyParams as PhoneNumberVerifyParams,
176
238
  };
177
239