agentphone 1.0.8 → 1.0.10

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 (104) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +17 -12
  4. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/agentSignup/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  7. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  8. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/calls/client/Client.d.ts +20 -0
  11. package/dist/cjs/api/resources/calls/client/Client.js +56 -0
  12. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.js +3 -0
  14. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/contactCards/client/Client.d.ts +61 -0
  16. package/dist/cjs/api/resources/contactCards/client/Client.js +229 -0
  17. package/dist/cjs/api/resources/contactCards/client/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/contactCards/client/index.js +17 -0
  19. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +16 -0
  20. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.js +3 -0
  21. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js +3 -0
  23. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.ts +9 -0
  24. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.js +3 -0
  25. package/dist/cjs/api/resources/contactCards/client/requests/index.d.ts +3 -0
  26. package/dist/cjs/api/resources/contactCards/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/contactCards/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/contactCards/index.js +17 -0
  29. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
  30. package/dist/cjs/api/resources/conversations/client/Client.js +1 -0
  31. package/dist/cjs/api/resources/index.d.ts +2 -0
  32. package/dist/cjs/api/resources/index.js +3 -1
  33. package/dist/cjs/api/resources/messages/client/Client.d.ts +10 -11
  34. package/dist/cjs/api/resources/messages/client/Client.js +10 -11
  35. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +20 -0
  36. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +19 -0
  37. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +15 -2
  38. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +13 -0
  39. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +2 -2
  40. package/dist/cjs/api/resources/messages/client/requests/index.js +5 -0
  41. package/dist/cjs/api/resources/numbers/client/Client.d.ts +4 -4
  42. package/dist/cjs/api/resources/numbers/client/Client.js +4 -4
  43. package/dist/cjs/api/types/AgentResponse.d.ts +1 -0
  44. package/dist/cjs/api/types/ContactCardResponse.d.ts +6 -0
  45. package/dist/cjs/api/types/ContactCardResponse.js +3 -0
  46. package/dist/cjs/api/types/index.d.ts +1 -0
  47. package/dist/cjs/api/types/index.js +1 -0
  48. package/dist/cjs/environments.d.ts +1 -1
  49. package/dist/cjs/environments.js +1 -1
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/BaseClient.mjs +2 -2
  53. package/dist/esm/Client.d.mts +3 -0
  54. package/dist/esm/Client.mjs +5 -0
  55. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +1 -1
  56. package/dist/esm/api/resources/agentSignup/client/Client.mjs +1 -1
  57. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  58. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  59. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
  60. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
  61. package/dist/esm/api/resources/calls/client/Client.d.mts +20 -0
  62. package/dist/esm/api/resources/calls/client/Client.mjs +56 -0
  63. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.mts +9 -0
  64. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.mjs +2 -0
  65. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  66. package/dist/esm/api/resources/contactCards/client/Client.d.mts +61 -0
  67. package/dist/esm/api/resources/contactCards/client/Client.mjs +192 -0
  68. package/dist/esm/api/resources/contactCards/client/index.d.mts +1 -0
  69. package/dist/esm/api/resources/contactCards/client/index.mjs +1 -0
  70. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +16 -0
  71. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.mjs +2 -0
  72. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.mts +9 -0
  73. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs +2 -0
  74. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.mts +9 -0
  75. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs +2 -0
  76. package/dist/esm/api/resources/contactCards/client/requests/index.d.mts +3 -0
  77. package/dist/esm/api/resources/contactCards/client/requests/index.mjs +1 -0
  78. package/dist/esm/api/resources/contactCards/index.d.mts +1 -0
  79. package/dist/esm/api/resources/contactCards/index.mjs +1 -0
  80. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
  81. package/dist/esm/api/resources/conversations/client/Client.mjs +1 -0
  82. package/dist/esm/api/resources/index.d.mts +2 -0
  83. package/dist/esm/api/resources/index.mjs +2 -0
  84. package/dist/esm/api/resources/messages/client/Client.d.mts +10 -11
  85. package/dist/esm/api/resources/messages/client/Client.mjs +10 -11
  86. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +20 -0
  87. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +18 -1
  88. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +15 -2
  89. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +12 -1
  90. package/dist/esm/api/resources/messages/client/requests/index.d.mts +2 -2
  91. package/dist/esm/api/resources/messages/client/requests/index.mjs +2 -1
  92. package/dist/esm/api/resources/numbers/client/Client.d.mts +4 -4
  93. package/dist/esm/api/resources/numbers/client/Client.mjs +4 -4
  94. package/dist/esm/api/types/AgentResponse.d.mts +1 -0
  95. package/dist/esm/api/types/ContactCardResponse.d.mts +6 -0
  96. package/dist/esm/api/types/ContactCardResponse.mjs +2 -0
  97. package/dist/esm/api/types/index.d.mts +1 -0
  98. package/dist/esm/api/types/index.mjs +1 -0
  99. package/dist/esm/environments.d.mts +1 -1
  100. package/dist/esm/environments.mjs +1 -1
  101. package/dist/esm/version.d.mts +1 -1
  102. package/dist/esm/version.mjs +1 -1
  103. package/package.json +1 -1
  104. package/reference.md +286 -17
@@ -0,0 +1,3 @@
1
+ export type { ContactCardWriteRequest } from "./ContactCardWriteRequest.js";
2
+ export type { DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest } from "./DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js";
3
+ export type { GetContactCardV1NumbersNumberIdContactCardGetRequest } from "./GetContactCardV1NumbersNumberIdContactCardGetRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -14,6 +14,7 @@ export declare class ConversationsClient {
14
14
  * List all conversations for this account.
15
15
  *
16
16
  * Sorted by most recent activity (lastMessageAt desc).
17
+ * Also includes conversations on shared lines owned by this account.
17
18
  *
18
19
  * @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
19
20
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -70,6 +70,7 @@ class ConversationsClient {
70
70
  * List all conversations for this account.
71
71
  *
72
72
  * Sorted by most recent activity (lastMessageAt desc).
73
+ * Also includes conversations on shared lines owned by this account.
73
74
  *
74
75
  * @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
75
76
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -6,6 +6,8 @@ export * from "./agentWebhooks/client/requests/index.js";
6
6
  export * as agentWebhooks from "./agentWebhooks/index.js";
7
7
  export * from "./calls/client/requests/index.js";
8
8
  export * as calls from "./calls/index.js";
9
+ export * from "./contactCards/client/requests/index.js";
10
+ export * as contactCards from "./contactCards/index.js";
9
11
  export * from "./contacts/client/requests/index.js";
10
12
  export * as contacts from "./contacts/index.js";
11
13
  export * from "./conversations/client/requests/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
39
+ exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
40
40
  __exportStar(require("./agentSignup/client/requests/index.js"), exports);
41
41
  exports.agentSignup = __importStar(require("./agentSignup/index.js"));
42
42
  __exportStar(require("./agents/client/requests/index.js"), exports);
@@ -45,6 +45,8 @@ __exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
45
45
  exports.agentWebhooks = __importStar(require("./agentWebhooks/index.js"));
46
46
  __exportStar(require("./calls/client/requests/index.js"), exports);
47
47
  exports.calls = __importStar(require("./calls/index.js"));
48
+ __exportStar(require("./contactCards/client/requests/index.js"), exports);
49
+ exports.contactCards = __importStar(require("./contactCards/index.js"));
48
50
  __exportStar(require("./contacts/client/requests/index.js"), exports);
49
51
  exports.contacts = __importStar(require("./contacts/index.js"));
50
52
  __exportStar(require("./conversations/client/requests/index.js"), exports);
@@ -13,7 +13,11 @@ export declare class MessagesClient {
13
13
  /**
14
14
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
15
15
  *
16
- * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
16
+ * Attach media by passing public HTTPS URLs in `media_urls`.
17
+ *
18
+ * ### Single attachment
19
+ *
20
+ * Pass a single-item array in `media_urls`. The URL must be publicly accessible.
17
21
  *
18
22
  * ### Carousel / multi-image (iMessage)
19
23
  *
@@ -23,13 +27,7 @@ export declare class MessagesClient {
23
27
  * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
24
28
  * - Only supported on iMessage-capable lines
25
29
  *
26
- * ### Single attachment
27
- *
28
- * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
29
- *
30
- * ### Multi-attachment (iMessage)
31
- *
32
- * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
30
+ * > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
33
31
  *
34
32
  * @param {AgentPhone.SendMessageRequest} request
35
33
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -48,8 +46,9 @@ export declare class MessagesClient {
48
46
  /**
49
47
  * Send a tapback reaction to a message (iMessage only).
50
48
  *
51
- * Reactions are an iMessage feature. Attempting to react to a message
52
- * sent via an SMS/Twilio number will return a clear error.
49
+ * Reactions are available only for iMessage messages. Attempting to react
50
+ * to an SMS message or another channel that does not support tapbacks
51
+ * returns a clear error.
53
52
  *
54
53
  * @param {AgentPhone.SendReactionRequest} request
55
54
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -59,7 +58,7 @@ export declare class MessagesClient {
59
58
  * @example
60
59
  * await client.messages.sendReaction({
61
60
  * message_id: "message_id",
62
- * reaction: "reaction"
61
+ * reaction: "love"
63
62
  * })
64
63
  */
65
64
  sendReaction(request: AgentPhone.SendReactionRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendReactionResponse>;
@@ -69,7 +69,11 @@ class MessagesClient {
69
69
  /**
70
70
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
71
71
  *
72
- * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
72
+ * Attach media by passing public HTTPS URLs in `media_urls`.
73
+ *
74
+ * ### Single attachment
75
+ *
76
+ * Pass a single-item array in `media_urls`. The URL must be publicly accessible.
73
77
  *
74
78
  * ### Carousel / multi-image (iMessage)
75
79
  *
@@ -79,13 +83,7 @@ class MessagesClient {
79
83
  * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
80
84
  * - Only supported on iMessage-capable lines
81
85
  *
82
- * ### Single attachment
83
- *
84
- * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
85
- *
86
- * ### Multi-attachment (iMessage)
87
- *
88
- * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
86
+ * > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
89
87
  *
90
88
  * @param {AgentPhone.SendMessageRequest} request
91
89
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -142,8 +140,9 @@ class MessagesClient {
142
140
  /**
143
141
  * Send a tapback reaction to a message (iMessage only).
144
142
  *
145
- * Reactions are an iMessage feature. Attempting to react to a message
146
- * sent via an SMS/Twilio number will return a clear error.
143
+ * Reactions are available only for iMessage messages. Attempting to react
144
+ * to an SMS message or another channel that does not support tapbacks
145
+ * returns a clear error.
147
146
  *
148
147
  * @param {AgentPhone.SendReactionRequest} request
149
148
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -153,7 +152,7 @@ class MessagesClient {
153
152
  * @example
154
153
  * await client.messages.sendReaction({
155
154
  * message_id: "message_id",
156
- * reaction: "reaction"
155
+ * reaction: "love"
157
156
  * })
158
157
  */
159
158
  sendReaction(request, requestOptions) {
@@ -13,4 +13,24 @@ export interface SendMessageRequest {
13
13
  media_url?: string | null;
14
14
  media_urls?: string[] | null;
15
15
  number_id?: string | null;
16
+ /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
17
+ send_style?: SendMessageRequest.SendStyle;
18
+ }
19
+ export declare namespace SendMessageRequest {
20
+ /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
21
+ const SendStyle: {
22
+ readonly Celebration: "celebration";
23
+ readonly Fireworks: "fireworks";
24
+ readonly Lasers: "lasers";
25
+ readonly Love: "love";
26
+ readonly Confetti: "confetti";
27
+ readonly Balloons: "balloons";
28
+ readonly Spotlight: "spotlight";
29
+ readonly Echo: "echo";
30
+ readonly Invisible: "invisible";
31
+ readonly Gentle: "gentle";
32
+ readonly Loud: "loud";
33
+ readonly Slam: "slam";
34
+ };
35
+ type SendStyle = (typeof SendStyle)[keyof typeof SendStyle];
16
36
  }
@@ -1,3 +1,22 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SendMessageRequest = void 0;
5
+ var SendMessageRequest;
6
+ (function (SendMessageRequest) {
7
+ /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
8
+ SendMessageRequest.SendStyle = {
9
+ Celebration: "celebration",
10
+ Fireworks: "fireworks",
11
+ Lasers: "lasers",
12
+ Love: "love",
13
+ Confetti: "confetti",
14
+ Balloons: "balloons",
15
+ Spotlight: "spotlight",
16
+ Echo: "echo",
17
+ Invisible: "invisible",
18
+ Gentle: "gentle",
19
+ Loud: "loud",
20
+ Slam: "slam",
21
+ };
22
+ })(SendMessageRequest || (exports.SendMessageRequest = SendMessageRequest = {}));
@@ -2,10 +2,23 @@
2
2
  * @example
3
3
  * {
4
4
  * message_id: "message_id",
5
- * reaction: "reaction"
5
+ * reaction: "love"
6
6
  * }
7
7
  */
8
8
  export interface SendReactionRequest {
9
9
  message_id: string;
10
- reaction: string;
10
+ /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
11
+ reaction: SendReactionRequest.Reaction;
12
+ }
13
+ export declare namespace SendReactionRequest {
14
+ /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
15
+ const Reaction: {
16
+ readonly Love: "love";
17
+ readonly Like: "like";
18
+ readonly Dislike: "dislike";
19
+ readonly Laugh: "laugh";
20
+ readonly Emphasize: "emphasize";
21
+ readonly Question: "question";
22
+ };
23
+ type Reaction = (typeof Reaction)[keyof typeof Reaction];
11
24
  }
@@ -1,3 +1,16 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SendReactionRequest = void 0;
5
+ var SendReactionRequest;
6
+ (function (SendReactionRequest) {
7
+ /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
8
+ SendReactionRequest.Reaction = {
9
+ Love: "love",
10
+ Like: "like",
11
+ Dislike: "dislike",
12
+ Laugh: "laugh",
13
+ Emphasize: "emphasize",
14
+ Question: "question",
15
+ };
16
+ })(SendReactionRequest || (exports.SendReactionRequest = SendReactionRequest = {}));
@@ -1,2 +1,2 @@
1
- export type { SendMessageRequest } from "./SendMessageRequest.js";
2
- export type { SendReactionRequest } from "./SendReactionRequest.js";
1
+ export { SendMessageRequest } from "./SendMessageRequest.js";
2
+ export { SendReactionRequest } from "./SendReactionRequest.js";
@@ -1,2 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendReactionRequest = exports.SendMessageRequest = void 0;
4
+ var SendMessageRequest_js_1 = require("./SendMessageRequest.js");
5
+ Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return SendMessageRequest_js_1.SendMessageRequest; } });
6
+ var SendReactionRequest_js_1 = require("./SendReactionRequest.js");
7
+ Object.defineProperty(exports, "SendReactionRequest", { enumerable: true, get: function () { return SendReactionRequest_js_1.SendReactionRequest; } });
@@ -27,10 +27,10 @@ export declare class NumbersClient {
27
27
  * Provision a new SMS-enabled phone number.
28
28
  *
29
29
  * 1. Check number limit (lifetime limit)
30
- * 2. Search Twilio for available numbers
30
+ * 2. Search the account's configured SMS provider for available numbers
31
31
  * 3. Purchase the first available one
32
- * 4. Configure webhook URL
33
- * 5. Store in our database
32
+ * 4. Configure messaging and voice routing
33
+ * 5. Store the number in our database
34
34
  *
35
35
  * @param {AgentPhone.CreateNumberRequest} request
36
36
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -63,7 +63,7 @@ export declare class NumbersClient {
63
63
  * Release (delete) a phone number.
64
64
  *
65
65
  * This will:
66
- * 1. Release the number from Twilio (number goes back to Twilio's pool)
66
+ * 1. Release the number from its upstream provider when supported
67
67
  * 2. Mark the number as "released" in the database
68
68
  * 3. Keep all messages and conversation history (for audit purposes)
69
69
  *
@@ -112,10 +112,10 @@ class NumbersClient {
112
112
  * Provision a new SMS-enabled phone number.
113
113
  *
114
114
  * 1. Check number limit (lifetime limit)
115
- * 2. Search Twilio for available numbers
115
+ * 2. Search the account's configured SMS provider for available numbers
116
116
  * 3. Purchase the first available one
117
- * 4. Configure webhook URL
118
- * 5. Store in our database
117
+ * 4. Configure messaging and voice routing
118
+ * 5. Store the number in our database
119
119
  *
120
120
  * @param {AgentPhone.CreateNumberRequest} request
121
121
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -227,7 +227,7 @@ class NumbersClient {
227
227
  * Release (delete) a phone number.
228
228
  *
229
229
  * This will:
230
- * 1. Release the number from Twilio (number goes back to Twilio's pool)
230
+ * 1. Release the number from its upstream provider when supported
231
231
  * 2. Mark the number as "released" in the database
232
232
  * 3. Keep all messages and conversation history (for audit purposes)
233
233
  *
@@ -4,6 +4,7 @@ export interface AgentResponse {
4
4
  name: string;
5
5
  description: string | null;
6
6
  voiceMode: AgentResponse.VoiceMode;
7
+ enableMessaging?: boolean;
7
8
  modelTier?: AgentResponse.ModelTier;
8
9
  systemPrompt?: string | null;
9
10
  beginMessage?: string | null;
@@ -0,0 +1,6 @@
1
+ export interface ContactCardResponse {
2
+ firstName?: string | null;
3
+ lastName?: string | null;
4
+ displayName?: string | null;
5
+ hasAvatar?: boolean;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,6 +11,7 @@ export * from "./AppRoutesConversationsConversationSummary.js";
11
11
  export * from "./AttachNumberResponse.js";
12
12
  export * from "./CallListResponse.js";
13
13
  export * from "./CallSummary.js";
14
+ export * from "./ContactCardResponse.js";
14
15
  export * from "./ContactListResponse.js";
15
16
  export * from "./ContactResponse.js";
16
17
  export * from "./ConversationDetail.js";
@@ -27,6 +27,7 @@ __exportStar(require("./AppRoutesConversationsConversationSummary.js"), exports)
27
27
  __exportStar(require("./AttachNumberResponse.js"), exports);
28
28
  __exportStar(require("./CallListResponse.js"), exports);
29
29
  __exportStar(require("./CallSummary.js"), exports);
30
+ __exportStar(require("./ContactCardResponse.js"), exports);
30
31
  __exportStar(require("./ContactListResponse.js"), exports);
31
32
  __exportStar(require("./ContactResponse.js"), exports);
32
33
  __exportStar(require("./ConversationDetail.js"), exports);
@@ -1,4 +1,4 @@
1
1
  export declare const AgentPhoneEnvironment: {
2
- readonly Production: "https://api.agentphone.to";
2
+ readonly Production: "https://api.agentphone.ai";
3
3
  };
4
4
  export type AgentPhoneEnvironment = typeof AgentPhoneEnvironment.Production;
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.AgentPhoneEnvironment = void 0;
5
5
  exports.AgentPhoneEnvironment = {
6
- Production: "https://api.agentphone.to",
6
+ Production: "https://api.agentphone.ai",
7
7
  };
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.7";
1
+ export declare const SDK_VERSION = "1.0.10";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.7";
4
+ exports.SDK_VERSION = "1.0.10";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.7",
10
- "User-Agent": "agentphone/1.0.7",
9
+ "X-Fern-SDK-Version": "1.0.10",
10
+ "User-Agent": "agentphone/1.0.10",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -2,6 +2,7 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
2
2
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
3
3
  import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
4
4
  import { CallsClient } from "./api/resources/calls/client/Client.mjs";
5
+ import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
5
6
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
6
7
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
7
8
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
@@ -27,6 +28,7 @@ export declare class AgentPhoneClient {
27
28
  protected _calls: CallsClient | undefined;
28
29
  protected _usage: UsageClient | undefined;
29
30
  protected _messages: MessagesClient | undefined;
31
+ protected _contactCards: ContactCardsClient | undefined;
30
32
  constructor(options?: AgentPhoneClient.Options);
31
33
  get agentSignup(): AgentSignupClient;
32
34
  get agents(): AgentsClient;
@@ -38,4 +40,5 @@ export declare class AgentPhoneClient {
38
40
  get calls(): CallsClient;
39
41
  get usage(): UsageClient;
40
42
  get messages(): MessagesClient;
43
+ get contactCards(): ContactCardsClient;
41
44
  }
@@ -3,6 +3,7 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
3
3
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
4
4
  import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
5
5
  import { CallsClient } from "./api/resources/calls/client/Client.mjs";
6
+ import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
6
7
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
7
8
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
8
9
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
@@ -54,4 +55,8 @@ export class AgentPhoneClient {
54
55
  var _a;
55
56
  return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new MessagesClient(this._options)));
56
57
  }
58
+ get contactCards() {
59
+ var _a;
60
+ return ((_a = this._contactCards) !== null && _a !== void 0 ? _a : (this._contactCards = new ContactCardsClient(this._options)));
61
+ }
57
62
  }
@@ -31,7 +31,7 @@ export declare class AgentSignupClient {
31
31
  /**
32
32
  * Verify the OTP and atomically provision everything.
33
33
  *
34
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
34
+ * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
35
35
  * + first-month charge + API key. Returns the key once — agents must save it.
36
36
  *
37
37
  * @param {AgentPhone.AgentVerifyRequest} request
@@ -77,7 +77,7 @@ export class AgentSignupClient {
77
77
  /**
78
78
  * Verify the OTP and atomically provision everything.
79
79
  *
80
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
80
+ * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
81
81
  * + first-month charge + API key. Returns the key once — agents must save it.
82
82
  *
83
83
  * @param {AgentPhone.AgentVerifyRequest} request
@@ -11,7 +11,7 @@ export declare class AgentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
12
12
  constructor(options?: AgentsClient.Options);
13
13
  /**
14
- * Return available voices for voice calls.
14
+ * Return available voices from the call provider (Retell).
15
15
  *
16
16
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
@@ -31,7 +31,7 @@ export class AgentsClient {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
34
- * Return available voices for voice calls.
34
+ * Return available voices from the call provider (Retell).
35
35
  *
36
36
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
37
37
  *
@@ -8,6 +8,8 @@ export interface CreateAgentRequest {
8
8
  name: string;
9
9
  description?: string | null;
10
10
  voiceMode?: CreateAgentRequest.VoiceMode;
11
+ /** When true, hosted-mode agents can send and read SMS/iMessage during calls. Defaults to true. */
12
+ enableMessaging?: boolean | null;
11
13
  modelTier?: CreateAgentRequest.ModelTier;
12
14
  systemPrompt?: string | null;
13
15
  beginMessage?: string | null;
@@ -9,6 +9,8 @@ export interface UpdateAgentRequest {
9
9
  name?: string | null;
10
10
  description?: string | null;
11
11
  voiceMode?: UpdateAgentRequest.VoiceMode;
12
+ /** When true, hosted-mode agents can send and read SMS/iMessage during calls. */
13
+ enableMessaging?: boolean | null;
12
14
  modelTier?: UpdateAgentRequest.ModelTier;
13
15
  systemPrompt?: string | null;
14
16
  beginMessage?: string | null;
@@ -90,6 +90,26 @@ export declare class CallsClient {
90
90
  */
91
91
  getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
92
92
  private __getCall;
93
+ /**
94
+ * Terminate an ongoing call.
95
+ *
96
+ * Works for both hosted-mode and webhook-mode calls. The call_ended
97
+ * webhook from Retell updates status/endedAt asynchronously, so this
98
+ * endpoint returns the current call as soon as the stop request is
99
+ * accepted by Retell.
100
+ *
101
+ * @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
102
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
103
+ *
104
+ * @throws {@link AgentPhone.UnprocessableEntityError}
105
+ *
106
+ * @example
107
+ * await client.calls.endCall({
108
+ * call_id: "call_id"
109
+ * })
110
+ */
111
+ endCall(request: AgentPhone.EndCallV1CallsCallIdEndPostRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
112
+ private __endCall;
93
113
  /**
94
114
  * Returns the audio file (WAV format) for a completed call.
95
115
  *
@@ -255,6 +255,62 @@ export class CallsClient {
255
255
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
256
256
  });
257
257
  }
258
+ /**
259
+ * Terminate an ongoing call.
260
+ *
261
+ * Works for both hosted-mode and webhook-mode calls. The call_ended
262
+ * webhook from Retell updates status/endedAt asynchronously, so this
263
+ * endpoint returns the current call as soon as the stop request is
264
+ * accepted by Retell.
265
+ *
266
+ * @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
267
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
268
+ *
269
+ * @throws {@link AgentPhone.UnprocessableEntityError}
270
+ *
271
+ * @example
272
+ * await client.calls.endCall({
273
+ * call_id: "call_id"
274
+ * })
275
+ */
276
+ endCall(request, requestOptions) {
277
+ return core.HttpResponsePromise.fromPromise(this.__endCall(request, requestOptions));
278
+ }
279
+ __endCall(request, requestOptions) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
282
+ const { call_id: callId } = request;
283
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
284
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _response = yield core.fetcher({
286
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/end`),
287
+ method: "POST",
288
+ headers: _headers,
289
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
290
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
291
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
292
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
293
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
294
+ logging: this._options.logging,
295
+ });
296
+ if (_response.ok) {
297
+ return { data: _response.body, rawResponse: _response.rawResponse };
298
+ }
299
+ if (_response.error.reason === "status-code") {
300
+ switch (_response.error.statusCode) {
301
+ case 422:
302
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
303
+ default:
304
+ throw new errors.AgentPhoneError({
305
+ statusCode: _response.error.statusCode,
306
+ body: _response.error.body,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ }
311
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/calls/{call_id}/end");
312
+ });
313
+ }
258
314
  /**
259
315
  * Returns the audio file (WAV format) for a completed call.
260
316
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * call_id: "call_id"
5
+ * }
6
+ */
7
+ export interface EndCallV1CallsCallIdEndPostRequest {
8
+ call_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,5 +1,6 @@
1
1
  export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.mjs";
2
2
  export type { CreateWebCallRequest } from "./CreateWebCallRequest.mjs";
3
+ export type { EndCallV1CallsCallIdEndPostRequest } from "./EndCallV1CallsCallIdEndPostRequest.mjs";
3
4
  export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs";
4
5
  export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.mjs";
5
6
  export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.mjs";