@surgeapi/node 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +5 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/accounts.d.mts +21 -21
  13. package/resources/accounts.d.mts.map +1 -1
  14. package/resources/accounts.d.ts +21 -21
  15. package/resources/accounts.d.ts.map +1 -1
  16. package/resources/audiences.d.mts +80 -0
  17. package/resources/audiences.d.mts.map +1 -0
  18. package/resources/audiences.d.ts +80 -0
  19. package/resources/audiences.d.ts.map +1 -0
  20. package/resources/audiences.js +59 -0
  21. package/resources/audiences.js.map +1 -0
  22. package/resources/audiences.mjs +55 -0
  23. package/resources/audiences.mjs.map +1 -0
  24. package/resources/campaigns.d.mts +146 -2
  25. package/resources/campaigns.d.mts.map +1 -1
  26. package/resources/campaigns.d.ts +146 -2
  27. package/resources/campaigns.d.ts.map +1 -1
  28. package/resources/campaigns.js +38 -0
  29. package/resources/campaigns.js.map +1 -1
  30. package/resources/campaigns.mjs +38 -0
  31. package/resources/campaigns.mjs.map +1 -1
  32. package/resources/index.d.mts +2 -1
  33. package/resources/index.d.mts.map +1 -1
  34. package/resources/index.d.ts +2 -1
  35. package/resources/index.d.ts.map +1 -1
  36. package/resources/index.js +3 -1
  37. package/resources/index.js.map +1 -1
  38. package/resources/index.mjs +1 -0
  39. package/resources/index.mjs.map +1 -1
  40. package/src/client.ts +19 -0
  41. package/src/resources/accounts.ts +21 -21
  42. package/src/resources/audiences.ts +117 -0
  43. package/src/resources/campaigns.ts +173 -1
  44. package/src/resources/index.ts +8 -0
  45. package/src/version.ts +1 -1
  46. package/version.d.mts +1 -1
  47. package/version.d.ts +1 -1
  48. package/version.js +1 -1
  49. package/version.mjs +1 -1
@@ -21,6 +21,8 @@ export declare class Campaigns extends APIResource {
21
21
  * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
22
22
  * ],
23
23
  * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
24
+ * terms_and_conditions_url:
25
+ * 'https://fastauto.shop/terms-and-conditions',
24
26
  * use_cases: [
25
27
  * 'account_notification',
26
28
  * 'customer_care',
@@ -43,6 +45,40 @@ export declare class Campaigns extends APIResource {
43
45
  * ```
44
46
  */
45
47
  retrieve(id: string, options?: RequestOptions): APIPromise<Campaign>;
48
+ /**
49
+ * Updates a campaign that has not yet been approved. This can be used to fix
50
+ * issues flagged during review and resubmit the campaign. Returns an error if the
51
+ * campaign is currently in review, has already been approved, or has been
52
+ * deactivated.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const campaign = await client.campaigns.update(
57
+ * 'cpn_01k0qczvhbet4azgn5xm2ccfst',
58
+ * {
59
+ * consent_flow:
60
+ * 'When customers bring in their car for service, they will fill out this web form for intake: https://fastauto.shop/bp108c In it they can choose to opt in to text message notifications. If they choose to opt in, we will send them notifications to let them know if our mechanics find issues and once the car is ready to go, as well as links to invoices and to leave us feedback.',
61
+ * description:
62
+ * 'This phone number will send auto maintenance notifications to end users that have opted in. It will also be used for responding to customer inquiries and sending some marketing offers.',
63
+ * message_samples: [
64
+ * 'You are now opted in to receive repair notifications from DT Precision Auto. Frequency varies. Msg&data rates apply. Reply STOP to opt out.',
65
+ * "You're lucky that hundred shot of NOS didn't blow the welds on the intake!",
66
+ * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
67
+ * ],
68
+ * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
69
+ * terms_and_conditions_url:
70
+ * 'https://fastauto.shop/terms-and-conditions',
71
+ * use_cases: [
72
+ * 'account_notification',
73
+ * 'customer_care',
74
+ * 'marketing',
75
+ * ],
76
+ * volume: 'high',
77
+ * },
78
+ * );
79
+ * ```
80
+ */
81
+ update(id: string, body: CampaignUpdateParams, options?: RequestOptions): APIPromise<Campaign>;
46
82
  /**
47
83
  * List all campaigns for an account with cursor-based pagination.
48
84
  *
@@ -201,6 +237,13 @@ export declare namespace CampaignCreateParams {
201
237
  * in to messaging.
202
238
  */
203
239
  privacy_policy_url: string;
240
+ /**
241
+ * The URL of the terms and conditions presented to end users when they opt in to
242
+ * messaging. These terms and conditions may be shared among all of a platform's
243
+ * customers if they're the terms that are presented to end users when they opt in
244
+ * to messaging.
245
+ */
246
+ terms_and_conditions_url: string;
204
247
  /**
205
248
  * A list containing 1-5 types of messages that will be sent with this campaign.
206
249
  *
@@ -263,13 +306,114 @@ export declare namespace CampaignCreateParams {
263
306
  * to disable automatic link shortening.
264
307
  */
265
308
  link_sample?: string;
309
+ }
310
+ interface ExternalCampaignParams {
311
+ /**
312
+ * The Campaign Registry (TCR) ID for the externally registered campaign
313
+ */
314
+ tcr_id: string;
315
+ }
316
+ }
317
+ export type CampaignUpdateParams = CampaignUpdateParams.StandardCampaignParams | CampaignUpdateParams.ExternalCampaignParams;
318
+ export declare namespace CampaignUpdateParams {
319
+ interface StandardCampaignParams {
320
+ /**
321
+ * A string explaining the method through which end users will opt in to receive
322
+ * messages from the brand. Typically this should include URLs for opt-in forms or
323
+ * screenshots that might be helpful in explaining the flow to someone unfamiliar
324
+ * with the organization's purpose.
325
+ */
326
+ consent_flow: string;
327
+ /**
328
+ * An explanation of the organization's purpose and how it will be using text
329
+ * messaging to accomplish that purpose.
330
+ */
331
+ description: string;
332
+ /**
333
+ * An array of 2-5 strings with examples of the messages that will be sent from
334
+ * this campaign. Typically the first sample should be a compliance message like
335
+ * `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
336
+ * These samples don't necessarily need to be the only templates that will be used
337
+ * for the campaign, but they should reflect the purpose of the messages that will
338
+ * be sent. Any variable content can be reflected by wrapping it in square brackets
339
+ * like `[customer name]`.
340
+ */
341
+ message_samples: Array<string>;
342
+ /**
343
+ * The URL of the privacy policy for the brand in question. This may be a shared
344
+ * privacy policy if it's the policy that is displayed to end users when they opt
345
+ * in to messaging.
346
+ */
347
+ privacy_policy_url: string;
266
348
  /**
267
349
  * The URL of the terms and conditions presented to end users when they opt in to
268
350
  * messaging. These terms and conditions may be shared among all of a platform's
269
351
  * customers if they're the terms that are presented to end users when they opt in
270
352
  * to messaging.
271
353
  */
272
- terms_and_conditions_url?: string;
354
+ terms_and_conditions_url: string;
355
+ /**
356
+ * A list containing 1-5 types of messages that will be sent with this campaign.
357
+ *
358
+ * The following use cases are typically available to all brands:
359
+ *
360
+ * - `account_notification` - For sending reminders, alerts, and general
361
+ * account-related notifications like booking confirmations or appointment
362
+ * reminders.
363
+ * - `customer_care` - For account support, troubleshooting, and general customer
364
+ * service communication.
365
+ * - `delivery_notification` - For notifying customers about the status of product
366
+ * or service deliveries.
367
+ * - `fraud_alert` - For warning customers about suspicious or potentially
368
+ * fraudulent activity.
369
+ * - `higher_education` - For messaging related to colleges, universities, and
370
+ * school districts outside of K–12.
371
+ * - `marketing` - For promotional or advertising messages intended to market
372
+ * products or services.
373
+ * - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
374
+ * - `public_service_announcement` - For raising awareness about social issues or
375
+ * important public information.
376
+ * - `security_alert` - For alerts related to potential security breaches or
377
+ * compromised systems requiring user action.
378
+ * - `two_factor_authentication` - For sending one-time passwords or verification
379
+ * codes for login or password reset.
380
+ *
381
+ * For access to special use cases not shown here, reach out to support@surge.app.
382
+ */
383
+ use_cases: Array<'account_notification' | 'customer_care' | 'delivery_notification' | 'fraud_alert' | 'higher_education' | 'marketing' | 'polling_voting' | 'public_service_announcement' | 'security_alert' | 'two_factor_authentication'>;
384
+ /**
385
+ * This will be one of the following:
386
+ *
387
+ * - `low` - The campaign will be allowed to send up to 2000 SMS segments to
388
+ * T-Mobile customers each day. In this case your platform will be charged for
389
+ * the setup fee for a low volume number upon receipt of the API request.
390
+ * - `high` - The campaign will be allowed to send up to 200k SMS segments to
391
+ * T-Mobile customers each day, depending on the trust score assigned by The
392
+ * Campaign Registry. Your platform will be charged for the setup fee for a high
393
+ * volume number upon receipt of the API request, and phone numbers will be
394
+ * charged as high volume numbers going forward.
395
+ */
396
+ volume: 'high' | 'low';
397
+ /**
398
+ * A list of properties that this campaign should include. These properties can be
399
+ * any of the following values:
400
+ *
401
+ * - `links` - whether the campaign might send links in messages
402
+ * - `phone_numbers` - whether the campaign might send phone numbers in messages
403
+ * - `age_gated` - whether the campaign contains age gated content (controlled
404
+ * substances or adult content)
405
+ * - `direct_lending` - whether the campaign contains content related to direct
406
+ * lending or other loan arrangements
407
+ */
408
+ includes?: Array<'links' | 'phone_numbers' | 'age_gated' | 'direct_lending'>;
409
+ /**
410
+ * A sample link that might be sent by this campaign. If links from other domains
411
+ * are sent through this campaign, they are much more likely to be filtered by the
412
+ * carriers. If link shortening is enabled for the account, the link shortener URL
413
+ * will be used instead of what is provided. Reach out to support if you would like
414
+ * to disable automatic link shortening.
415
+ */
416
+ link_sample?: string;
273
417
  }
274
418
  interface ExternalCampaignParams {
275
419
  /**
@@ -281,6 +425,6 @@ export declare namespace CampaignCreateParams {
281
425
  export interface CampaignListParams extends CursorParams {
282
426
  }
283
427
  export declare namespace Campaigns {
284
- export { type Campaign as Campaign, type CampaignsCursor as CampaignsCursor, type CampaignCreateParams as CampaignCreateParams, type CampaignListParams as CampaignListParams, };
428
+ export { type Campaign as Campaign, type CampaignsCursor as CampaignsCursor, type CampaignCreateParams as CampaignCreateParams, type CampaignUpdateParams as CampaignUpdateParams, type CampaignListParams as CampaignListParams, };
285
429
  }
286
430
  //# sourceMappingURL=campaigns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"campaigns.d.ts","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE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CAAC;QAEF;;;;;;;;;;;WAWG;QACH,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;QAEvB;;;;;;;;;;WAUG;QACH,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,eAAe,GAAG,WAAW,GAAG,gBAAgB,CAAC,CAAC;QAE7E;;;;;;WAMG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;IAED,UAAiB,sBAAsB;QACrC;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;CAAG;AAE3D,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -24,6 +24,8 @@ class Campaigns extends resource_1.APIResource {
24
24
  * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
25
25
  * ],
26
26
  * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
27
+ * terms_and_conditions_url:
28
+ * 'https://fastauto.shop/terms-and-conditions',
27
29
  * use_cases: [
28
30
  * 'account_notification',
29
31
  * 'customer_care',
@@ -50,6 +52,42 @@ class Campaigns extends resource_1.APIResource {
50
52
  retrieve(id, options) {
51
53
  return this._client.get((0, path_1.path) `/campaigns/${id}`, options);
52
54
  }
55
+ /**
56
+ * Updates a campaign that has not yet been approved. This can be used to fix
57
+ * issues flagged during review and resubmit the campaign. Returns an error if the
58
+ * campaign is currently in review, has already been approved, or has been
59
+ * deactivated.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const campaign = await client.campaigns.update(
64
+ * 'cpn_01k0qczvhbet4azgn5xm2ccfst',
65
+ * {
66
+ * consent_flow:
67
+ * 'When customers bring in their car for service, they will fill out this web form for intake: https://fastauto.shop/bp108c In it they can choose to opt in to text message notifications. If they choose to opt in, we will send them notifications to let them know if our mechanics find issues and once the car is ready to go, as well as links to invoices and to leave us feedback.',
68
+ * description:
69
+ * 'This phone number will send auto maintenance notifications to end users that have opted in. It will also be used for responding to customer inquiries and sending some marketing offers.',
70
+ * message_samples: [
71
+ * 'You are now opted in to receive repair notifications from DT Precision Auto. Frequency varies. Msg&data rates apply. Reply STOP to opt out.',
72
+ * "You're lucky that hundred shot of NOS didn't blow the welds on the intake!",
73
+ * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
74
+ * ],
75
+ * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
76
+ * terms_and_conditions_url:
77
+ * 'https://fastauto.shop/terms-and-conditions',
78
+ * use_cases: [
79
+ * 'account_notification',
80
+ * 'customer_care',
81
+ * 'marketing',
82
+ * ],
83
+ * volume: 'high',
84
+ * },
85
+ * );
86
+ * ```
87
+ */
88
+ update(id, body, options) {
89
+ return this._client.patch((0, path_1.path) `/campaigns/${id}`, { body, ...options });
90
+ }
53
91
  /**
54
92
  * List all campaigns for an account with cursor-based pagination.
55
93
  *
@@ -1 +1 @@
1
- {"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,SAAiB,EAAE,IAA0B,EAAE,OAAwB;QAC5E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC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;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,aAAa,SAAS,YAAY,EAAE,CAAA,mBAAgB,CAAA,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA7GD,8BA6GC"}
@@ -21,6 +21,8 @@ export class Campaigns extends APIResource {
21
21
  * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
22
22
  * ],
23
23
  * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
24
+ * terms_and_conditions_url:
25
+ * 'https://fastauto.shop/terms-and-conditions',
24
26
  * use_cases: [
25
27
  * 'account_notification',
26
28
  * 'customer_care',
@@ -47,6 +49,42 @@ export class Campaigns extends APIResource {
47
49
  retrieve(id, options) {
48
50
  return this._client.get(path `/campaigns/${id}`, options);
49
51
  }
52
+ /**
53
+ * Updates a campaign that has not yet been approved. This can be used to fix
54
+ * issues flagged during review and resubmit the campaign. Returns an error if the
55
+ * campaign is currently in review, has already been approved, or has been
56
+ * deactivated.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const campaign = await client.campaigns.update(
61
+ * 'cpn_01k0qczvhbet4azgn5xm2ccfst',
62
+ * {
63
+ * consent_flow:
64
+ * 'When customers bring in their car for service, they will fill out this web form for intake: https://fastauto.shop/bp108c In it they can choose to opt in to text message notifications. If they choose to opt in, we will send them notifications to let them know if our mechanics find issues and once the car is ready to go, as well as links to invoices and to leave us feedback.',
65
+ * description:
66
+ * 'This phone number will send auto maintenance notifications to end users that have opted in. It will also be used for responding to customer inquiries and sending some marketing offers.',
67
+ * message_samples: [
68
+ * 'You are now opted in to receive repair notifications from DT Precision Auto. Frequency varies. Msg&data rates apply. Reply STOP to opt out.',
69
+ * "You're lucky that hundred shot of NOS didn't blow the welds on the intake!",
70
+ * 'Your car is ready to go. See your invoice here: https://l.fastauto.shop/s034ij',
71
+ * ],
72
+ * privacy_policy_url: 'https://fastauto.shop/sms-privacy',
73
+ * terms_and_conditions_url:
74
+ * 'https://fastauto.shop/terms-and-conditions',
75
+ * use_cases: [
76
+ * 'account_notification',
77
+ * 'customer_care',
78
+ * 'marketing',
79
+ * ],
80
+ * volume: 'high',
81
+ * },
82
+ * );
83
+ * ```
84
+ */
85
+ update(id, body, options) {
86
+ return this._client.patch(path `/campaigns/${id}`, { body, ...options });
87
+ }
50
88
  /**
51
89
  * List all campaigns for an account with cursor-based pagination.
52
90
  *
@@ -1 +1 @@
1
- {"version":3,"file":"campaigns.mjs","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,SAAiB,EAAE,IAA0B,EAAE,OAAwB;QAC5E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,aAAa,SAAS,YAAY,EAAE,CAAA,MAAgB,CAAA,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"campaigns.mjs","sourceRoot":"","sources":["../src/resources/campaigns.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAiB,EAAE,IAA0B,EAAE,OAAwB;QAC5E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,EAAU,EAAE,IAA0B,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,SAAiB,EACjB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,aAAa,SAAS,YAAY,EAAE,CAAA,MAAgB,CAAA,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,7 +1,8 @@
1
1
  export * from "./shared.mjs";
2
2
  export { Accounts, type Account, type AccountStatus, type Organization, type AccountCreateParams, type AccountUpdateParams, type AccountRetrieveStatusParams, } from "./accounts.mjs";
3
+ export { Audiences, type AudienceCreateResponse, type AudienceCreateParams, type AudienceAddContactParams, type AudienceListContactsParams, } from "./audiences.mjs";
3
4
  export { Blasts, type Blast, type BlastCreateParams } from "./blasts.mjs";
4
- export { Campaigns, type Campaign, type CampaignCreateParams, type CampaignListParams, type CampaignsCursor, } from "./campaigns.mjs";
5
+ export { Campaigns, type Campaign, type CampaignCreateParams, type CampaignUpdateParams, type CampaignListParams, type CampaignsCursor, } from "./campaigns.mjs";
5
6
  export { Contacts, type Contact, type ContactCreateParams, type ContactUpdateParams, type ContactListParams, type ContactsCursor, } from "./contacts.mjs";
6
7
  export { Messages, type Message, type MessageCreateParams, type MessageListParams, type MessagesCursor, } from "./messages.mjs";
7
8
  export { PhoneNumbers, type PhoneNumber, type PhoneNumberListParams, type PhoneNumberPurchaseParams, type PhoneNumbersCursor, } from "./phone-numbers.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,GACjC;OACM,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE;OAC9C,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,yCAAyC,EAC9C,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,GACxB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,GACjC;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC;OACM,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE;OAC9C,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,yCAAyC,EAC9C,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,GACxB"}
@@ -1,7 +1,8 @@
1
1
  export * from "./shared.js";
2
2
  export { Accounts, type Account, type AccountStatus, type Organization, type AccountCreateParams, type AccountUpdateParams, type AccountRetrieveStatusParams, } from "./accounts.js";
3
+ export { Audiences, type AudienceCreateResponse, type AudienceCreateParams, type AudienceAddContactParams, type AudienceListContactsParams, } from "./audiences.js";
3
4
  export { Blasts, type Blast, type BlastCreateParams } from "./blasts.js";
4
- export { Campaigns, type Campaign, type CampaignCreateParams, type CampaignListParams, type CampaignsCursor, } from "./campaigns.js";
5
+ export { Campaigns, type Campaign, type CampaignCreateParams, type CampaignUpdateParams, type CampaignListParams, type CampaignsCursor, } from "./campaigns.js";
5
6
  export { Contacts, type Contact, type ContactCreateParams, type ContactUpdateParams, type ContactListParams, type ContactsCursor, } from "./contacts.js";
6
7
  export { Messages, type Message, type MessageCreateParams, type MessageListParams, type MessagesCursor, } from "./messages.js";
7
8
  export { PhoneNumbers, type PhoneNumber, type PhoneNumberListParams, type PhoneNumberPurchaseParams, type PhoneNumbersCursor, } from "./phone-numbers.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,GACjC;OACM,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE;OAC9C,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,yCAAyC,EAC9C,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,GACxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,GACjC;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,GAChC;OACM,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE;OAC9C,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB;OACM,EACL,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC;OACM,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB;OACM,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,yCAAyC,EAC9C,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,GACxB"}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Webhooks = exports.Verifications = exports.Users = exports.Recordings = exports.PhoneNumbers = exports.Messages = exports.Contacts = exports.Campaigns = exports.Blasts = exports.Accounts = void 0;
4
+ exports.Webhooks = exports.Verifications = exports.Users = exports.Recordings = exports.PhoneNumbers = exports.Messages = exports.Contacts = exports.Campaigns = exports.Blasts = exports.Audiences = exports.Accounts = void 0;
5
5
  const tslib_1 = require("../internal/tslib.js");
6
6
  tslib_1.__exportStar(require("./shared.js"), exports);
7
7
  var accounts_1 = require("./accounts.js");
8
8
  Object.defineProperty(exports, "Accounts", { enumerable: true, get: function () { return accounts_1.Accounts; } });
9
+ var audiences_1 = require("./audiences.js");
10
+ Object.defineProperty(exports, "Audiences", { enumerable: true, get: function () { return audiences_1.Audiences; } });
9
11
  var blasts_1 = require("./blasts.js");
10
12
  Object.defineProperty(exports, "Blasts", { enumerable: true, get: function () { return blasts_1.Blasts; } });
11
13
  var campaigns_1 = require("./campaigns.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,sCAAsE;AAA7D,gGAAA,MAAM,OAAA;AACf,4CAMqB;AALnB,sGAAA,SAAS,OAAA;AAMX,0CAOoB;AANlB,oGAAA,QAAQ,OAAA;AAOV,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,oDAMyB;AALvB,6GAAA,YAAY,OAAA;AAMd,8CAQsB;AAPpB,wGAAA,UAAU,OAAA;AAQZ,oCASiB;AARf,8FAAA,KAAK,OAAA;AASP,oDAMyB;AALvB,8GAAA,aAAa,OAAA;AAMf,0CAgBoB;AAflB,oGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,4CAMqB;AALnB,sGAAA,SAAS,OAAA;AAMX,sCAAsE;AAA7D,gGAAA,MAAM,OAAA;AACf,4CAOqB;AANnB,sGAAA,SAAS,OAAA;AAOX,0CAOoB;AANlB,oGAAA,QAAQ,OAAA;AAOV,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,oDAMyB;AALvB,6GAAA,YAAY,OAAA;AAMd,8CAQsB;AAPpB,wGAAA,UAAU,OAAA;AAQZ,oCASiB;AARf,8FAAA,KAAK,OAAA;AASP,oDAMyB;AALvB,8GAAA,aAAa,OAAA;AAMf,0CAgBoB;AAflB,oGAAA,QAAQ,OAAA"}
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export * from "./shared.mjs";
3
3
  export { Accounts, } from "./accounts.mjs";
4
+ export { Audiences, } from "./audiences.mjs";
4
5
  export { Blasts } from "./blasts.mjs";
5
6
  export { Campaigns, } from "./campaigns.mjs";
6
7
  export { Contacts, } from "./contacts.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,QAAQ,GAOT;OACM,EAAE,MAAM,EAAsC;OAC9C,EACL,SAAS,GAKV;OACM,EACL,QAAQ,GAMT;OACM,EACL,QAAQ,GAKT;OACM,EACL,YAAY,GAKb;OACM,EACL,UAAU,GAOX;OACM,EACL,KAAK,GAQN;OACM,EACL,aAAa,GAKd;OACM,EACL,QAAQ,GAeT"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,QAAQ,GAOT;OACM,EACL,SAAS,GAKV;OACM,EAAE,MAAM,EAAsC;OAC9C,EACL,SAAS,GAMV;OACM,EACL,QAAQ,GAMT;OACM,EACL,QAAQ,GAKT;OACM,EACL,YAAY,GAKb;OACM,EACL,UAAU,GAOX;OACM,EACL,KAAK,GAQN;OACM,EACL,aAAa,GAKd;OACM,EACL,QAAQ,GAeT"}
package/src/client.ts CHANGED
@@ -28,11 +28,19 @@ import {
28
28
  Accounts,
29
29
  Organization,
30
30
  } from './resources/accounts';
31
+ import {
32
+ AudienceAddContactParams,
33
+ AudienceCreateParams,
34
+ AudienceCreateResponse,
35
+ AudienceListContactsParams,
36
+ Audiences,
37
+ } from './resources/audiences';
31
38
  import { Blast, BlastCreateParams, Blasts } from './resources/blasts';
32
39
  import {
33
40
  Campaign,
34
41
  CampaignCreateParams,
35
42
  CampaignListParams,
43
+ CampaignUpdateParams,
36
44
  Campaigns,
37
45
  CampaignsCursor,
38
46
  } from './resources/campaigns';
@@ -834,6 +842,7 @@ export class Surge {
834
842
  static toFile = Uploads.toFile;
835
843
 
836
844
  accounts: API.Accounts = new API.Accounts(this);
845
+ audiences: API.Audiences = new API.Audiences(this);
837
846
  blasts: API.Blasts = new API.Blasts(this);
838
847
  campaigns: API.Campaigns = new API.Campaigns(this);
839
848
  contacts: API.Contacts = new API.Contacts(this);
@@ -846,6 +855,7 @@ export class Surge {
846
855
  }
847
856
 
848
857
  Surge.Accounts = Accounts;
858
+ Surge.Audiences = Audiences;
849
859
  Surge.Blasts = Blasts;
850
860
  Surge.Campaigns = Campaigns;
851
861
  Surge.Contacts = Contacts;
@@ -872,6 +882,14 @@ export declare namespace Surge {
872
882
  type AccountRetrieveStatusParams as AccountRetrieveStatusParams,
873
883
  };
874
884
 
885
+ export {
886
+ Audiences as Audiences,
887
+ type AudienceCreateResponse as AudienceCreateResponse,
888
+ type AudienceCreateParams as AudienceCreateParams,
889
+ type AudienceAddContactParams as AudienceAddContactParams,
890
+ type AudienceListContactsParams as AudienceListContactsParams,
891
+ };
892
+
875
893
  export { Blasts as Blasts, type Blast as Blast, type BlastCreateParams as BlastCreateParams };
876
894
 
877
895
  export {
@@ -879,6 +897,7 @@ export declare namespace Surge {
879
897
  type Campaign as Campaign,
880
898
  type CampaignsCursor as CampaignsCursor,
881
899
  type CampaignCreateParams as CampaignCreateParams,
900
+ type CampaignUpdateParams as CampaignUpdateParams,
882
901
  type CampaignListParams as CampaignListParams,
883
902
  };
884
903
 
@@ -198,16 +198,16 @@ export interface Organization {
198
198
 
199
199
  /**
200
200
  * The value of the identifier whose type is specified in the identifier_type
201
- * field. Typically this will be an EIN, and can be formatted with or without the
202
- * hyphen.
201
+ * field. For EIN, can be formatted with or without the hyphen. For CBN, must be
202
+ * exactly 9 digits.
203
203
  */
204
204
  identifier: string | null;
205
205
 
206
206
  /**
207
- * The type of identifier being provided for the organization. Support for more
208
- * values will be added in the future.
207
+ * The type of identifier being provided for the organization. Use "ein" for US
208
+ * businesses or "cbn" for Canadian businesses.
209
209
  */
210
- identifier_type: 'ein' | null;
210
+ identifier_type: 'ein' | 'cbn' | null;
211
211
 
212
212
  /**
213
213
  * The industry in which the organization operates.
@@ -249,8 +249,8 @@ export interface Organization {
249
249
  | null;
250
250
 
251
251
  /**
252
- * For sole proprietors, this must be a valid US mobile phone number to which a
253
- * verification text message will be sent. (E.164 format)
252
+ * For sole proprietors, this must be a valid US or Canadian mobile phone number to
253
+ * which a verification text message will be sent. (E.164 format)
254
254
  */
255
255
  mobile_number: string | null;
256
256
 
@@ -480,16 +480,16 @@ export namespace AccountCreateParams {
480
480
 
481
481
  /**
482
482
  * The value of the identifier whose type is specified in the identifier_type
483
- * field. Typically this will be an EIN, and can be formatted with or without the
484
- * hyphen.
483
+ * field. For EIN, can be formatted with or without the hyphen. For CBN, must be
484
+ * exactly 9 digits.
485
485
  */
486
486
  identifier?: string | null;
487
487
 
488
488
  /**
489
- * The type of identifier being provided for the organization. Support for more
490
- * values will be added in the future.
489
+ * The type of identifier being provided for the organization. Use "ein" for US
490
+ * businesses or "cbn" for Canadian businesses.
491
491
  */
492
- identifier_type?: 'ein' | null;
492
+ identifier_type?: 'ein' | 'cbn' | null;
493
493
 
494
494
  /**
495
495
  * The industry in which the organization operates.
@@ -531,8 +531,8 @@ export namespace AccountCreateParams {
531
531
  | null;
532
532
 
533
533
  /**
534
- * For sole proprietors, this must be a valid US mobile phone number to which a
535
- * verification text message will be sent. (E.164 format)
534
+ * For sole proprietors, this must be a valid US or Canadian mobile phone number to
535
+ * which a verification text message will be sent. (E.164 format)
536
536
  */
537
537
  mobile_number?: string | null;
538
538
 
@@ -766,16 +766,16 @@ export namespace AccountUpdateParams {
766
766
 
767
767
  /**
768
768
  * The value of the identifier whose type is specified in the identifier_type
769
- * field. Typically this will be an EIN, and can be formatted with or without the
770
- * hyphen.
769
+ * field. For EIN, can be formatted with or without the hyphen. For CBN, must be
770
+ * exactly 9 digits.
771
771
  */
772
772
  identifier?: string | null;
773
773
 
774
774
  /**
775
- * The type of identifier being provided for the organization. Support for more
776
- * values will be added in the future.
775
+ * The type of identifier being provided for the organization. Use "ein" for US
776
+ * businesses or "cbn" for Canadian businesses.
777
777
  */
778
- identifier_type?: 'ein' | null;
778
+ identifier_type?: 'ein' | 'cbn' | null;
779
779
 
780
780
  /**
781
781
  * The industry in which the organization operates.
@@ -817,8 +817,8 @@ export namespace AccountUpdateParams {
817
817
  | null;
818
818
 
819
819
  /**
820
- * For sole proprietors, this must be a valid US mobile phone number to which a
821
- * verification text message will be sent. (E.164 format)
820
+ * For sole proprietors, this must be a valid US or Canadian mobile phone number to
821
+ * which a verification text message will be sent. (E.164 format)
822
822
  */
823
823
  mobile_number?: string | null;
824
824