agentphone 1.0.13 → 1.0.15

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 (86) 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/contactCards/client/Client.d.ts +1 -4
  5. package/dist/cjs/api/resources/contactCards/client/Client.js +1 -4
  6. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +4 -7
  7. package/dist/cjs/api/resources/conversations/client/Client.d.ts +8 -6
  8. package/dist/cjs/api/resources/conversations/client/Client.js +8 -6
  9. package/dist/cjs/api/resources/conversations/client/requests/UpdateConversationRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/index.d.ts +2 -0
  11. package/dist/cjs/api/resources/index.js +3 -1
  12. package/dist/cjs/api/resources/location/client/Client.d.ts +34 -0
  13. package/dist/cjs/api/resources/location/client/Client.js +146 -0
  14. package/dist/cjs/api/resources/location/client/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/location/client/index.js +17 -0
  16. package/dist/cjs/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.d.ts +9 -0
  17. package/dist/cjs/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.js +3 -0
  18. package/dist/cjs/api/resources/location/client/requests/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/location/client/requests/index.js +2 -0
  20. package/dist/cjs/api/resources/location/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/location/index.js +17 -0
  22. package/dist/cjs/api/resources/messages/client/Client.d.ts +0 -2
  23. package/dist/cjs/api/resources/messages/client/Client.js +0 -2
  24. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +6 -4
  25. package/dist/cjs/api/resources/numbers/client/Client.d.ts +29 -7
  26. package/dist/cjs/api/resources/numbers/client/Client.js +75 -17
  27. package/dist/cjs/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.d.ts +9 -0
  28. package/dist/cjs/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.js +3 -0
  29. package/dist/cjs/api/resources/numbers/client/requests/index.d.ts +1 -0
  30. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +1 -0
  31. package/dist/cjs/api/types/LocationRefreshResponse.d.ts +4 -0
  32. package/dist/cjs/api/types/LocationRefreshResponse.js +3 -0
  33. package/dist/cjs/api/types/LocationResponse.d.ts +7 -0
  34. package/dist/cjs/api/types/LocationResponse.js +3 -0
  35. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  36. package/dist/cjs/api/types/ReplyToInConversation.d.ts +5 -0
  37. package/dist/cjs/api/types/ReplyToInConversation.js +3 -0
  38. package/dist/cjs/api/types/SendMessageResponse.d.ts +1 -0
  39. package/dist/cjs/api/types/index.d.ts +3 -0
  40. package/dist/cjs/api/types/index.js +3 -0
  41. package/dist/cjs/version.d.ts +1 -1
  42. package/dist/cjs/version.js +1 -1
  43. package/dist/esm/BaseClient.mjs +2 -2
  44. package/dist/esm/Client.d.mts +3 -0
  45. package/dist/esm/Client.mjs +5 -0
  46. package/dist/esm/api/resources/contactCards/client/Client.d.mts +1 -4
  47. package/dist/esm/api/resources/contactCards/client/Client.mjs +1 -4
  48. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +4 -7
  49. package/dist/esm/api/resources/conversations/client/Client.d.mts +8 -6
  50. package/dist/esm/api/resources/conversations/client/Client.mjs +8 -6
  51. package/dist/esm/api/resources/conversations/client/requests/UpdateConversationRequest.d.mts +2 -0
  52. package/dist/esm/api/resources/index.d.mts +2 -0
  53. package/dist/esm/api/resources/index.mjs +2 -0
  54. package/dist/esm/api/resources/location/client/Client.d.mts +34 -0
  55. package/dist/esm/api/resources/location/client/Client.mjs +109 -0
  56. package/dist/esm/api/resources/location/client/index.d.mts +1 -0
  57. package/dist/esm/api/resources/location/client/index.mjs +1 -0
  58. package/dist/esm/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.d.mts +9 -0
  59. package/dist/esm/api/resources/location/client/requests/GetLocationV1LocationPhoneNumberGetRequest.mjs +2 -0
  60. package/dist/esm/api/resources/location/client/requests/index.d.mts +1 -0
  61. package/dist/esm/api/resources/location/client/requests/index.mjs +1 -0
  62. package/dist/esm/api/resources/location/index.d.mts +1 -0
  63. package/dist/esm/api/resources/location/index.mjs +1 -0
  64. package/dist/esm/api/resources/messages/client/Client.d.mts +0 -2
  65. package/dist/esm/api/resources/messages/client/Client.mjs +0 -2
  66. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +6 -4
  67. package/dist/esm/api/resources/numbers/client/Client.d.mts +29 -7
  68. package/dist/esm/api/resources/numbers/client/Client.mjs +75 -17
  69. package/dist/esm/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.d.mts +9 -0
  70. package/dist/esm/api/resources/numbers/client/requests/GetNumberV1NumbersNumberIdGetRequest.mjs +2 -0
  71. package/dist/esm/api/resources/numbers/client/requests/index.d.mts +1 -0
  72. package/dist/esm/api/types/AgentVerifyRequest.d.mts +1 -0
  73. package/dist/esm/api/types/LocationRefreshResponse.d.mts +4 -0
  74. package/dist/esm/api/types/LocationRefreshResponse.mjs +2 -0
  75. package/dist/esm/api/types/LocationResponse.d.mts +7 -0
  76. package/dist/esm/api/types/LocationResponse.mjs +2 -0
  77. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  78. package/dist/esm/api/types/ReplyToInConversation.d.mts +5 -0
  79. package/dist/esm/api/types/ReplyToInConversation.mjs +2 -0
  80. package/dist/esm/api/types/SendMessageResponse.d.mts +1 -0
  81. package/dist/esm/api/types/index.d.mts +3 -0
  82. package/dist/esm/api/types/index.mjs +3 -0
  83. package/dist/esm/version.d.mts +1 -1
  84. package/dist/esm/version.mjs +1 -1
  85. package/package.json +1 -1
  86. package/reference.md +180 -18
@@ -36,8 +36,6 @@ export declare class MessagesClient {
36
36
  *
37
37
  * @example
38
38
  * await client.messages.sendMessage({
39
- * agent_id: "agent_id",
40
- * to_number: "to_number",
41
39
  * body: "body"
42
40
  * })
43
41
  */
@@ -56,8 +56,6 @@ export class MessagesClient {
56
56
  *
57
57
  * @example
58
58
  * await client.messages.sendMessage({
59
- * agent_id: "agent_id",
60
- * to_number: "to_number",
61
59
  * body: "body"
62
60
  * })
63
61
  */
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * agent_id: "agent_id",
5
- * to_number: "to_number",
6
4
  * body: "body"
7
5
  * }
8
6
  */
9
7
  export interface SendMessageRequest {
10
- agent_id: string;
11
- to_number: string;
8
+ agent_id?: string | null;
9
+ /** Recipient of an existing chat: a phone (any format, normalized to E.164), US short code, email, or a group id (grp_...). Provide this OR `recipients` (to start a new group), not both. */
10
+ to_number?: string | null;
11
+ /** Start a NEW iMessage group by listing 2 or more recipients (phones or emails). The first message is delivered to all of them, an iMessage group is created, and the response `to_number` returns the new group id (grp_...) to use for follow-up sends. iMessage numbers only. */
12
+ recipients?: string[] | null;
12
13
  body: string;
13
14
  media_url?: string | null;
14
15
  media_urls?: string[] | null;
15
16
  number_id?: string | null;
17
+ from_number?: string | null;
16
18
  /** 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
19
  send_style?: SendMessageRequest.SendStyle;
18
20
  /** Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply in iMessage. */
@@ -11,7 +11,11 @@ export declare class NumbersClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<NumbersClient.Options>;
12
12
  constructor(options?: NumbersClient.Options);
13
13
  /**
14
- * List all phone numbers for this account.
14
+ * List the active phone numbers for this account.
15
+ *
16
+ * Released (deleted) numbers are excluded so the count reflects the numbers
17
+ * the account actually holds. Fetch a single number via GET /{number_id}
18
+ * (which returns it regardless of status).
15
19
  *
16
20
  * @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
17
21
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -43,22 +47,23 @@ export declare class NumbersClient {
43
47
  createNumber(request?: AgentPhone.CreateNumberRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.PhoneNumberResponse>;
44
48
  private __createNumber;
45
49
  /**
46
- * Get messages for a specific phone number.
50
+ * Get a single phone number owned by this account.
47
51
  *
48
- * Supports cursor-based pagination via before/after timestamps.
52
+ * Returns the number regardless of status (including released) so detail
53
+ * pages still load for numbers that are no longer active.
49
54
  *
50
- * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
55
+ * @param {AgentPhone.GetNumberV1NumbersNumberIdGetRequest} request
51
56
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
52
57
  *
53
58
  * @throws {@link AgentPhone.UnprocessableEntityError}
54
59
  *
55
60
  * @example
56
- * await client.numbers.getMessages({
61
+ * await client.numbers.getNumber({
57
62
  * number_id: "number_id"
58
63
  * })
59
64
  */
60
- getMessages(request: AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessageListResponse>;
61
- private __getMessages;
65
+ getNumber(request: AgentPhone.GetNumberV1NumbersNumberIdGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.PhoneNumberResponse>;
66
+ private __getNumber;
62
67
  /**
63
68
  * Release (delete) a phone number.
64
69
  *
@@ -81,4 +86,21 @@ export declare class NumbersClient {
81
86
  */
82
87
  deleteNumber(request: AgentPhone.DeleteNumberV1NumbersNumberIdDeleteRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<unknown>;
83
88
  private __deleteNumber;
89
+ /**
90
+ * Get messages for a specific phone number.
91
+ *
92
+ * Supports cursor-based pagination via before/after timestamps.
93
+ *
94
+ * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
95
+ * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
96
+ *
97
+ * @throws {@link AgentPhone.UnprocessableEntityError}
98
+ *
99
+ * @example
100
+ * await client.numbers.getMessages({
101
+ * number_id: "number_id"
102
+ * })
103
+ */
104
+ getMessages(request: AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest, requestOptions?: NumbersClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessageListResponse>;
105
+ private __getMessages;
84
106
  }
@@ -31,7 +31,11 @@ export class NumbersClient {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
34
- * List all phone numbers for this account.
34
+ * List the active phone numbers for this account.
35
+ *
36
+ * Released (deleted) numbers are excluded so the count reflects the numbers
37
+ * the account actually holds. Fetch a single number via GET /{number_id}
38
+ * (which returns it regardless of status).
35
39
  *
36
40
  * @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
37
41
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -141,39 +145,35 @@ export class NumbersClient {
141
145
  });
142
146
  }
143
147
  /**
144
- * Get messages for a specific phone number.
148
+ * Get a single phone number owned by this account.
145
149
  *
146
- * Supports cursor-based pagination via before/after timestamps.
150
+ * Returns the number regardless of status (including released) so detail
151
+ * pages still load for numbers that are no longer active.
147
152
  *
148
- * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
153
+ * @param {AgentPhone.GetNumberV1NumbersNumberIdGetRequest} request
149
154
  * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
150
155
  *
151
156
  * @throws {@link AgentPhone.UnprocessableEntityError}
152
157
  *
153
158
  * @example
154
- * await client.numbers.getMessages({
159
+ * await client.numbers.getNumber({
155
160
  * number_id: "number_id"
156
161
  * })
157
162
  */
158
- getMessages(request, requestOptions) {
159
- return core.HttpResponsePromise.fromPromise(this.__getMessages(request, requestOptions));
163
+ getNumber(request, requestOptions) {
164
+ return core.HttpResponsePromise.fromPromise(this.__getNumber(request, requestOptions));
160
165
  }
161
- __getMessages(request, requestOptions) {
166
+ __getNumber(request, requestOptions) {
162
167
  return __awaiter(this, void 0, void 0, function* () {
163
168
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
164
- const { number_id: numberId, limit, before, after } = request;
165
- const _queryParams = {
166
- limit,
167
- before: before !== undefined ? before : undefined,
168
- after: after !== undefined ? after : undefined,
169
- };
169
+ const { number_id: numberId } = request;
170
170
  const _authRequest = yield this._options.authProvider.getAuthRequest();
171
171
  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);
172
172
  const _response = yield core.fetcher({
173
- 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/numbers/${core.url.encodePathParam(numberId)}/messages`),
173
+ 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/numbers/${core.url.encodePathParam(numberId)}`),
174
174
  method: "GET",
175
175
  headers: _headers,
176
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
176
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
177
177
  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,
178
178
  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,
179
179
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -195,7 +195,7 @@ export class NumbersClient {
195
195
  });
196
196
  }
197
197
  }
198
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}/messages");
198
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}");
199
199
  });
200
200
  }
201
201
  /**
@@ -256,4 +256,62 @@ export class NumbersClient {
256
256
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/numbers/{number_id}");
257
257
  });
258
258
  }
259
+ /**
260
+ * Get messages for a specific phone number.
261
+ *
262
+ * Supports cursor-based pagination via before/after timestamps.
263
+ *
264
+ * @param {AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest} request
265
+ * @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
266
+ *
267
+ * @throws {@link AgentPhone.UnprocessableEntityError}
268
+ *
269
+ * @example
270
+ * await client.numbers.getMessages({
271
+ * number_id: "number_id"
272
+ * })
273
+ */
274
+ getMessages(request, requestOptions) {
275
+ return core.HttpResponsePromise.fromPromise(this.__getMessages(request, requestOptions));
276
+ }
277
+ __getMessages(request, requestOptions) {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
280
+ const { number_id: numberId, limit, before, after } = request;
281
+ const _queryParams = {
282
+ limit,
283
+ before: before !== undefined ? before : undefined,
284
+ after: after !== undefined ? after : undefined,
285
+ };
286
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
287
+ 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);
288
+ const _response = yield core.fetcher({
289
+ 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/numbers/${core.url.encodePathParam(numberId)}/messages`),
290
+ method: "GET",
291
+ headers: _headers,
292
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
293
+ 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,
294
+ 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,
295
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
296
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
297
+ logging: this._options.logging,
298
+ });
299
+ if (_response.ok) {
300
+ return { data: _response.body, rawResponse: _response.rawResponse };
301
+ }
302
+ if (_response.error.reason === "status-code") {
303
+ switch (_response.error.statusCode) {
304
+ case 422:
305
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
306
+ default:
307
+ throw new errors.AgentPhoneError({
308
+ statusCode: _response.error.statusCode,
309
+ body: _response.error.body,
310
+ rawResponse: _response.rawResponse,
311
+ });
312
+ }
313
+ }
314
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}/messages");
315
+ });
316
+ }
259
317
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * number_id: "number_id"
5
+ * }
6
+ */
7
+ export interface GetNumberV1NumbersNumberIdGetRequest {
8
+ number_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,4 +1,5 @@
1
1
  export type { CreateNumberRequest } from "./CreateNumberRequest.mjs";
2
2
  export type { DeleteNumberV1NumbersNumberIdDeleteRequest } from "./DeleteNumberV1NumbersNumberIdDeleteRequest.mjs";
3
3
  export type { GetMessagesV1NumbersNumberIdMessagesGetRequest } from "./GetMessagesV1NumbersNumberIdMessagesGetRequest.mjs";
4
+ export type { GetNumberV1NumbersNumberIdGetRequest } from "./GetNumberV1NumbersNumberIdGetRequest.mjs";
4
5
  export type { ListNumbersV1NumbersGetRequest } from "./ListNumbersV1NumbersGetRequest.mjs";
@@ -1,4 +1,5 @@
1
1
  export interface AgentVerifyRequest {
2
2
  verification_id: string;
3
3
  otp_code: string;
4
+ source?: string | null;
4
5
  }
@@ -0,0 +1,4 @@
1
+ export interface LocationRefreshResponse {
2
+ success: boolean;
3
+ pollAfterSeconds?: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface LocationResponse {
2
+ phoneNumber: string;
3
+ latitude?: number | null;
4
+ longitude?: number | null;
5
+ status: string;
6
+ lastUpdated: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -11,4 +11,5 @@ export interface MessageInConversation {
11
11
  mediaUrls?: string[];
12
12
  receivedAt: string;
13
13
  reactions?: AgentPhone.ReactionInConversation[];
14
+ replyTo?: AgentPhone.ReplyToInConversation | null;
14
15
  }
@@ -0,0 +1,5 @@
1
+ export interface ReplyToInConversation {
2
+ messageId: string;
3
+ message: string;
4
+ mediaUrls?: string[];
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,6 +4,7 @@ export interface SendMessageResponse {
4
4
  channel: string;
5
5
  from_number: string;
6
6
  to_number: string;
7
+ conversation_id?: string | null;
7
8
  media_urls?: string[];
8
9
  reply_to_message_id?: string | null;
9
10
  reply_parent_unresolved?: boolean | null;
@@ -23,6 +23,8 @@ export * from "./DeleteAgentResponse.mjs";
23
23
  export * from "./FieldWarning.mjs";
24
24
  export * from "./GroupParticipant.mjs";
25
25
  export * from "./HttpValidationError.mjs";
26
+ export * from "./LocationRefreshResponse.mjs";
27
+ export * from "./LocationResponse.mjs";
26
28
  export * from "./MessageInConversation.mjs";
27
29
  export * from "./MessageListResponse.mjs";
28
30
  export * from "./MessageResponse.mjs";
@@ -39,6 +41,7 @@ export * from "./PlanInfo.mjs";
39
41
  export * from "./PlanLimits.mjs";
40
42
  export * from "./ReactionInConversation.mjs";
41
43
  export * from "./RegistrationResponse.mjs";
44
+ export * from "./ReplyToInConversation.mjs";
42
45
  export * from "./SendMessageResponse.mjs";
43
46
  export * from "./SendReactionResponse.mjs";
44
47
  export * from "./SendTypingResponse.mjs";
@@ -23,6 +23,8 @@ export * from "./DeleteAgentResponse.mjs";
23
23
  export * from "./FieldWarning.mjs";
24
24
  export * from "./GroupParticipant.mjs";
25
25
  export * from "./HttpValidationError.mjs";
26
+ export * from "./LocationRefreshResponse.mjs";
27
+ export * from "./LocationResponse.mjs";
26
28
  export * from "./MessageInConversation.mjs";
27
29
  export * from "./MessageListResponse.mjs";
28
30
  export * from "./MessageResponse.mjs";
@@ -39,6 +41,7 @@ export * from "./PlanInfo.mjs";
39
41
  export * from "./PlanLimits.mjs";
40
42
  export * from "./ReactionInConversation.mjs";
41
43
  export * from "./RegistrationResponse.mjs";
44
+ export * from "./ReplyToInConversation.mjs";
42
45
  export * from "./SendMessageResponse.mjs";
43
46
  export * from "./SendReactionResponse.mjs";
44
47
  export * from "./SendTypingResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.13";
1
+ export declare const SDK_VERSION = "1.0.15";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.13";
1
+ export const SDK_VERSION = "1.0.15";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentphone",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -669,7 +669,11 @@ await client.agents.listAgentCalls({
669
669
  <dl>
670
670
  <dd>
671
671
 
672
- List all phone numbers for this account.
672
+ List the active phone numbers for this account.
673
+
674
+ Released (deleted) numbers are excluded so the count reflects the numbers
675
+ the account actually holds. Fetch a single number via GET /{number_id}
676
+ (which returns it regardless of status).
673
677
  </dd>
674
678
  </dl>
675
679
  </dd>
@@ -789,7 +793,7 @@ await client.numbers.createNumber();
789
793
  </dl>
790
794
  </details>
791
795
 
792
- <details><summary><code>client.numbers.<a href="/src/api/resources/numbers/client/Client.ts">getMessages</a>({ ...params }) -> AgentPhone.MessageListResponse</code></summary>
796
+ <details><summary><code>client.numbers.<a href="/src/api/resources/numbers/client/Client.ts">getNumber</a>({ ...params }) -> AgentPhone.PhoneNumberResponse</code></summary>
793
797
  <dl>
794
798
  <dd>
795
799
 
@@ -801,9 +805,10 @@ await client.numbers.createNumber();
801
805
  <dl>
802
806
  <dd>
803
807
 
804
- Get messages for a specific phone number.
808
+ Get a single phone number owned by this account.
805
809
 
806
- Supports cursor-based pagination via before/after timestamps.
810
+ Returns the number regardless of status (including released) so detail
811
+ pages still load for numbers that are no longer active.
807
812
  </dd>
808
813
  </dl>
809
814
  </dd>
@@ -818,7 +823,7 @@ Supports cursor-based pagination via before/after timestamps.
818
823
  <dd>
819
824
 
820
825
  ```typescript
821
- await client.numbers.getMessages({
826
+ await client.numbers.getNumber({
822
827
  number_id: "number_id"
823
828
  });
824
829
 
@@ -836,7 +841,7 @@ await client.numbers.getMessages({
836
841
  <dl>
837
842
  <dd>
838
843
 
839
- **request:** `AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest`
844
+ **request:** `AgentPhone.GetNumberV1NumbersNumberIdGetRequest`
840
845
 
841
846
  </dd>
842
847
  </dl>
@@ -924,6 +929,73 @@ await client.numbers.deleteNumber({
924
929
  </dl>
925
930
 
926
931
 
932
+ </dd>
933
+ </dl>
934
+ </details>
935
+
936
+ <details><summary><code>client.numbers.<a href="/src/api/resources/numbers/client/Client.ts">getMessages</a>({ ...params }) -> AgentPhone.MessageListResponse</code></summary>
937
+ <dl>
938
+ <dd>
939
+
940
+ #### 📝 Description
941
+
942
+ <dl>
943
+ <dd>
944
+
945
+ <dl>
946
+ <dd>
947
+
948
+ Get messages for a specific phone number.
949
+
950
+ Supports cursor-based pagination via before/after timestamps.
951
+ </dd>
952
+ </dl>
953
+ </dd>
954
+ </dl>
955
+
956
+ #### 🔌 Usage
957
+
958
+ <dl>
959
+ <dd>
960
+
961
+ <dl>
962
+ <dd>
963
+
964
+ ```typescript
965
+ await client.numbers.getMessages({
966
+ number_id: "number_id"
967
+ });
968
+
969
+ ```
970
+ </dd>
971
+ </dl>
972
+ </dd>
973
+ </dl>
974
+
975
+ #### ⚙️ Parameters
976
+
977
+ <dl>
978
+ <dd>
979
+
980
+ <dl>
981
+ <dd>
982
+
983
+ **request:** `AgentPhone.GetMessagesV1NumbersNumberIdMessagesGetRequest`
984
+
985
+ </dd>
986
+ </dl>
987
+
988
+ <dl>
989
+ <dd>
990
+
991
+ **requestOptions:** `NumbersClient.RequestOptions`
992
+
993
+ </dd>
994
+ </dl>
995
+ </dd>
996
+ </dl>
997
+
998
+
927
999
  </dd>
928
1000
  </dl>
929
1001
  </details>
@@ -2175,14 +2247,16 @@ await client.conversations.getConversation({
2175
2247
  <dl>
2176
2248
  <dd>
2177
2249
 
2178
- Update conversation metadata (state).
2250
+ Update a conversation.
2179
2251
 
2180
- Use this to store custom context for AI agents:
2181
- - Customer information (name, account ID)
2182
- - Business context (order ID, ticket number)
2183
- - Session state (current topic, preferences)
2252
+ - `metadata`: store custom context for AI agents (customer info, order/ticket
2253
+ ids, session state). Replaces the stored object; surfaced in webhook
2254
+ payloads as `conversationState`.
2255
+ - `group_name`: rename a group conversation (iMessage groups only). Also
2256
+ renames the underlying iMessage thread.
2184
2257
 
2185
- The metadata is included in webhook payloads as `conversationState`.
2258
+ Only the fields you include are changed: a rename-only PATCH leaves metadata
2259
+ untouched, and vice versa.
2186
2260
  </dd>
2187
2261
  </dl>
2188
2262
  </dd>
@@ -3503,8 +3577,6 @@ To send a carousel of images on iMessage, pass 2-20 URLs in `media_urls`. Requir
3503
3577
 
3504
3578
  ```typescript
3505
3579
  await client.messages.sendMessage({
3506
- agent_id: "agent_id",
3507
- to_number: "to_number",
3508
3580
  body: "body"
3509
3581
  });
3510
3582
 
@@ -3706,10 +3778,7 @@ Create or replace the iMessage contact card on this number.
3706
3778
 
3707
3779
  ```typescript
3708
3780
  await client.contactCards.putContactCard({
3709
- number_id: "number_id",
3710
- firstName: "firstName",
3711
- lastName: "lastName",
3712
- avatarUrl: "avatarUrl"
3781
+ number_id: "number_id"
3713
3782
  });
3714
3783
 
3715
3784
  ```
@@ -4102,6 +4171,99 @@ await client.subAccounts.updateSubAccount({
4102
4171
  </dl>
4103
4172
 
4104
4173
 
4174
+ </dd>
4175
+ </dl>
4176
+ </details>
4177
+
4178
+ ## Location
4179
+ <details><summary><code>client.location.<a href="/src/api/resources/location/client/Client.ts">getLocation</a>({ ...params }) -> AgentPhone.LocationResponse</code></summary>
4180
+ <dl>
4181
+ <dd>
4182
+
4183
+ #### 🔌 Usage
4184
+
4185
+ <dl>
4186
+ <dd>
4187
+
4188
+ <dl>
4189
+ <dd>
4190
+
4191
+ ```typescript
4192
+ await client.location.getLocation({
4193
+ phone_number: "phone_number"
4194
+ });
4195
+
4196
+ ```
4197
+ </dd>
4198
+ </dl>
4199
+ </dd>
4200
+ </dl>
4201
+
4202
+ #### ⚙️ Parameters
4203
+
4204
+ <dl>
4205
+ <dd>
4206
+
4207
+ <dl>
4208
+ <dd>
4209
+
4210
+ **request:** `AgentPhone.GetLocationV1LocationPhoneNumberGetRequest`
4211
+
4212
+ </dd>
4213
+ </dl>
4214
+
4215
+ <dl>
4216
+ <dd>
4217
+
4218
+ **requestOptions:** `LocationClient.RequestOptions`
4219
+
4220
+ </dd>
4221
+ </dl>
4222
+ </dd>
4223
+ </dl>
4224
+
4225
+
4226
+ </dd>
4227
+ </dl>
4228
+ </details>
4229
+
4230
+ <details><summary><code>client.location.<a href="/src/api/resources/location/client/Client.ts">refreshLocations</a>() -> AgentPhone.LocationRefreshResponse</code></summary>
4231
+ <dl>
4232
+ <dd>
4233
+
4234
+ #### 🔌 Usage
4235
+
4236
+ <dl>
4237
+ <dd>
4238
+
4239
+ <dl>
4240
+ <dd>
4241
+
4242
+ ```typescript
4243
+ await client.location.refreshLocations();
4244
+
4245
+ ```
4246
+ </dd>
4247
+ </dl>
4248
+ </dd>
4249
+ </dl>
4250
+
4251
+ #### ⚙️ Parameters
4252
+
4253
+ <dl>
4254
+ <dd>
4255
+
4256
+ <dl>
4257
+ <dd>
4258
+
4259
+ **requestOptions:** `LocationClient.RequestOptions`
4260
+
4261
+ </dd>
4262
+ </dl>
4263
+ </dd>
4264
+ </dl>
4265
+
4266
+
4105
4267
  </dd>
4106
4268
  </dl>
4107
4269
  </details>