@sentdm/sentdm 0.7.2 → 0.14.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 (161) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +71 -34
  3. package/client.d.mts +49 -21
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +49 -21
  6. package/client.d.ts.map +1 -1
  7. package/client.js +52 -38
  8. package/client.js.map +1 -1
  9. package/client.mjs +52 -38
  10. package/client.mjs.map +1 -1
  11. package/internal/tslib.js +17 -17
  12. package/internal/utils/log.d.mts.map +1 -1
  13. package/internal/utils/log.d.ts.map +1 -1
  14. package/internal/utils/log.js +0 -1
  15. package/internal/utils/log.js.map +1 -1
  16. package/internal/utils/log.mjs +0 -1
  17. package/internal/utils/log.mjs.map +1 -1
  18. package/internal/utils/query.d.mts +5 -0
  19. package/internal/utils/query.d.mts.map +1 -0
  20. package/internal/utils/query.d.ts +5 -0
  21. package/internal/utils/query.d.ts.map +1 -0
  22. package/internal/utils/query.js +23 -0
  23. package/internal/utils/query.js.map +1 -0
  24. package/internal/utils/query.mjs +20 -0
  25. package/internal/utils/query.mjs.map +1 -0
  26. package/internal/utils.d.mts +1 -0
  27. package/internal/utils.d.ts +1 -0
  28. package/internal/utils.js +1 -0
  29. package/internal/utils.js.map +1 -1
  30. package/internal/utils.mjs +1 -0
  31. package/package.json +7 -1
  32. package/resources/contacts.d.mts +243 -49
  33. package/resources/contacts.d.mts.map +1 -1
  34. package/resources/contacts.d.ts +243 -49
  35. package/resources/contacts.d.ts.map +1 -1
  36. package/resources/contacts.js +112 -15
  37. package/resources/contacts.js.map +1 -1
  38. package/resources/contacts.mjs +112 -15
  39. package/resources/contacts.mjs.map +1 -1
  40. package/resources/index.d.mts +8 -4
  41. package/resources/index.d.mts.map +1 -1
  42. package/resources/index.d.ts +8 -4
  43. package/resources/index.d.ts.map +1 -1
  44. package/resources/index.js +11 -3
  45. package/resources/index.js.map +1 -1
  46. package/resources/index.mjs +5 -1
  47. package/resources/index.mjs.map +1 -1
  48. package/resources/me.d.mts +269 -0
  49. package/resources/me.d.mts.map +1 -0
  50. package/resources/me.d.ts +269 -0
  51. package/resources/me.d.ts.map +1 -0
  52. package/resources/me.js +40 -0
  53. package/resources/me.js.map +1 -0
  54. package/resources/me.mjs +36 -0
  55. package/resources/me.mjs.map +1 -0
  56. package/resources/messages.d.mts +239 -133
  57. package/resources/messages.d.mts.map +1 -1
  58. package/resources/messages.d.ts +239 -133
  59. package/resources/messages.d.ts.map +1 -1
  60. package/resources/messages.js +42 -50
  61. package/resources/messages.js.map +1 -1
  62. package/resources/messages.mjs +42 -50
  63. package/resources/messages.mjs.map +1 -1
  64. package/resources/numbers.d.mts +70 -0
  65. package/resources/numbers.d.mts.map +1 -0
  66. package/resources/numbers.d.ts +70 -0
  67. package/resources/numbers.d.ts.map +1 -0
  68. package/resources/numbers.js +36 -0
  69. package/resources/numbers.js.map +1 -0
  70. package/resources/numbers.mjs +32 -0
  71. package/resources/numbers.mjs.map +1 -0
  72. package/resources/profiles/campaigns.d.mts +339 -0
  73. package/resources/profiles/campaigns.d.mts.map +1 -0
  74. package/resources/profiles/campaigns.d.ts +339 -0
  75. package/resources/profiles/campaigns.d.ts.map +1 -0
  76. package/resources/profiles/campaigns.js +148 -0
  77. package/resources/profiles/campaigns.js.map +1 -0
  78. package/resources/profiles/campaigns.mjs +144 -0
  79. package/resources/profiles/campaigns.mjs.map +1 -0
  80. package/resources/profiles/index.d.mts +3 -0
  81. package/resources/profiles/index.d.mts.map +1 -0
  82. package/resources/profiles/index.d.ts +3 -0
  83. package/resources/profiles/index.d.ts.map +1 -0
  84. package/resources/profiles/index.js +9 -0
  85. package/resources/profiles/index.js.map +1 -0
  86. package/resources/profiles/index.mjs +4 -0
  87. package/resources/profiles/index.mjs.map +1 -0
  88. package/resources/profiles/profiles.d.mts +967 -0
  89. package/resources/profiles/profiles.d.mts.map +1 -0
  90. package/resources/profiles/profiles.d.ts +967 -0
  91. package/resources/profiles/profiles.d.ts.map +1 -0
  92. package/resources/profiles/profiles.js +227 -0
  93. package/resources/profiles/profiles.js.map +1 -0
  94. package/resources/profiles/profiles.mjs +222 -0
  95. package/resources/profiles/profiles.mjs.map +1 -0
  96. package/resources/profiles.d.mts +2 -0
  97. package/resources/profiles.d.mts.map +1 -0
  98. package/resources/profiles.d.ts +2 -0
  99. package/resources/profiles.d.ts.map +1 -0
  100. package/resources/profiles.js +6 -0
  101. package/resources/profiles.js.map +1 -0
  102. package/resources/profiles.mjs +3 -0
  103. package/resources/profiles.mjs.map +1 -0
  104. package/resources/templates.d.mts +327 -191
  105. package/resources/templates.d.mts.map +1 -1
  106. package/resources/templates.d.ts +327 -191
  107. package/resources/templates.d.ts.map +1 -1
  108. package/resources/templates.js +80 -35
  109. package/resources/templates.js.map +1 -1
  110. package/resources/templates.mjs +80 -35
  111. package/resources/templates.mjs.map +1 -1
  112. package/resources/users.d.mts +251 -0
  113. package/resources/users.d.mts.map +1 -0
  114. package/resources/users.d.ts +251 -0
  115. package/resources/users.d.ts.map +1 -0
  116. package/resources/users.js +124 -0
  117. package/resources/users.js.map +1 -0
  118. package/resources/users.mjs +120 -0
  119. package/resources/users.mjs.map +1 -0
  120. package/resources/webhooks.d.mts +639 -0
  121. package/resources/webhooks.d.mts.map +1 -0
  122. package/resources/webhooks.d.ts +639 -0
  123. package/resources/webhooks.d.ts.map +1 -0
  124. package/resources/webhooks.js +237 -0
  125. package/resources/webhooks.js.map +1 -0
  126. package/resources/webhooks.mjs +233 -0
  127. package/resources/webhooks.mjs.map +1 -0
  128. package/src/client.ts +228 -80
  129. package/src/internal/utils/log.ts +0 -1
  130. package/src/internal/utils/query.ts +23 -0
  131. package/src/internal/utils.ts +1 -0
  132. package/src/resources/contacts.ts +335 -57
  133. package/src/resources/index.ts +81 -12
  134. package/src/resources/me.ts +333 -0
  135. package/src/resources/messages.ts +306 -147
  136. package/src/resources/numbers.ts +102 -0
  137. package/src/resources/profiles/campaigns.ts +501 -0
  138. package/src/resources/profiles/index.ts +38 -0
  139. package/src/resources/profiles/profiles.ts +1302 -0
  140. package/src/resources/profiles.ts +3 -0
  141. package/src/resources/templates.ts +424 -202
  142. package/src/resources/users.ts +366 -0
  143. package/src/resources/webhooks.ts +923 -0
  144. package/src/version.ts +1 -1
  145. package/version.d.mts +1 -1
  146. package/version.d.mts.map +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.d.ts.map +1 -1
  149. package/version.js +1 -1
  150. package/version.js.map +1 -1
  151. package/version.mjs +1 -1
  152. package/version.mjs.map +1 -1
  153. package/resources/number-lookup.d.mts +0 -59
  154. package/resources/number-lookup.d.mts.map +0 -1
  155. package/resources/number-lookup.d.ts +0 -59
  156. package/resources/number-lookup.d.ts.map +0 -1
  157. package/resources/number-lookup.js +0 -17
  158. package/resources/number-lookup.js.map +0 -1
  159. package/resources/number-lookup.mjs +0 -13
  160. package/resources/number-lookup.mjs.map +0 -1
  161. package/src/resources/number-lookup.ts +0 -80
@@ -1,61 +1,63 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import * as TemplatesAPI from "./templates.mjs";
3
+ import * as WebhooksAPI from "./webhooks.mjs";
3
4
  import { APIPromise } from "../core/api-promise.mjs";
4
5
  import { RequestOptions } from "../internal/request-options.mjs";
6
+ /**
7
+ * Manage message templates with variable substitution
8
+ */
5
9
  export declare class Templates extends APIResource {
6
10
  /**
7
- * Creates a new message template for the authenticated customer with comprehensive
8
- * template definitions including headers, body, footer, and interactive buttons.
9
- * Supports automatic metadata generation using AI (display name, language,
10
- * category). Optionally submits the template for WhatsApp review. The customer ID
11
- * is extracted from the authentication token.
11
+ * Creates a new message template with header, body, footer, and buttons. The
12
+ * template can be submitted for review immediately or saved as draft for later
13
+ * submission.
12
14
  *
13
15
  * @example
14
16
  * ```ts
15
- * const templateResponseV2 = await client.templates.create({
16
- * definition: { body: {} },
17
- * });
17
+ * const apiResponseTemplate = await client.templates.create();
18
+ * ```
19
+ */
20
+ create(params: TemplateCreateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
21
+ /**
22
+ * Retrieves a specific template by its ID. Returns template details including
23
+ * name, category, language, status, and definition.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const apiResponseTemplate = await client.templates.retrieve(
28
+ * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
29
+ * );
18
30
  * ```
19
31
  */
20
- create(body: TemplateCreateParams, options?: RequestOptions): APIPromise<TemplateResponseV2>;
32
+ retrieve(id: string, params?: TemplateRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIResponseTemplate>;
21
33
  /**
22
- * Retrieves a specific message template by its unique identifier for the
23
- * authenticated customer with comprehensive template definitions including
24
- * headers, body, footer, and interactive buttons. The customer ID is extracted
25
- * from the authentication token.
34
+ * Updates an existing template's name, category, language, definition, or submits
35
+ * it for review.
26
36
  *
27
37
  * @example
28
38
  * ```ts
29
- * const templateResponseV2 = await client.templates.retrieve(
39
+ * const apiResponseTemplate = await client.templates.update(
30
40
  * '7ba7b820-9dad-11d1-80b4-00c04fd430c8',
31
41
  * );
32
42
  * ```
33
43
  */
34
- retrieve(id: string, options?: RequestOptions): APIPromise<TemplateResponseV2>;
44
+ update(id: string, params: TemplateUpdateParams, options?: RequestOptions): APIPromise<APIResponseTemplate>;
35
45
  /**
36
- * Retrieves all message templates available for the authenticated customer with
37
- * comprehensive template definitions including headers, body, footer, and
38
- * interactive buttons. Supports advanced filtering by search term, status, and
39
- * category, plus pagination. The customer ID is extracted from the authentication
40
- * token.
46
+ * Retrieves a paginated list of message templates for the authenticated customer.
47
+ * Supports filtering by status, category, and search term.
41
48
  *
42
49
  * @example
43
50
  * ```ts
44
51
  * const templates = await client.templates.list({
45
52
  * page: 0,
46
- * pageSize: 0,
53
+ * page_size: 0,
47
54
  * });
48
55
  * ```
49
56
  */
50
- list(query: TemplateListParams, options?: RequestOptions): APIPromise<TemplateListResponse>;
57
+ list(params: TemplateListParams, options?: RequestOptions): APIPromise<TemplateListResponse>;
51
58
  /**
52
- * Deletes a specific message template by its unique identifier for the
53
- * authenticated customer with smart deletion strategy. Deletion behavior: - If
54
- * template has NO messages: Permanently deleted from database (hard delete). - If
55
- * template has messages: Marked as deleted but preserved for message history (soft
56
- * delete with snapshot). The template must exist and belong to the authenticated
57
- * customer to be deleted successfully. The customer ID is extracted from the
58
- * authentication token.
59
+ * Deletes a template by ID. Optionally, you can also delete the template from
60
+ * WhatsApp/Meta by setting delete_from_meta=true.
59
61
  *
60
62
  * @example
61
63
  * ```ts
@@ -64,201 +66,208 @@ export declare class Templates extends APIResource {
64
66
  * );
65
67
  * ```
66
68
  */
67
- delete(id: string, options?: RequestOptions): APIPromise<void>;
69
+ delete(id: string, params: TemplateDeleteParams, options?: RequestOptions): APIPromise<void>;
68
70
  }
69
- export interface TemplateBodyContent {
70
- template?: string;
71
- type?: string | null;
72
- variables?: Array<TemplateVariable> | null;
71
+ /**
72
+ * Standard API response envelope for all v3 endpoints
73
+ */
74
+ export interface APIResponseTemplate {
75
+ /**
76
+ * Template response for v3 API
77
+ */
78
+ data?: Template | null;
79
+ /**
80
+ * Error information
81
+ */
82
+ error?: WebhooksAPI.ErrorDetail | null;
83
+ /**
84
+ * Request and response metadata
85
+ */
86
+ meta?: WebhooksAPI.APIMeta;
87
+ /**
88
+ * Indicates whether the request was successful
89
+ */
90
+ success?: boolean;
73
91
  }
74
92
  /**
75
- * Complete definition of a message template including header, body, footer, and
76
- * buttons
93
+ * Configuration for AUTHENTICATION category templates
77
94
  */
78
- export interface TemplateDefinition {
95
+ export interface SentDmServicesCommonContractsPocOsAuthenticationConfig {
79
96
  /**
80
- * Required template body with content for different channels (multi-channel,
81
- * SMS-specific, or WhatsApp-specific)
97
+ * Whether to add the security recommendation text: "For your security, do not
98
+ * share this code."
82
99
  */
83
- body: TemplateDefinition.Body;
100
+ addSecurityRecommendation?: boolean;
84
101
  /**
85
- * Configuration specific to AUTHENTICATION category templates (optional)
102
+ * Code expiration time in minutes (1-90). If set, adds footer: "This code expires
103
+ * in X minutes."
86
104
  */
87
- authenticationConfig?: TemplateDefinition.AuthenticationConfig | null;
105
+ codeExpirationMinutes?: number | null;
106
+ }
107
+ /**
108
+ * Body section of a message template with channel-specific content
109
+ */
110
+ export interface SentDmServicesCommonContractsPocOsTemplateBody {
88
111
  /**
89
- * Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
112
+ * Content that will be used for all channels (SMS and WhatsApp) unless
113
+ * channel-specific content is provided
90
114
  */
91
- buttons?: Array<TemplateDefinition.Button> | null;
115
+ multiChannel?: TemplateBodyContent | null;
92
116
  /**
93
- * The version of the template definition format
117
+ * SMS-specific content that overrides multi-channel content for SMS messages
94
118
  */
95
- definitionVersion?: string | null;
119
+ sms?: TemplateBodyContent | null;
96
120
  /**
97
- * Optional template footer with optional variables
121
+ * WhatsApp-specific content that overrides multi-channel content for WhatsApp
122
+ * messages
98
123
  */
99
- footer?: TemplateDefinition.Footer | null;
124
+ whatsapp?: TemplateBodyContent | null;
125
+ }
126
+ /**
127
+ * Interactive button in a message template
128
+ */
129
+ export interface SentDmServicesCommonContractsPocOsTemplateButton {
130
+ /**
131
+ * The unique identifier of the button (1-based index)
132
+ */
133
+ id?: number;
100
134
  /**
101
- * Optional template header with optional variables
135
+ * Properties specific to the button type
102
136
  */
103
- header?: TemplateDefinition.Header | null;
137
+ props?: SentDmServicesCommonContractsPocOsTemplateButtonProps;
138
+ /**
139
+ * The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
140
+ */
141
+ type?: string;
142
+ }
143
+ export interface SentDmServicesCommonContractsPocOsTemplateButtonProps {
144
+ activeFor?: number | null;
145
+ autofillText?: string | null;
146
+ countryCode?: string | null;
147
+ offerCode?: string | null;
148
+ otpType?: string | null;
149
+ packageName?: string | null;
150
+ phoneNumber?: string | null;
151
+ quickReplyType?: string | null;
152
+ signatureHash?: string | null;
153
+ text?: string | null;
154
+ url?: string | null;
155
+ urlType?: string | null;
104
156
  }
105
- export declare namespace TemplateDefinition {
157
+ /**
158
+ * Footer section of a message template
159
+ */
160
+ export interface SentDmServicesCommonContractsPocOsTemplateFooter {
106
161
  /**
107
- * Required template body with content for different channels (multi-channel,
108
- * SMS-specific, or WhatsApp-specific)
162
+ * The footer template text with optional variable placeholders
109
163
  */
110
- interface Body {
111
- /**
112
- * Content that will be used for all channels (SMS and WhatsApp) unless
113
- * channel-specific content is provided
114
- */
115
- multiChannel?: TemplatesAPI.TemplateBodyContent | null;
116
- /**
117
- * SMS-specific content that overrides multi-channel content for SMS messages
118
- */
119
- sms?: TemplatesAPI.TemplateBodyContent | null;
120
- /**
121
- * WhatsApp-specific content that overrides multi-channel content for WhatsApp
122
- * messages
123
- */
124
- whatsapp?: TemplatesAPI.TemplateBodyContent | null;
125
- }
164
+ template?: string;
126
165
  /**
127
- * Configuration specific to AUTHENTICATION category templates (optional)
166
+ * The type of footer (typically "text")
128
167
  */
129
- interface AuthenticationConfig {
130
- /**
131
- * Whether to add the security recommendation text: "For your security, do not
132
- * share this code."
133
- */
134
- addSecurityRecommendation?: boolean;
135
- /**
136
- * Code expiration time in minutes (1-90). If set, adds footer: "This code expires
137
- * in X minutes."
138
- */
139
- codeExpirationMinutes?: number | null;
140
- }
168
+ type?: string | null;
141
169
  /**
142
- * Interactive button in a message template
170
+ * List of variables used in the footer template
143
171
  */
144
- interface Button {
145
- /**
146
- * The unique identifier of the button (1-based index)
147
- */
148
- id?: number;
149
- /**
150
- * Properties specific to the button type
151
- */
152
- props?: Button.Props;
153
- /**
154
- * The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
155
- */
156
- type?: string;
157
- }
158
- namespace Button {
159
- /**
160
- * Properties specific to the button type
161
- */
162
- interface Props {
163
- activeFor?: number | null;
164
- autofillText?: string | null;
165
- countryCode?: string | null;
166
- offerCode?: string | null;
167
- otpType?: string | null;
168
- packageName?: string | null;
169
- phoneNumber?: string | null;
170
- quickReplyType?: string | null;
171
- signatureHash?: string | null;
172
- text?: string | null;
173
- url?: string | null;
174
- urlType?: string | null;
175
- }
176
- }
172
+ variables?: Array<TemplateVariable> | null;
173
+ }
174
+ /**
175
+ * Header section of a message template
176
+ */
177
+ export interface SentDmServicesCommonContractsPocOsTemplateHeader {
177
178
  /**
178
- * Optional template footer with optional variables
179
+ * The header template text with optional variable placeholders (e.g., "Welcome to
180
+ * {{0:variable}}")
179
181
  */
180
- interface Footer {
181
- /**
182
- * The footer template text with optional variable placeholders
183
- */
184
- template?: string;
185
- /**
186
- * The type of footer (typically "text")
187
- */
188
- type?: string | null;
189
- /**
190
- * List of variables used in the footer template
191
- */
192
- variables?: Array<TemplatesAPI.TemplateVariable> | null;
193
- }
182
+ template?: string;
194
183
  /**
195
- * Optional template header with optional variables
184
+ * The type of header (e.g., "text", "image", "video", "document")
196
185
  */
197
- interface Header {
198
- /**
199
- * The header template text with optional variable placeholders (e.g., "Welcome to
200
- * {{0:variable}}")
201
- */
202
- template?: string;
203
- /**
204
- * The type of header (e.g., "text", "image", "video", "document")
205
- */
206
- type?: string | null;
207
- /**
208
- * List of variables used in the header template
209
- */
210
- variables?: Array<TemplatesAPI.TemplateVariable> | null;
211
- }
186
+ type?: string | null;
187
+ /**
188
+ * List of variables used in the header template
189
+ */
190
+ variables?: Array<TemplateVariable> | null;
212
191
  }
213
192
  /**
214
- * Represents a message template with comprehensive metadata including definition
215
- * structure
193
+ * Template response for v3 API
216
194
  */
217
- export interface TemplateResponseV2 {
195
+ export interface Template {
218
196
  /**
219
- * The unique identifier of the template
197
+ * Unique template identifier
220
198
  */
221
199
  id?: string;
222
200
  /**
223
- * The template category (e.g., MARKETING, UTILITY, AUTHENTICATION)
201
+ * Template category: MARKETING, UTILITY, AUTHENTICATION
224
202
  */
225
203
  category?: string;
226
204
  /**
227
- * The date and time when the template was created
205
+ * Supported channels: sms, whatsapp
228
206
  */
229
- createdAt?: string;
207
+ channels?: Array<string> | null;
230
208
  /**
231
- * The complete template definition including header, body, footer, and buttons
209
+ * When the template was created
232
210
  */
233
- definition?: TemplateDefinition;
211
+ created_at?: string;
234
212
  /**
235
- * The display name of the template (auto-generated if not provided)
213
+ * Whether the template is published and active
236
214
  */
237
- displayName?: string;
215
+ is_published?: boolean;
238
216
  /**
239
- * Indicates whether the template is published and available for use
217
+ * Template language code (e.g., en_US)
240
218
  */
241
- isPublished?: boolean;
219
+ language?: string;
242
220
  /**
243
- * The template language code (e.g., en_US, es_ES)
221
+ * Template display name
244
222
  */
245
- language?: string;
223
+ name?: string;
246
224
  /**
247
- * The approval status of the template (e.g., APPROVED, PENDING, REJECTED, DRAFT)
225
+ * Template status: APPROVED, PENDING, REJECTED
248
226
  */
249
227
  status?: string;
250
228
  /**
251
- * The date and time when the template was last updated
229
+ * When the template was last updated
252
230
  */
253
- updatedAt?: string | null;
231
+ updated_at?: string | null;
254
232
  /**
255
- * The WhatsApp Business API template ID from Meta
233
+ * Template variables for personalization
256
234
  */
257
- whatsappTemplateId?: string;
235
+ variables?: Array<string> | null;
236
+ }
237
+ export interface TemplateBodyContent {
238
+ template?: string;
239
+ type?: string | null;
240
+ variables?: Array<TemplateVariable> | null;
241
+ }
242
+ /**
243
+ * Complete definition of a message template including header, body, footer, and
244
+ * buttons
245
+ */
246
+ export interface TemplateDefinition {
258
247
  /**
259
- * The WhatsApp template name as registered with Meta
248
+ * Body section of a message template with channel-specific content
260
249
  */
261
- whatsappTemplateName?: string;
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;
259
+ /**
260
+ * The version of the template definition format
261
+ */
262
+ definitionVersion?: string | null;
263
+ /**
264
+ * Footer section of a message template
265
+ */
266
+ footer?: SentDmServicesCommonContractsPocOsTemplateFooter | null;
267
+ /**
268
+ * Header section of a message template
269
+ */
270
+ header?: SentDmServicesCommonContractsPocOsTemplateHeader | null;
262
271
  }
263
272
  export interface TemplateVariable {
264
273
  id?: number;
@@ -270,64 +279,191 @@ export declare namespace TemplateVariable {
270
279
  interface Props {
271
280
  alt?: string | null;
272
281
  mediaType?: string | null;
282
+ regex?: string | null;
273
283
  sample?: string | null;
274
284
  shortUrl?: string | null;
275
285
  url?: string | null;
276
286
  variableType?: string | null;
277
287
  }
278
288
  }
289
+ /**
290
+ * Standard API response envelope for all v3 endpoints
291
+ */
279
292
  export interface TemplateListResponse {
280
- items?: Array<TemplateResponseV2>;
281
- page?: number;
282
- pageSize?: number;
283
- totalCount?: number;
284
- totalPages?: number;
293
+ /**
294
+ * Paginated list of templates
295
+ */
296
+ data?: TemplateListResponse.Data | null;
297
+ /**
298
+ * Error information
299
+ */
300
+ error?: WebhooksAPI.ErrorDetail | null;
301
+ /**
302
+ * Request and response metadata
303
+ */
304
+ meta?: WebhooksAPI.APIMeta;
305
+ /**
306
+ * Indicates whether the request was successful
307
+ */
308
+ success?: boolean;
309
+ }
310
+ export declare namespace TemplateListResponse {
311
+ /**
312
+ * Paginated list of templates
313
+ */
314
+ interface Data {
315
+ /**
316
+ * Pagination metadata for list responses
317
+ */
318
+ pagination?: WebhooksAPI.PaginationMeta;
319
+ /**
320
+ * List of templates
321
+ */
322
+ templates?: Array<TemplatesAPI.Template>;
323
+ }
285
324
  }
286
325
  export interface TemplateCreateParams {
287
326
  /**
288
- * Template definition containing header, body, footer, and buttons
327
+ * Body param: Template category: MARKETING, UTILITY, AUTHENTICATION (optional,
328
+ * auto-detected if not provided)
329
+ */
330
+ category?: string | null;
331
+ /**
332
+ * Body param: Source of template creation (default: from-api)
289
333
  */
290
- definition: TemplateDefinition;
334
+ creation_source?: string | null;
335
+ /**
336
+ * Body param: Complete definition of a message template including header, body,
337
+ * footer, and buttons
338
+ */
339
+ definition?: TemplateDefinition;
340
+ /**
341
+ * Body param: Template language code (e.g., en_US) (optional, auto-detected if not
342
+ * provided)
343
+ */
344
+ language?: string | null;
291
345
  /**
292
- * The template category (e.g., MARKETING, UTILITY, AUTHENTICATION). Can only be
293
- * set when creating a new template. If not provided, will be auto-generated using
294
- * AI.
346
+ * Body param: Sandbox flag - when true, the operation is simulated without side
347
+ * effects Useful for testing integrations without actual execution
348
+ */
349
+ sandbox?: boolean;
350
+ /**
351
+ * Body param: Whether to submit the template for review after creation (default:
352
+ * false)
353
+ */
354
+ submit_for_review?: boolean;
355
+ /**
356
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
357
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
358
+ * hours per key per customer.
359
+ */
360
+ 'Idempotency-Key'?: string;
361
+ /**
362
+ * Header param: Profile UUID to scope the request to a child profile. Only
363
+ * organization API keys can use this header. The profile must belong to the
364
+ * calling organization.
365
+ */
366
+ 'x-profile-id'?: string;
367
+ }
368
+ export interface TemplateRetrieveParams {
369
+ /**
370
+ * Profile UUID to scope the request to a child profile. Only organization API keys
371
+ * can use this header. The profile must belong to the calling organization.
372
+ */
373
+ 'x-profile-id'?: string;
374
+ }
375
+ export interface TemplateUpdateParams {
376
+ /**
377
+ * Body param: Template category: MARKETING, UTILITY, AUTHENTICATION
295
378
  */
296
379
  category?: string | null;
297
380
  /**
298
- * The template language code (e.g., en_US, es_ES). Can only be set when creating a
299
- * new template. If not provided, will be auto-detected using AI.
381
+ * Body param: Complete definition of a message template including header, body,
382
+ * footer, and buttons
383
+ */
384
+ definition?: TemplateDefinition | null;
385
+ /**
386
+ * Body param: Template language code (e.g., en_US)
300
387
  */
301
388
  language?: string | null;
302
389
  /**
303
- * When false, the template will be saved as draft. When true, the template will be
304
- * submitted for review.
390
+ * Body param: Template display name
391
+ */
392
+ name?: string | null;
393
+ /**
394
+ * Body param: Sandbox flag - when true, the operation is simulated without side
395
+ * effects Useful for testing integrations without actual execution
396
+ */
397
+ sandbox?: boolean;
398
+ /**
399
+ * Body param: Whether to submit the template for review after updating (default:
400
+ * false)
401
+ */
402
+ submit_for_review?: boolean;
403
+ /**
404
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
405
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
406
+ * hours per key per customer.
407
+ */
408
+ 'Idempotency-Key'?: string;
409
+ /**
410
+ * Header param: Profile UUID to scope the request to a child profile. Only
411
+ * organization API keys can use this header. The profile must belong to the
412
+ * calling organization.
305
413
  */
306
- submitForReview?: boolean;
414
+ 'x-profile-id'?: string;
307
415
  }
308
416
  export interface TemplateListParams {
309
417
  /**
310
- * The page number (zero-indexed). Default is 0.
418
+ * Query param: Page number (1-indexed)
311
419
  */
312
420
  page: number;
313
421
  /**
314
- * The number of items per page (1-1000). Default is 100.
422
+ * Query param: Number of items per page
315
423
  */
316
- pageSize: number;
424
+ page_size: number;
317
425
  /**
318
- * Optional filter by template category (e.g., MARKETING, UTILITY, AUTHENTICATION)
426
+ * Query param: Optional category filter: MARKETING, UTILITY, AUTHENTICATION
319
427
  */
320
428
  category?: string | null;
321
429
  /**
322
- * Optional search term to filter templates by name or content
430
+ * Query param: Optional filter by welcome playground flag
431
+ */
432
+ is_welcome_playground?: boolean | null;
433
+ /**
434
+ * Query param: Optional search term for filtering templates
323
435
  */
324
436
  search?: string | null;
325
437
  /**
326
- * Optional filter by template status (e.g., APPROVED, PENDING, REJECTED, DRAFT)
438
+ * Query param: Optional status filter: APPROVED, PENDING, REJECTED
327
439
  */
328
440
  status?: string | null;
441
+ /**
442
+ * Header param: Profile UUID to scope the request to a child profile. Only
443
+ * organization API keys can use this header. The profile must belong to the
444
+ * calling organization.
445
+ */
446
+ 'x-profile-id'?: string;
447
+ }
448
+ export interface TemplateDeleteParams {
449
+ /**
450
+ * Body param: Whether to also delete the template from WhatsApp/Meta (optional,
451
+ * defaults to false)
452
+ */
453
+ delete_from_meta?: boolean | null;
454
+ /**
455
+ * Body param: Sandbox flag - when true, the operation is simulated without side
456
+ * effects Useful for testing integrations without actual execution
457
+ */
458
+ sandbox?: boolean;
459
+ /**
460
+ * Header param: Profile UUID to scope the request to a child profile. Only
461
+ * organization API keys can use this header. The profile must belong to the
462
+ * calling organization.
463
+ */
464
+ 'x-profile-id'?: string;
329
465
  }
330
466
  export declare namespace Templates {
331
- export { type TemplateBodyContent as TemplateBodyContent, type TemplateDefinition as TemplateDefinition, type TemplateResponseV2 as TemplateResponseV2, type TemplateVariable as TemplateVariable, type TemplateListResponse as TemplateListResponse, type TemplateCreateParams as TemplateCreateParams, type TemplateListParams as TemplateListParams, };
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, };
332
468
  }
333
469
  //# sourceMappingURL=templates.d.mts.map