@sentdm/sentdm 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/client.d.mts +53 -22
- package/client.d.mts.map +1 -1
- package/client.d.ts +53 -22
- package/client.d.ts.map +1 -1
- package/client.js +39 -8
- package/client.js.map +1 -1
- package/client.mjs +39 -8
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/contacts.d.mts +606 -89
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +606 -89
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +21 -15
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +21 -15
- package/resources/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +335 -69
- package/resources/conversations.d.mts.map +1 -1
- package/resources/conversations.d.ts +335 -69
- package/resources/conversations.d.ts.map +1 -1
- package/resources/conversations.js +15 -10
- package/resources/conversations.js.map +1 -1
- package/resources/conversations.mjs +15 -10
- package/resources/conversations.mjs.map +1 -1
- package/resources/index.d.mts +7 -7
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +132 -41
- package/resources/me.d.mts.map +1 -1
- package/resources/me.d.ts +132 -41
- package/resources/me.d.ts.map +1 -1
- package/resources/me.js +3 -1
- package/resources/me.js.map +1 -1
- package/resources/me.mjs +3 -1
- package/resources/me.mjs.map +1 -1
- package/resources/messages.d.mts +206 -27
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +206 -27
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +5 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +5 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +45 -4
- package/resources/numbers.d.mts.map +1 -1
- package/resources/numbers.d.ts +45 -4
- package/resources/numbers.d.ts.map +1 -1
- package/resources/numbers.js +3 -1
- package/resources/numbers.js.map +1 -1
- package/resources/numbers.mjs +3 -1
- package/resources/numbers.mjs.map +1 -1
- package/resources/profiles/campaigns.d.mts +579 -209
- package/resources/profiles/campaigns.d.mts.map +1 -1
- package/resources/profiles/campaigns.d.ts +579 -209
- package/resources/profiles/campaigns.d.ts.map +1 -1
- package/resources/profiles/campaigns.js +33 -64
- package/resources/profiles/campaigns.js.map +1 -1
- package/resources/profiles/campaigns.mjs +33 -64
- package/resources/profiles/campaigns.mjs.map +1 -1
- package/resources/profiles/index.d.mts +2 -2
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts +2 -2
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.js.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/profiles.d.mts +2006 -508
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +2006 -508
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js +98 -75
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs +98 -75
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/templates.d.mts +497 -84
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +497 -84
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +6 -4
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +6 -4
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +444 -43
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +444 -43
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +6 -4
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +6 -4
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +770 -169
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +770 -169
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +11 -8
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +11 -8
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +78 -60
- package/src/resources/contacts.ts +696 -92
- package/src/resources/conversations.ts +400 -77
- package/src/resources/index.ts +20 -26
- package/src/resources/me.ts +151 -52
- package/src/resources/messages.ts +230 -27
- package/src/resources/numbers.ts +50 -4
- package/src/resources/profiles/campaigns.ts +706 -232
- package/src/resources/profiles/index.ts +6 -14
- package/src/resources/profiles/profiles.ts +2421 -646
- package/src/resources/templates.ts +583 -99
- package/src/resources/users.ts +514 -44
- package/src/resources/webhooks.ts +1006 -283
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/contacts.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
-
import * as ContactsAPI from "./contacts.js";
|
|
3
|
-
import * as WebhooksAPI from "./webhooks.js";
|
|
4
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
5
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
5
|
+
* The people you message, and their channel identities.
|
|
6
|
+
*
|
|
7
|
+
* A contact holds one identity per channel — a phone number, a WhatsApp number — so routing can choose between them for the same person. Opt-out is recorded against the contact and honoured on every send, whichever channel it came through.
|
|
8
|
+
*
|
|
9
|
+
* `GET /v3/contacts/{id}/message-summary` is the per-contact view of what you have sent and what happened to it.
|
|
8
10
|
*/
|
|
9
11
|
export declare class Contacts extends APIResource {
|
|
10
12
|
/**
|
|
@@ -13,12 +15,12 @@ export declare class Contacts extends APIResource {
|
|
|
13
15
|
*
|
|
14
16
|
* @example
|
|
15
17
|
* ```ts
|
|
16
|
-
* const
|
|
18
|
+
* const contact = await client.contacts.create({
|
|
17
19
|
* phone_number: '+1234567890',
|
|
18
20
|
* });
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
create(params: ContactCreateParams, options?: RequestOptions): APIPromise<
|
|
23
|
+
create(params: ContactCreateParams, options?: RequestOptions): APIPromise<ContactCreateResponse>;
|
|
22
24
|
/**
|
|
23
25
|
* Retrieves a specific contact by their unique identifier. Returns detailed
|
|
24
26
|
* contact information including phone formats, available channels, and opt-out
|
|
@@ -26,24 +28,23 @@ export declare class Contacts extends APIResource {
|
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* ```ts
|
|
29
|
-
* const
|
|
31
|
+
* const contact = await client.contacts.retrieve(
|
|
30
32
|
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
31
33
|
* );
|
|
32
34
|
* ```
|
|
33
35
|
*/
|
|
34
|
-
retrieve(id: string, params?: ContactRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<
|
|
36
|
+
retrieve(id: string, params?: ContactRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<ContactRetrieveResponse>;
|
|
35
37
|
/**
|
|
36
|
-
* Updates a contact's default channel and/or opt-out status.
|
|
37
|
-
* cannot be updated.
|
|
38
|
+
* Updates a contact's default channel and/or opt-out status.
|
|
38
39
|
*
|
|
39
40
|
* @example
|
|
40
41
|
* ```ts
|
|
41
|
-
* const
|
|
42
|
+
* const contact = await client.contacts.update(
|
|
42
43
|
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
43
44
|
* );
|
|
44
45
|
* ```
|
|
45
46
|
*/
|
|
46
|
-
update(id: string, params: ContactUpdateParams, options?: RequestOptions): APIPromise<
|
|
47
|
+
update(id: string, params: ContactUpdateParams, options?: RequestOptions): APIPromise<ContactUpdateResponse>;
|
|
47
48
|
/**
|
|
48
49
|
* Retrieves a paginated list of contacts for the authenticated customer. Supports
|
|
49
50
|
* filtering by search term, channel, or phone number.
|
|
@@ -58,15 +59,18 @@ export declare class Contacts extends APIResource {
|
|
|
58
59
|
*/
|
|
59
60
|
list(params: ContactListParams, options?: RequestOptions): APIPromise<ContactListResponse>;
|
|
60
61
|
/**
|
|
61
|
-
*
|
|
62
|
-
* be
|
|
62
|
+
* **Deprecated.** Use `PATCH /v3/contacts/{id}` with `{"opt_out": true}` instead,
|
|
63
|
+
* and expect this to be removed in a future release. It still behaves exactly as
|
|
64
|
+
* before, so nothing needs to change today.
|
|
63
65
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
66
|
+
* Opting a contact out stops every send to them, which is what deleting one was
|
|
67
|
+
* mostly used for — and it keeps the record of who they were and that they asked.
|
|
68
|
+
* A delete discards the consent history along with the contact, which is the part
|
|
69
|
+
* you need if anyone ever asks why you stopped, or why you started again.
|
|
70
|
+
*
|
|
71
|
+
* Dissociates a contact from the authenticated customer.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated
|
|
70
74
|
*/
|
|
71
75
|
delete(id: string, params: ContactDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
72
76
|
/**
|
|
@@ -77,174 +81,687 @@ export declare class Contacts extends APIResource {
|
|
|
77
81
|
*
|
|
78
82
|
* @example
|
|
79
83
|
* ```ts
|
|
80
|
-
* const
|
|
84
|
+
* const response =
|
|
81
85
|
* await client.contacts.retrieveMessageSummary(
|
|
82
86
|
* '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
|
|
83
87
|
* );
|
|
84
88
|
* ```
|
|
85
89
|
*/
|
|
86
|
-
retrieveMessageSummary(contactID: string, params?: ContactRetrieveMessageSummaryParams | null | undefined, options?: RequestOptions): APIPromise<
|
|
90
|
+
retrieveMessageSummary(contactID: string, params?: ContactRetrieveMessageSummaryParams | null | undefined, options?: RequestOptions): APIPromise<ContactRetrieveMessageSummaryResponse>;
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* Standard API response envelope for all v3 endpoints
|
|
90
94
|
*/
|
|
91
|
-
export interface
|
|
95
|
+
export interface ContactCreateResponse {
|
|
92
96
|
/**
|
|
93
97
|
* Contact response for v3 API Uses snake_case for JSON property names
|
|
94
98
|
*/
|
|
95
|
-
data?:
|
|
99
|
+
data?: ContactCreateResponse.Data | null;
|
|
96
100
|
/**
|
|
97
101
|
* Error information
|
|
98
102
|
*/
|
|
99
|
-
error?:
|
|
103
|
+
error?: ContactCreateResponse.Error | null;
|
|
100
104
|
/**
|
|
101
105
|
* Request and response metadata
|
|
102
106
|
*/
|
|
103
|
-
meta?:
|
|
107
|
+
meta?: ContactCreateResponse.Meta;
|
|
104
108
|
/**
|
|
105
109
|
* Indicates whether the request was successful
|
|
106
110
|
*/
|
|
107
111
|
success?: boolean;
|
|
108
112
|
}
|
|
113
|
+
export declare namespace ContactCreateResponse {
|
|
114
|
+
/**
|
|
115
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
116
|
+
*/
|
|
117
|
+
interface Data {
|
|
118
|
+
/**
|
|
119
|
+
* Unique identifier for the contact
|
|
120
|
+
*/
|
|
121
|
+
id?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
|
|
124
|
+
*/
|
|
125
|
+
available_channels?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Country calling code (e.g., 1 for US/Canada)
|
|
128
|
+
*/
|
|
129
|
+
country_code?: string;
|
|
130
|
+
/**
|
|
131
|
+
* When the contact was created
|
|
132
|
+
*/
|
|
133
|
+
created_at?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
136
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
137
|
+
*/
|
|
138
|
+
customer_id?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Default messaging channel to use (e.g., "sms" or "whatsapp")
|
|
141
|
+
*/
|
|
142
|
+
default_channel?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Phone number in E.164 format (e.g., +1234567890)
|
|
145
|
+
*/
|
|
146
|
+
format_e164?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Phone number in international format (e.g., +1 234-567-890)
|
|
149
|
+
*/
|
|
150
|
+
format_international?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Phone number in national format (e.g., (234) 567-890)
|
|
153
|
+
*/
|
|
154
|
+
format_national?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
|
|
157
|
+
*/
|
|
158
|
+
format_rfc?: string;
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated Always false. Contacts are no longer shared or inherited between
|
|
161
|
+
* sender profiles — a profile sees only the contacts it owns. Retained so existing
|
|
162
|
+
* v3 clients reading is_inherited keep deserializing; it carries no information.
|
|
163
|
+
*/
|
|
164
|
+
is_inherited?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Whether the contact has opted out of messaging. Single source of truth — opt-out
|
|
167
|
+
* is per-contact, not per-channel.
|
|
168
|
+
*/
|
|
169
|
+
opt_out?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Phone number in original format
|
|
172
|
+
*/
|
|
173
|
+
phone_number?: string;
|
|
174
|
+
/**
|
|
175
|
+
* ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
176
|
+
*/
|
|
177
|
+
region_code?: string;
|
|
178
|
+
/**
|
|
179
|
+
* When the contact was last updated
|
|
180
|
+
*/
|
|
181
|
+
updated_at?: string | null;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Error information
|
|
185
|
+
*/
|
|
186
|
+
interface Error {
|
|
187
|
+
/**
|
|
188
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
189
|
+
*/
|
|
190
|
+
code?: string;
|
|
191
|
+
/**
|
|
192
|
+
* Additional validation error details (field-level errors)
|
|
193
|
+
*/
|
|
194
|
+
details?: {
|
|
195
|
+
[key: string]: Array<string>;
|
|
196
|
+
} | null;
|
|
197
|
+
/**
|
|
198
|
+
* URL to documentation about this error
|
|
199
|
+
*/
|
|
200
|
+
doc_url?: string | null;
|
|
201
|
+
/**
|
|
202
|
+
* Human-readable error message
|
|
203
|
+
*/
|
|
204
|
+
message?: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Request and response metadata
|
|
208
|
+
*/
|
|
209
|
+
interface Meta {
|
|
210
|
+
/**
|
|
211
|
+
* Unique identifier for this request (for tracing and support)
|
|
212
|
+
*/
|
|
213
|
+
request_id?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Server timestamp when the response was generated
|
|
216
|
+
*/
|
|
217
|
+
timestamp?: string;
|
|
218
|
+
/**
|
|
219
|
+
* API version used for this request
|
|
220
|
+
*/
|
|
221
|
+
version?: string;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
109
224
|
/**
|
|
110
225
|
* Standard API response envelope for all v3 endpoints
|
|
111
226
|
*/
|
|
112
|
-
export interface
|
|
227
|
+
export interface ContactRetrieveResponse {
|
|
113
228
|
/**
|
|
114
|
-
*
|
|
229
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
115
230
|
*/
|
|
116
|
-
data?:
|
|
231
|
+
data?: ContactRetrieveResponse.Data | null;
|
|
117
232
|
/**
|
|
118
233
|
* Error information
|
|
119
234
|
*/
|
|
120
|
-
error?:
|
|
235
|
+
error?: ContactRetrieveResponse.Error | null;
|
|
121
236
|
/**
|
|
122
237
|
* Request and response metadata
|
|
123
238
|
*/
|
|
124
|
-
meta?:
|
|
239
|
+
meta?: ContactRetrieveResponse.Meta;
|
|
125
240
|
/**
|
|
126
241
|
* Indicates whether the request was successful
|
|
127
242
|
*/
|
|
128
243
|
success?: boolean;
|
|
129
244
|
}
|
|
130
|
-
export
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
245
|
+
export declare namespace ContactRetrieveResponse {
|
|
246
|
+
/**
|
|
247
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
248
|
+
*/
|
|
249
|
+
interface Data {
|
|
250
|
+
/**
|
|
251
|
+
* Unique identifier for the contact
|
|
252
|
+
*/
|
|
253
|
+
id?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
|
|
256
|
+
*/
|
|
257
|
+
available_channels?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Country calling code (e.g., 1 for US/Canada)
|
|
260
|
+
*/
|
|
261
|
+
country_code?: string;
|
|
141
262
|
/**
|
|
142
|
-
*
|
|
263
|
+
* When the contact was created
|
|
143
264
|
*/
|
|
144
|
-
|
|
265
|
+
created_at?: string;
|
|
145
266
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
267
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
268
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
148
269
|
*/
|
|
149
|
-
|
|
270
|
+
customer_id?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Default messaging channel to use (e.g., "sms" or "whatsapp")
|
|
273
|
+
*/
|
|
274
|
+
default_channel?: string;
|
|
275
|
+
/**
|
|
276
|
+
* Phone number in E.164 format (e.g., +1234567890)
|
|
277
|
+
*/
|
|
278
|
+
format_e164?: string;
|
|
279
|
+
/**
|
|
280
|
+
* Phone number in international format (e.g., +1 234-567-890)
|
|
281
|
+
*/
|
|
282
|
+
format_international?: string;
|
|
283
|
+
/**
|
|
284
|
+
* Phone number in national format (e.g., (234) 567-890)
|
|
285
|
+
*/
|
|
286
|
+
format_national?: string;
|
|
287
|
+
/**
|
|
288
|
+
* Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
|
|
289
|
+
*/
|
|
290
|
+
format_rfc?: string;
|
|
291
|
+
/**
|
|
292
|
+
* @deprecated Always false. Contacts are no longer shared or inherited between
|
|
293
|
+
* sender profiles — a profile sees only the contacts it owns. Retained so existing
|
|
294
|
+
* v3 clients reading is_inherited keep deserializing; it carries no information.
|
|
295
|
+
*/
|
|
296
|
+
is_inherited?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Whether the contact has opted out of messaging. Single source of truth — opt-out
|
|
299
|
+
* is per-contact, not per-channel.
|
|
300
|
+
*/
|
|
301
|
+
opt_out?: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Phone number in original format
|
|
304
|
+
*/
|
|
305
|
+
phone_number?: string;
|
|
306
|
+
/**
|
|
307
|
+
* ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
308
|
+
*/
|
|
309
|
+
region_code?: string;
|
|
310
|
+
/**
|
|
311
|
+
* When the contact was last updated
|
|
312
|
+
*/
|
|
313
|
+
updated_at?: string | null;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Error information
|
|
317
|
+
*/
|
|
318
|
+
interface Error {
|
|
319
|
+
/**
|
|
320
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
321
|
+
*/
|
|
322
|
+
code?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Additional validation error details (field-level errors)
|
|
325
|
+
*/
|
|
326
|
+
details?: {
|
|
327
|
+
[key: string]: Array<string>;
|
|
328
|
+
} | null;
|
|
329
|
+
/**
|
|
330
|
+
* URL to documentation about this error
|
|
331
|
+
*/
|
|
332
|
+
doc_url?: string | null;
|
|
333
|
+
/**
|
|
334
|
+
* Human-readable error message
|
|
335
|
+
*/
|
|
336
|
+
message?: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Request and response metadata
|
|
340
|
+
*/
|
|
341
|
+
interface Meta {
|
|
342
|
+
/**
|
|
343
|
+
* Unique identifier for this request (for tracing and support)
|
|
344
|
+
*/
|
|
345
|
+
request_id?: string;
|
|
346
|
+
/**
|
|
347
|
+
* Server timestamp when the response was generated
|
|
348
|
+
*/
|
|
349
|
+
timestamp?: string;
|
|
350
|
+
/**
|
|
351
|
+
* API version used for this request
|
|
352
|
+
*/
|
|
353
|
+
version?: string;
|
|
150
354
|
}
|
|
151
355
|
}
|
|
152
356
|
/**
|
|
153
|
-
*
|
|
357
|
+
* Standard API response envelope for all v3 endpoints
|
|
154
358
|
*/
|
|
155
|
-
export interface
|
|
359
|
+
export interface ContactUpdateResponse {
|
|
156
360
|
/**
|
|
157
|
-
*
|
|
361
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
158
362
|
*/
|
|
159
|
-
|
|
363
|
+
data?: ContactUpdateResponse.Data | null;
|
|
160
364
|
/**
|
|
161
|
-
*
|
|
365
|
+
* Error information
|
|
162
366
|
*/
|
|
163
|
-
|
|
367
|
+
error?: ContactUpdateResponse.Error | null;
|
|
164
368
|
/**
|
|
165
|
-
*
|
|
369
|
+
* Request and response metadata
|
|
166
370
|
*/
|
|
167
|
-
|
|
371
|
+
meta?: ContactUpdateResponse.Meta;
|
|
168
372
|
/**
|
|
169
|
-
*
|
|
373
|
+
* Indicates whether the request was successful
|
|
170
374
|
*/
|
|
171
|
-
|
|
375
|
+
success?: boolean;
|
|
376
|
+
}
|
|
377
|
+
export declare namespace ContactUpdateResponse {
|
|
172
378
|
/**
|
|
173
|
-
*
|
|
379
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
174
380
|
*/
|
|
175
|
-
|
|
381
|
+
interface Data {
|
|
382
|
+
/**
|
|
383
|
+
* Unique identifier for the contact
|
|
384
|
+
*/
|
|
385
|
+
id?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
|
|
388
|
+
*/
|
|
389
|
+
available_channels?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Country calling code (e.g., 1 for US/Canada)
|
|
392
|
+
*/
|
|
393
|
+
country_code?: string;
|
|
394
|
+
/**
|
|
395
|
+
* When the contact was created
|
|
396
|
+
*/
|
|
397
|
+
created_at?: string;
|
|
398
|
+
/**
|
|
399
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
400
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
401
|
+
*/
|
|
402
|
+
customer_id?: string;
|
|
403
|
+
/**
|
|
404
|
+
* Default messaging channel to use (e.g., "sms" or "whatsapp")
|
|
405
|
+
*/
|
|
406
|
+
default_channel?: string;
|
|
407
|
+
/**
|
|
408
|
+
* Phone number in E.164 format (e.g., +1234567890)
|
|
409
|
+
*/
|
|
410
|
+
format_e164?: string;
|
|
411
|
+
/**
|
|
412
|
+
* Phone number in international format (e.g., +1 234-567-890)
|
|
413
|
+
*/
|
|
414
|
+
format_international?: string;
|
|
415
|
+
/**
|
|
416
|
+
* Phone number in national format (e.g., (234) 567-890)
|
|
417
|
+
*/
|
|
418
|
+
format_national?: string;
|
|
419
|
+
/**
|
|
420
|
+
* Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
|
|
421
|
+
*/
|
|
422
|
+
format_rfc?: string;
|
|
423
|
+
/**
|
|
424
|
+
* @deprecated Always false. Contacts are no longer shared or inherited between
|
|
425
|
+
* sender profiles — a profile sees only the contacts it owns. Retained so existing
|
|
426
|
+
* v3 clients reading is_inherited keep deserializing; it carries no information.
|
|
427
|
+
*/
|
|
428
|
+
is_inherited?: boolean;
|
|
429
|
+
/**
|
|
430
|
+
* Whether the contact has opted out of messaging. Single source of truth — opt-out
|
|
431
|
+
* is per-contact, not per-channel.
|
|
432
|
+
*/
|
|
433
|
+
opt_out?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* Phone number in original format
|
|
436
|
+
*/
|
|
437
|
+
phone_number?: string;
|
|
438
|
+
/**
|
|
439
|
+
* ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
440
|
+
*/
|
|
441
|
+
region_code?: string;
|
|
442
|
+
/**
|
|
443
|
+
* When the contact was last updated
|
|
444
|
+
*/
|
|
445
|
+
updated_at?: string | null;
|
|
446
|
+
}
|
|
176
447
|
/**
|
|
177
|
-
*
|
|
448
|
+
* Error information
|
|
178
449
|
*/
|
|
179
|
-
|
|
450
|
+
interface Error {
|
|
451
|
+
/**
|
|
452
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
453
|
+
*/
|
|
454
|
+
code?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Additional validation error details (field-level errors)
|
|
457
|
+
*/
|
|
458
|
+
details?: {
|
|
459
|
+
[key: string]: Array<string>;
|
|
460
|
+
} | null;
|
|
461
|
+
/**
|
|
462
|
+
* URL to documentation about this error
|
|
463
|
+
*/
|
|
464
|
+
doc_url?: string | null;
|
|
465
|
+
/**
|
|
466
|
+
* Human-readable error message
|
|
467
|
+
*/
|
|
468
|
+
message?: string;
|
|
469
|
+
}
|
|
180
470
|
/**
|
|
181
|
-
*
|
|
471
|
+
* Request and response metadata
|
|
182
472
|
*/
|
|
183
|
-
|
|
473
|
+
interface Meta {
|
|
474
|
+
/**
|
|
475
|
+
* Unique identifier for this request (for tracing and support)
|
|
476
|
+
*/
|
|
477
|
+
request_id?: string;
|
|
478
|
+
/**
|
|
479
|
+
* Server timestamp when the response was generated
|
|
480
|
+
*/
|
|
481
|
+
timestamp?: string;
|
|
482
|
+
/**
|
|
483
|
+
* API version used for this request
|
|
484
|
+
*/
|
|
485
|
+
version?: string;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Standard API response envelope for all v3 endpoints
|
|
490
|
+
*/
|
|
491
|
+
export interface ContactListResponse {
|
|
184
492
|
/**
|
|
185
|
-
*
|
|
493
|
+
* A paginated list of contacts.
|
|
186
494
|
*/
|
|
187
|
-
|
|
495
|
+
data?: ContactListResponse.Data | null;
|
|
188
496
|
/**
|
|
189
|
-
*
|
|
497
|
+
* Error information
|
|
190
498
|
*/
|
|
191
|
-
|
|
499
|
+
error?: ContactListResponse.Error | null;
|
|
192
500
|
/**
|
|
193
|
-
*
|
|
501
|
+
* Request and response metadata
|
|
194
502
|
*/
|
|
195
|
-
|
|
503
|
+
meta?: ContactListResponse.Meta;
|
|
196
504
|
/**
|
|
197
|
-
*
|
|
198
|
-
* is per-contact, not per-channel.
|
|
505
|
+
* Indicates whether the request was successful
|
|
199
506
|
*/
|
|
200
|
-
|
|
507
|
+
success?: boolean;
|
|
508
|
+
}
|
|
509
|
+
export declare namespace ContactListResponse {
|
|
201
510
|
/**
|
|
202
|
-
*
|
|
511
|
+
* A paginated list of contacts.
|
|
203
512
|
*/
|
|
204
|
-
|
|
513
|
+
interface Data {
|
|
514
|
+
/**
|
|
515
|
+
* The contacts on this page.
|
|
516
|
+
*/
|
|
517
|
+
contacts?: Array<Data.Contact>;
|
|
518
|
+
/**
|
|
519
|
+
* Pagination metadata for list responses
|
|
520
|
+
*/
|
|
521
|
+
pagination?: Data.Pagination;
|
|
522
|
+
}
|
|
523
|
+
namespace Data {
|
|
524
|
+
/**
|
|
525
|
+
* Contact response for v3 API Uses snake_case for JSON property names
|
|
526
|
+
*/
|
|
527
|
+
interface Contact {
|
|
528
|
+
/**
|
|
529
|
+
* Unique identifier for the contact
|
|
530
|
+
*/
|
|
531
|
+
id?: string;
|
|
532
|
+
/**
|
|
533
|
+
* Comma-separated list of available messaging channels (e.g., "sms,whatsapp")
|
|
534
|
+
*/
|
|
535
|
+
available_channels?: string;
|
|
536
|
+
/**
|
|
537
|
+
* Country calling code (e.g., 1 for US/Canada)
|
|
538
|
+
*/
|
|
539
|
+
country_code?: string;
|
|
540
|
+
/**
|
|
541
|
+
* When the contact was created
|
|
542
|
+
*/
|
|
543
|
+
created_at?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Which customer owns this — the key's own, or the profile named in x-profile-id.
|
|
546
|
+
* Says whose resource this is, which the resource's own id does not.
|
|
547
|
+
*/
|
|
548
|
+
customer_id?: string;
|
|
549
|
+
/**
|
|
550
|
+
* Default messaging channel to use (e.g., "sms" or "whatsapp")
|
|
551
|
+
*/
|
|
552
|
+
default_channel?: string;
|
|
553
|
+
/**
|
|
554
|
+
* Phone number in E.164 format (e.g., +1234567890)
|
|
555
|
+
*/
|
|
556
|
+
format_e164?: string;
|
|
557
|
+
/**
|
|
558
|
+
* Phone number in international format (e.g., +1 234-567-890)
|
|
559
|
+
*/
|
|
560
|
+
format_international?: string;
|
|
561
|
+
/**
|
|
562
|
+
* Phone number in national format (e.g., (234) 567-890)
|
|
563
|
+
*/
|
|
564
|
+
format_national?: string;
|
|
565
|
+
/**
|
|
566
|
+
* Phone number in RFC 3966 format (e.g., tel:+1-234-567-890)
|
|
567
|
+
*/
|
|
568
|
+
format_rfc?: string;
|
|
569
|
+
/**
|
|
570
|
+
* @deprecated Always false. Contacts are no longer shared or inherited between
|
|
571
|
+
* sender profiles — a profile sees only the contacts it owns. Retained so existing
|
|
572
|
+
* v3 clients reading is_inherited keep deserializing; it carries no information.
|
|
573
|
+
*/
|
|
574
|
+
is_inherited?: boolean;
|
|
575
|
+
/**
|
|
576
|
+
* Whether the contact has opted out of messaging. Single source of truth — opt-out
|
|
577
|
+
* is per-contact, not per-channel.
|
|
578
|
+
*/
|
|
579
|
+
opt_out?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Phone number in original format
|
|
582
|
+
*/
|
|
583
|
+
phone_number?: string;
|
|
584
|
+
/**
|
|
585
|
+
* ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
586
|
+
*/
|
|
587
|
+
region_code?: string;
|
|
588
|
+
/**
|
|
589
|
+
* When the contact was last updated
|
|
590
|
+
*/
|
|
591
|
+
updated_at?: string | null;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Pagination metadata for list responses
|
|
595
|
+
*/
|
|
596
|
+
interface Pagination {
|
|
597
|
+
/**
|
|
598
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
599
|
+
*/
|
|
600
|
+
cursors?: Pagination.Cursors | null;
|
|
601
|
+
/**
|
|
602
|
+
* Whether there are more pages after this one
|
|
603
|
+
*/
|
|
604
|
+
has_more?: boolean;
|
|
605
|
+
/**
|
|
606
|
+
* Current page number (1-indexed)
|
|
607
|
+
*/
|
|
608
|
+
page?: number;
|
|
609
|
+
/**
|
|
610
|
+
* Number of items per page
|
|
611
|
+
*/
|
|
612
|
+
page_size?: number;
|
|
613
|
+
/**
|
|
614
|
+
* Total number of items across all pages
|
|
615
|
+
*/
|
|
616
|
+
total_count?: number;
|
|
617
|
+
/**
|
|
618
|
+
* Total number of pages
|
|
619
|
+
*/
|
|
620
|
+
total_pages?: number;
|
|
621
|
+
}
|
|
622
|
+
namespace Pagination {
|
|
623
|
+
/**
|
|
624
|
+
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
625
|
+
*/
|
|
626
|
+
interface Cursors {
|
|
627
|
+
/**
|
|
628
|
+
* Cursor to fetch the next page.
|
|
629
|
+
*/
|
|
630
|
+
after?: string | null;
|
|
631
|
+
/**
|
|
632
|
+
* Cursor to fetch the previous page.
|
|
633
|
+
*/
|
|
634
|
+
before?: string | null;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
205
638
|
/**
|
|
206
|
-
*
|
|
639
|
+
* Error information
|
|
207
640
|
*/
|
|
208
|
-
|
|
641
|
+
interface Error {
|
|
642
|
+
/**
|
|
643
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
644
|
+
*/
|
|
645
|
+
code?: string;
|
|
646
|
+
/**
|
|
647
|
+
* Additional validation error details (field-level errors)
|
|
648
|
+
*/
|
|
649
|
+
details?: {
|
|
650
|
+
[key: string]: Array<string>;
|
|
651
|
+
} | null;
|
|
652
|
+
/**
|
|
653
|
+
* URL to documentation about this error
|
|
654
|
+
*/
|
|
655
|
+
doc_url?: string | null;
|
|
656
|
+
/**
|
|
657
|
+
* Human-readable error message
|
|
658
|
+
*/
|
|
659
|
+
message?: string;
|
|
660
|
+
}
|
|
209
661
|
/**
|
|
210
|
-
*
|
|
662
|
+
* Request and response metadata
|
|
211
663
|
*/
|
|
212
|
-
|
|
664
|
+
interface Meta {
|
|
665
|
+
/**
|
|
666
|
+
* Unique identifier for this request (for tracing and support)
|
|
667
|
+
*/
|
|
668
|
+
request_id?: string;
|
|
669
|
+
/**
|
|
670
|
+
* Server timestamp when the response was generated
|
|
671
|
+
*/
|
|
672
|
+
timestamp?: string;
|
|
673
|
+
/**
|
|
674
|
+
* API version used for this request
|
|
675
|
+
*/
|
|
676
|
+
version?: string;
|
|
677
|
+
}
|
|
213
678
|
}
|
|
214
679
|
/**
|
|
215
680
|
* Standard API response envelope for all v3 endpoints
|
|
216
681
|
*/
|
|
217
|
-
export interface
|
|
682
|
+
export interface ContactRetrieveMessageSummaryResponse {
|
|
218
683
|
/**
|
|
219
|
-
*
|
|
684
|
+
* The response data (null if error)
|
|
220
685
|
*/
|
|
221
|
-
data?:
|
|
686
|
+
data?: ContactRetrieveMessageSummaryResponse.Data | null;
|
|
222
687
|
/**
|
|
223
688
|
* Error information
|
|
224
689
|
*/
|
|
225
|
-
error?:
|
|
690
|
+
error?: ContactRetrieveMessageSummaryResponse.Error | null;
|
|
226
691
|
/**
|
|
227
692
|
* Request and response metadata
|
|
228
693
|
*/
|
|
229
|
-
meta?:
|
|
694
|
+
meta?: ContactRetrieveMessageSummaryResponse.Meta;
|
|
230
695
|
/**
|
|
231
696
|
* Indicates whether the request was successful
|
|
232
697
|
*/
|
|
233
698
|
success?: boolean;
|
|
234
699
|
}
|
|
235
|
-
export declare namespace
|
|
700
|
+
export declare namespace ContactRetrieveMessageSummaryResponse {
|
|
236
701
|
/**
|
|
237
|
-
*
|
|
702
|
+
* The response data (null if error)
|
|
238
703
|
*/
|
|
239
704
|
interface Data {
|
|
705
|
+
channel_scores?: Array<Data.ChannelScore>;
|
|
706
|
+
channels_used?: Array<string>;
|
|
707
|
+
contact_id?: string;
|
|
708
|
+
first_message_at?: string | null;
|
|
709
|
+
last_message_at?: string | null;
|
|
710
|
+
message_count?: number;
|
|
711
|
+
}
|
|
712
|
+
namespace Data {
|
|
713
|
+
interface ChannelScore {
|
|
714
|
+
channel?: string;
|
|
715
|
+
/**
|
|
716
|
+
* Percentage (0-100) of messages on this channel that ended in FAILED.
|
|
717
|
+
*/
|
|
718
|
+
fail_score?: number;
|
|
719
|
+
/**
|
|
720
|
+
* Percentage (0-100) of messages on this channel that reached a successful
|
|
721
|
+
* terminal state: SENT/DELIVERED/READ for outbound, RECEIVED for inbound.
|
|
722
|
+
*/
|
|
723
|
+
success_score?: number;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Error information
|
|
728
|
+
*/
|
|
729
|
+
interface Error {
|
|
240
730
|
/**
|
|
241
|
-
*
|
|
731
|
+
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
242
732
|
*/
|
|
243
|
-
|
|
733
|
+
code?: string;
|
|
244
734
|
/**
|
|
245
|
-
*
|
|
735
|
+
* Additional validation error details (field-level errors)
|
|
736
|
+
*/
|
|
737
|
+
details?: {
|
|
738
|
+
[key: string]: Array<string>;
|
|
739
|
+
} | null;
|
|
740
|
+
/**
|
|
741
|
+
* URL to documentation about this error
|
|
742
|
+
*/
|
|
743
|
+
doc_url?: string | null;
|
|
744
|
+
/**
|
|
745
|
+
* Human-readable error message
|
|
746
|
+
*/
|
|
747
|
+
message?: string;
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Request and response metadata
|
|
751
|
+
*/
|
|
752
|
+
interface Meta {
|
|
753
|
+
/**
|
|
754
|
+
* Unique identifier for this request (for tracing and support)
|
|
755
|
+
*/
|
|
756
|
+
request_id?: string;
|
|
757
|
+
/**
|
|
758
|
+
* Server timestamp when the response was generated
|
|
759
|
+
*/
|
|
760
|
+
timestamp?: string;
|
|
761
|
+
/**
|
|
762
|
+
* API version used for this request
|
|
246
763
|
*/
|
|
247
|
-
|
|
764
|
+
version?: string;
|
|
248
765
|
}
|
|
249
766
|
}
|
|
250
767
|
export interface ContactCreateParams {
|
|
@@ -354,6 +871,6 @@ export interface ContactRetrieveMessageSummaryParams {
|
|
|
354
871
|
'x-profile-id'?: string;
|
|
355
872
|
}
|
|
356
873
|
export declare namespace Contacts {
|
|
357
|
-
export { type
|
|
874
|
+
export { type ContactCreateResponse as ContactCreateResponse, type ContactRetrieveResponse as ContactRetrieveResponse, type ContactUpdateResponse as ContactUpdateResponse, type ContactListResponse as ContactListResponse, type ContactRetrieveMessageSummaryResponse as ContactRetrieveMessageSummaryResponse, type ContactCreateParams as ContactCreateParams, type ContactRetrieveParams as ContactRetrieveParams, type ContactUpdateParams as ContactUpdateParams, type ContactListParams as ContactListParams, type ContactDeleteParams as ContactDeleteParams, type ContactRetrieveMessageSummaryParams as ContactRetrieveMessageSummaryParams, };
|
|
358
875
|
}
|
|
359
876
|
//# sourceMappingURL=contacts.d.ts.map
|