@wix/crm 1.0.0 → 1.0.2

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 (79) hide show
  1. package/build/cjs/index.d.ts +4 -1
  2. package/build/cjs/index.js +5 -2
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/contacts-v4-contact.http.d.ts +192 -0
  5. package/build/cjs/src/contacts-v4-contact.http.js +522 -0
  6. package/build/cjs/src/contacts-v4-contact.http.js.map +1 -0
  7. package/build/cjs/src/contacts-v4-contact.public.d.ts +14 -0
  8. package/build/cjs/src/contacts-v4-contact.public.js +64 -0
  9. package/build/cjs/src/contacts-v4-contact.public.js.map +1 -0
  10. package/build/cjs/src/contacts-v4-contact.types.d.ts +1310 -0
  11. package/build/cjs/src/contacts-v4-contact.types.js +202 -0
  12. package/build/cjs/src/contacts-v4-contact.types.js.map +1 -0
  13. package/build/cjs/src/contacts-v4-contact.universal.d.ts +1663 -0
  14. package/build/cjs/src/contacts-v4-contact.universal.js +903 -0
  15. package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-extended-field.http.d.ts +31 -0
  17. package/build/cjs/src/contacts-v4-extended-field.http.js +215 -0
  18. package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -0
  19. package/build/cjs/src/contacts-v4-extended-field.public.d.ts +12 -0
  20. package/build/cjs/src/contacts-v4-extended-field.public.js +40 -0
  21. package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -0
  22. package/build/cjs/src/contacts-v4-extended-field.types.d.ts +257 -0
  23. package/build/cjs/src/contacts-v4-extended-field.types.js +23 -0
  24. package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -0
  25. package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +476 -0
  26. package/build/cjs/src/contacts-v4-extended-field.universal.js +393 -0
  27. package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -0
  28. package/build/cjs/src/contacts-v4-label.http.d.ts +31 -0
  29. package/build/cjs/src/contacts-v4-label.http.js +191 -0
  30. package/build/cjs/src/contacts-v4-label.http.js.map +1 -0
  31. package/build/cjs/src/contacts-v4-label.public.d.ts +11 -0
  32. package/build/cjs/src/contacts-v4-label.public.js +33 -0
  33. package/build/cjs/src/contacts-v4-label.public.js.map +1 -0
  34. package/build/cjs/src/contacts-v4-label.types.d.ts +253 -0
  35. package/build/cjs/src/contacts-v4-label.types.js +17 -0
  36. package/build/cjs/src/contacts-v4-label.types.js.map +1 -0
  37. package/build/cjs/src/contacts-v4-label.universal.d.ts +442 -0
  38. package/build/cjs/src/contacts-v4-label.universal.js +326 -0
  39. package/build/cjs/src/contacts-v4-label.universal.js.map +1 -0
  40. package/build/es/index.d.ts +4 -1
  41. package/build/es/index.js +4 -1
  42. package/build/es/index.js.map +1 -1
  43. package/build/es/src/contacts-v4-contact.http.d.ts +192 -0
  44. package/build/es/src/contacts-v4-contact.http.js +512 -0
  45. package/build/es/src/contacts-v4-contact.http.js.map +1 -0
  46. package/build/es/src/contacts-v4-contact.public.d.ts +14 -0
  47. package/build/es/src/contacts-v4-contact.public.js +39 -0
  48. package/build/es/src/contacts-v4-contact.public.js.map +1 -0
  49. package/build/es/src/contacts-v4-contact.types.d.ts +1310 -0
  50. package/build/es/src/contacts-v4-contact.types.js +199 -0
  51. package/build/es/src/contacts-v4-contact.types.js.map +1 -0
  52. package/build/es/src/contacts-v4-contact.universal.d.ts +1663 -0
  53. package/build/es/src/contacts-v4-contact.universal.js +874 -0
  54. package/build/es/src/contacts-v4-contact.universal.js.map +1 -0
  55. package/build/es/src/contacts-v4-extended-field.http.d.ts +31 -0
  56. package/build/es/src/contacts-v4-extended-field.http.js +207 -0
  57. package/build/es/src/contacts-v4-extended-field.http.js.map +1 -0
  58. package/build/es/src/contacts-v4-extended-field.public.d.ts +12 -0
  59. package/build/es/src/contacts-v4-extended-field.public.js +29 -0
  60. package/build/es/src/contacts-v4-extended-field.public.js.map +1 -0
  61. package/build/es/src/contacts-v4-extended-field.types.d.ts +257 -0
  62. package/build/es/src/contacts-v4-extended-field.types.js +20 -0
  63. package/build/es/src/contacts-v4-extended-field.types.js.map +1 -0
  64. package/build/es/src/contacts-v4-extended-field.universal.d.ts +476 -0
  65. package/build/es/src/contacts-v4-extended-field.universal.js +366 -0
  66. package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -0
  67. package/build/es/src/contacts-v4-label.http.d.ts +31 -0
  68. package/build/es/src/contacts-v4-label.http.js +184 -0
  69. package/build/es/src/contacts-v4-label.http.js.map +1 -0
  70. package/build/es/src/contacts-v4-label.public.d.ts +11 -0
  71. package/build/es/src/contacts-v4-label.public.js +24 -0
  72. package/build/es/src/contacts-v4-label.public.js.map +1 -0
  73. package/build/es/src/contacts-v4-label.types.d.ts +253 -0
  74. package/build/es/src/contacts-v4-label.types.js +14 -0
  75. package/build/es/src/contacts-v4-label.types.js.map +1 -0
  76. package/build/es/src/contacts-v4-label.universal.d.ts +442 -0
  77. package/build/es/src/contacts-v4-label.universal.js +300 -0
  78. package/build/es/src/contacts-v4-label.universal.js.map +1 -0
  79. package/package.json +2 -2
@@ -0,0 +1,1663 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ export interface Contact {
8
+ /**
9
+ * Contact ID.
10
+ * @readonly
11
+ */
12
+ _id?: string;
13
+ /**
14
+ * Revision number, which increments by 1 each time the contact is updated.
15
+ * To prevent conflicting changes,
16
+ * the existing `revision` must be used when updating a contact.
17
+ * @readonly
18
+ */
19
+ revision?: number;
20
+ /**
21
+ * Details about the contact's source.
22
+ * @readonly
23
+ */
24
+ source?: ContactSource;
25
+ /**
26
+ * Date and time the contact was created.
27
+ * @readonly
28
+ */
29
+ _createdDate?: Date;
30
+ /**
31
+ * Date and time the contact was last updated.
32
+ * @readonly
33
+ */
34
+ _updatedDate?: Date;
35
+ /**
36
+ * Details about the contact's last action in the site.
37
+ * @readonly
38
+ */
39
+ lastActivity?: ContactActivity;
40
+ /**
41
+ * Contact's primary phone and email.
42
+ *
43
+ * This property reflects the email address in `contactInfo.emails` where `primary` is `true`.
44
+ * @readonly
45
+ */
46
+ primaryInfo?: PrimaryContactInfo;
47
+ /**
48
+ * Contact's profile picture.
49
+ * This can contain an image URL and a Wix Media image ID.
50
+ *
51
+ * > **Deprecation Notice:**
52
+ * > This property has been replaced with
53
+ * > `info.picture`
54
+ * > and will be removed on March 31, 2022. If your app uses this property,
55
+ * > we recommend updating your code as soon as possible.
56
+ * @readonly
57
+ */
58
+ picture?: string;
59
+ /** Contact's details. */
60
+ info?: ContactInfo;
61
+ }
62
+ export interface ContactSource {
63
+ /**
64
+ * Some possible values:
65
+ *
66
+ * `"OTHER"`, `"ADMIN"`, `"WIX_APP"`, `"IMPORT"`, `"THIRD_PARTY"`,
67
+ * `"WIX_BOOKINGS"`, `"WIX_CHAT"`, `"WIX_EMAIL_MARKETING"`, `"WIX_EVENTS"`,
68
+ * `"WIX_FORMS"`, `"WIX_GROUPS"`, `"WIX_HOTELS"`, `"WIX_MARKET_PLACE"`,
69
+ * `"WIX_MUSIC"`, `"WIX_RESTAURANTS"`, `"WIX_SITE_MEMBERS"`, `"WIX_STORES"`.
70
+ * @readonly
71
+ */
72
+ sourceType?: ContactSourceType;
73
+ /**
74
+ * App ID, if the contact was created by a Wix app.
75
+ *
76
+ * > **Deprecation Notice:**
77
+ * > This property has been replaced with
78
+ * > `appId`
79
+ * > and will be removed on March 31, 2022. If your app uses this property,
80
+ * > we recommend updating your code as soon as possible.
81
+ * @readonly
82
+ */
83
+ wixAppId?: string | null;
84
+ /**
85
+ * App ID, if the contact was created by an app.
86
+ * @readonly
87
+ */
88
+ appId?: string | null;
89
+ }
90
+ export declare enum ContactSourceType {
91
+ OTHER = "OTHER",
92
+ ADMIN = "ADMIN",
93
+ WIX_APP = "WIX_APP",
94
+ IMPORT = "IMPORT",
95
+ THIRD_PARTY = "THIRD_PARTY",
96
+ WIX_BOOKINGS = "WIX_BOOKINGS",
97
+ WIX_CHAT = "WIX_CHAT",
98
+ WIX_EMAIL_MARKETING = "WIX_EMAIL_MARKETING",
99
+ WIX_EVENTS = "WIX_EVENTS",
100
+ WIX_FORMS = "WIX_FORMS",
101
+ WIX_GROUPS = "WIX_GROUPS",
102
+ WIX_HOTELS = "WIX_HOTELS",
103
+ WIX_MARKET_PLACE = "WIX_MARKET_PLACE",
104
+ WIX_MUSIC = "WIX_MUSIC",
105
+ WIX_RESTAURANTS = "WIX_RESTAURANTS",
106
+ WIX_SITE_MEMBERS = "WIX_SITE_MEMBERS",
107
+ WIX_STORES = "WIX_STORES",
108
+ WIX_CODE = "WIX_CODE"
109
+ }
110
+ export interface ContactActivity {
111
+ /** Date and time of the last action. */
112
+ activityDate?: Date;
113
+ /**
114
+ * Contact's last action in the site.
115
+ *
116
+ * Some possible values:
117
+ * `"GENERAL"`, `"CONTACT_CREATED"`, `"MEMBER_LOGIN"`, `"MEMBER_REGISTER"`,
118
+ * `"MEMBER_STATUS_CHANGED"`, `"FORM_SUBMITTED"`, `"INBOX_FORM_SUBMITTED"`,
119
+ * `"INBOX_PAYMENT_REQUEST_PAID"`, `"INBOX_MESSAGE_TO_CUSTOMER"`,
120
+ * `"INBOX_MESSAGE_FROM_CUSTOMER"`, `"NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED"`,
121
+ * `"NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE"`, `"ECOM_PURCHASE"`,
122
+ * `"ECOM_CART_ABANDON"`, `"ECOM_CHECKOUT_BUYER"`, `"BOOKINGS_APPOINTMENT"`,
123
+ * `"HOTELS_RESERVATION"`, `"HOTELS_PURCHASE"`, `"HOTELS_CONFIRMATION"`,
124
+ * `"HOTELS_CANCEL"`, `"VIDEO_PURCHASE"`, `"VIDEO_RENT"`,
125
+ * `"CASHIER_BUTTON_PURCHASE"`, `"ARENA_NEW_LEAD"`, `"EVENTS_RSVP"`,
126
+ * `"INVOICE_PAY"`, `"INVOICE_OVERDUE"`, `"PRICE_QUOTE_ACCEPT"`,
127
+ * `"PRICE_QUOTE_EXPIRE"`, `"RESTAURANTS_ORDER"`, `"RESTAURANTS_RESERVATION"`,
128
+ * `"SHOUTOUT_OPEN"`, `"SHOUTOUT_CLICK"`, `"CONTACT_MERGED"`.
129
+ */
130
+ activityType?: ContactActivityType;
131
+ }
132
+ export declare enum ContactActivityType {
133
+ /** Last visit to your site (any unknown activity) */
134
+ GENERAL = "GENERAL",
135
+ /** This cannot be reported, used when contact created, will throw exception */
136
+ CONTACT_CREATED = "CONTACT_CREATED",
137
+ /** "auth/login" */
138
+ MEMBER_LOGIN = "MEMBER_LOGIN",
139
+ /** "auth/register" */
140
+ MEMBER_REGISTER = "MEMBER_REGISTER",
141
+ /** "auth/status-change" */
142
+ MEMBER_STATUS_CHANGED = "MEMBER_STATUS_CHANGED",
143
+ /** "contact/contact-form", (but also "form/contact-form", "form/form") */
144
+ FORM_SUBMITTED = "FORM_SUBMITTED",
145
+ /** "form/lead-capture-form" */
146
+ INBOX_FORM_SUBMITTED = "INBOX_FORM_SUBMITTED",
147
+ /** "chat/payment-request-paid" */
148
+ INBOX_PAYMENT_REQUEST_PAID = "INBOX_PAYMENT_REQUEST_PAID",
149
+ /** "messaging/email" - Direction BUSINESS_TO_CUSTOMER */
150
+ INBOX_MESSAGE_TO_CUSTOMER = "INBOX_MESSAGE_TO_CUSTOMER",
151
+ /** "messaging/email" - Direction CUSTOMER_TO_BUSINESS */
152
+ INBOX_MESSAGE_FROM_CUSTOMER = "INBOX_MESSAGE_FROM_CUSTOMER",
153
+ /** "contact/subscription-form" (but also "form/subscription-form") */
154
+ NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED = "NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED",
155
+ /** "contact/unsubscribe" */
156
+ NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE = "NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE",
157
+ /** "e_commerce/purchase" */
158
+ ECOM_PURCHASE = "ECOM_PURCHASE",
159
+ /** "e_commerce/cart-abandon" */
160
+ ECOM_CART_ABANDON = "ECOM_CART_ABANDON",
161
+ /** "e_commerce/checkout-buyer" */
162
+ ECOM_CHECKOUT_BUYER = "ECOM_CHECKOUT_BUYER",
163
+ /** "scheduler/appointment" */
164
+ BOOKINGS_APPOINTMENT = "BOOKINGS_APPOINTMENT",
165
+ /** "hotels/reservation" */
166
+ HOTELS_RESERVATION = "HOTELS_RESERVATION",
167
+ /** "hotels/purchase" */
168
+ HOTELS_PURCHASE = "HOTELS_PURCHASE",
169
+ /** "hotels/confirmation" */
170
+ HOTELS_CONFIRMATION = "HOTELS_CONFIRMATION",
171
+ /** "hotels/cancel" */
172
+ HOTELS_CANCEL = "HOTELS_CANCEL",
173
+ /** "video/purchase" */
174
+ VIDEO_PURCHASE = "VIDEO_PURCHASE",
175
+ /** "video/rent" */
176
+ VIDEO_RENT = "VIDEO_RENT",
177
+ /** "cashier/button_purchase" */
178
+ CASHIER_BUTTON_PURCHASE = "CASHIER_BUTTON_PURCHASE",
179
+ /** "arena/new-lead" */
180
+ ARENA_NEW_LEAD = "ARENA_NEW_LEAD",
181
+ /** "events/rsvp" */
182
+ EVENTS_RSVP = "EVENTS_RSVP",
183
+ /** "invoice/pay" */
184
+ INVOICE_PAY = "INVOICE_PAY",
185
+ /** "invoice/overdue" */
186
+ INVOICE_OVERDUE = "INVOICE_OVERDUE",
187
+ /** "price-quote/accept" */
188
+ PRICE_QUOTE_ACCEPT = "PRICE_QUOTE_ACCEPT",
189
+ /** "price-quote/expire" */
190
+ PRICE_QUOTE_EXPIRE = "PRICE_QUOTE_EXPIRE",
191
+ /** "restaurants/order" */
192
+ RESTAURANTS_ORDER = "RESTAURANTS_ORDER",
193
+ /** "restaurants/reservation" */
194
+ RESTAURANTS_RESERVATION = "RESTAURANTS_RESERVATION",
195
+ /** "shoutout/open" */
196
+ SHOUTOUT_OPEN = "SHOUTOUT_OPEN",
197
+ /** "shoutout/click" */
198
+ SHOUTOUT_CLICK = "SHOUTOUT_CLICK",
199
+ CONTACT_MERGED = "CONTACT_MERGED"
200
+ }
201
+ export interface PrimaryContactInfo {
202
+ /**
203
+ * Primary email address.
204
+ *
205
+ * This property reflects the email address in `info.emails`
206
+ * where `primary` is `true`.
207
+ * @readonly
208
+ */
209
+ email?: string | null;
210
+ /**
211
+ * Primary phone number.
212
+ *
213
+ * This property reflects the phone number in `contactInfo.phones` where `primary` is `true`.
214
+ * @readonly
215
+ */
216
+ phone?: string | null;
217
+ }
218
+ export interface ContactInfo {
219
+ /** Contact's first and last name. */
220
+ name?: ContactName;
221
+ /** Contact's email addresses. */
222
+ emails?: ContactEmailsWrapper;
223
+ /** Contact's phone numbers. */
224
+ phones?: ContactPhonesWrapper;
225
+ /** Contact's street addresses. */
226
+ addresses?: ContactAddressesWrapper;
227
+ /** Contact's company name. */
228
+ company?: string | null;
229
+ /**
230
+ * Contact's job title.
231
+ * Corresponds to the **Position** field in the Dashboard.
232
+ */
233
+ jobTitle?: string | null;
234
+ /** Birth date in `YYYY-MM-DD` format. For example, `2020-03-15`. */
235
+ birthdate?: string | null;
236
+ /**
237
+ * Locale in
238
+ * [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
239
+ * Typically, this is a lowercase 2-letter language code,
240
+ * followed by a hyphen, followed by an uppercase 2-letter country code.
241
+ * For example, `en-US` for U.S. English, and `de-DE` for Germany German.
242
+ */
243
+ locale?: string | null;
244
+ /**
245
+ * List of contact label keys.
246
+ * [Contact labels](https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list)
247
+ * help categorize contacts.
248
+ *
249
+ *
250
+ * Label keys must exist to be added to the contact.
251
+ * Contact labels can be created or retrieved with
252
+ * [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel)
253
+ * or
254
+ * [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
255
+ *
256
+ */
257
+ labelKeys?: LabelsWrapper;
258
+ /**
259
+ * Additional custom fields.
260
+ * This includes fields managed by Wix, by 3rd-party apps, and by the site.
261
+ *
262
+ * Empty fields are not returned.
263
+ */
264
+ extendedFields?: ExtendedFieldsWrapper;
265
+ /** Contact's profile picture. */
266
+ picture?: ContactPicture;
267
+ }
268
+ export interface ContactName {
269
+ /** Contact's first name. */
270
+ first?: string | null;
271
+ /** Contact's last name. */
272
+ last?: string | null;
273
+ }
274
+ export interface ContactEmailsWrapper {
275
+ /** List of up to 50 email addresses. */
276
+ items?: ContactEmail[];
277
+ }
278
+ export interface ContactEmail {
279
+ /**
280
+ * Email ID.
281
+ * @readonly
282
+ */
283
+ _id?: string | null;
284
+ /**
285
+ * Email type.
286
+ *
287
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
288
+ *
289
+ * One of:
290
+ *
291
+ * - `"UNTAGGED"`
292
+ * - `"MAIN"`
293
+ * - `"HOME"`
294
+ * - `"WORK"`
295
+ */
296
+ tag?: EmailTag;
297
+ /** Email address. */
298
+ email?: string;
299
+ /**
300
+ * Indicates whether this is the contact's primary email address.
301
+ * When changing `primary` to `true` for an email,
302
+ * the contact's other emails become `false`.
303
+ */
304
+ primary?: boolean | null;
305
+ }
306
+ export declare enum EmailTag {
307
+ UNTAGGED = "UNTAGGED",
308
+ MAIN = "MAIN",
309
+ HOME = "HOME",
310
+ WORK = "WORK"
311
+ }
312
+ export interface ContactPhonesWrapper {
313
+ /** List of up to 50 phone numbers. */
314
+ items?: ContactPhone[];
315
+ }
316
+ export interface ContactPhone {
317
+ /**
318
+ * Phone ID.
319
+ * @readonly
320
+ */
321
+ _id?: string | null;
322
+ /**
323
+ * Phone type.
324
+ *
325
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
326
+ *
327
+ * One of:
328
+ *
329
+ * - `"UNTAGGED"`
330
+ * - `"MAIN"`
331
+ * - `"HOME"`
332
+ * - `"MOBILE"`
333
+ * - `"WORK"`
334
+ * - `"FAX"`
335
+ */
336
+ tag?: PhoneTag;
337
+ /** [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. */
338
+ countryCode?: string | null;
339
+ /** Phone number. */
340
+ phone?: string;
341
+ /**
342
+ * [ITU E.164-formatted](https://www.itu.int/rec/T-REC-E.164/)
343
+ * phone number.
344
+ * Automatically generated using `phone` and `countryCode`,
345
+ * as long as both of those values are valid.
346
+ * @readonly
347
+ */
348
+ e164Phone?: string | null;
349
+ /**
350
+ * Whether this is the contact's primary phone number.
351
+ * When changing `primary` to `true` for a phone,
352
+ * the contact's other phones become `false`.
353
+ */
354
+ primary?: boolean | null;
355
+ }
356
+ export declare enum PhoneTag {
357
+ UNTAGGED = "UNTAGGED",
358
+ MAIN = "MAIN",
359
+ HOME = "HOME",
360
+ MOBILE = "MOBILE",
361
+ WORK = "WORK",
362
+ FAX = "FAX"
363
+ }
364
+ export interface ContactAddressesWrapper {
365
+ /** List of up to 50 addresses. */
366
+ items?: ContactAddress[];
367
+ }
368
+ export interface ContactAddress {
369
+ /**
370
+ * Street address ID.
371
+ * @readonly
372
+ */
373
+ _id?: string | null;
374
+ /**
375
+ * Address type.
376
+ *
377
+ * `"UNTAGGED"` is shown as "Other" in the Contact List.
378
+ *
379
+ * One of:
380
+ *
381
+ * - `"UNTAGGED"`
382
+ * - `"HOME"`
383
+ * - `"WORK"`
384
+ * - `"BILLING"`
385
+ * - `"SHIPPING"`
386
+ */
387
+ tag?: AddressTag;
388
+ /** Street address. */
389
+ address?: Address;
390
+ }
391
+ export declare enum AddressTag {
392
+ UNTAGGED = "UNTAGGED",
393
+ HOME = "HOME",
394
+ WORK = "WORK",
395
+ BILLING = "BILLING",
396
+ SHIPPING = "SHIPPING"
397
+ }
398
+ /** Physical address */
399
+ export interface Address extends AddressStreetOneOf {
400
+ /** Street address object, with number and name in separate fields. */
401
+ streetAddress?: StreetAddress;
402
+ /** Main address line, usually street and number, as free text. */
403
+ addressLine1?: string | null;
404
+ /**
405
+ * 2-letter country code in an
406
+ * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.
407
+ */
408
+ country?: string | null;
409
+ /**
410
+ * Code for a subdivision (such as state, prefecture, or province) in an
411
+ * [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.
412
+ */
413
+ subdivision?: string | null;
414
+ /** City name. */
415
+ city?: string | null;
416
+ /** Postal or zip code. */
417
+ postalCode?: string | null;
418
+ /**
419
+ * Free text providing more detailed address information,
420
+ * such as apartment, suite, or floor.
421
+ */
422
+ addressLine2?: string | null;
423
+ }
424
+ /** @oneof */
425
+ export interface AddressStreetOneOf {
426
+ /** Street address object, with number and name in separate fields. */
427
+ streetAddress?: StreetAddress;
428
+ /** Main address line, usually street and number, as free text. */
429
+ addressLine?: string | null;
430
+ }
431
+ export interface StreetAddress {
432
+ /** Street number. */
433
+ number?: string;
434
+ /** Street name. */
435
+ name?: string;
436
+ }
437
+ export interface AddressLocation {
438
+ /** Address's latitude. */
439
+ latitude?: number | null;
440
+ /** Address's longitude. */
441
+ longitude?: number | null;
442
+ }
443
+ export interface Subdivision {
444
+ /** subdivision short code */
445
+ code?: string;
446
+ /** Full subdivision name. */
447
+ name?: string;
448
+ }
449
+ export declare enum SubdivisionType {
450
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
451
+ /** state */
452
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
453
+ /** county */
454
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
455
+ /** cities/towns */
456
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
457
+ /** neighborhood/quarter */
458
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
459
+ /** street/block */
460
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
461
+ /** (ADMINISTRATIVE_AREA_LEVEL_0) indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
462
+ COUNTRY = "COUNTRY"
463
+ }
464
+ export interface AssigneesWrapper {
465
+ /** List of site contributor user IDs. */
466
+ items?: string[];
467
+ }
468
+ export interface LabelsWrapper {
469
+ /**
470
+ * List of contact label keys.
471
+ * [Contact labels](https://support.wix.com/en/article/adding-labels-to-contacts-in-your-contact-list)
472
+ * help categorize contacts.
473
+ *
474
+ * Label keys must exist to be added to the contact.
475
+ * Contact labels can be created or retrieved with
476
+ * [Find or Create Label](https://dev.wix.com/api/rest/contacts/labels/find-or-create-label)
477
+ * or
478
+ * [List Labels](https://dev.wix.com/api/rest/contacts/labels/list-labels)
479
+ */
480
+ items?: string[];
481
+ }
482
+ export interface ExtendedFieldsWrapper {
483
+ /**
484
+ * Set of key-value pairs.
485
+ *
486
+ * Contact's
487
+ * [extended fields](wix-crm-backend/contacts/introduction#about-extended-fields),
488
+ * which allow you to store additional information about your contacts.
489
+ *
490
+ * To view or create extended fields, use
491
+ * [`findOrCreateExtendedField()`](wix-crm-backend/contacts/findorcreateextendedfield),
492
+ * [`getExtendedField()`](wix-crm-backend/contacts/getextendedfield), or
493
+ * [`queryExtendedFields()`](wix-crm-backend/contacts/queryextendedfields).
494
+ */
495
+ items?: Record<string, any>;
496
+ }
497
+ export interface LocationsWrapper {
498
+ /** List of location ids. */
499
+ items?: string[];
500
+ }
501
+ /** TEST contact picture description */
502
+ export interface ContactPicture {
503
+ /**
504
+ * Image.
505
+ * This can contain an image URL or a Wix Media image ID.
506
+ */
507
+ image?: string;
508
+ }
509
+ export declare enum ImageProvider {
510
+ UNKNOWN = "UNKNOWN",
511
+ /** Image stored outside Wix */
512
+ EXTERNAL = "EXTERNAL",
513
+ /** Stored in wix media platform, Must be uploaded by using `GeneratePictureUploadUrl` */
514
+ WIX_MEDIA = "WIX_MEDIA"
515
+ }
516
+ export interface SegmentsWrapper {
517
+ /** List of Contact segment IDs */
518
+ items?: string[];
519
+ }
520
+ export interface EstimateFilterSizeRequest {
521
+ /** Contacts filter expression. */
522
+ filter?: Record<string, any> | null;
523
+ /** Should "inactive" contacts be excluded or not (default value "false"). */
524
+ activeContactsOnly?: boolean;
525
+ /** Contacts plain text search expression (searches in name, phone and email fields). */
526
+ search?: string | null;
527
+ }
528
+ export interface EstimateFilterSizeResponse {
529
+ /** Mailing list size estimation. */
530
+ estimation?: number;
531
+ }
532
+ export interface EstimateAudienceSizeRequest {
533
+ /** Contact IDs of a campaign audience. */
534
+ contactIds?: string[];
535
+ /** Label IDs of a campaign audience. */
536
+ labelIds?: string[];
537
+ /** Contacts filter expression (json). */
538
+ contactsFilter?: Record<string, any> | null;
539
+ /** Contacts plain text search expression (searches in name, phone and email fields). */
540
+ search?: string | null;
541
+ /** Segment ids of a campaign audience. */
542
+ segmentIds?: string[];
543
+ /** Should "inactive" contacts be excluded or not (default value "false"). */
544
+ activeContactsOnly?: boolean;
545
+ /** Id of a campaign that is to be resent. */
546
+ resendCampaignId?: string | null;
547
+ }
548
+ export interface EstimateAudienceSizeResponse {
549
+ /** Audience size estimation. */
550
+ estimation?: number;
551
+ }
552
+ export interface ContactSubmitted {
553
+ /** Pass through data, submitted with the contact */
554
+ passThroughData?: string | null;
555
+ /** Submitted activity */
556
+ activity?: ContactActivity;
557
+ /** Submitted Contact (after processing) */
558
+ contact?: Contact;
559
+ }
560
+ export interface ContactChanged {
561
+ /** The Contact before the changes */
562
+ previousContact?: Contact;
563
+ /** The Contact after the changes */
564
+ currentContact?: Contact;
565
+ }
566
+ /** Contact creation options. */
567
+ export interface CreateContactRequest {
568
+ /** Contact info. */
569
+ info: ContactInfo;
570
+ /**
571
+ * Controls whether the call will succeed
572
+ * if the new contact information contains an email or a phone number already used by another contact.
573
+ *
574
+ * If set to `true`,
575
+ * the call will succeed even if an email address or phone number is used by another contact.
576
+ * If set to `false`,
577
+ * the call will fail if the given email address is used by another contact or,
578
+ * if the email address is not given and the given phone number is used by another contact.
579
+ *
580
+ * Defaults to `false`.
581
+ */
582
+ allowDuplicates?: boolean;
583
+ }
584
+ /** Contact. */
585
+ export interface CreateContactResponse {
586
+ /** Contact. */
587
+ contact?: Contact;
588
+ }
589
+ export interface DuplicateContactExists {
590
+ duplicateContactId?: string | null;
591
+ duplicateEmail?: string | null;
592
+ duplicatePhone?: string | null;
593
+ }
594
+ export interface UpdateContactRequest {
595
+ /** ID of the contact to update. */
596
+ contactId: string;
597
+ /**
598
+ * Revision number.
599
+ * When updating, include the existing `revision`
600
+ * to prevent conflicting updates.
601
+ */
602
+ revision: number | null;
603
+ /**
604
+ * Controls whether the call will succeed
605
+ * if the new contact information contains an email or a phone number already used by another contact.
606
+ *
607
+ * If set to `true`,
608
+ * the call will succeed even if an email address or phone number is used by another contact.
609
+ * If set to `false`,
610
+ * the call will fail if the given email address is used by another contact or,
611
+ * if the email address is not given and the given phone number is used by another contact.
612
+ *
613
+ * Defaults to `false`.
614
+ */
615
+ allowDuplicates?: boolean;
616
+ /** Contact info. */
617
+ info: ContactInfo;
618
+ }
619
+ /** Updated contact. */
620
+ export interface UpdateContactResponse {
621
+ /** Updated contact. */
622
+ contact?: Contact;
623
+ }
624
+ export interface MergeContactsRequest {
625
+ /** Target contact ID. */
626
+ targetContactId: string;
627
+ /**
628
+ * Target contact revision number, which increments by 1 each time the contact is updated.
629
+ * To prevent conflicting changes,
630
+ * the target contact's current revision must be passed.
631
+ */
632
+ targetContactRevision: number | null;
633
+ /**
634
+ * IDs of up to 5 contacts to merge into the target contact.
635
+ * If merging more than one source contact,
636
+ * the first source is given precedence, then the second, and so on.
637
+ */
638
+ sourceContactIds?: string[];
639
+ }
640
+ export interface MergeContactsResponse {
641
+ /** Updated target contact. */
642
+ contact?: Contact;
643
+ }
644
+ export interface ContactMerged {
645
+ /** ID of the contact the source contacts were merged into. */
646
+ targetContactId?: string;
647
+ /** IDs of contacts that were merged into the target contact. */
648
+ sourceContactIds?: string[];
649
+ /** Updated target contact. */
650
+ targetContact?: Contact;
651
+ }
652
+ export interface PreviewMergeContactsRequest {
653
+ /** Target contact ID. */
654
+ targetContactId?: string;
655
+ /**
656
+ * IDs of up to 5 contacts to merge into the target contact.
657
+ * If merging more than one source contact,
658
+ * the first source is given precedence, then the second, and so on.
659
+ */
660
+ sourceContactIds?: string[];
661
+ }
662
+ export interface PreviewMergeContactsResponse {
663
+ /** Preview of the updated target contact. */
664
+ contact?: Contact;
665
+ }
666
+ export interface DeleteContactRequest {
667
+ /** ID of the contact to delete. */
668
+ contactId: string;
669
+ }
670
+ export interface DeleteContactResponse {
671
+ }
672
+ export interface LabelContactRequest {
673
+ /** ID of the contact to add labels to. */
674
+ contactId: string;
675
+ /**
676
+ * List of label keys to add to the contact.
677
+ *
678
+ * Label keys must exist to be added to the contact.
679
+ * Contact labels can be created or retrieved with
680
+ * [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel)
681
+ * or
682
+ * [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
683
+ */
684
+ labelKeys: string[];
685
+ }
686
+ /** Updated contact. */
687
+ export interface LabelContactResponse {
688
+ /** Updated contact. */
689
+ contact?: Contact;
690
+ }
691
+ export interface UnlabelContactRequest {
692
+ /** ID of the contact to remove labels from. */
693
+ contactId: string;
694
+ /** List of label keys to remove from the contact. */
695
+ labelKeys: string[];
696
+ }
697
+ /** Updated contact. */
698
+ export interface UnlabelContactResponse {
699
+ /** Updated contact. */
700
+ contact?: Contact;
701
+ }
702
+ export interface LabelAndUnlabelContactRequest {
703
+ /** Contact ID. */
704
+ contactId?: string;
705
+ /**
706
+ * List of label keys to add to the contact.
707
+ *
708
+ * Label keys must exist to be added to the contact.
709
+ * Contact labels can be created or retrieved with
710
+ * [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel)
711
+ * or
712
+ * [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
713
+ */
714
+ labelKeysToAdd?: string[];
715
+ /** List of label keys to remove from the contact. */
716
+ labelKeysToRemove?: string[];
717
+ }
718
+ export interface LabelAndUnlabelContactResponse {
719
+ /** Updated contact. */
720
+ contact?: Contact;
721
+ }
722
+ export interface ListContactsRequest {
723
+ /** Sort order. */
724
+ sort?: Sorting;
725
+ /** Pagination, defaults to offset = 0 and limit = 50 (max limit 1,000). */
726
+ paging?: Paging;
727
+ /**
728
+ * List of projected fields to return.
729
+ * If both `fields` and `fieldsets` are sent in the request,
730
+ * the union of both lists is returned.
731
+ * `id` and `revision` are always returned.
732
+ *
733
+ * Supported properties:
734
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
735
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
736
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
737
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
738
+ */
739
+ fields?: string[];
740
+ fieldsets?: ContactFieldSet[];
741
+ }
742
+ export interface Sorting {
743
+ /**
744
+ * Field to sort by.
745
+ *
746
+ * Supported properties:
747
+ * `createdDate`, `lastActivity.activityDate`, `primaryInfo.email`,
748
+ * `info.name.first`, `info.name.last`, `info.company`, `info.jobTitle`,
749
+ * `info.birthdate`
750
+ */
751
+ fieldName?: string;
752
+ /**
753
+ * Sort order.
754
+ * Use `ASC` for ascending order or `DESC` for descending order.
755
+ *
756
+ * Defaults to `ASC`.
757
+ */
758
+ order?: SortOrder;
759
+ }
760
+ export declare enum SortOrder {
761
+ ASC = "ASC",
762
+ DESC = "DESC"
763
+ }
764
+ export interface Paging {
765
+ /** Number of items to return. */
766
+ limit?: number | null;
767
+ /** Number of items to skip in the current sort order. */
768
+ offset?: number | null;
769
+ }
770
+ export declare enum ContactFieldSet {
771
+ /** name, primaryEmail, primaryPhone */
772
+ BASIC = "BASIC",
773
+ /** name, phones, emails, addressses */
774
+ COMMUNICATION_DETAILS = "COMMUNICATION_DETAILS",
775
+ /** name, primaryInfo(email, phone), extendedFields */
776
+ EXTENDED = "EXTENDED",
777
+ /** Full contact object */
778
+ FULL = "FULL"
779
+ }
780
+ /** List of contacts. */
781
+ export interface ListContactsResponse {
782
+ /** List of contacts. */
783
+ contacts?: Contact[];
784
+ /** Details on the paged set of results returned. */
785
+ pagingMetadata?: PagingMetadata;
786
+ }
787
+ export interface PagingMetadata {
788
+ /** The number of items returned in this response */
789
+ count?: number | null;
790
+ /** The offset which was requested */
791
+ offset?: number | null;
792
+ /** The total number of items that match the query */
793
+ total?: number | null;
794
+ /** A flag that indicates the server failed to calculate 'total' field */
795
+ tooManyToCount?: boolean | null;
796
+ }
797
+ export interface QueryContactsRequest {
798
+ /**
799
+ * Plain text search for an exact match.
800
+ *
801
+ * Supported properties:
802
+ * `info.name.first`, `info.name.last`, `info.emails.email`, `info.phones.phone`
803
+ *
804
+ * Max: 100 characters
805
+ */
806
+ search?: string | null;
807
+ /** Query options. */
808
+ query?: Query;
809
+ }
810
+ export interface Query {
811
+ /**
812
+ * Filter object.
813
+ * See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
814
+ * for more information.
815
+ *
816
+ * For a detailed list of supported filters, see
817
+ * [Supported Filters](https://dev.wix.com/api/rest/contacts/contacts/supported-filters).
818
+ */
819
+ filter?: Record<string, any> | null;
820
+ /**
821
+ * Sorting options.
822
+ * See [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination)
823
+ * for more information.
824
+ *
825
+ * Max: 1 sort object
826
+ */
827
+ sort?: Sorting[];
828
+ /** Pagination options. */
829
+ paging?: Paging;
830
+ /**
831
+ * List of projected fields to return.
832
+ * If both `fields` and `fieldsets` are sent in the request,
833
+ * the union of both lists is returned.
834
+ * `id` and `revision` are always returned.
835
+ *
836
+ * Supported properties:
837
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
838
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
839
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
840
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
841
+ */
842
+ fields?: string[];
843
+ /**
844
+ * Predefined sets of fields to return.
845
+ * If both `fields` and `fieldsets` are sent in the request,
846
+ * the union of both lists is returned.
847
+ *
848
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
849
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
850
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
851
+ * - `FULL`: Returns all fields.
852
+ *
853
+ * Default: If `fields` is omitted from the request, `FULL`.
854
+ */
855
+ fieldsets?: ContactFieldSet[];
856
+ }
857
+ /** List of contacts. */
858
+ export interface QueryContactsResponse {
859
+ /** List of contacts. */
860
+ contacts?: Contact[];
861
+ /** Details on the paged set of results returned. */
862
+ pagingMetadata?: PagingMetadata;
863
+ }
864
+ export interface ListFacetsRequest {
865
+ /** Allow paginating, default: offset = 0 and limit = 1000 */
866
+ paging?: Paging;
867
+ /** Language for localization */
868
+ language?: string | null;
869
+ }
870
+ export interface ListFacetsResponse {
871
+ /** List of facets. */
872
+ facets?: ContactsFacet[];
873
+ /** Details on the paged set of results returned. */
874
+ pagingMetadata?: PagingMetadata;
875
+ }
876
+ export interface ContactsFacet {
877
+ /** Type of facet. */
878
+ facetType?: ContactsFacetType;
879
+ /**
880
+ * Scope for facet keys.
881
+ * When a facet key exists in a namespace,
882
+ * each key is unique within that namespace.
883
+ *
884
+ * Currently, facets not created by Wix are in the `custom` namespace.
885
+ */
886
+ namespace?: string | null;
887
+ /** Human-readable display name. */
888
+ namespaceDisplayName?: string | null;
889
+ /** Facet key, automatically generated. */
890
+ facetKey?: string | null;
891
+ /** Human-readable name. Shown in the Wix UI. */
892
+ facetDisplayName?: string | null;
893
+ /** Number of contacts the facet is applied to. */
894
+ count?: number | null;
895
+ /** Filter used for query contacts of this facet */
896
+ queryFilter?: Record<string, any> | null;
897
+ }
898
+ export declare enum ContactsFacetType {
899
+ UNKNOWN = "UNKNOWN",
900
+ ALL_CONTACTS = "ALL_CONTACTS",
901
+ NOT_LABELED = "NOT_LABELED",
902
+ LABEL = "LABEL",
903
+ SUBSCRIPTION_STATUS = "SUBSCRIPTION_STATUS",
904
+ MEMBERSHIP_STATUS = "MEMBERSHIP_STATUS"
905
+ }
906
+ export interface QueryFacetsRequest {
907
+ /** Allow paginating, default: offset = 0 and limit = 1000 */
908
+ paging?: Paging;
909
+ /** Language for localization */
910
+ language?: string | null;
911
+ /**
912
+ * Only allowed fields:
913
+ * #info.extendedFields.emailSubscriptions.effectiveEmail ($exists)
914
+ * #info.extendedFields.emailSubscriptions.deliverabilityStatus ($eq, $ne, $in, $nin)
915
+ * #info.extendedFields.emailSubscriptions.subscriptionStatus ($eq, $ne, $in)
916
+ */
917
+ filter?: Record<string, any> | null;
918
+ }
919
+ export interface QueryFacetsResponse {
920
+ /** List of facets. */
921
+ facets?: ContactsFacet[];
922
+ /** Details on the paged set of results returned. */
923
+ pagingMetadata?: PagingMetadata;
924
+ }
925
+ export interface BulkDeleteContactsRequest {
926
+ /**
927
+ * Filter object.
928
+ *
929
+ * Possible filters:
930
+ * `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
931
+ *
932
+ * For a detailed list of supported filters, see
933
+ * filtering and sorting for
934
+ * [contact properties](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#contact-properties-filtering-sorting-and-searching),
935
+ * [extended fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#extended-fields-filtering-sorting-and-searching),
936
+ * and [custom fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#custom-fields-filtering-sorting-and-searching).
937
+ *
938
+ * Example:
939
+ * `{ "filter": { "info.name.last": "Smith" } }`
940
+ */
941
+ filter?: Record<string, any> | null;
942
+ /**
943
+ * Plain text search for an exact match, up to 100 characters.
944
+ *
945
+ * Searchable fields:
946
+ *
947
+ * - `info.name.first`
948
+ * - `info.name.last`
949
+ * - `info.emails.email`
950
+ * - `info.phones.phone`
951
+ */
952
+ search?: string | null;
953
+ }
954
+ export interface BulkDeleteContactsResponse {
955
+ /**
956
+ * Bulk job ID.
957
+ * The job's status can be retrieved with
958
+ * [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
959
+ * [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
960
+ */
961
+ jobId?: string;
962
+ }
963
+ export interface BulkUpdateContactsRequest {
964
+ /**
965
+ * Filter object.
966
+ *
967
+ * Possible filters:
968
+ * `$eq`, `$exists`, `$gt`, `$gte`, `$hasAll`, `$hasSome`, `$in`, `$lt`, `$lte`, `$ne`, `$startsWith`.
969
+ *
970
+ * For a detailed list of supported filters, see
971
+ * filtering and sorting for
972
+ * [contact properties](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#contact-properties-filtering-sorting-and-searching),
973
+ * [extended fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#extended-fields-filtering-sorting-and-searching),
974
+ * and [custom fields](https://dev.wix.com/api/rest/contacts/contacts/sorting,-filtering,-and-searching#custom-fields-filtering-sorting-and-searching).
975
+ *
976
+ * Example:
977
+ * `{ "filter": { "info.name.last": "Smith" } }`
978
+ */
979
+ filter?: Record<string, any> | null;
980
+ /**
981
+ * Plain text search for an exact match, up to 100 characters.
982
+ *
983
+ * Searchable fields:
984
+ *
985
+ * - `info.name.first`
986
+ * - `info.name.last`
987
+ * - `info.emails.email`
988
+ * - `info.phones.phone`
989
+ */
990
+ search?: string | null;
991
+ /** Contact info. */
992
+ info?: ContactInfo;
993
+ }
994
+ export interface BulkUpdateContactsResponse {
995
+ /**
996
+ * Bulk job ID.
997
+ * The job's status can be retrieved with
998
+ * [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
999
+ * [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
1000
+ */
1001
+ jobId?: string;
1002
+ }
1003
+ export interface BulkLabelAndUnlabelContactsRequest {
1004
+ /**
1005
+ * Filter options.
1006
+ * Labels will be removed from contacts that meet the `filter` and `search` criteria.
1007
+ *
1008
+ * See
1009
+ * [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter#contacts_contacts_sort-and-filter_field-support-for-filtering-sorting-and-searching)
1010
+ * for a list of supported filters and fields.
1011
+ */
1012
+ filter?: Record<string, any> | null;
1013
+ /**
1014
+ * Plain text search for an exact match, up to 100 characters.
1015
+ * Labels will be removed from contacts that meet the `filter` and `search` criteria.
1016
+ *
1017
+ * See
1018
+ * [Field Support for Filtering, Sorting, and Searching](https://dev.wix.com/api/rest/contacts/contacts/sort-and-filter#contacts_contacts_sort-and-filter_field-support-for-filtering-sorting-and-searching)
1019
+ * for a list of searchable fields.
1020
+ */
1021
+ search?: string | null;
1022
+ /**
1023
+ * List of label keys to add to the contacts.
1024
+ *
1025
+ * Label keys must exist to be added to the contact.
1026
+ * Contact labels can be created or retrieved with
1027
+ * [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel)
1028
+ * or
1029
+ * [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
1030
+ */
1031
+ labelKeysToAdd?: string[];
1032
+ /** List of label keys to remove from the contacts. */
1033
+ labelKeysToRemove?: string[];
1034
+ }
1035
+ export interface BulkLabelAndUnlabelContactsResponse {
1036
+ /**
1037
+ * Bulk job ID.
1038
+ * The job's status can be retrieved with
1039
+ * [Get Bulk Job](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/get-bulk-job) or
1040
+ * [List Bulk Jobs](https://dev.wix.com/api/rest/contacts/contacts/bulk-jobs/list-bulk-jobs).
1041
+ */
1042
+ jobId?: string;
1043
+ }
1044
+ export interface BulkUpsertContactsRequest {
1045
+ info?: ContactInfo[];
1046
+ returnFullEntity?: boolean;
1047
+ }
1048
+ export interface BulkUpsertContactsResponse {
1049
+ results?: Item[];
1050
+ metadata?: BulkUpsertContactsResponseMetadata;
1051
+ }
1052
+ export declare enum Action {
1053
+ UNKNOWN = "UNKNOWN",
1054
+ UPDATED = "UPDATED",
1055
+ CREATED = "CREATED"
1056
+ }
1057
+ export interface Error {
1058
+ /** Error code. */
1059
+ code?: string;
1060
+ /** Error details. */
1061
+ message?: string | null;
1062
+ }
1063
+ export interface Metadata {
1064
+ _id?: string | null;
1065
+ originalIndex?: number;
1066
+ action?: Action;
1067
+ success?: boolean;
1068
+ error?: Error;
1069
+ }
1070
+ export interface Item {
1071
+ contact?: Contact;
1072
+ metadata?: Metadata;
1073
+ }
1074
+ export interface BulkUpsertContactsResponseMetadata {
1075
+ totalSuccess?: number;
1076
+ totalFailure?: number;
1077
+ totalCreated?: number;
1078
+ totalUpdated?: number;
1079
+ }
1080
+ export interface UpsertContactRequest {
1081
+ info?: ContactInfo;
1082
+ }
1083
+ export interface UpsertContactResponse {
1084
+ /** Upserted contact. */
1085
+ contact?: Contact;
1086
+ action?: UpsertContactResponseAction;
1087
+ }
1088
+ export declare enum UpsertContactResponseAction {
1089
+ UNKNOWN = "UNKNOWN",
1090
+ UPDATED = "UPDATED",
1091
+ CREATED = "CREATED"
1092
+ }
1093
+ export interface GeneratePictureUploadUrlRequest {
1094
+ /** ID of the contact whose picture is being updated. */
1095
+ contactId?: string;
1096
+ /**
1097
+ * Mime Type. Must be one of:
1098
+ * `image/png`, `image/jpeg`.
1099
+ * Defaults to `image/png`.
1100
+ */
1101
+ mimeType?: string | null;
1102
+ }
1103
+ export interface GeneratePictureUploadUrlResponse {
1104
+ /** URL to upload the image */
1105
+ uploadUrl?: string;
1106
+ }
1107
+ export interface GetContactRequest {
1108
+ /** ID of the contact to retrieve. */
1109
+ _id: string;
1110
+ /**
1111
+ * List of projected fields to return.
1112
+ * If both `fields` and `fieldsets` are sent in the request,
1113
+ * the union of both lists is returned.
1114
+ * `id` and `revision` are always returned.
1115
+ *
1116
+ * Supported properties:
1117
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1118
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1119
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1120
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1121
+ */
1122
+ fields?: string[];
1123
+ /**
1124
+ * Predefined sets of fields to return.
1125
+ * If both `fields` and `fieldsets` are sent in the request,
1126
+ * the union of both lists is returned.
1127
+ *
1128
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
1129
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
1130
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
1131
+ * - `FULL`: Returns all fields.
1132
+ *
1133
+ * Default: If `fields` is omitted from the request, `FULL`.
1134
+ */
1135
+ fieldsets?: ContactFieldSet[];
1136
+ }
1137
+ /** The requested contact. */
1138
+ export interface GetContactResponse {
1139
+ /** The requested contact. */
1140
+ contact?: Contact;
1141
+ /**
1142
+ * Contact response type.
1143
+ *
1144
+ * - `REGULAR`: The specified contact was returned.
1145
+ * - `IMPLICIT`: Not used.
1146
+ * - `MERGED`: The specified contact was previously merged with another contact, and the new contact was
1147
+ */
1148
+ responseType?: GetContactResponseType;
1149
+ }
1150
+ export declare enum GetContactResponseType {
1151
+ /** Normal contact */
1152
+ REGULAR = "REGULAR",
1153
+ /** Contact that id was already allocated for it, but the contact not yet created. */
1154
+ IMPLICIT = "IMPLICIT",
1155
+ /** Contact was merged into another contact */
1156
+ MERGED = "MERGED"
1157
+ }
1158
+ export interface SyncSubmitContactRequest {
1159
+ contactInfo?: ContactInfo;
1160
+ activity?: ContactActivity;
1161
+ passThroughData?: string | null;
1162
+ contactId?: string;
1163
+ submitOperation?: SubmitOperation;
1164
+ /** Need to resolve source in allocator, because of server sign */
1165
+ sourceType?: ContactSourceType;
1166
+ sourceId?: string | null;
1167
+ hideFromContactList?: boolean;
1168
+ }
1169
+ export declare enum SubmitOperation {
1170
+ UNKNOWN = "UNKNOWN",
1171
+ CREATE = "CREATE",
1172
+ UPDATE = "UPDATE"
1173
+ }
1174
+ export interface SyncSubmitContactResponse {
1175
+ }
1176
+ export interface CountContactsRequest {
1177
+ }
1178
+ export interface CountContactsResponse {
1179
+ count?: number;
1180
+ }
1181
+ export interface SearchContactsRequest {
1182
+ /** Search object. Encapsulates filter, sorting, paging and other details */
1183
+ search?: Search;
1184
+ }
1185
+ export interface Search extends SearchPagingMethodOneOf {
1186
+ /** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
1187
+ cursorPaging?: CursorPaging;
1188
+ /** A filter object. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf) */
1189
+ filter?: Record<string, any> | null;
1190
+ /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
1191
+ sort?: Sorting[];
1192
+ /**
1193
+ * List of projected fields to return.
1194
+ *
1195
+ * If used in the request,
1196
+ * all the fields contained in `fields` and `fieldsets` are returned.
1197
+ * If left blank, `fieldsets` is used to determine which fields to return.
1198
+ *
1199
+ * For a list of valid projected fields, see
1200
+ * [Valid Contact Projection Fields](https://dev.wix.com/api/rest/contacts/contacts/fieldsets-and-projected-fields#contacts_contacts_fieldsets-and-projected-fields_valid-contact-projection-fields).
1201
+ */
1202
+ fields?: string[];
1203
+ /**
1204
+ * Predefined sets of fields to return.
1205
+ *
1206
+ * Defaults to `FULL`.
1207
+ * Ignored if left empty when `fields` is used in the request.
1208
+ *
1209
+ * For more information,
1210
+ * see [Contact Fieldsets](https://dev.wix.com/api/rest/contacts/contacts/fieldsets-and-projected-fields#contacts_contacts_fieldsets-and-projected-fields_contact-fieldsets).
1211
+ */
1212
+ fieldsets?: string[];
1213
+ /** free text to match in searchable fields */
1214
+ search?: SearchDetails;
1215
+ }
1216
+ /** @oneof */
1217
+ export interface SearchPagingMethodOneOf {
1218
+ /** Cursor pointing to page of results. 'cursorPaging.cursor' can not be used together with 'filter' or 'sort' */
1219
+ cursorPaging?: CursorPaging;
1220
+ }
1221
+ export interface SearchDetails {
1222
+ /** boolean search mode. Default is `OR` */
1223
+ mode?: Mode;
1224
+ /** search term or expression */
1225
+ expression?: string | null;
1226
+ /**
1227
+ * fields to search in. if empty - server will search in own default fieldsDefault searchable fields:
1228
+ *
1229
+ * - `info.name.first`
1230
+ * - `info.name.last`
1231
+ * - `info.emails.email`
1232
+ * - `info.phones.phone`
1233
+ */
1234
+ fields?: string[];
1235
+ /** flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm) */
1236
+ fuzzy?: boolean;
1237
+ }
1238
+ export declare enum Mode {
1239
+ /** any */
1240
+ OR = "OR",
1241
+ /** all */
1242
+ AND = "AND"
1243
+ }
1244
+ export interface CursorPaging {
1245
+ /** The number of contacts to load (default = 50, max = 1000) */
1246
+ limit?: number | null;
1247
+ /** Cursor returned in last query response. Should not be provided on first page request */
1248
+ cursor?: string | null;
1249
+ }
1250
+ export interface SearchContactsResponse {
1251
+ /** List of contacts. */
1252
+ contacts?: Contact[];
1253
+ /** Details on the paged set of results returned. */
1254
+ pagingMetadata?: PagingMetadataV2;
1255
+ }
1256
+ export interface PagingMetadataV2 {
1257
+ /** The number of items returned in this response */
1258
+ count?: number | null;
1259
+ /** The offset which was requested. Returned if offset paging was used */
1260
+ offset?: number | null;
1261
+ /** The total number of items that match the query. Returned if offset paging was used and 'too_many_to_count' flag is not set */
1262
+ total?: number | null;
1263
+ /** A flag that indicates the server failed to calculate 'total' field */
1264
+ tooManyToCount?: boolean | null;
1265
+ /** Cursors to navigate through result pages. Returned if cursor paging was used */
1266
+ cursors?: Cursors;
1267
+ }
1268
+ export interface Cursors {
1269
+ /** Cursor pointing to next result page */
1270
+ next?: string | null;
1271
+ /** Cursor pointing to previous result page */
1272
+ prev?: string | null;
1273
+ }
1274
+ export interface BulkAddSegmentToContactsRequest {
1275
+ /** Segment id */
1276
+ segmentId?: string;
1277
+ /** List of Contact ids */
1278
+ contactIds?: string[];
1279
+ /** List of existing segment ids */
1280
+ existsSegmentIds?: string[];
1281
+ }
1282
+ export interface BulkAddSegmentToContactsResponse {
1283
+ /** List of action results */
1284
+ results?: ItemMetadata[];
1285
+ /** Metadata on the bulk action */
1286
+ bulkActionMetadata?: BulkActionMetadata;
1287
+ }
1288
+ export interface ItemMetadata {
1289
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
1290
+ _id?: string | null;
1291
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
1292
+ originalIndex?: number;
1293
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
1294
+ success?: boolean;
1295
+ /** Details about the error in case of failure. */
1296
+ error?: ApplicationError;
1297
+ }
1298
+ export interface ApplicationError {
1299
+ /** Error code. */
1300
+ code?: string;
1301
+ /** Description of the error. */
1302
+ description?: string;
1303
+ /** Data related to the error. */
1304
+ data?: Record<string, any> | null;
1305
+ }
1306
+ export interface BulkActionMetadata {
1307
+ /** Number of items that were successfully processed. */
1308
+ totalSuccesses?: number;
1309
+ /** Number of items that couldn't be processed. */
1310
+ totalFailures?: number;
1311
+ /** Number of failures without details because detailed failure threshold was exceeded. */
1312
+ undetailedFailures?: number;
1313
+ }
1314
+ export interface ContactAddedToSegment {
1315
+ /** Id of the segment to which the contact was added */
1316
+ segmentId?: string;
1317
+ /** The contact that was added */
1318
+ contact?: Contact;
1319
+ }
1320
+ export interface BulkRemoveSegmentFromContactsRequest {
1321
+ /** Segment id */
1322
+ segmentId?: string;
1323
+ /** List of Contact ids */
1324
+ contactIds?: string[];
1325
+ }
1326
+ export interface BulkRemoveSegmentFromContactsResponse {
1327
+ /** List of action results */
1328
+ results?: ItemMetadata[];
1329
+ /** Metadata on the bulk action */
1330
+ bulkActionMetadata?: BulkActionMetadata;
1331
+ }
1332
+ export interface ContactRemovedFromSegment {
1333
+ /** Id of the segment from which the contact was removed */
1334
+ segmentId?: string;
1335
+ /** The contact that was removed */
1336
+ contact?: Contact;
1337
+ }
1338
+ /**
1339
+ * Creates a new contact.
1340
+ *
1341
+ *
1342
+ * The `createContact()` function returns a Promise
1343
+ * that resolves to the new contact when it is created.
1344
+ * > **Note:**
1345
+ * > This function replaces the deprecated
1346
+ * > `wixCrmBackend.createContact()`.
1347
+ * > The deprecated function will continue to work, but it will not receive updates.
1348
+ * > To keep any existing code compatible with future changes, see the
1349
+ * > [migration instructions](wix-crm-backend/createcontact#migration-instructions).
1350
+ *
1351
+ * The `contactInfo` parameter object must include a name, phone number, or email address.
1352
+ * If all 3 of these parameters are missing,
1353
+ * the contact won't be created.
1354
+ *
1355
+ * <!--
1356
+ * > **Note:**
1357
+ * > Only visitors with
1358
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1359
+ * > can create contacts.
1360
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1361
+ * -->
1362
+ * By default,
1363
+ * if the call contains an email already in use by another contact,
1364
+ * the new contact won't be created.
1365
+ * To override this behavior,
1366
+ * set `allowDuplicates` in the `options` object to `true`.
1367
+ *
1368
+ * This function is not a universal function and runs only on the backend.
1369
+ * @param info - Contact info.
1370
+ * @public
1371
+ * @documentationMaturity preview
1372
+ * @requiredField info
1373
+ * @param options - Create contact options.
1374
+ * @returns Contact.
1375
+ */
1376
+ export declare function createContact(info: ContactInfo, options?: CreateContactOptions): Promise<CreateContactResponse>;
1377
+ export interface CreateContactOptions {
1378
+ /**
1379
+ * Controls whether the call will succeed
1380
+ * if the new contact information contains an email or a phone number already used by another contact.
1381
+ *
1382
+ * If set to `true`,
1383
+ * the call will succeed even if an email address or phone number is used by another contact.
1384
+ * If set to `false`,
1385
+ * the call will fail if the given email address is used by another contact or,
1386
+ * if the email address is not given and the given phone number is used by another contact.
1387
+ *
1388
+ * Defaults to `false`.
1389
+ */
1390
+ allowDuplicates?: boolean;
1391
+ }
1392
+ /**
1393
+ * Updates a contact's properties.
1394
+ *
1395
+ * The `updateContact()` function returns a Promise that resolves
1396
+ * when the specified contact's information is updated.
1397
+ *
1398
+ * > **Note:**
1399
+ * > This function replaces the deprecated
1400
+ * > `wixCrmBackend.updateContact()`.
1401
+ * > The deprecated function will continue to work, but it will not receive updates.
1402
+ * > To keep any existing code compatible with future changes, see the
1403
+ * > [migration instructions](wix-crm-backend/updatecontact#migration-instructions).
1404
+ *
1405
+ * Each time the contact is updated,
1406
+ * `revision` increments by 1.
1407
+ * The existing `revision` must be included when updating the contact.
1408
+ * This ensures you're working with the latest contact information,
1409
+ * and it prevents unintended overwrites.
1410
+ *
1411
+ * <!--
1412
+ * > **Note:**
1413
+ * > Only visitors with
1414
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1415
+ * > can update contacts.
1416
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1417
+ * -->
1418
+ *
1419
+ * This function is not a universal function and runs only on the backend.
1420
+ * @param contactId - ID of the contact to update.
1421
+ * @param info - Contact info.
1422
+ * @public
1423
+ * @documentationMaturity preview
1424
+ * @requiredField contactId
1425
+ * @requiredField info
1426
+ * @requiredField options
1427
+ * @requiredField options.revision
1428
+ * @param options - Contact update options.
1429
+ * @returns Updated contact.
1430
+ */
1431
+ export declare function updateContact(contactId: string, info: ContactInfo, options: UpdateContactOptions): Promise<UpdateContactResponse>;
1432
+ export interface UpdateContactOptions {
1433
+ /**
1434
+ * Revision number.
1435
+ * When updating, include the existing `revision`
1436
+ * to prevent conflicting updates.
1437
+ */
1438
+ revision: number | null;
1439
+ /**
1440
+ * Controls whether the call will succeed if the new contact information contains an email already used by another contact.
1441
+ *
1442
+ * If set to `true`, the call will succeed even if an email address is used by another contact. If set to `false`, the call will fail if an email address is used by another contact.
1443
+ *
1444
+ * Defaults to `false`.
1445
+ */
1446
+ allowDuplicates?: boolean;
1447
+ }
1448
+ /**
1449
+ * Merges source contacts into a target contact.
1450
+ *
1451
+ * Merging contacts has these effects on the target contact:
1452
+ *
1453
+ * - No target contact data is overwritten or deleted.
1454
+ * - Arrays (emails, phones, addresses, and labels) are merged from the source contacts.
1455
+ * - If merging more than one source contact, the 1st source is given precedence, then the 2nd, and so on.
1456
+ *
1457
+ * <blockquote class="important">
1458
+ *
1459
+ * __Important:__
1460
+ * Merges cannot be undone.
1461
+ * Use [Preview Merge Contacts](#preview-merge-contacts)
1462
+ * to test before merging.
1463
+ *
1464
+ * </blockquote>
1465
+ *
1466
+ * Source contacts are deleted when merging.
1467
+ * However, if a source contact is a site member or contributor,
1468
+ * the merge fails because site contributors and members can't be deleted.
1469
+ * Site members and contributors can be target contacts only.
1470
+ *
1471
+ * After merging,
1472
+ * if you call [Get Contact](#get-contact) with a deleted source contact ID,
1473
+ * the target contact ID is returned.
1474
+ * This is supported when calling Get Contact only.
1475
+ * Deleted source contact IDs are not supported on any other endpoint.
1476
+ *
1477
+ * Merging contacts triggers these webhooks:
1478
+ *
1479
+ * - [Contact Merged](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-merged-webhook) is triggered.
1480
+ * - [Contact Updated](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-updated-webhook) is triggered for the target contact. `originatedFrom` is set to `merge`.
1481
+ * - [Contact Deleted](https://dev.wix.com/api/rest/contacts/contacts/contacts-v4/contact-deleted-webhook) is triggered for each source contact. `originatedFrom` is set to `merge`.
1482
+ *
1483
+ * This function is not a universal function and runs only on the backend.
1484
+ * @param targetContactId - Target contact ID.
1485
+ * @param targetContactRevision - Target contact revision number, which increments by 1 each time the contact is updated.
1486
+ * To prevent conflicting changes,
1487
+ * the target contact's current revision must be passed.
1488
+ * @public
1489
+ * @documentationMaturity preview
1490
+ * @requiredField targetContactId
1491
+ * @requiredField targetContactRevision
1492
+ * @param options - Merge contacts options.
1493
+ */
1494
+ export declare function mergeContacts(targetContactId: string, targetContactRevision: number | null, options?: MergeContactsOptions): Promise<MergeContactsResponse>;
1495
+ export interface MergeContactsOptions {
1496
+ /**
1497
+ * IDs of up to 5 contacts to merge into the target contact.
1498
+ * If merging more than one source contact,
1499
+ * the first source is given precedence, then the second, and so on.
1500
+ */
1501
+ sourceContactIds?: string[];
1502
+ }
1503
+ /**
1504
+ * Deletes a contact who is not a site member or contributor.
1505
+ *
1506
+ * The `deleteContact()` function returns a Promise
1507
+ * that resolves when the specified contact is deleted.
1508
+ * > **Note:**
1509
+ * > This function replaces the deprecated
1510
+ * > `wixCrmBackend.deleteContact()`.
1511
+ * > The deprecated function will continue to work, but it will not receive updates.
1512
+ * > To keep any existing code compatible with future changes, see the
1513
+ * > [migration instructions](wix-crm-backend/deletecontact#migration-instructions).
1514
+ *
1515
+ * Deleting a contact permanently removes them from your Contact List.
1516
+ *
1517
+ * If the contact is also a site member,
1518
+ * the member must be deleted first,
1519
+ * and then the contact can be deleted.
1520
+ *
1521
+ * <!--
1522
+ * > **Note:**
1523
+ * > Only visitors with
1524
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1525
+ * > can delete contacts.
1526
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1527
+ * -->
1528
+ *
1529
+ * This function is not a universal function and runs only on the backend.
1530
+ * @param contactId - ID of the contact to delete.
1531
+ * @public
1532
+ * @documentationMaturity preview
1533
+ * @requiredField contactId
1534
+ */
1535
+ export declare function deleteContact(contactId: string): Promise<void>;
1536
+ /**
1537
+ * Adds labels to a contact.
1538
+ *
1539
+ *
1540
+ * The `labelContact()` function returns a Promise
1541
+ * that resolves when the specified labels are added to the contact.
1542
+ * - **To create new labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel).
1543
+ * - **To find labels:** Use [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel), [`getLabel()`](wix-crm-backend/contacts/getlabel), or [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
1544
+ *
1545
+ * <!--
1546
+ * > **Note:**
1547
+ * > Only visitors with
1548
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1549
+ * > can label contacts.
1550
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1551
+ * -->
1552
+ *
1553
+ * This function is not a universal function and runs only on the backend.
1554
+ * @param contactId - ID of the contact to add labels to.
1555
+ * @param labelKeys - List of label keys to add to the contact.
1556
+ *
1557
+ * Label keys must exist to be added to the contact.
1558
+ * Contact labels can be created or retrieved with
1559
+ * [`findOrCreateLabel()`](wix-crm-backend/contacts/findorcreatelabel)
1560
+ * or
1561
+ * [`queryLabels()`](wix-crm-backend/contacts/queryLabels).
1562
+ * @public
1563
+ * @documentationMaturity preview
1564
+ * @requiredField contactId
1565
+ * @requiredField labelKeys
1566
+ * @returns Updated contact.
1567
+ */
1568
+ export declare function labelContact(contactId: string, labelKeys: string[]): Promise<LabelContactResponse>;
1569
+ /**
1570
+ * Removes labels from a contact.
1571
+ *
1572
+ * The `unlabelContact()` function returns a Promise
1573
+ * that resolves when the specified labels are removed from the contact.
1574
+ *
1575
+ * If a label is no longer needed
1576
+ * and you want to remove it from all contacts,
1577
+ * you can delete it with
1578
+ * [`deleteLabel()`](wix-crm-backend/contacts/deletelabel).
1579
+ *
1580
+ * <!--
1581
+ * > **Note:**
1582
+ * > Only visitors with
1583
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1584
+ * > can unlabel contacts.
1585
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1586
+ * -->
1587
+ *
1588
+ * This function is not a universal function and runs only on the backend.
1589
+ * @param contactId - ID of the contact to remove labels from.
1590
+ * @param labelKeys - List of label keys to remove from the contact.
1591
+ * @public
1592
+ * @documentationMaturity preview
1593
+ * @requiredField contactId
1594
+ * @requiredField labelKeys
1595
+ * @returns Updated contact.
1596
+ */
1597
+ export declare function unlabelContact(contactId: string, labelKeys: string[]): Promise<UnlabelContactResponse>;
1598
+ /**
1599
+ * Retrieves a contact.
1600
+ *
1601
+ *
1602
+ * The `getContact()` function returns a Promise
1603
+ * that resolves when the contact is found.
1604
+ * #### Getting Merged Contacts
1605
+ * When a source contact is merged
1606
+ * with a target contact, the source contact is deleted.
1607
+ * When calling `getContact()` for a merged contact,
1608
+ * you can use the source or target contact ID.
1609
+ * In both cases, the target contact is returned.
1610
+ *
1611
+ * This is supported only when calling `getContact()`,
1612
+ * and only for merged contacts.
1613
+ * Deleted source contact IDs are not supported on any other function.
1614
+ * > **Notes:**
1615
+ * >
1616
+ * > - This function replaces the deprecated
1617
+ * > `wixCrmBackend.getContactById()`.
1618
+ * > The deprecated function will continue to work, but it will not receive updates.
1619
+ * > To keep any existing code compatible with future changes, see the
1620
+ * > [migration instructions](wix-crm-backend/getcontactbyid#migration-instructions).
1621
+ * <!-- > - Only visitors with
1622
+ * > **Manage Contacts** [permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Froles-and-permissions)
1623
+ * > can retrieve contacts.
1624
+ * > You can override the permissions by setting the `suppressAuth` option to `true`.
1625
+ * -->
1626
+ *
1627
+ * This function is not a universal function and runs only on the backend.
1628
+ * @param _id - ID of the contact to retrieve.
1629
+ * @public
1630
+ * @documentationMaturity preview
1631
+ * @requiredField _id
1632
+ * @param options - Get contact options.
1633
+ * @returns The requested contact.
1634
+ */
1635
+ export declare function getContact(_id: string, options?: GetContactOptions): Promise<Contact>;
1636
+ export interface GetContactOptions {
1637
+ /**
1638
+ * List of projected fields to return.
1639
+ * If both `fields` and `fieldsets` are sent in the request,
1640
+ * the union of both lists is returned.
1641
+ * `id` and `revision` are always returned.
1642
+ *
1643
+ * Supported properties:
1644
+ * `source`, `createdDate`, `updatedDate`, `lastActivity`, `primaryInfo`,
1645
+ * `info.name`, `info.emails`, `info.phones`, `info.addresses`, `info.company`,
1646
+ * `info.jobTitle`, `info.picture`, `info.birthdate`, `info.locale`,
1647
+ * `info.labelKeys`, `info.locations`, `info.extendedFields`
1648
+ */
1649
+ fields?: string[];
1650
+ /**
1651
+ * Predefined sets of fields to return.
1652
+ * If both `fields` and `fieldsets` are sent in the request,
1653
+ * the union of both lists is returned.
1654
+ *
1655
+ * - `BASIC`: Returns `id`, `revision`, `primaryInfo`, `info.name`.
1656
+ * - `COMMUNICATION_DETAILS`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.emails`, `info.phones`, `info.addresses`.
1657
+ * - `EXTENDED`: Returns `id`, `revision`, `primaryInfo`, `info.name`, `info.extendedFields`.
1658
+ * - `FULL`: Returns all fields.
1659
+ *
1660
+ * Default: If `fields` is omitted from the request, `FULL`.
1661
+ */
1662
+ fieldsets?: ContactFieldSet[];
1663
+ }