@linqapp/sdk 0.28.0 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +59 -9
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +59 -9
  5. package/client.d.ts.map +1 -1
  6. package/client.js +63 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +64 -6
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/attachments.d.mts +1 -1
  61. package/resources/attachments.d.ts +1 -1
  62. package/resources/attachments.js +1 -1
  63. package/resources/attachments.mjs +1 -1
  64. package/resources/available-number.d.mts +58 -0
  65. package/resources/available-number.d.mts.map +1 -0
  66. package/resources/available-number.d.ts +58 -0
  67. package/resources/available-number.d.ts.map +1 -0
  68. package/resources/available-number.js +36 -0
  69. package/resources/available-number.js.map +1 -0
  70. package/resources/available-number.mjs +32 -0
  71. package/resources/available-number.mjs.map +1 -0
  72. package/resources/chats/chats.d.mts +59 -11
  73. package/resources/chats/chats.d.mts.map +1 -1
  74. package/resources/chats/chats.d.ts +59 -11
  75. package/resources/chats/chats.d.ts.map +1 -1
  76. package/resources/chats/chats.js.map +1 -1
  77. package/resources/chats/chats.mjs.map +1 -1
  78. package/resources/chats/location.d.mts +9 -8
  79. package/resources/chats/location.d.mts.map +1 -1
  80. package/resources/chats/location.d.ts +9 -8
  81. package/resources/chats/location.d.ts.map +1 -1
  82. package/resources/chats/location.js +9 -8
  83. package/resources/chats/location.js.map +1 -1
  84. package/resources/chats/location.mjs +9 -8
  85. package/resources/chats/location.mjs.map +1 -1
  86. package/resources/chats/messages.d.mts +84 -6
  87. package/resources/chats/messages.d.mts.map +1 -1
  88. package/resources/chats/messages.d.ts +84 -6
  89. package/resources/chats/messages.d.ts.map +1 -1
  90. package/resources/chats/messages.js +40 -0
  91. package/resources/chats/messages.js.map +1 -1
  92. package/resources/chats/messages.mjs +40 -0
  93. package/resources/chats/messages.mjs.map +1 -1
  94. package/resources/contact-card.d.mts +1 -2
  95. package/resources/contact-card.d.mts.map +1 -1
  96. package/resources/contact-card.d.ts +1 -2
  97. package/resources/contact-card.d.ts.map +1 -1
  98. package/resources/index.d.mts +3 -2
  99. package/resources/index.d.mts.map +1 -1
  100. package/resources/index.d.ts +3 -2
  101. package/resources/index.d.ts.map +1 -1
  102. package/resources/index.js +3 -1
  103. package/resources/index.js.map +1 -1
  104. package/resources/index.mjs +2 -1
  105. package/resources/index.mjs.map +1 -1
  106. package/resources/messages.d.mts +400 -7
  107. package/resources/messages.d.mts.map +1 -1
  108. package/resources/messages.d.ts +400 -7
  109. package/resources/messages.d.ts.map +1 -1
  110. package/resources/messages.js +148 -0
  111. package/resources/messages.js.map +1 -1
  112. package/resources/messages.mjs +148 -0
  113. package/resources/messages.mjs.map +1 -1
  114. package/resources/phone-numbers.d.mts +68 -23
  115. package/resources/phone-numbers.d.mts.map +1 -1
  116. package/resources/phone-numbers.d.ts +68 -23
  117. package/resources/phone-numbers.d.ts.map +1 -1
  118. package/resources/phone-numbers.js +23 -0
  119. package/resources/phone-numbers.js.map +1 -1
  120. package/resources/phone-numbers.mjs +23 -0
  121. package/resources/phone-numbers.mjs.map +1 -1
  122. package/resources/webhooks.d.mts +14 -14
  123. package/resources/webhooks.d.ts +14 -14
  124. package/src/client.ts +94 -8
  125. package/src/internal/qs/LICENSE.md +13 -0
  126. package/src/internal/qs/README.md +3 -0
  127. package/src/internal/qs/formats.ts +10 -0
  128. package/src/internal/qs/index.ts +13 -0
  129. package/src/internal/qs/stringify.ts +385 -0
  130. package/src/internal/qs/types.ts +71 -0
  131. package/src/internal/qs/utils.ts +265 -0
  132. package/src/internal/utils/query.ts +2 -18
  133. package/src/resources/attachments.ts +1 -1
  134. package/src/resources/available-number.ts +72 -0
  135. package/src/resources/chats/chats.ts +64 -12
  136. package/src/resources/chats/location.ts +9 -8
  137. package/src/resources/chats/messages.ts +87 -6
  138. package/src/resources/contact-card.ts +1 -2
  139. package/src/resources/index.ts +15 -1
  140. package/src/resources/messages.ts +453 -6
  141. package/src/resources/phone-numbers.ts +85 -23
  142. package/src/resources/webhooks.ts +14 -14
  143. package/src/version.ts +1 -1
  144. package/version.d.mts +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.js +1 -1
  147. package/version.mjs +1 -1
@@ -22,8 +22,117 @@ import { path } from "../internal/utils/path.mjs";
22
22
  * **Limitations:**
23
23
  * - A `link` part cannot be combined with other parts in the same message.
24
24
  * - Maximum URL length: 2,048 characters.
25
+ *
26
+ * ## Ephemeral Messages (Privacy Tier)
27
+ *
28
+ * For regulated or sensitive conversations, opt in to the **ephemeral messages** tier by contacting your Linq support contact. When enabled, every message on the covered phone numbers is automatically given a fixed **24-hour retention window** — after that window the platform permanently deletes the message from Linq storage. There is no per-message flag; ephemerality is applied automatically based on your configuration.
29
+ *
30
+ * You can request it at two scopes:
31
+ *
32
+ * | Scope | Effect |
33
+ * |---|---|
34
+ * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
35
+ * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
36
+ *
37
+ * **Behavioral differences vs the standard default:**
38
+ *
39
+ * | Aspect | Standard | Ephemeral |
40
+ * |---|---|---|
41
+ * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
42
+ * | After expiry | Message stays retrievable | Message is permanently deleted — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
43
+ * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
44
+ * | Cross-partner isolation | Enforced | Enforced |
45
+ *
46
+ * **How the 24-hour window works:**
47
+ *
48
+ * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
49
+ * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
50
+ * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
51
+ *
52
+ * **What you observe:**
53
+ *
54
+ * - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
55
+ * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
56
+ * - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
57
+ *
58
+ * **When to choose ephemeral:**
59
+ *
60
+ * - You have a compliance requirement that the platform must not retain message content beyond a short window.
61
+ * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
62
+ * - Your application is the system of record — you capture what you need from the delivery webhook in real time and do not rely on reading message history back from Linq later.
63
+ *
64
+ * **Important:** ephemeral applies in *both directions* — messages you send **and** messages received by the phone numbers in that scope. Because Linq can no longer return the message after 24 hours, persist anything you need to keep from the webhook payload at the time it is delivered.
25
65
  */
26
66
  export class Messages extends APIResource {
67
+ /**
68
+ * Send a message to one or more recipients **without supplying a `from` number**.
69
+ * Linq resolves both the sending line and the target chat for you, then returns
70
+ * exactly which line was used, which chat the message landed in, whether a new
71
+ * chat was created, and every resulting message id.
72
+ *
73
+ * This fuses "create chat" and "send message" behind a single message-centric
74
+ * resource. Provide only the recipients (`to`) and the `message`; the platform
75
+ * decides the rest.
76
+ *
77
+ * ## How the from-number and chat are chosen
78
+ *
79
+ * - **Reuse** — if a chat with exactly these recipients already exists and the
80
+ * line it lives on is healthy, the message is sent into that chat on its
81
+ * existing line (`from_selection.reason = reused_active_chat`).
82
+ * - **New** — if no such chat exists, a new chat is created on the best available
83
+ * line (`from_selection.reason = new_best_number`).
84
+ * - **Failover** — if a matching chat exists but its line has been flagged, a
85
+ * **new** chat is created on a fresh best line and the flagged chat is abandoned
86
+ * (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
87
+ * supply `continuation_message`, that text is sent as the single message INSTEAD
88
+ * of `message` (useful as a fresh-number-appropriate opener). Exactly one
89
+ * message is sent either way.
90
+ *
91
+ * Recipients (`to`) are an order-independent set: a single handle is a direct
92
+ * chat, multiple handles a group chat.
93
+ *
94
+ * ## Differences from POST /v3/chats
95
+ *
96
+ * - The first message **may contain a link** (including for a newly created chat).
97
+ * Note: sending a link as the very first message on a freshly selected line can
98
+ * elevate that line's flagging risk — it is allowed, not recommended.
99
+ * - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
100
+ * use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
101
+ *
102
+ * ## Service preference, effects, decorations
103
+ *
104
+ * Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
105
+ * and per-part `text_decorations` exactly as on the other send endpoints.
106
+ *
107
+ * Always responds `202 Accepted` — chat creation is incidental to the send.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const message = await client.messages.create({
112
+ * message: {
113
+ * parts: [
114
+ * {
115
+ * type: 'text',
116
+ * value:
117
+ * 'Hi! Thanks for reaching out — how can we help?',
118
+ * },
119
+ * ],
120
+ * },
121
+ * to: ['+14155559876'],
122
+ * });
123
+ * ```
124
+ */
125
+ create(params, options) {
126
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
127
+ return this._client.post('/v3/messages', {
128
+ body,
129
+ ...options,
130
+ headers: buildHeaders([
131
+ { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
132
+ options?.headers,
133
+ ]),
134
+ });
135
+ }
27
136
  /**
28
137
  * Retrieve all messages in a conversation thread. Given any message ID in the
29
138
  * thread, returns the originator message and all replies in chronological order.
@@ -121,5 +230,44 @@ export class Messages extends APIResource {
121
230
  update(messageID, body, options) {
122
231
  return this._client.patch(path `/v3/messages/${messageID}`, { body, ...options });
123
232
  }
233
+ /**
234
+ * Replaces a previously delivered `imessage_app` card on the recipient's screen
235
+ * with new content, instead of posting a new bubble (like a game move redrawing
236
+ * the board).
237
+ *
238
+ * The update is delivered as a **new message** with its own id and delivery
239
+ * lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
240
+ * for the new id). To update the card again, reference the message id returned by
241
+ * this call.
242
+ *
243
+ * Constraints:
244
+ *
245
+ * - The referenced message must be an `imessage_app` card sent by you (`400`
246
+ * otherwise — inbound cards cannot be updated).
247
+ * - The referenced card must already be delivered (`409` otherwise — retry after
248
+ * the `message.delivered` webhook for it).
249
+ * - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
250
+ * card and cannot change; only `url`, `fallback_text`, and `layout` are
251
+ * replaced.
252
+ * - iMessage-only, like all app cards.
253
+ * - Concurrent updates against the same card are not serialized server-side; the
254
+ * last one delivered wins on the recipient's screen. Serialize updates by always
255
+ * referencing the message id returned by the previous call.
256
+ *
257
+ * @example
258
+ * ```ts
259
+ * const response = await client.messages.updateAppCard(
260
+ * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
261
+ * {
262
+ * layout: { caption: 'Score: 2 – 1' },
263
+ * fallback_text: 'Score update',
264
+ * url: 'https://app.example.com/card?game=7f3a&move=2',
265
+ * },
266
+ * );
267
+ * ```
268
+ */
269
+ updateAppCard(messageID, body, options) {
270
+ return this._client.post(path `/v3/messages/${messageID}/update`, { body, ...options });
271
+ }
124
272
  }
125
273
  //# sourceMappingURL=messages.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,sBAAsB,EAAkD,+BAA2B;AAC5G,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;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AO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,CACT,SAAiB,EACjB,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,CACX,SAAiB,EACjB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -15,8 +15,42 @@ export declare class PhoneNumbers extends APIResource {
15
15
  * Returns all phone numbers assigned to the authenticated partner. Use this
16
16
  * endpoint to discover which phone numbers are available for use as the `from`
17
17
  * field when creating a chat, listing chats, or sending a voice memo.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const phoneNumbers = await client.phoneNumbers.list();
22
+ * ```
18
23
  */
19
24
  list(options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
25
+ /**
26
+ * Updates the forwarding number for a phone number. The forwarding number is where
27
+ * inbound calls will be forwarded to.
28
+ *
29
+ * Pass an empty string to clear the forwarding number.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const phoneNumber = await client.phoneNumbers.update(
34
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
35
+ * { forwarding_number: '+12025559999' },
36
+ * );
37
+ * ```
38
+ */
39
+ update(phoneNumberID: string, body: PhoneNumberUpdateParams, options?: RequestOptions): APIPromise<PhoneNumberUpdateResponse>;
40
+ }
41
+ export interface PhoneNumberUpdateResponse {
42
+ /**
43
+ * Unique identifier for the phone number
44
+ */
45
+ id: string;
46
+ /**
47
+ * The forwarding number after the update. Null when cleared.
48
+ */
49
+ forwarding_number: string | null;
50
+ /**
51
+ * Phone number in E.164 format
52
+ */
53
+ phone_number: string;
20
54
  }
21
55
  export interface PhoneNumberListResponse {
22
56
  /**
@@ -38,8 +72,8 @@ export declare namespace PhoneNumberListResponse {
38
72
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
39
73
  * applies to individual recipients, not the whole line.
40
74
  *
41
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
42
- * status means and how to react.
75
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
76
+ * what each status means and how to react.
43
77
  */
44
78
  health_status: PhoneNumber.HealthStatus;
45
79
  /**
@@ -54,10 +88,15 @@ export declare namespace PhoneNumberListResponse {
54
88
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
55
89
  * applies to individual recipients, not the whole line.
56
90
  *
57
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
58
- * status means and how to react.
91
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
92
+ * what each status means and how to react.
59
93
  */
60
94
  reputation: PhoneNumber.Reputation;
95
+ /**
96
+ * The forwarding number associated with this phone number, in E.164 format. Null
97
+ * when no forwarding number is configured.
98
+ */
99
+ forwarding_number?: string | null;
61
100
  }
62
101
  namespace PhoneNumber {
63
102
  /**
@@ -68,22 +107,22 @@ export declare namespace PhoneNumberListResponse {
68
107
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
69
108
  * applies to individual recipients, not the whole line.
70
109
  *
71
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
72
- * status means and how to react.
110
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
111
+ * what each status means and how to react.
73
112
  */
74
113
  interface HealthStatus {
75
114
  /**
76
- * Deep-link to the relevant section of the Phone Health guide for this status.
115
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
77
116
  */
78
117
  doc_url: string;
79
118
  /**
80
- * Current reputation of this phone line as assessed by risk-service.
119
+ * Current reputation of this phone line.
81
120
  *
82
- * - `HEALTHY` — No elevated risk detected.
83
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
84
- * reviewing messaging patterns.
85
- * - `CRITICAL` — High risk; further sending may result in line flagging or
86
- * restriction.
121
+ * - `HEALTHY` — The line is in good standing. Send normally.
122
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
123
+ * send pace and review your messaging patterns.
124
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
125
+ * Pause outbound on the line until it recovers.
87
126
  *
88
127
  * Defaults to `HEALTHY` for lines that have not yet been scored.
89
128
  */
@@ -97,22 +136,22 @@ export declare namespace PhoneNumberListResponse {
97
136
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
98
137
  * applies to individual recipients, not the whole line.
99
138
  *
100
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
101
- * status means and how to react.
139
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
140
+ * what each status means and how to react.
102
141
  */
103
142
  interface Reputation {
104
143
  /**
105
- * Deep-link to the relevant section of the Phone Health guide for this status.
144
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
106
145
  */
107
146
  doc_url: string;
108
147
  /**
109
- * Current reputation of this phone line as assessed by risk-service.
148
+ * Current reputation of this phone line.
110
149
  *
111
- * - `HEALTHY` — No elevated risk detected.
112
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
113
- * reviewing messaging patterns.
114
- * - `CRITICAL` — High risk; further sending may result in line flagging or
115
- * restriction.
150
+ * - `HEALTHY` — The line is in good standing. Send normally.
151
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
152
+ * send pace and review your messaging patterns.
153
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
154
+ * Pause outbound on the line until it recovers.
116
155
  *
117
156
  * Defaults to `HEALTHY` for lines that have not yet been scored.
118
157
  */
@@ -120,7 +159,13 @@ export declare namespace PhoneNumberListResponse {
120
159
  }
121
160
  }
122
161
  }
162
+ export interface PhoneNumberUpdateParams {
163
+ /**
164
+ * The forwarding number in E.164 format. Set to null or empty string to clear.
165
+ */
166
+ forwarding_number: string | null;
167
+ }
123
168
  export declare namespace PhoneNumbers {
124
- export { type PhoneNumberListResponse as PhoneNumberListResponse };
169
+ export { type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, };
125
170
  }
126
171
  //# sourceMappingURL=phone-numbers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.d.mts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH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EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -15,8 +15,42 @@ export declare class PhoneNumbers extends APIResource {
15
15
  * Returns all phone numbers assigned to the authenticated partner. Use this
16
16
  * endpoint to discover which phone numbers are available for use as the `from`
17
17
  * field when creating a chat, listing chats, or sending a voice memo.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const phoneNumbers = await client.phoneNumbers.list();
22
+ * ```
18
23
  */
19
24
  list(options?: RequestOptions): APIPromise<PhoneNumberListResponse>;
25
+ /**
26
+ * Updates the forwarding number for a phone number. The forwarding number is where
27
+ * inbound calls will be forwarded to.
28
+ *
29
+ * Pass an empty string to clear the forwarding number.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const phoneNumber = await client.phoneNumbers.update(
34
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
35
+ * { forwarding_number: '+12025559999' },
36
+ * );
37
+ * ```
38
+ */
39
+ update(phoneNumberID: string, body: PhoneNumberUpdateParams, options?: RequestOptions): APIPromise<PhoneNumberUpdateResponse>;
40
+ }
41
+ export interface PhoneNumberUpdateResponse {
42
+ /**
43
+ * Unique identifier for the phone number
44
+ */
45
+ id: string;
46
+ /**
47
+ * The forwarding number after the update. Null when cleared.
48
+ */
49
+ forwarding_number: string | null;
50
+ /**
51
+ * Phone number in E.164 format
52
+ */
53
+ phone_number: string;
20
54
  }
21
55
  export interface PhoneNumberListResponse {
22
56
  /**
@@ -38,8 +72,8 @@ export declare namespace PhoneNumberListResponse {
38
72
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
39
73
  * applies to individual recipients, not the whole line.
40
74
  *
41
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
42
- * status means and how to react.
75
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
76
+ * what each status means and how to react.
43
77
  */
44
78
  health_status: PhoneNumber.HealthStatus;
45
79
  /**
@@ -54,10 +88,15 @@ export declare namespace PhoneNumberListResponse {
54
88
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
55
89
  * applies to individual recipients, not the whole line.
56
90
  *
57
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
58
- * status means and how to react.
91
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
92
+ * what each status means and how to react.
59
93
  */
60
94
  reputation: PhoneNumber.Reputation;
95
+ /**
96
+ * The forwarding number associated with this phone number, in E.164 format. Null
97
+ * when no forwarding number is configured.
98
+ */
99
+ forwarding_number?: string | null;
61
100
  }
62
101
  namespace PhoneNumber {
63
102
  /**
@@ -68,22 +107,22 @@ export declare namespace PhoneNumberListResponse {
68
107
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
69
108
  * applies to individual recipients, not the whole line.
70
109
  *
71
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
72
- * status means and how to react.
110
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
111
+ * what each status means and how to react.
73
112
  */
74
113
  interface HealthStatus {
75
114
  /**
76
- * Deep-link to the relevant section of the Phone Health guide for this status.
115
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
77
116
  */
78
117
  doc_url: string;
79
118
  /**
80
- * Current reputation of this phone line as assessed by risk-service.
119
+ * Current reputation of this phone line.
81
120
  *
82
- * - `HEALTHY` — No elevated risk detected.
83
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
84
- * reviewing messaging patterns.
85
- * - `CRITICAL` — High risk; further sending may result in line flagging or
86
- * restriction.
121
+ * - `HEALTHY` — The line is in good standing. Send normally.
122
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
123
+ * send pace and review your messaging patterns.
124
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
125
+ * Pause outbound on the line until it recovers.
87
126
  *
88
127
  * Defaults to `HEALTHY` for lines that have not yet been scored.
89
128
  */
@@ -97,22 +136,22 @@ export declare namespace PhoneNumberListResponse {
97
136
  * Unlike chat health, line reputation does not include `opted_out` — opt-out
98
137
  * applies to individual recipients, not the whole line.
99
138
  *
100
- * See the [Phone Health guide](/guides/phone-numbers/phone-health) for what each
101
- * status means and how to react.
139
+ * See the [Phone Reputation guide](/guides/phone-numbers/phone-reputation) for
140
+ * what each status means and how to react.
102
141
  */
103
142
  interface Reputation {
104
143
  /**
105
- * Deep-link to the relevant section of the Phone Health guide for this status.
144
+ * Deep-link to the relevant section of the Phone Reputation guide for this status.
106
145
  */
107
146
  doc_url: string;
108
147
  /**
109
- * Current reputation of this phone line as assessed by risk-service.
148
+ * Current reputation of this phone line.
110
149
  *
111
- * - `HEALTHY` — No elevated risk detected.
112
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
113
- * reviewing messaging patterns.
114
- * - `CRITICAL` — High risk; further sending may result in line flagging or
115
- * restriction.
150
+ * - `HEALTHY` — The line is in good standing. Send normally.
151
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
152
+ * send pace and review your messaging patterns.
153
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
154
+ * Pause outbound on the line until it recovers.
116
155
  *
117
156
  * Defaults to `HEALTHY` for lines that have not yet been scored.
118
157
  */
@@ -120,7 +159,13 @@ export declare namespace PhoneNumberListResponse {
120
159
  }
121
160
  }
122
161
  }
162
+ export interface PhoneNumberUpdateParams {
163
+ /**
164
+ * The forwarding number in E.164 format. Set to null or empty string to clear.
165
+ */
166
+ forwarding_number: string | null;
167
+ }
123
168
  export declare namespace PhoneNumbers {
124
- export { type PhoneNumberListResponse as PhoneNumberListResponse };
169
+ export { type PhoneNumberUpdateResponse as PhoneNumberUpdateResponse, type PhoneNumberListResponse as PhoneNumberListResponse, type PhoneNumberUpdateParams as PhoneNumberUpdateParams, };
125
170
  }
126
171
  //# sourceMappingURL=phone-numbers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.d.ts","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGpE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;CAC3D;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,WAAW;QAC1B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;;;;;;;;;WAUG;QACH,aAAa,EAAE,WAAW,CAAC,YAAY,CAAC;QAExC;;WAEG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;;;;;;;;;WAUG;QACH,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC;KACpC;IAED,UAAiB,WAAW,CAAC;QAC3B;;;;;;;;;;WAUG;QACH,UAAiB,YAAY;YAC3B;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;;;;;;;;;eAUG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;QAED;;;;;;;;;;WAUG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;;;;;;;;;eAUG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB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E,MAAM,CAAC;YAEhB;;;;;;;;;;eAUG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;QAED;;;;;;;;;;WAUG;QACH,UAAiB,UAAU;YACzB;;eAEG;YACH,OAAO,EAAE,MAAM,CAAC;YAEhB;;;;;;;;;;eAUG;YACH,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;SAC5C;KACF;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PhoneNumbers = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
6
7
  /**
7
8
  * Phone Numbers represent the phone numbers assigned to your partner account.
8
9
  *
@@ -17,10 +18,32 @@ class PhoneNumbers extends resource_1.APIResource {
17
18
  * Returns all phone numbers assigned to the authenticated partner. Use this
18
19
  * endpoint to discover which phone numbers are available for use as the `from`
19
20
  * field when creating a chat, listing chats, or sending a voice memo.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const phoneNumbers = await client.phoneNumbers.list();
25
+ * ```
20
26
  */
21
27
  list(options) {
22
28
  return this._client.get('/v3/phone_numbers', options);
23
29
  }
30
+ /**
31
+ * Updates the forwarding number for a phone number. The forwarding number is where
32
+ * inbound calls will be forwarded to.
33
+ *
34
+ * Pass an empty string to clear the forwarding number.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const phoneNumber = await client.phoneNumbers.update(
39
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
40
+ * { forwarding_number: '+12025559999' },
41
+ * );
42
+ * ```
43
+ */
44
+ update(phoneNumberID, body, options) {
45
+ return this._client.put((0, path_1.path) `/v3/phone_numbers/${phoneNumberID}`, { body, ...options });
46
+ }
24
47
  }
25
48
  exports.PhoneNumbers = PhoneNumbers;
26
49
  //# sourceMappingURL=phone-numbers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AATD,oCASC"}
1
+ {"version":3,"file":"phone-numbers.js","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;;;;;GAQG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF;AApCD,oCAoCC"}
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
+ import { path } from "../internal/utils/path.mjs";
3
4
  /**
4
5
  * Phone Numbers represent the phone numbers assigned to your partner account.
5
6
  *
@@ -14,9 +15,31 @@ export class PhoneNumbers extends APIResource {
14
15
  * Returns all phone numbers assigned to the authenticated partner. Use this
15
16
  * endpoint to discover which phone numbers are available for use as the `from`
16
17
  * field when creating a chat, listing chats, or sending a voice memo.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const phoneNumbers = await client.phoneNumbers.list();
22
+ * ```
17
23
  */
18
24
  list(options) {
19
25
  return this._client.get('/v3/phone_numbers', options);
20
26
  }
27
+ /**
28
+ * Updates the forwarding number for a phone number. The forwarding number is where
29
+ * inbound calls will be forwarded to.
30
+ *
31
+ * Pass an empty string to clear the forwarding number.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const phoneNumber = await client.phoneNumbers.update(
36
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
37
+ * { forwarding_number: '+12025559999' },
38
+ * );
39
+ * ```
40
+ */
41
+ update(phoneNumberID, body, options) {
42
+ return this._client.put(path `/v3/phone_numbers/${phoneNumberID}`, { body, ...options });
43
+ }
21
44
  }
22
45
  //# sourceMappingURL=phone-numbers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;OAIG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
1
+ {"version":3,"file":"phone-numbers.mjs","sourceRoot":"","sources":["../src/resources/phone-numbers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,aAAqB,EACrB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,aAAa,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;CACF"}
@@ -175,7 +175,7 @@ export declare namespace MessageEventV2 {
175
175
  */
176
176
  type: 'imessage_app';
177
177
  /**
178
- * The URL delivered to the iMessage app on tap.
178
+ * The URL the recipient's app opens when the user taps the card.
179
179
  */
180
180
  url: string;
181
181
  /**
@@ -321,7 +321,7 @@ export declare namespace MessagePayload {
321
321
  */
322
322
  type: 'imessage_app';
323
323
  /**
324
- * The URL delivered to the iMessage app on tap.
324
+ * The URL the recipient's app opens when the user taps the card.
325
325
  */
326
326
  url: string;
327
327
  /**
@@ -1777,13 +1777,13 @@ export declare namespace PhoneNumberStatusUpdatedWebhookEvent {
1777
1777
  */
1778
1778
  changed_at: string;
1779
1779
  /**
1780
- * @deprecated Current reputation of this phone line as assessed by risk-service.
1780
+ * @deprecated Current reputation of this phone line.
1781
1781
  *
1782
- * - `HEALTHY` — No elevated risk detected.
1783
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
1784
- * reviewing messaging patterns.
1785
- * - `CRITICAL` — High risk; further sending may result in line flagging or
1786
- * restriction.
1782
+ * - `HEALTHY` — The line is in good standing. Send normally.
1783
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
1784
+ * send pace and review your messaging patterns.
1785
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
1786
+ * Pause outbound on the line until it recovers.
1787
1787
  *
1788
1788
  * Defaults to `HEALTHY` for lines that have not yet been scored.
1789
1789
  */
@@ -1801,13 +1801,13 @@ export declare namespace PhoneNumberStatusUpdatedWebhookEvent {
1801
1801
  */
1802
1802
  phone_number: string;
1803
1803
  /**
1804
- * @deprecated Current reputation of this phone line as assessed by risk-service.
1804
+ * @deprecated Current reputation of this phone line.
1805
1805
  *
1806
- * - `HEALTHY` — No elevated risk detected.
1807
- * - `AT_RISK` — Elevated risk indicators present; consider reducing send volume or
1808
- * reviewing messaging patterns.
1809
- * - `CRITICAL` — High risk; further sending may result in line flagging or
1810
- * restriction.
1806
+ * - `HEALTHY` — The line is in good standing. Send normally.
1807
+ * - `AT_RISK` — The line's overall engagement is trending down. Slow the line's
1808
+ * send pace and review your messaging patterns.
1809
+ * - `CRITICAL` — Strong signals that messages from this line aren't landing well.
1810
+ * Pause outbound on the line until it recovers.
1811
1811
  *
1812
1812
  * Defaults to `HEALTHY` for lines that have not yet been scored.
1813
1813
  */