retell-sdk 5.32.4 → 5.33.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.
@@ -20,6 +20,23 @@ export class PhoneNumber extends APIResource {
20
20
  return this._client.post('/create-phone-number', { body, ...options });
21
21
  }
22
22
 
23
+ /**
24
+ * Import a phone number from custom telephony & Bind agents
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const phoneNumberResponse = await client.phoneNumber.import(
29
+ * {
30
+ * phone_number: '+14157774444',
31
+ * termination_uri: 'someuri.pstn.twilio.com',
32
+ * },
33
+ * );
34
+ * ```
35
+ */
36
+ import(body: PhoneNumberImportParams, options?: RequestOptions): APIPromise<PhoneNumberResponse> {
37
+ return this._client.post('/import-phone-number', { body, ...options });
38
+ }
39
+
23
40
  /**
24
41
  * Retrieve details of a specific phone number
25
42
  *
@@ -33,6 +50,21 @@ export class PhoneNumber extends APIResource {
33
50
  return this._client.get(path`/get-phone-number/${phoneNumber}`, options);
34
51
  }
35
52
 
53
+ /**
54
+ * List phone numbers with pagination
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const phoneNumbers = await client.phoneNumber.list();
59
+ * ```
60
+ */
61
+ list(
62
+ query: PhoneNumberListParams | null | undefined = {},
63
+ options?: RequestOptions,
64
+ ): APIPromise<PhoneNumberListResponse> {
65
+ return this._client.get('/v2/list-phone-numbers', { query, ...options });
66
+ }
67
+
36
68
  /**
37
69
  * Update agent bound to a purchased phone number
38
70
  *
@@ -68,21 +100,6 @@ export class PhoneNumber extends APIResource {
68
100
  return this._client.patch(path`/update-phone-number/${phoneNumber}`, { body, ...options });
69
101
  }
70
102
 
71
- /**
72
- * List phone numbers with pagination
73
- *
74
- * @example
75
- * ```ts
76
- * const phoneNumbers = await client.phoneNumber.list();
77
- * ```
78
- */
79
- list(
80
- query: PhoneNumberListParams | null | undefined = {},
81
- options?: RequestOptions,
82
- ): APIPromise<PhoneNumberListResponse> {
83
- return this._client.get('/v2/list-phone-numbers', { query, ...options });
84
- }
85
-
86
103
  /**
87
104
  * Delete an existing phone number
88
105
  *
@@ -97,23 +114,6 @@ export class PhoneNumber extends APIResource {
97
114
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
98
115
  });
99
116
  }
100
-
101
- /**
102
- * Import a phone number from custom telephony & Bind agents
103
- *
104
- * @example
105
- * ```ts
106
- * const phoneNumberResponse = await client.phoneNumber.import(
107
- * {
108
- * phone_number: '+14157774444',
109
- * termination_uri: 'someuri.pstn.twilio.com',
110
- * },
111
- * );
112
- * ```
113
- */
114
- import(body: PhoneNumberImportParams, options?: RequestOptions): APIPromise<PhoneNumberResponse> {
115
- return this._client.post('/import-phone-number', { body, ...options });
116
- }
117
117
  }
118
118
 
119
119
  export interface PhoneNumberResponse {
@@ -153,11 +153,11 @@ export interface PhoneNumberResponse {
153
153
  area_code?: number;
154
154
 
155
155
  /**
156
- * Enterprise only. Phone number to transfer inbound calls to when organization is
157
- * in outage mode or when an inbound call cannot get a concurrency slot before the
158
- * fallback timeout. Can be either a Retell phone number or an external number.
159
- * Cannot be the same as this phone number, and cannot be a number that already has
160
- * its own fallback configured (prevents nested forwarding).
156
+ * When inbound call concurrency is reached and a slot does not free up after
157
+ * extended ringing, the call will fall back to this number. Can be either a Retell
158
+ * phone number or an external number. Cannot be the same as this phone number, and
159
+ * cannot be a number that already has its own fallback configured (prevents nested
160
+ * forwarding).
161
161
  */
162
162
  fallback_number?: string | null;
163
163
 
@@ -177,8 +177,9 @@ export interface PhoneNumberResponse {
177
177
  inbound_sms_agents?: Array<PhoneNumberResponse.InboundSMSAgent> | null;
178
178
 
179
179
  /**
180
- * If set, will send a webhook for inbound SMS, where you can override agent id,
181
- * set dynamic variables and other fields specific to that chat.
180
+ * If set, Retell will send a webhook for inbound SMS, where you can override the
181
+ * agent ID, set dynamic variables, and configure other fields specific to that
182
+ * chat.
182
183
  */
183
184
  inbound_sms_webhook_url?: string | null;
184
185
 
@@ -369,11 +370,11 @@ export interface PhoneNumberCreateParams {
369
370
  country_code?: 'US' | 'CA';
370
371
 
371
372
  /**
372
- * Enterprise only. Phone number to transfer inbound calls to when organization is
373
- * in outage mode or when an inbound call cannot get a concurrency slot before the
374
- * fallback timeout. Can be either a Retell phone number or an external number.
375
- * Cannot be the same as this phone number, and cannot be a number that already has
376
- * its own fallback configured (prevents nested forwarding).
373
+ * When inbound call concurrency is reached and a slot does not free up after
374
+ * extended ringing, the call will fall back to this number. Can be either a Retell
375
+ * phone number or an external number. Cannot be the same as this phone number, and
376
+ * cannot be a number that already has its own fallback configured (prevents nested
377
+ * forwarding).
377
378
  */
378
379
  fallback_number?: string | null;
379
380
 
@@ -385,8 +386,9 @@ export interface PhoneNumberCreateParams {
385
386
  inbound_agents?: Array<PhoneNumberCreateParams.InboundAgent> | null;
386
387
 
387
388
  /**
388
- * If set, will send a webhook for inbound calls, where you can override agent id,
389
- * set dynamic variables and other fields specific to that call.
389
+ * If set, Retell will send a webhook for inbound calls, where you can override the
390
+ * agent ID, set dynamic variables, and configure other fields specific to that
391
+ * call.
390
392
  */
391
393
  inbound_webhook_url?: string | null;
392
394
 
@@ -473,93 +475,76 @@ export namespace PhoneNumberCreateParams {
473
475
  }
474
476
  }
475
477
 
476
- export interface PhoneNumberUpdateParams {
478
+ export interface PhoneNumberImportParams {
477
479
  /**
478
- * List of ISO 3166-1 alpha-2 country codes from which inbound calls are allowed.
479
- * If not set or empty, calls from all countries are allowed.
480
+ * The number you are trying to import in E.164 format of the number (+country
481
+ * code, then number with no space, no special characters), used as the unique
482
+ * identifier for phone number APIs.
480
483
  */
481
- allowed_inbound_country_list?: Array<string> | null;
484
+ phone_number: string;
482
485
 
483
486
  /**
484
- * List of ISO 3166-1 alpha-2 country codes to which outbound calls are allowed. If
485
- * not set or empty, calls to all countries are allowed.
487
+ * The termination uri to uniquely identify your elastic SIP trunk. This is used
488
+ * for outbound calls. For Twilio elastic SIP trunks it always end with
489
+ * ".pstn.twilio.com".
486
490
  */
487
- allowed_outbound_country_list?: Array<string> | null;
491
+ termination_uri: string;
488
492
 
489
493
  /**
490
- * The password used for authentication for the SIP trunk to update for the phone
491
- * number.
494
+ * List of ISO 3166-1 alpha-2 country codes from which inbound calls are allowed.
495
+ * If not set or empty, calls from all countries are allowed.
492
496
  */
493
- auth_password?: string;
497
+ allowed_inbound_country_list?: Array<string> | null;
494
498
 
495
499
  /**
496
- * The username used for authentication for the SIP trunk to update for the phone
497
- * number.
500
+ * List of ISO 3166-1 alpha-2 country codes to which outbound calls are allowed. If
501
+ * not set or empty, calls to all countries are allowed.
498
502
  */
499
- auth_username?: string;
503
+ allowed_outbound_country_list?: Array<string> | null;
500
504
 
501
505
  /**
502
- * Enterprise only. Phone number to transfer inbound calls to when organization is
503
- * in outage mode or when an inbound call cannot get a concurrency slot before the
504
- * fallback timeout. Can be either a Retell phone number or an external number. Set
505
- * to null to remove. Cannot be the same as this phone number, and cannot be a
506
- * number that already has its own fallback configured (prevents nested
507
- * forwarding).
506
+ * If true, E.164 validation for phone_number is skipped. This is useful for
507
+ * internal pseudo numbers when using custom telephony. If omitted, default is
508
+ * true. Must be a boolean literal; string values like "true" or "false" are
509
+ * invalid.
508
510
  */
509
- fallback_number?: string | null;
511
+ ignore_e164_validation?: boolean;
510
512
 
511
513
  /**
512
514
  * Inbound agents to bind to the number with weights. If set and non-empty, one
513
515
  * agent will be picked randomly for each inbound call, with probability
514
516
  * proportional to the weight. Total weights must add up to 1.
515
517
  */
516
- inbound_agents?: Array<PhoneNumberUpdateParams.InboundAgent> | null;
517
-
518
- /**
519
- * Inbound SMS agents to bind to the number with weights. If set and non-empty, one
520
- * agent will be picked randomly for each inbound SMS, with probability
521
- * proportional to the weight. Total weights must add up to 1. If not set or empty,
522
- * fallback to inbound_sms_agent_id.
523
- */
524
- inbound_sms_agents?: Array<PhoneNumberUpdateParams.InboundSMSAgent> | null;
525
-
526
- /**
527
- * If set, will send a webhook for inbound SMS, where you can override agent id,
528
- * set dynamic variables and other fields specific to that chat.
529
- */
530
- inbound_sms_webhook_url?: string | null;
518
+ inbound_agents?: Array<PhoneNumberImportParams.InboundAgent> | null;
531
519
 
532
520
  /**
533
- * If set, will send a webhook for inbound calls, where you can override agent id,
534
- * set dynamic variables and other fields specific to that call.
521
+ * If set, Retell will send a webhook for inbound calls, where you can override the
522
+ * agent ID, set dynamic variables, and configure other fields specific to that
523
+ * call.
535
524
  */
536
525
  inbound_webhook_url?: string | null;
537
526
 
538
527
  /**
539
528
  * Nickname of the number. This is for your reference only.
540
529
  */
541
- nickname?: string | null;
530
+ nickname?: string;
542
531
 
543
532
  /**
544
533
  * Outbound agents to bind to the number with weights. If set and non-empty, one
545
534
  * agent will be picked randomly for each outbound call, with probability
546
535
  * proportional to the weight. Total weights must add up to 1.
547
536
  */
548
- outbound_agents?: Array<PhoneNumberUpdateParams.OutboundAgent> | null;
537
+ outbound_agents?: Array<PhoneNumberImportParams.OutboundAgent> | null;
549
538
 
550
539
  /**
551
- * Outbound SMS agents to bind to the number with weights. If set and non-empty,
552
- * one agent will be picked randomly for each outbound SMS, with probability
553
- * proportional to the weight. Total weights must add up to 1. If not set or empty,
554
- * fallback to outbound_sms_agent_id.
540
+ * The password used for authentication for the SIP trunk.
555
541
  */
556
- outbound_sms_agents?: Array<PhoneNumberUpdateParams.OutboundSMSAgent> | null;
542
+ sip_trunk_auth_password?: string;
557
543
 
558
544
  /**
559
- * The termination uri to update for the phone number. This is used for outbound
560
- * calls.
545
+ * The username used for authentication for the SIP trunk.
561
546
  */
562
- termination_uri?: string;
547
+ sip_trunk_auth_username?: string;
563
548
 
564
549
  /**
565
550
  * Outbound transport protocol to update for the phone number. Valid values are
@@ -568,7 +553,7 @@ export interface PhoneNumberUpdateParams {
568
553
  transport?: string | null;
569
554
  }
570
555
 
571
- export namespace PhoneNumberUpdateParams {
556
+ export namespace PhoneNumberImportParams {
572
557
  export interface InboundAgent {
573
558
  agent_id: string;
574
559
 
@@ -592,29 +577,6 @@ export namespace PhoneNumberUpdateParams {
592
577
  agent_version?: number | string;
593
578
  }
594
579
 
595
- export interface InboundSMSAgent {
596
- agent_id: string;
597
-
598
- /**
599
- * The weight of the agent. When used in a list of agents, the total weights must
600
- * add up to 1.
601
- */
602
- weight: number;
603
-
604
- /**
605
- * Agent version reference. Supports a numeric version (for example 3) or a
606
- * tag/environment name (for example "prod"). The string "latest" resolves to the
607
- * most recently created version (the largest version number), and
608
- * "latest_published" resolves to the most recently published version. When a tag
609
- * is provided, resolution uses that exact tag assignment (including its dynamic
610
- * variables). If the tag exists but is currently unassigned, it resolves to
611
- * latest. When a numeric version, latest, or latest_published is provided,
612
- * resolution applies dynamic variables from the preferred tag for that resolved
613
- * version (most recently assigned), if any.
614
- */
615
- agent_version?: number | string;
616
- }
617
-
618
580
  export interface OutboundAgent {
619
581
  agent_id: string;
620
582
 
@@ -637,29 +599,6 @@ export namespace PhoneNumberUpdateParams {
637
599
  */
638
600
  agent_version?: number | string;
639
601
  }
640
-
641
- export interface OutboundSMSAgent {
642
- agent_id: string;
643
-
644
- /**
645
- * The weight of the agent. When used in a list of agents, the total weights must
646
- * add up to 1.
647
- */
648
- weight: number;
649
-
650
- /**
651
- * Agent version reference. Supports a numeric version (for example 3) or a
652
- * tag/environment name (for example "prod"). The string "latest" resolves to the
653
- * most recently created version (the largest version number), and
654
- * "latest_published" resolves to the most recently published version. When a tag
655
- * is provided, resolution uses that exact tag assignment (including its dynamic
656
- * variables). If the tag exists but is currently unassigned, it resolves to
657
- * latest. When a numeric version, latest, or latest_published is provided,
658
- * resolution applies dynamic variables from the preferred tag for that resolved
659
- * version (most recently assigned), if any.
660
- */
661
- agent_version?: number | string;
662
- }
663
602
  }
664
603
 
665
604
  export interface PhoneNumberListParams {
@@ -679,21 +618,7 @@ export interface PhoneNumberListParams {
679
618
  sort_order?: 'ascending' | 'descending';
680
619
  }
681
620
 
682
- export interface PhoneNumberImportParams {
683
- /**
684
- * The number you are trying to import in E.164 format of the number (+country
685
- * code, then number with no space, no special characters), used as the unique
686
- * identifier for phone number APIs.
687
- */
688
- phone_number: string;
689
-
690
- /**
691
- * The termination uri to uniquely identify your elastic SIP trunk. This is used
692
- * for outbound calls. For Twilio elastic SIP trunks it always end with
693
- * ".pstn.twilio.com".
694
- */
695
- termination_uri: string;
696
-
621
+ export interface PhoneNumberUpdateParams {
697
622
  /**
698
623
  * List of ISO 3166-1 alpha-2 country codes from which inbound calls are allowed.
699
624
  * If not set or empty, calls from all countries are allowed.
@@ -707,47 +632,80 @@ export interface PhoneNumberImportParams {
707
632
  allowed_outbound_country_list?: Array<string> | null;
708
633
 
709
634
  /**
710
- * If true, E.164 validation for phone_number is skipped. This is useful for
711
- * internal pseudo numbers when using custom telephony. If omitted, default is
712
- * true. Must be a boolean literal; string values like "true" or "false" are
713
- * invalid.
635
+ * The password used for authentication for the SIP trunk to update for the phone
636
+ * number.
714
637
  */
715
- ignore_e164_validation?: boolean;
638
+ auth_password?: string;
639
+
640
+ /**
641
+ * The username used for authentication for the SIP trunk to update for the phone
642
+ * number.
643
+ */
644
+ auth_username?: string;
645
+
646
+ /**
647
+ * When inbound call concurrency is reached and a slot does not free up after
648
+ * extended ringing, the call will fall back to this number. Can be either a Retell
649
+ * phone number or an external number. Set to null to remove. Cannot be the same as
650
+ * this phone number, and cannot be a number that already has its own fallback
651
+ * configured (prevents nested forwarding).
652
+ */
653
+ fallback_number?: string | null;
716
654
 
717
655
  /**
718
656
  * Inbound agents to bind to the number with weights. If set and non-empty, one
719
657
  * agent will be picked randomly for each inbound call, with probability
720
658
  * proportional to the weight. Total weights must add up to 1.
721
659
  */
722
- inbound_agents?: Array<PhoneNumberImportParams.InboundAgent> | null;
660
+ inbound_agents?: Array<PhoneNumberUpdateParams.InboundAgent> | null;
723
661
 
724
662
  /**
725
- * If set, will send a webhook for inbound calls, where you can override agent id,
726
- * set dynamic variables and other fields specific to that call.
663
+ * Inbound SMS agents to bind to the number with weights. If set and non-empty, one
664
+ * agent will be picked randomly for each inbound SMS, with probability
665
+ * proportional to the weight. Total weights must add up to 1. If not set or empty,
666
+ * fallback to inbound_sms_agent_id.
667
+ */
668
+ inbound_sms_agents?: Array<PhoneNumberUpdateParams.InboundSMSAgent> | null;
669
+
670
+ /**
671
+ * If set, Retell will send a webhook for inbound SMS, where you can override the
672
+ * agent ID, set dynamic variables, and configure other fields specific to that
673
+ * chat.
674
+ */
675
+ inbound_sms_webhook_url?: string | null;
676
+
677
+ /**
678
+ * If set, Retell will send a webhook for inbound calls, where you can override the
679
+ * agent ID, set dynamic variables, and configure other fields specific to that
680
+ * call.
727
681
  */
728
682
  inbound_webhook_url?: string | null;
729
683
 
730
684
  /**
731
685
  * Nickname of the number. This is for your reference only.
732
686
  */
733
- nickname?: string;
687
+ nickname?: string | null;
734
688
 
735
689
  /**
736
690
  * Outbound agents to bind to the number with weights. If set and non-empty, one
737
691
  * agent will be picked randomly for each outbound call, with probability
738
692
  * proportional to the weight. Total weights must add up to 1.
739
693
  */
740
- outbound_agents?: Array<PhoneNumberImportParams.OutboundAgent> | null;
694
+ outbound_agents?: Array<PhoneNumberUpdateParams.OutboundAgent> | null;
741
695
 
742
696
  /**
743
- * The password used for authentication for the SIP trunk.
697
+ * Outbound SMS agents to bind to the number with weights. If set and non-empty,
698
+ * one agent will be picked randomly for each outbound SMS, with probability
699
+ * proportional to the weight. Total weights must add up to 1. If not set or empty,
700
+ * fallback to outbound_sms_agent_id.
744
701
  */
745
- sip_trunk_auth_password?: string;
702
+ outbound_sms_agents?: Array<PhoneNumberUpdateParams.OutboundSMSAgent> | null;
746
703
 
747
704
  /**
748
- * The username used for authentication for the SIP trunk.
705
+ * The termination uri to update for the phone number. This is used for outbound
706
+ * calls.
749
707
  */
750
- sip_trunk_auth_username?: string;
708
+ termination_uri?: string;
751
709
 
752
710
  /**
753
711
  * Outbound transport protocol to update for the phone number. Valid values are
@@ -756,7 +714,7 @@ export interface PhoneNumberImportParams {
756
714
  transport?: string | null;
757
715
  }
758
716
 
759
- export namespace PhoneNumberImportParams {
717
+ export namespace PhoneNumberUpdateParams {
760
718
  export interface InboundAgent {
761
719
  agent_id: string;
762
720
 
@@ -780,6 +738,29 @@ export namespace PhoneNumberImportParams {
780
738
  agent_version?: number | string;
781
739
  }
782
740
 
741
+ export interface InboundSMSAgent {
742
+ agent_id: string;
743
+
744
+ /**
745
+ * The weight of the agent. When used in a list of agents, the total weights must
746
+ * add up to 1.
747
+ */
748
+ weight: number;
749
+
750
+ /**
751
+ * Agent version reference. Supports a numeric version (for example 3) or a
752
+ * tag/environment name (for example "prod"). The string "latest" resolves to the
753
+ * most recently created version (the largest version number), and
754
+ * "latest_published" resolves to the most recently published version. When a tag
755
+ * is provided, resolution uses that exact tag assignment (including its dynamic
756
+ * variables). If the tag exists but is currently unassigned, it resolves to
757
+ * latest. When a numeric version, latest, or latest_published is provided,
758
+ * resolution applies dynamic variables from the preferred tag for that resolved
759
+ * version (most recently assigned), if any.
760
+ */
761
+ agent_version?: number | string;
762
+ }
763
+
783
764
  export interface OutboundAgent {
784
765
  agent_id: string;
785
766
 
@@ -802,6 +783,29 @@ export namespace PhoneNumberImportParams {
802
783
  */
803
784
  agent_version?: number | string;
804
785
  }
786
+
787
+ export interface OutboundSMSAgent {
788
+ agent_id: string;
789
+
790
+ /**
791
+ * The weight of the agent. When used in a list of agents, the total weights must
792
+ * add up to 1.
793
+ */
794
+ weight: number;
795
+
796
+ /**
797
+ * Agent version reference. Supports a numeric version (for example 3) or a
798
+ * tag/environment name (for example "prod"). The string "latest" resolves to the
799
+ * most recently created version (the largest version number), and
800
+ * "latest_published" resolves to the most recently published version. When a tag
801
+ * is provided, resolution uses that exact tag assignment (including its dynamic
802
+ * variables). If the tag exists but is currently unassigned, it resolves to
803
+ * latest. When a numeric version, latest, or latest_published is provided,
804
+ * resolution applies dynamic variables from the preferred tag for that resolved
805
+ * version (most recently assigned), if any.
806
+ */
807
+ agent_version?: number | string;
808
+ }
805
809
  }
806
810
 
807
811
  export declare namespace PhoneNumber {
@@ -809,8 +813,8 @@ export declare namespace PhoneNumber {
809
813
  type PhoneNumberResponse as PhoneNumberResponse,
810
814
  type PhoneNumberListResponse as PhoneNumberListResponse,
811
815
  type PhoneNumberCreateParams as PhoneNumberCreateParams,
812
- type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
813
- type PhoneNumberListParams as PhoneNumberListParams,
814
816
  type PhoneNumberImportParams as PhoneNumberImportParams,
817
+ type PhoneNumberListParams as PhoneNumberListParams,
818
+ type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
815
819
  };
816
820
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.32.4'; // x-release-please-version
1
+ export const VERSION = '5.33.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.32.4";
1
+ export declare const VERSION = "5.33.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.32.4";
1
+ export declare const VERSION = "5.33.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '5.32.4'; // x-release-please-version
4
+ exports.VERSION = '5.33.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.32.4'; // x-release-please-version
1
+ export const VERSION = '5.33.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map