@sentdm/sentdm 0.25.4 → 0.26.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 (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +12 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/contacts.d.mts +488 -68
  10. package/resources/contacts.d.mts.map +1 -1
  11. package/resources/contacts.d.ts +488 -68
  12. package/resources/contacts.d.ts.map +1 -1
  13. package/resources/contacts.js +3 -3
  14. package/resources/contacts.js.map +1 -1
  15. package/resources/contacts.mjs +3 -3
  16. package/resources/contacts.mjs.map +1 -1
  17. package/resources/index.d.mts +6 -6
  18. package/resources/index.d.mts.map +1 -1
  19. package/resources/index.d.ts +6 -6
  20. package/resources/index.d.ts.map +1 -1
  21. package/resources/index.js.map +1 -1
  22. package/resources/index.mjs.map +1 -1
  23. package/resources/me.d.mts +113 -40
  24. package/resources/me.d.mts.map +1 -1
  25. package/resources/me.d.ts +113 -40
  26. package/resources/me.d.ts.map +1 -1
  27. package/resources/me.js.map +1 -1
  28. package/resources/me.mjs.map +1 -1
  29. package/resources/messages.d.mts +130 -9
  30. package/resources/messages.d.mts.map +1 -1
  31. package/resources/messages.d.ts +130 -9
  32. package/resources/messages.d.ts.map +1 -1
  33. package/resources/messages.js.map +1 -1
  34. package/resources/messages.mjs.map +1 -1
  35. package/resources/numbers.d.mts +42 -3
  36. package/resources/numbers.d.mts.map +1 -1
  37. package/resources/numbers.d.ts +42 -3
  38. package/resources/numbers.d.ts.map +1 -1
  39. package/resources/numbers.js.map +1 -1
  40. package/resources/numbers.mjs.map +1 -1
  41. package/resources/profiles/campaigns.d.mts +480 -147
  42. package/resources/profiles/campaigns.d.mts.map +1 -1
  43. package/resources/profiles/campaigns.d.ts +480 -147
  44. package/resources/profiles/campaigns.d.ts.map +1 -1
  45. package/resources/profiles/campaigns.js +39 -41
  46. package/resources/profiles/campaigns.js.map +1 -1
  47. package/resources/profiles/campaigns.mjs +39 -41
  48. package/resources/profiles/campaigns.mjs.map +1 -1
  49. package/resources/profiles/index.d.mts +2 -2
  50. package/resources/profiles/index.d.mts.map +1 -1
  51. package/resources/profiles/index.d.ts +2 -2
  52. package/resources/profiles/index.d.ts.map +1 -1
  53. package/resources/profiles/index.js.map +1 -1
  54. package/resources/profiles/index.mjs.map +1 -1
  55. package/resources/profiles/profiles.d.mts +1699 -391
  56. package/resources/profiles/profiles.d.mts.map +1 -1
  57. package/resources/profiles/profiles.d.ts +1699 -391
  58. package/resources/profiles/profiles.d.ts.map +1 -1
  59. package/resources/profiles/profiles.js +3 -6
  60. package/resources/profiles/profiles.js.map +1 -1
  61. package/resources/profiles/profiles.mjs +3 -6
  62. package/resources/profiles/profiles.mjs.map +1 -1
  63. package/resources/templates.d.mts +993 -172
  64. package/resources/templates.d.mts.map +1 -1
  65. package/resources/templates.d.ts +993 -172
  66. package/resources/templates.d.ts.map +1 -1
  67. package/resources/templates.js +3 -3
  68. package/resources/templates.js.map +1 -1
  69. package/resources/templates.mjs +3 -3
  70. package/resources/templates.mjs.map +1 -1
  71. package/resources/users.d.mts +373 -46
  72. package/resources/users.d.mts.map +1 -1
  73. package/resources/users.d.ts +373 -46
  74. package/resources/users.d.ts.map +1 -1
  75. package/resources/users.js +3 -7
  76. package/resources/users.js.map +1 -1
  77. package/resources/users.mjs +3 -7
  78. package/resources/users.mjs.map +1 -1
  79. package/resources/webhooks.d.mts +624 -110
  80. package/resources/webhooks.d.mts.map +1 -1
  81. package/resources/webhooks.d.ts +624 -110
  82. package/resources/webhooks.d.ts.map +1 -1
  83. package/resources/webhooks.js +6 -7
  84. package/resources/webhooks.js.map +1 -1
  85. package/resources/webhooks.mjs +6 -7
  86. package/resources/webhooks.mjs.map +1 -1
  87. package/src/client.ts +33 -68
  88. package/src/resources/contacts.ts +567 -66
  89. package/src/resources/index.ts +17 -34
  90. package/src/resources/me.ts +132 -51
  91. package/src/resources/messages.ts +147 -9
  92. package/src/resources/numbers.ts +47 -3
  93. package/src/resources/profiles/campaigns.ts +668 -169
  94. package/src/resources/profiles/index.ts +5 -17
  95. package/src/resources/profiles/profiles.ts +2278 -545
  96. package/src/resources/templates.ts +1261 -206
  97. package/src/resources/users.ts +430 -47
  98. package/src/resources/webhooks.ts +742 -120
  99. package/src/version.ts +1 -1
  100. package/version.d.mts +1 -1
  101. package/version.d.ts +1 -1
  102. package/version.js +1 -1
  103. package/version.mjs +1 -1
@@ -1,6 +1,4 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
- import * as TemplatesAPI from "./templates.mjs";
3
- import * as WebhooksAPI from "./webhooks.mjs";
4
2
  import { APIPromise } from "../core/api-promise.mjs";
5
3
  import { RequestOptions } from "../internal/request-options.mjs";
6
4
  /**
@@ -14,34 +12,34 @@ export declare class Templates extends APIResource {
14
12
  *
15
13
  * @example
16
14
  * ```ts
17
- * const apiResponseTemplate = await client.templates.create();
15
+ * const template = await client.templates.create();
18
16
  * ```
19
17
  */
20
- create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
18
+ create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<TemplateCreateResponse>;
21
19
  /**
22
20
  * Retrieves a specific template by its ID. Returns template details including
23
21
  * name, category, language, status, and definition.
24
22
  *
25
23
  * @example
26
24
  * ```ts
27
- * const apiResponseTemplate = await client.templates.retrieve(
25
+ * const template = await client.templates.retrieve(
28
26
  * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
29
27
  * );
30
28
  * ```
31
29
  */
32
- retrieve(id: string, params?: TemplateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseTemplate>;
30
+ retrieve(id: string, params?: TemplateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<TemplateRetrieveResponse>;
33
31
  /**
34
32
  * Updates an existing template's name, category, language, definition, or submits
35
33
  * it for review.
36
34
  *
37
35
  * @example
38
36
  * ```ts
39
- * const apiResponseTemplate = await client.templates.update(
37
+ * const template = await client.templates.update(
40
38
  * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
41
39
  * );
42
40
  * ```
43
41
  */
44
- update(id: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
42
+ update(id: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<TemplateUpdateResponse>;
45
43
  /**
46
44
  * Retrieves a paginated list of message templates for the authenticated customer.
47
45
  * Supports filtering by status, category, and search term.
@@ -71,219 +69,325 @@ export declare class Templates extends APIResource {
71
69
  /**
72
70
  * Standard API response envelope for all v3 endpoints
73
71
  */
74
- export interface APIResponseTemplate {
72
+ export interface TemplateCreateResponse {
75
73
  /**
76
74
  * Template response for v3 API
77
75
  */
78
- data?: Template | null;
76
+ data?: TemplateCreateResponse.Data | null;
79
77
  /**
80
78
  * Error information
81
79
  */
82
- error?: WebhooksAPI.ErrorDetail | null;
80
+ error?: TemplateCreateResponse.Error | null;
83
81
  /**
84
82
  * Request and response metadata
85
83
  */
86
- meta?: WebhooksAPI.APIMeta;
84
+ meta?: TemplateCreateResponse.Meta;
87
85
  /**
88
86
  * Indicates whether the request was successful
89
87
  */
90
88
  success?: boolean;
91
89
  }
92
- /**
93
- * Configuration for AUTHENTICATION category templates
94
- */
95
- export interface SentDmServicesCommonContractsPocOsAuthenticationConfig {
96
- /**
97
- * Whether to add the security recommendation text: "For your security, do not
98
- * share this code."
99
- */
100
- addSecurityRecommendation?: boolean;
101
- /**
102
- * Code expiration time in minutes (1-90). If set, adds footer: "This code expires
103
- * in X minutes."
104
- */
105
- codeExpirationMinutes?: number | null;
106
- }
107
- /**
108
- * Body section of a message template with channel-specific content
109
- */
110
- export interface SentDmServicesCommonContractsPocOsTemplateBody {
90
+ export declare namespace TemplateCreateResponse {
111
91
  /**
112
- * Content that will be used for all channels (SMS and WhatsApp) unless
113
- * channel-specific content is provided
92
+ * Template response for v3 API
114
93
  */
115
- multiChannel?: TemplateBodyContent | null;
94
+ interface Data {
95
+ /**
96
+ * Unique template identifier
97
+ */
98
+ id?: string;
99
+ /**
100
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
101
+ */
102
+ category?: string;
103
+ /**
104
+ * Supported channels: sms, whatsapp
105
+ */
106
+ channels?: Array<string> | null;
107
+ /**
108
+ * When the template was created
109
+ */
110
+ created_at?: string;
111
+ /**
112
+ * Whether the template is published and active
113
+ */
114
+ is_published?: boolean;
115
+ /**
116
+ * Template language code (e.g., en_US)
117
+ */
118
+ language?: string;
119
+ /**
120
+ * Template display name
121
+ */
122
+ name?: string;
123
+ /**
124
+ * Template status: APPROVED, PENDING, REJECTED
125
+ */
126
+ status?: string;
127
+ /**
128
+ * When the template was last updated
129
+ */
130
+ updated_at?: string | null;
131
+ /**
132
+ * Template variables for personalization
133
+ */
134
+ variables?: Array<string> | null;
135
+ }
116
136
  /**
117
- * SMS-specific content that overrides multi-channel content for SMS messages
137
+ * Error information
118
138
  */
119
- sms?: TemplateBodyContent | null;
139
+ interface Error {
140
+ /**
141
+ * Machine-readable error code (e.g., "RESOURCE_001")
142
+ */
143
+ code?: string;
144
+ /**
145
+ * Additional validation error details (field-level errors)
146
+ */
147
+ details?: {
148
+ [key: string]: Array<string>;
149
+ } | null;
150
+ /**
151
+ * URL to documentation about this error
152
+ */
153
+ doc_url?: string | null;
154
+ /**
155
+ * Human-readable error message
156
+ */
157
+ message?: string;
158
+ }
120
159
  /**
121
- * WhatsApp-specific content that overrides multi-channel content for WhatsApp
122
- * messages
160
+ * Request and response metadata
123
161
  */
124
- whatsapp?: TemplateBodyContent | null;
162
+ interface Meta {
163
+ /**
164
+ * Unique identifier for this request (for tracing and support)
165
+ */
166
+ request_id?: string;
167
+ /**
168
+ * Server timestamp when the response was generated
169
+ */
170
+ timestamp?: string;
171
+ /**
172
+ * API version used for this request
173
+ */
174
+ version?: string;
175
+ }
125
176
  }
126
177
  /**
127
- * Interactive button in a message template
178
+ * Standard API response envelope for all v3 endpoints
128
179
  */
129
- export interface SentDmServicesCommonContractsPocOsTemplateButton {
130
- /**
131
- * Properties specific to the button type
132
- */
133
- props: SentDmServicesCommonContractsPocOsTemplateButtonProps;
180
+ export interface TemplateRetrieveResponse {
134
181
  /**
135
- * The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
136
- */
137
- type: string;
138
- /**
139
- * The unique identifier of the button (1-based index)
182
+ * Template response for v3 API
140
183
  */
141
- id?: number;
142
- }
143
- export interface SentDmServicesCommonContractsPocOsTemplateButtonProps {
144
- activeFor: number;
145
- countryCode: string;
146
- offerCode: string;
147
- phoneNumber: string;
148
- quickReplyType: string;
149
- text: string;
150
- url: string;
151
- urlType: string;
152
- autofillText?: string | null;
153
- otpType?: string | null;
154
- packageName?: string | null;
155
- signatureHash?: string | null;
156
- }
157
- /**
158
- * Footer section of a message template
159
- */
160
- export interface SentDmServicesCommonContractsPocOsTemplateFooter {
184
+ data?: TemplateRetrieveResponse.Data | null;
161
185
  /**
162
- * The footer template text with optional variable placeholders
186
+ * Error information
163
187
  */
164
- template: string;
188
+ error?: TemplateRetrieveResponse.Error | null;
165
189
  /**
166
- * The type of footer (typically "text")
190
+ * Request and response metadata
167
191
  */
168
- type?: string | null;
192
+ meta?: TemplateRetrieveResponse.Meta;
169
193
  /**
170
- * List of variables used in the footer template
194
+ * Indicates whether the request was successful
171
195
  */
172
- variables?: Array<TemplateVariable> | null;
196
+ success?: boolean;
173
197
  }
174
- /**
175
- * Header section of a message template
176
- */
177
- export interface SentDmServicesCommonContractsPocOsTemplateHeader {
198
+ export declare namespace TemplateRetrieveResponse {
178
199
  /**
179
- * The header template text with optional variable placeholders (e.g., "Welcome to
180
- * {{0:variable}}")
200
+ * Template response for v3 API
181
201
  */
182
- template: string;
202
+ interface Data {
203
+ /**
204
+ * Unique template identifier
205
+ */
206
+ id?: string;
207
+ /**
208
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
209
+ */
210
+ category?: string;
211
+ /**
212
+ * Supported channels: sms, whatsapp
213
+ */
214
+ channels?: Array<string> | null;
215
+ /**
216
+ * When the template was created
217
+ */
218
+ created_at?: string;
219
+ /**
220
+ * Whether the template is published and active
221
+ */
222
+ is_published?: boolean;
223
+ /**
224
+ * Template language code (e.g., en_US)
225
+ */
226
+ language?: string;
227
+ /**
228
+ * Template display name
229
+ */
230
+ name?: string;
231
+ /**
232
+ * Template status: APPROVED, PENDING, REJECTED
233
+ */
234
+ status?: string;
235
+ /**
236
+ * When the template was last updated
237
+ */
238
+ updated_at?: string | null;
239
+ /**
240
+ * Template variables for personalization
241
+ */
242
+ variables?: Array<string> | null;
243
+ }
183
244
  /**
184
- * The type of header (e.g., "text", "image", "video", "document")
245
+ * Error information
185
246
  */
186
- type?: string | null;
247
+ interface Error {
248
+ /**
249
+ * Machine-readable error code (e.g., "RESOURCE_001")
250
+ */
251
+ code?: string;
252
+ /**
253
+ * Additional validation error details (field-level errors)
254
+ */
255
+ details?: {
256
+ [key: string]: Array<string>;
257
+ } | null;
258
+ /**
259
+ * URL to documentation about this error
260
+ */
261
+ doc_url?: string | null;
262
+ /**
263
+ * Human-readable error message
264
+ */
265
+ message?: string;
266
+ }
187
267
  /**
188
- * List of variables used in the header template
268
+ * Request and response metadata
189
269
  */
190
- variables?: Array<TemplateVariable> | null;
270
+ interface Meta {
271
+ /**
272
+ * Unique identifier for this request (for tracing and support)
273
+ */
274
+ request_id?: string;
275
+ /**
276
+ * Server timestamp when the response was generated
277
+ */
278
+ timestamp?: string;
279
+ /**
280
+ * API version used for this request
281
+ */
282
+ version?: string;
283
+ }
191
284
  }
192
285
  /**
193
- * Template response for v3 API
286
+ * Standard API response envelope for all v3 endpoints
194
287
  */
195
- export interface Template {
196
- /**
197
- * Unique template identifier
198
- */
199
- id?: string;
200
- /**
201
- * Template category: MARKETING, UTILITY, AUTHENTICATION
202
- */
203
- category?: string;
204
- /**
205
- * Supported channels: sms, whatsapp
206
- */
207
- channels?: Array<string> | null;
208
- /**
209
- * When the template was created
210
- */
211
- created_at?: string;
212
- /**
213
- * Whether the template is published and active
214
- */
215
- is_published?: boolean;
216
- /**
217
- * Template language code (e.g., en_US)
218
- */
219
- language?: string;
288
+ export interface TemplateUpdateResponse {
220
289
  /**
221
- * Template display name
290
+ * Template response for v3 API
222
291
  */
223
- name?: string;
292
+ data?: TemplateUpdateResponse.Data | null;
224
293
  /**
225
- * Template status: APPROVED, PENDING, REJECTED
294
+ * Error information
226
295
  */
227
- status?: string;
296
+ error?: TemplateUpdateResponse.Error | null;
228
297
  /**
229
- * When the template was last updated
298
+ * Request and response metadata
230
299
  */
231
- updated_at?: string | null;
300
+ meta?: TemplateUpdateResponse.Meta;
232
301
  /**
233
- * Template variables for personalization
302
+ * Indicates whether the request was successful
234
303
  */
235
- variables?: Array<string> | null;
236
- }
237
- export interface TemplateBodyContent {
238
- template: string;
239
- type?: string | null;
240
- variables?: Array<TemplateVariable> | null;
304
+ success?: boolean;
241
305
  }
242
- /**
243
- * Complete definition of a message template including header, body, footer, and
244
- * buttons
245
- */
246
- export interface TemplateDefinition {
247
- /**
248
- * Body section of a message template with channel-specific content
249
- */
250
- body: SentDmServicesCommonContractsPocOsTemplateBody;
251
- /**
252
- * Configuration for AUTHENTICATION category templates
253
- */
254
- authenticationConfig?: SentDmServicesCommonContractsPocOsAuthenticationConfig | null;
255
- /**
256
- * Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
257
- */
258
- buttons?: Array<SentDmServicesCommonContractsPocOsTemplateButton> | null;
306
+ export declare namespace TemplateUpdateResponse {
259
307
  /**
260
- * The version of the template definition format
308
+ * Template response for v3 API
261
309
  */
262
- definitionVersion?: string | null;
310
+ interface Data {
311
+ /**
312
+ * Unique template identifier
313
+ */
314
+ id?: string;
315
+ /**
316
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
317
+ */
318
+ category?: string;
319
+ /**
320
+ * Supported channels: sms, whatsapp
321
+ */
322
+ channels?: Array<string> | null;
323
+ /**
324
+ * When the template was created
325
+ */
326
+ created_at?: string;
327
+ /**
328
+ * Whether the template is published and active
329
+ */
330
+ is_published?: boolean;
331
+ /**
332
+ * Template language code (e.g., en_US)
333
+ */
334
+ language?: string;
335
+ /**
336
+ * Template display name
337
+ */
338
+ name?: string;
339
+ /**
340
+ * Template status: APPROVED, PENDING, REJECTED
341
+ */
342
+ status?: string;
343
+ /**
344
+ * When the template was last updated
345
+ */
346
+ updated_at?: string | null;
347
+ /**
348
+ * Template variables for personalization
349
+ */
350
+ variables?: Array<string> | null;
351
+ }
263
352
  /**
264
- * Footer section of a message template
353
+ * Error information
265
354
  */
266
- footer?: SentDmServicesCommonContractsPocOsTemplateFooter | null;
355
+ interface Error {
356
+ /**
357
+ * Machine-readable error code (e.g., "RESOURCE_001")
358
+ */
359
+ code?: string;
360
+ /**
361
+ * Additional validation error details (field-level errors)
362
+ */
363
+ details?: {
364
+ [key: string]: Array<string>;
365
+ } | null;
366
+ /**
367
+ * URL to documentation about this error
368
+ */
369
+ doc_url?: string | null;
370
+ /**
371
+ * Human-readable error message
372
+ */
373
+ message?: string;
374
+ }
267
375
  /**
268
- * Header section of a message template
376
+ * Request and response metadata
269
377
  */
270
- header?: SentDmServicesCommonContractsPocOsTemplateHeader | null;
271
- }
272
- export interface TemplateVariable {
273
- name: string;
274
- props: TemplateVariable.Props;
275
- type: string;
276
- id?: number;
277
- }
278
- export declare namespace TemplateVariable {
279
- interface Props {
280
- mediaType: string;
281
- sample: string;
282
- url: string;
283
- variableType: string;
284
- alt?: string | null;
285
- regex?: string | null;
286
- shortUrl?: string | null;
378
+ interface Meta {
379
+ /**
380
+ * Unique identifier for this request (for tracing and support)
381
+ */
382
+ request_id?: string;
383
+ /**
384
+ * Server timestamp when the response was generated
385
+ */
386
+ timestamp?: string;
387
+ /**
388
+ * API version used for this request
389
+ */
390
+ version?: string;
287
391
  }
288
392
  }
289
393
  /**
@@ -297,11 +401,11 @@ export interface TemplateListResponse {
297
401
  /**
298
402
  * Error information
299
403
  */
300
- error?: WebhooksAPI.ErrorDetail | null;
404
+ error?: TemplateListResponse.Error | null;
301
405
  /**
302
406
  * Request and response metadata
303
407
  */
304
- meta?: WebhooksAPI.APIMeta;
408
+ meta?: TemplateListResponse.Meta;
305
409
  /**
306
410
  * Indicates whether the request was successful
307
411
  */
@@ -315,11 +419,142 @@ export declare namespace TemplateListResponse {
315
419
  /**
316
420
  * Pagination metadata for list responses
317
421
  */
318
- pagination?: WebhooksAPI.PaginationMeta;
422
+ pagination?: Data.Pagination;
319
423
  /**
320
424
  * List of templates
321
425
  */
322
- templates?: Array<TemplatesAPI.Template>;
426
+ templates?: Array<Data.Template>;
427
+ }
428
+ namespace Data {
429
+ /**
430
+ * Pagination metadata for list responses
431
+ */
432
+ interface Pagination {
433
+ /**
434
+ * Cursor-based pagination pointers
435
+ */
436
+ cursors?: Pagination.Cursors | null;
437
+ /**
438
+ * Whether there are more pages after this one
439
+ */
440
+ has_more?: boolean;
441
+ /**
442
+ * Current page number (1-indexed)
443
+ */
444
+ page?: number;
445
+ /**
446
+ * Number of items per page
447
+ */
448
+ page_size?: number;
449
+ /**
450
+ * Total number of items across all pages
451
+ */
452
+ total_count?: number;
453
+ /**
454
+ * Total number of pages
455
+ */
456
+ total_pages?: number;
457
+ }
458
+ namespace Pagination {
459
+ /**
460
+ * Cursor-based pagination pointers
461
+ */
462
+ interface Cursors {
463
+ /**
464
+ * Cursor to fetch the next page
465
+ */
466
+ after?: string | null;
467
+ /**
468
+ * Cursor to fetch the previous page
469
+ */
470
+ before?: string | null;
471
+ }
472
+ }
473
+ /**
474
+ * Template response for v3 API
475
+ */
476
+ interface Template {
477
+ /**
478
+ * Unique template identifier
479
+ */
480
+ id?: string;
481
+ /**
482
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
483
+ */
484
+ category?: string;
485
+ /**
486
+ * Supported channels: sms, whatsapp
487
+ */
488
+ channels?: Array<string> | null;
489
+ /**
490
+ * When the template was created
491
+ */
492
+ created_at?: string;
493
+ /**
494
+ * Whether the template is published and active
495
+ */
496
+ is_published?: boolean;
497
+ /**
498
+ * Template language code (e.g., en_US)
499
+ */
500
+ language?: string;
501
+ /**
502
+ * Template display name
503
+ */
504
+ name?: string;
505
+ /**
506
+ * Template status: APPROVED, PENDING, REJECTED
507
+ */
508
+ status?: string;
509
+ /**
510
+ * When the template was last updated
511
+ */
512
+ updated_at?: string | null;
513
+ /**
514
+ * Template variables for personalization
515
+ */
516
+ variables?: Array<string> | null;
517
+ }
518
+ }
519
+ /**
520
+ * Error information
521
+ */
522
+ interface Error {
523
+ /**
524
+ * Machine-readable error code (e.g., "RESOURCE_001")
525
+ */
526
+ code?: string;
527
+ /**
528
+ * Additional validation error details (field-level errors)
529
+ */
530
+ details?: {
531
+ [key: string]: Array<string>;
532
+ } | null;
533
+ /**
534
+ * URL to documentation about this error
535
+ */
536
+ doc_url?: string | null;
537
+ /**
538
+ * Human-readable error message
539
+ */
540
+ message?: string;
541
+ }
542
+ /**
543
+ * Request and response metadata
544
+ */
545
+ interface Meta {
546
+ /**
547
+ * Unique identifier for this request (for tracing and support)
548
+ */
549
+ request_id?: string;
550
+ /**
551
+ * Server timestamp when the response was generated
552
+ */
553
+ timestamp?: string;
554
+ /**
555
+ * API version used for this request
556
+ */
557
+ version?: string;
323
558
  }
324
559
  }
325
560
  export interface TemplateCreateParams {
@@ -336,7 +571,7 @@ export interface TemplateCreateParams {
336
571
  * Body param: Complete definition of a message template including header, body,
337
572
  * footer, and buttons
338
573
  */
339
- definition?: TemplateDefinition;
574
+ definition?: TemplateCreateParams.Definition;
340
575
  /**
341
576
  * Body param: Template language code (e.g., en_US) (optional, auto-detected if not
342
577
  * provided)
@@ -365,6 +600,299 @@ export interface TemplateCreateParams {
365
600
  */
366
601
  'x-profile-id'?: string;
367
602
  }
603
+ export declare namespace TemplateCreateParams {
604
+ /**
605
+ * Complete definition of a message template including header, body, footer, and
606
+ * buttons
607
+ */
608
+ interface Definition {
609
+ /**
610
+ * Body section of a message template with channel-specific content
611
+ */
612
+ body: Definition.Body;
613
+ /**
614
+ * Configuration for AUTHENTICATION category templates
615
+ */
616
+ authenticationConfig?: Definition.AuthenticationConfig | null;
617
+ /**
618
+ * Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
619
+ */
620
+ buttons?: Array<Definition.Button> | null;
621
+ /**
622
+ * The version of the template definition format
623
+ */
624
+ definitionVersion?: string | null;
625
+ /**
626
+ * Footer section of a message template
627
+ */
628
+ footer?: Definition.Footer | null;
629
+ /**
630
+ * Header section of a message template
631
+ */
632
+ header?: Definition.Header | null;
633
+ }
634
+ namespace Definition {
635
+ /**
636
+ * Body section of a message template with channel-specific content
637
+ */
638
+ interface Body {
639
+ /**
640
+ * Content that will be used for all channels (SMS and WhatsApp) unless
641
+ * channel-specific content is provided
642
+ */
643
+ multiChannel?: Body.MultiChannel | null;
644
+ /**
645
+ * RCS-specific content that overrides multi-channel content for RCS messages
646
+ */
647
+ rcs?: Body.Rcs | null;
648
+ /**
649
+ * SMS-specific content that overrides multi-channel content for SMS messages
650
+ */
651
+ sms?: Body.SMS | null;
652
+ /**
653
+ * WhatsApp-specific content that overrides multi-channel content for WhatsApp
654
+ * messages
655
+ */
656
+ whatsapp?: Body.Whatsapp | null;
657
+ }
658
+ namespace Body {
659
+ /**
660
+ * Content that will be used for all channels (SMS and WhatsApp) unless
661
+ * channel-specific content is provided
662
+ */
663
+ interface MultiChannel {
664
+ template: string;
665
+ type?: string | null;
666
+ variables?: Array<MultiChannel.Variable> | null;
667
+ }
668
+ namespace MultiChannel {
669
+ interface Variable {
670
+ name: string;
671
+ props: Variable.Props;
672
+ type: string;
673
+ id?: number;
674
+ }
675
+ namespace Variable {
676
+ interface Props {
677
+ mediaType: string;
678
+ sample: string;
679
+ url: string;
680
+ variableType: string;
681
+ alt?: string | null;
682
+ regex?: string | null;
683
+ shortUrl?: string | null;
684
+ }
685
+ }
686
+ }
687
+ /**
688
+ * RCS-specific content that overrides multi-channel content for RCS messages
689
+ */
690
+ interface Rcs {
691
+ template: string;
692
+ type?: string | null;
693
+ variables?: Array<Rcs.Variable> | null;
694
+ }
695
+ namespace Rcs {
696
+ interface Variable {
697
+ name: string;
698
+ props: Variable.Props;
699
+ type: string;
700
+ id?: number;
701
+ }
702
+ namespace Variable {
703
+ interface Props {
704
+ mediaType: string;
705
+ sample: string;
706
+ url: string;
707
+ variableType: string;
708
+ alt?: string | null;
709
+ regex?: string | null;
710
+ shortUrl?: string | null;
711
+ }
712
+ }
713
+ }
714
+ /**
715
+ * SMS-specific content that overrides multi-channel content for SMS messages
716
+ */
717
+ interface SMS {
718
+ template: string;
719
+ type?: string | null;
720
+ variables?: Array<SMS.Variable> | null;
721
+ }
722
+ namespace SMS {
723
+ interface Variable {
724
+ name: string;
725
+ props: Variable.Props;
726
+ type: string;
727
+ id?: number;
728
+ }
729
+ namespace Variable {
730
+ interface Props {
731
+ mediaType: string;
732
+ sample: string;
733
+ url: string;
734
+ variableType: string;
735
+ alt?: string | null;
736
+ regex?: string | null;
737
+ shortUrl?: string | null;
738
+ }
739
+ }
740
+ }
741
+ /**
742
+ * WhatsApp-specific content that overrides multi-channel content for WhatsApp
743
+ * messages
744
+ */
745
+ interface Whatsapp {
746
+ template: string;
747
+ type?: string | null;
748
+ variables?: Array<Whatsapp.Variable> | null;
749
+ }
750
+ namespace Whatsapp {
751
+ interface Variable {
752
+ name: string;
753
+ props: Variable.Props;
754
+ type: string;
755
+ id?: number;
756
+ }
757
+ namespace Variable {
758
+ interface Props {
759
+ mediaType: string;
760
+ sample: string;
761
+ url: string;
762
+ variableType: string;
763
+ alt?: string | null;
764
+ regex?: string | null;
765
+ shortUrl?: string | null;
766
+ }
767
+ }
768
+ }
769
+ }
770
+ /**
771
+ * Configuration for AUTHENTICATION category templates
772
+ */
773
+ interface AuthenticationConfig {
774
+ /**
775
+ * Whether to add the security recommendation text: "For your security, do not
776
+ * share this code."
777
+ */
778
+ addSecurityRecommendation?: boolean;
779
+ /**
780
+ * Code expiration time in minutes (1-90). If set, adds footer: "This code expires
781
+ * in X minutes."
782
+ */
783
+ codeExpirationMinutes?: number | null;
784
+ }
785
+ /**
786
+ * Interactive button in a message template
787
+ */
788
+ interface Button {
789
+ /**
790
+ * Properties specific to the button type
791
+ */
792
+ props: Button.Props;
793
+ /**
794
+ * The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
795
+ */
796
+ type: string;
797
+ /**
798
+ * The unique identifier of the button (1-based index)
799
+ */
800
+ id?: number;
801
+ }
802
+ namespace Button {
803
+ /**
804
+ * Properties specific to the button type
805
+ */
806
+ interface Props {
807
+ activeFor: number;
808
+ countryCode: string;
809
+ offerCode: string;
810
+ phoneNumber: string;
811
+ quickReplyType: string;
812
+ text: string;
813
+ url: string;
814
+ urlType: string;
815
+ autofillText?: string | null;
816
+ otpType?: string | null;
817
+ packageName?: string | null;
818
+ signatureHash?: string | null;
819
+ }
820
+ }
821
+ /**
822
+ * Footer section of a message template
823
+ */
824
+ interface Footer {
825
+ /**
826
+ * The footer template text with optional variable placeholders
827
+ */
828
+ template: string;
829
+ /**
830
+ * The type of footer (typically "text")
831
+ */
832
+ type?: string | null;
833
+ /**
834
+ * List of variables used in the footer template
835
+ */
836
+ variables?: Array<Footer.Variable> | null;
837
+ }
838
+ namespace Footer {
839
+ interface Variable {
840
+ name: string;
841
+ props: Variable.Props;
842
+ type: string;
843
+ id?: number;
844
+ }
845
+ namespace Variable {
846
+ interface Props {
847
+ mediaType: string;
848
+ sample: string;
849
+ url: string;
850
+ variableType: string;
851
+ alt?: string | null;
852
+ regex?: string | null;
853
+ shortUrl?: string | null;
854
+ }
855
+ }
856
+ }
857
+ /**
858
+ * Header section of a message template
859
+ */
860
+ interface Header {
861
+ /**
862
+ * The header template text with optional variable placeholders (e.g., "Welcome to
863
+ * {{0:variable}}")
864
+ */
865
+ template: string;
866
+ /**
867
+ * The type of header (e.g., "text", "image", "video", "document")
868
+ */
869
+ type?: string | null;
870
+ /**
871
+ * List of variables used in the header template
872
+ */
873
+ variables?: Array<Header.Variable> | null;
874
+ }
875
+ namespace Header {
876
+ interface Variable {
877
+ name: string;
878
+ props: Variable.Props;
879
+ type: string;
880
+ id?: number;
881
+ }
882
+ namespace Variable {
883
+ interface Props {
884
+ mediaType: string;
885
+ sample: string;
886
+ url: string;
887
+ variableType: string;
888
+ alt?: string | null;
889
+ regex?: string | null;
890
+ shortUrl?: string | null;
891
+ }
892
+ }
893
+ }
894
+ }
895
+ }
368
896
  export interface TemplateRetrieveParams {
369
897
  /**
370
898
  * Profile UUID to scope the request to a child profile. Only organization API keys
@@ -381,7 +909,7 @@ export interface TemplateUpdateParams {
381
909
  * Body param: Complete definition of a message template including header, body,
382
910
  * footer, and buttons
383
911
  */
384
- definition?: TemplateDefinition | null;
912
+ definition?: TemplateUpdateParams.Definition | null;
385
913
  /**
386
914
  * Body param: Template language code (e.g., en_US)
387
915
  */
@@ -413,6 +941,299 @@ export interface TemplateUpdateParams {
413
941
  */
414
942
  'x-profile-id'?: string;
415
943
  }
944
+ export declare namespace TemplateUpdateParams {
945
+ /**
946
+ * Complete definition of a message template including header, body, footer, and
947
+ * buttons
948
+ */
949
+ interface Definition {
950
+ /**
951
+ * Body section of a message template with channel-specific content
952
+ */
953
+ body: Definition.Body;
954
+ /**
955
+ * Configuration for AUTHENTICATION category templates
956
+ */
957
+ authenticationConfig?: Definition.AuthenticationConfig | null;
958
+ /**
959
+ * Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
960
+ */
961
+ buttons?: Array<Definition.Button> | null;
962
+ /**
963
+ * The version of the template definition format
964
+ */
965
+ definitionVersion?: string | null;
966
+ /**
967
+ * Footer section of a message template
968
+ */
969
+ footer?: Definition.Footer | null;
970
+ /**
971
+ * Header section of a message template
972
+ */
973
+ header?: Definition.Header | null;
974
+ }
975
+ namespace Definition {
976
+ /**
977
+ * Body section of a message template with channel-specific content
978
+ */
979
+ interface Body {
980
+ /**
981
+ * Content that will be used for all channels (SMS and WhatsApp) unless
982
+ * channel-specific content is provided
983
+ */
984
+ multiChannel?: Body.MultiChannel | null;
985
+ /**
986
+ * RCS-specific content that overrides multi-channel content for RCS messages
987
+ */
988
+ rcs?: Body.Rcs | null;
989
+ /**
990
+ * SMS-specific content that overrides multi-channel content for SMS messages
991
+ */
992
+ sms?: Body.SMS | null;
993
+ /**
994
+ * WhatsApp-specific content that overrides multi-channel content for WhatsApp
995
+ * messages
996
+ */
997
+ whatsapp?: Body.Whatsapp | null;
998
+ }
999
+ namespace Body {
1000
+ /**
1001
+ * Content that will be used for all channels (SMS and WhatsApp) unless
1002
+ * channel-specific content is provided
1003
+ */
1004
+ interface MultiChannel {
1005
+ template: string;
1006
+ type?: string | null;
1007
+ variables?: Array<MultiChannel.Variable> | null;
1008
+ }
1009
+ namespace MultiChannel {
1010
+ interface Variable {
1011
+ name: string;
1012
+ props: Variable.Props;
1013
+ type: string;
1014
+ id?: number;
1015
+ }
1016
+ namespace Variable {
1017
+ interface Props {
1018
+ mediaType: string;
1019
+ sample: string;
1020
+ url: string;
1021
+ variableType: string;
1022
+ alt?: string | null;
1023
+ regex?: string | null;
1024
+ shortUrl?: string | null;
1025
+ }
1026
+ }
1027
+ }
1028
+ /**
1029
+ * RCS-specific content that overrides multi-channel content for RCS messages
1030
+ */
1031
+ interface Rcs {
1032
+ template: string;
1033
+ type?: string | null;
1034
+ variables?: Array<Rcs.Variable> | null;
1035
+ }
1036
+ namespace Rcs {
1037
+ interface Variable {
1038
+ name: string;
1039
+ props: Variable.Props;
1040
+ type: string;
1041
+ id?: number;
1042
+ }
1043
+ namespace Variable {
1044
+ interface Props {
1045
+ mediaType: string;
1046
+ sample: string;
1047
+ url: string;
1048
+ variableType: string;
1049
+ alt?: string | null;
1050
+ regex?: string | null;
1051
+ shortUrl?: string | null;
1052
+ }
1053
+ }
1054
+ }
1055
+ /**
1056
+ * SMS-specific content that overrides multi-channel content for SMS messages
1057
+ */
1058
+ interface SMS {
1059
+ template: string;
1060
+ type?: string | null;
1061
+ variables?: Array<SMS.Variable> | null;
1062
+ }
1063
+ namespace SMS {
1064
+ interface Variable {
1065
+ name: string;
1066
+ props: Variable.Props;
1067
+ type: string;
1068
+ id?: number;
1069
+ }
1070
+ namespace Variable {
1071
+ interface Props {
1072
+ mediaType: string;
1073
+ sample: string;
1074
+ url: string;
1075
+ variableType: string;
1076
+ alt?: string | null;
1077
+ regex?: string | null;
1078
+ shortUrl?: string | null;
1079
+ }
1080
+ }
1081
+ }
1082
+ /**
1083
+ * WhatsApp-specific content that overrides multi-channel content for WhatsApp
1084
+ * messages
1085
+ */
1086
+ interface Whatsapp {
1087
+ template: string;
1088
+ type?: string | null;
1089
+ variables?: Array<Whatsapp.Variable> | null;
1090
+ }
1091
+ namespace Whatsapp {
1092
+ interface Variable {
1093
+ name: string;
1094
+ props: Variable.Props;
1095
+ type: string;
1096
+ id?: number;
1097
+ }
1098
+ namespace Variable {
1099
+ interface Props {
1100
+ mediaType: string;
1101
+ sample: string;
1102
+ url: string;
1103
+ variableType: string;
1104
+ alt?: string | null;
1105
+ regex?: string | null;
1106
+ shortUrl?: string | null;
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ /**
1112
+ * Configuration for AUTHENTICATION category templates
1113
+ */
1114
+ interface AuthenticationConfig {
1115
+ /**
1116
+ * Whether to add the security recommendation text: "For your security, do not
1117
+ * share this code."
1118
+ */
1119
+ addSecurityRecommendation?: boolean;
1120
+ /**
1121
+ * Code expiration time in minutes (1-90). If set, adds footer: "This code expires
1122
+ * in X minutes."
1123
+ */
1124
+ codeExpirationMinutes?: number | null;
1125
+ }
1126
+ /**
1127
+ * Interactive button in a message template
1128
+ */
1129
+ interface Button {
1130
+ /**
1131
+ * Properties specific to the button type
1132
+ */
1133
+ props: Button.Props;
1134
+ /**
1135
+ * The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
1136
+ */
1137
+ type: string;
1138
+ /**
1139
+ * The unique identifier of the button (1-based index)
1140
+ */
1141
+ id?: number;
1142
+ }
1143
+ namespace Button {
1144
+ /**
1145
+ * Properties specific to the button type
1146
+ */
1147
+ interface Props {
1148
+ activeFor: number;
1149
+ countryCode: string;
1150
+ offerCode: string;
1151
+ phoneNumber: string;
1152
+ quickReplyType: string;
1153
+ text: string;
1154
+ url: string;
1155
+ urlType: string;
1156
+ autofillText?: string | null;
1157
+ otpType?: string | null;
1158
+ packageName?: string | null;
1159
+ signatureHash?: string | null;
1160
+ }
1161
+ }
1162
+ /**
1163
+ * Footer section of a message template
1164
+ */
1165
+ interface Footer {
1166
+ /**
1167
+ * The footer template text with optional variable placeholders
1168
+ */
1169
+ template: string;
1170
+ /**
1171
+ * The type of footer (typically "text")
1172
+ */
1173
+ type?: string | null;
1174
+ /**
1175
+ * List of variables used in the footer template
1176
+ */
1177
+ variables?: Array<Footer.Variable> | null;
1178
+ }
1179
+ namespace Footer {
1180
+ interface Variable {
1181
+ name: string;
1182
+ props: Variable.Props;
1183
+ type: string;
1184
+ id?: number;
1185
+ }
1186
+ namespace Variable {
1187
+ interface Props {
1188
+ mediaType: string;
1189
+ sample: string;
1190
+ url: string;
1191
+ variableType: string;
1192
+ alt?: string | null;
1193
+ regex?: string | null;
1194
+ shortUrl?: string | null;
1195
+ }
1196
+ }
1197
+ }
1198
+ /**
1199
+ * Header section of a message template
1200
+ */
1201
+ interface Header {
1202
+ /**
1203
+ * The header template text with optional variable placeholders (e.g., "Welcome to
1204
+ * {{0:variable}}")
1205
+ */
1206
+ template: string;
1207
+ /**
1208
+ * The type of header (e.g., "text", "image", "video", "document")
1209
+ */
1210
+ type?: string | null;
1211
+ /**
1212
+ * List of variables used in the header template
1213
+ */
1214
+ variables?: Array<Header.Variable> | null;
1215
+ }
1216
+ namespace Header {
1217
+ interface Variable {
1218
+ name: string;
1219
+ props: Variable.Props;
1220
+ type: string;
1221
+ id?: number;
1222
+ }
1223
+ namespace Variable {
1224
+ interface Props {
1225
+ mediaType: string;
1226
+ sample: string;
1227
+ url: string;
1228
+ variableType: string;
1229
+ alt?: string | null;
1230
+ regex?: string | null;
1231
+ shortUrl?: string | null;
1232
+ }
1233
+ }
1234
+ }
1235
+ }
1236
+ }
416
1237
  export interface TemplateListParams {
417
1238
  /**
418
1239
  * Query param: Page number (1-indexed)
@@ -464,6 +1285,6 @@ export interface TemplateDeleteParams {
464
1285
  'x-profile-id'?: string;
465
1286
  }
466
1287
  export declare namespace Templates {
467
- export { type APIResponseTemplate as APIResponseTemplate, type SentDmServicesCommonContractsPocOsAuthenticationConfig as SentDmServicesCommonContractsPocOsAuthenticationConfig, type SentDmServicesCommonContractsPocOsTemplateBody as SentDmServicesCommonContractsPocOsTemplateBody, type SentDmServicesCommonContractsPocOsTemplateButton as SentDmServicesCommonContractsPocOsTemplateButton, type SentDmServicesCommonContractsPocOsTemplateButtonProps as SentDmServicesCommonContractsPocOsTemplateButtonProps, type SentDmServicesCommonContractsPocOsTemplateFooter as SentDmServicesCommonContractsPocOsTemplateFooter, type SentDmServicesCommonContractsPocOsTemplateHeader as SentDmServicesCommonContractsPocOsTemplateHeader, type Template as Template, type TemplateBodyContent as TemplateBodyContent, type TemplateDefinition as TemplateDefinition, type TemplateVariable as TemplateVariable, type TemplateListResponse as TemplateListResponse, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateUpdateParams as TemplateUpdateParams, type TemplateListParams as TemplateListParams, type TemplateDeleteParams as TemplateDeleteParams, };
1288
+ export { type TemplateCreateResponse as TemplateCreateResponse, type TemplateRetrieveResponse as TemplateRetrieveResponse, type TemplateUpdateResponse as TemplateUpdateResponse, type TemplateListResponse as TemplateListResponse, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateUpdateParams as TemplateUpdateParams, type TemplateListParams as TemplateListParams, type TemplateDeleteParams as TemplateDeleteParams, };
468
1289
  }
469
1290
  //# sourceMappingURL=templates.d.mts.map