@linqapp/sdk 0.55.0 → 0.55.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.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +38 -19
- package/client.d.mts.map +1 -1
- package/client.d.ts +38 -19
- package/client.d.ts.map +1 -1
- package/client.js +38 -19
- package/client.js.map +1 -1
- package/client.mjs +38 -19
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attachments.d.mts +35 -13
- package/resources/attachments.d.mts.map +1 -1
- package/resources/attachments.d.ts +35 -13
- package/resources/attachments.d.ts.map +1 -1
- package/resources/attachments.js +31 -11
- package/resources/attachments.js.map +1 -1
- package/resources/attachments.mjs +31 -11
- package/resources/attachments.mjs.map +1 -1
- package/resources/chats/messages.d.mts +16 -12
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +16 -12
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -12
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -12
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/chats/polls.d.mts +16 -12
- package/resources/chats/polls.d.mts.map +1 -1
- package/resources/chats/polls.d.ts +16 -12
- package/resources/chats/polls.d.ts.map +1 -1
- package/resources/chats/polls.js +16 -12
- package/resources/chats/polls.js.map +1 -1
- package/resources/chats/polls.mjs +16 -12
- package/resources/chats/polls.mjs.map +1 -1
- package/resources/messages/messages.d.mts +16 -12
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +16 -12
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +16 -12
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +16 -12
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/messages/poll.d.mts +16 -12
- package/resources/messages/poll.d.mts.map +1 -1
- package/resources/messages/poll.d.ts +16 -12
- package/resources/messages/poll.d.ts.map +1 -1
- package/resources/messages/poll.js +16 -12
- package/resources/messages/poll.js.map +1 -1
- package/resources/messages/poll.mjs +16 -12
- package/resources/messages/poll.mjs.map +1 -1
- package/src/client.ts +38 -19
- package/src/resources/attachments.ts +35 -13
- package/src/resources/chats/messages.ts +16 -12
- package/src/resources/chats/polls.ts +16 -12
- package/src/resources/messages/messages.ts +16 -12
- package/src/resources/messages/poll.ts +16 -12
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkMG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqFG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CA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AE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAE5C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,YAAY,EAAE,oBAAoB,CAAC;IAEnC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,YAAY,EAAE,oBAAoB,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/attachments.js
CHANGED
|
@@ -31,13 +31,28 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
31
31
|
* - **Reduce message send latency** — the file is already stored, so sending is faster
|
|
32
32
|
*
|
|
33
33
|
* **How it works:**
|
|
34
|
-
* 1. `POST /v3/attachments` with file metadata → returns a presigned `upload_url` (valid for **15 minutes**) and a
|
|
34
|
+
* 1. `POST /v3/attachments` with file metadata → returns a presigned `upload_url` (valid for **15 minutes**) and a reusable `attachment_id`
|
|
35
35
|
* 2. PUT the raw file bytes to the `upload_url` with the `required_headers` (no JSON or multipart — just the binary content)
|
|
36
|
-
* 3. Reference the `attachment_id` in your media part when sending messages (
|
|
36
|
+
* 3. Reference the `attachment_id` in your media part when sending messages (stays valid unless deleted — see [Attachment Lifetime](#attachment-lifetime))
|
|
37
37
|
*
|
|
38
38
|
* **Key difference:** When you provide an external `url`, we download and process the file on every send.
|
|
39
39
|
* When you use a pre-uploaded `attachment_id`, the file is already stored — so repeated sends skip the download step entirely.
|
|
40
40
|
*
|
|
41
|
+
* ## Attachment Lifetime
|
|
42
|
+
*
|
|
43
|
+
* An `attachment_id` and its CDN URL stay valid until the file is deleted. Three things delete it:
|
|
44
|
+
*
|
|
45
|
+
* | Trigger | Applies to |
|
|
46
|
+
* |---|---|
|
|
47
|
+
* | `DELETE /v3/attachments/{attachmentId}` | Any attachment you own |
|
|
48
|
+
* | Ephemeral **attachments** tier (24–48h storage backstop) | Attachments on ephemeral-tier partners or phone numbers |
|
|
49
|
+
* | Ephemeral **messages** tier | Does **not** remove attachment bytes on its own: ephemeral-tier objects are removed by the 24–48h storage backstop above, and persistent-tier attachments are kept until you `DELETE` them explicitly. |
|
|
50
|
+
*
|
|
51
|
+
* Deletion is not reversible, and there is no `attachment.deleted` webhook. On either
|
|
52
|
+
* ephemeral tier, download anything you need to keep when you receive it rather than
|
|
53
|
+
* re-fetching later, and do not assume a pre-uploaded `attachment_id` can be reused
|
|
54
|
+
* indefinitely.
|
|
55
|
+
*
|
|
41
56
|
* ## Domain Allowlisting
|
|
42
57
|
*
|
|
43
58
|
* Attachment URLs in API responses are served from `cdn.linqapp.com`. This includes:
|
|
@@ -88,7 +103,7 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
88
103
|
*
|
|
89
104
|
* | Tier | URL pattern | TTL |
|
|
90
105
|
* |---|---|---|
|
|
91
|
-
* | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived |
|
|
106
|
+
* | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived — the URL itself does not expire, but see [Attachment Lifetime](#attachment-lifetime) |
|
|
92
107
|
* | Ephemeral | Pre-signed URL pointing at the ephemeral prefix on `cdn.linqapp.com` | 15 minutes per signed URL — re-fetch via the API for a fresh URL |
|
|
93
108
|
*
|
|
94
109
|
* Inbound media you receive over webhooks uses the same layout your outbound sends produce, so the URL you store and the URL you build look identical — no special casing in your client.
|
|
@@ -107,7 +122,7 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
107
122
|
* | Aspect | Persistent | Ephemeral |
|
|
108
123
|
* |---|---|---|
|
|
109
124
|
* | Download URL form | Long-lived CDN URL | Pre-signed URL with short TTL |
|
|
110
|
-
* | Retention floor |
|
|
125
|
+
* | Retention floor | Until you call `DELETE` | **Hard backstop: 24–48h** — even without an explicit `DELETE`, the platform removes the underlying bytes within roughly 24–48 hours of upload |
|
|
111
126
|
* | URL re-fetch | Not required | Fetch via `GET /v3/attachments/{attachmentId}` for a fresh signed URL after TTL expiry |
|
|
112
127
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
113
128
|
*
|
|
@@ -167,9 +182,9 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
167
182
|
*
|
|
168
183
|
* | Data | Persistent tier | Ephemeral tier |
|
|
169
184
|
* |---|---|---|
|
|
170
|
-
* | Attachment bytes | Retained until you `DELETE` | **Auto-removed
|
|
185
|
+
* | Attachment bytes | Retained until you `DELETE` | **Auto-removed within roughly 24–48 hours** of upload, independently of any message window. Also removable via `DELETE` |
|
|
171
186
|
* | Attachment metadata (id, filename, mime type, size) | Retained until you `DELETE` | Removed alongside the bytes |
|
|
172
|
-
* | Message body & parts | Retained per message-retention policy | Retained per message-retention policy — unless the line also has **ephemeral messages** enabled (see the Messages page), in which case the message and
|
|
187
|
+
* | Message body & parts | Retained per message-retention policy | Retained per message-retention policy — unless the line also has **ephemeral messages** enabled (see the Messages page), in which case the message's text, formatting, and attachment references are no longer retrievable through the API after that account's configured retention window (60 minutes – 24 hours, default 24 hours) from creation. Metadata is retained; see the Messages page for details |
|
|
173
188
|
* | Audit log of deletions | Retained per platform retention policy | Retained per platform retention policy |
|
|
174
189
|
*
|
|
175
190
|
* **In transit:** TLS 1.2+ everywhere. **At rest:** AES-256 (server-side encryption).
|
|
@@ -181,7 +196,7 @@ const path_1 = require("../internal/utils/path.js");
|
|
|
181
196
|
* - Allowlist exactly one outbound domain: `cdn.linqapp.com`.
|
|
182
197
|
* - Decide whether you need ephemeral attachments (high-sensitivity content) — request enablement through your Linq support contact.
|
|
183
198
|
* - Implement `DELETE /v3/attachments/{attachmentId}` calls in your deletion workflow.
|
|
184
|
-
* - Persist any attachments your application needs long-term — Linq is the authoritative source until you delete, but the ephemeral tier auto-purges
|
|
199
|
+
* - Persist any attachments your application needs long-term — Linq is the authoritative source until you delete, but the ephemeral tier auto-purges within roughly 24–48 hours of upload.
|
|
185
200
|
* - For audit: every deletion is logged on Linq's side. Surface a confirmation in your application UI based on the `204` response.
|
|
186
201
|
* - For end-user "right to delete" requests: enumerate attachment ids and `DELETE` each. The platform does not provide a partner-wide wipe endpoint — deletion is per-attachment by design.
|
|
187
202
|
*/
|
|
@@ -191,8 +206,11 @@ class Attachments extends resource_1.APIResource {
|
|
|
191
206
|
* your message's media part — no pre-upload required. Use this endpoint only when
|
|
192
207
|
* you want to upload a file ahead of time for reuse or latency optimization.
|
|
193
208
|
*
|
|
194
|
-
* Returns a presigned upload URL and a
|
|
195
|
-
* in future messages.
|
|
209
|
+
* Returns a presigned upload URL and a reusable `attachment_id` you can reference
|
|
210
|
+
* in future messages. Attachments stored on the **ephemeral attachments tier**
|
|
211
|
+
* (and their URLs) are removed within roughly 24–48 hours of upload, independently
|
|
212
|
+
* of any message retention window. Attachments on the persistent tier are kept
|
|
213
|
+
* until you `DELETE` them, regardless of message expiry.
|
|
196
214
|
*
|
|
197
215
|
* ## Step 1: Request an upload URL
|
|
198
216
|
*
|
|
@@ -206,7 +224,7 @@ class Attachments extends resource_1.APIResource {
|
|
|
206
224
|
* }
|
|
207
225
|
* ```
|
|
208
226
|
*
|
|
209
|
-
* The response includes an `upload_url` (valid for 15 minutes) and a
|
|
227
|
+
* The response includes an `upload_url` (valid for 15 minutes) and a reusable
|
|
210
228
|
* `attachment_id`.
|
|
211
229
|
*
|
|
212
230
|
* ## Step 2: Upload the file
|
|
@@ -230,7 +248,9 @@ class Attachments extends resource_1.APIResource {
|
|
|
230
248
|
* ## Step 3: Send a message with the attachment
|
|
231
249
|
*
|
|
232
250
|
* Reference the `attachment_id` in a media part with `POST /v3/chats`. The ID
|
|
233
|
-
*
|
|
251
|
+
* stays valid for as many messages as you want — unless the attachment is stored
|
|
252
|
+
* on the ephemeral attachments tier, in which case it is removed within roughly
|
|
253
|
+
* 24–48 hours of upload.
|
|
234
254
|
*
|
|
235
255
|
* ```json
|
|
236
256
|
* {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C
|
|
1
|
+
{"version":3,"file":"attachments.js","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkMG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqFG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,mBAAmB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAoB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,mBAAmB,YAAY,EAAE,EAAE;YAChE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA5HD,kCA4HC"}
|
|
@@ -28,13 +28,28 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
28
28
|
* - **Reduce message send latency** — the file is already stored, so sending is faster
|
|
29
29
|
*
|
|
30
30
|
* **How it works:**
|
|
31
|
-
* 1. `POST /v3/attachments` with file metadata → returns a presigned `upload_url` (valid for **15 minutes**) and a
|
|
31
|
+
* 1. `POST /v3/attachments` with file metadata → returns a presigned `upload_url` (valid for **15 minutes**) and a reusable `attachment_id`
|
|
32
32
|
* 2. PUT the raw file bytes to the `upload_url` with the `required_headers` (no JSON or multipart — just the binary content)
|
|
33
|
-
* 3. Reference the `attachment_id` in your media part when sending messages (
|
|
33
|
+
* 3. Reference the `attachment_id` in your media part when sending messages (stays valid unless deleted — see [Attachment Lifetime](#attachment-lifetime))
|
|
34
34
|
*
|
|
35
35
|
* **Key difference:** When you provide an external `url`, we download and process the file on every send.
|
|
36
36
|
* When you use a pre-uploaded `attachment_id`, the file is already stored — so repeated sends skip the download step entirely.
|
|
37
37
|
*
|
|
38
|
+
* ## Attachment Lifetime
|
|
39
|
+
*
|
|
40
|
+
* An `attachment_id` and its CDN URL stay valid until the file is deleted. Three things delete it:
|
|
41
|
+
*
|
|
42
|
+
* | Trigger | Applies to |
|
|
43
|
+
* |---|---|
|
|
44
|
+
* | `DELETE /v3/attachments/{attachmentId}` | Any attachment you own |
|
|
45
|
+
* | Ephemeral **attachments** tier (24–48h storage backstop) | Attachments on ephemeral-tier partners or phone numbers |
|
|
46
|
+
* | Ephemeral **messages** tier | Does **not** remove attachment bytes on its own: ephemeral-tier objects are removed by the 24–48h storage backstop above, and persistent-tier attachments are kept until you `DELETE` them explicitly. |
|
|
47
|
+
*
|
|
48
|
+
* Deletion is not reversible, and there is no `attachment.deleted` webhook. On either
|
|
49
|
+
* ephemeral tier, download anything you need to keep when you receive it rather than
|
|
50
|
+
* re-fetching later, and do not assume a pre-uploaded `attachment_id` can be reused
|
|
51
|
+
* indefinitely.
|
|
52
|
+
*
|
|
38
53
|
* ## Domain Allowlisting
|
|
39
54
|
*
|
|
40
55
|
* Attachment URLs in API responses are served from `cdn.linqapp.com`. This includes:
|
|
@@ -85,7 +100,7 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
85
100
|
*
|
|
86
101
|
* | Tier | URL pattern | TTL |
|
|
87
102
|
* |---|---|---|
|
|
88
|
-
* | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived |
|
|
103
|
+
* | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived — the URL itself does not expire, but see [Attachment Lifetime](#attachment-lifetime) |
|
|
89
104
|
* | Ephemeral | Pre-signed URL pointing at the ephemeral prefix on `cdn.linqapp.com` | 15 minutes per signed URL — re-fetch via the API for a fresh URL |
|
|
90
105
|
*
|
|
91
106
|
* Inbound media you receive over webhooks uses the same layout your outbound sends produce, so the URL you store and the URL you build look identical — no special casing in your client.
|
|
@@ -104,7 +119,7 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
104
119
|
* | Aspect | Persistent | Ephemeral |
|
|
105
120
|
* |---|---|---|
|
|
106
121
|
* | Download URL form | Long-lived CDN URL | Pre-signed URL with short TTL |
|
|
107
|
-
* | Retention floor |
|
|
122
|
+
* | Retention floor | Until you call `DELETE` | **Hard backstop: 24–48h** — even without an explicit `DELETE`, the platform removes the underlying bytes within roughly 24–48 hours of upload |
|
|
108
123
|
* | URL re-fetch | Not required | Fetch via `GET /v3/attachments/{attachmentId}` for a fresh signed URL after TTL expiry |
|
|
109
124
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
110
125
|
*
|
|
@@ -164,9 +179,9 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
164
179
|
*
|
|
165
180
|
* | Data | Persistent tier | Ephemeral tier |
|
|
166
181
|
* |---|---|---|
|
|
167
|
-
* | Attachment bytes | Retained until you `DELETE` | **Auto-removed
|
|
182
|
+
* | Attachment bytes | Retained until you `DELETE` | **Auto-removed within roughly 24–48 hours** of upload, independently of any message window. Also removable via `DELETE` |
|
|
168
183
|
* | Attachment metadata (id, filename, mime type, size) | Retained until you `DELETE` | Removed alongside the bytes |
|
|
169
|
-
* | Message body & parts | Retained per message-retention policy | Retained per message-retention policy — unless the line also has **ephemeral messages** enabled (see the Messages page), in which case the message and
|
|
184
|
+
* | Message body & parts | Retained per message-retention policy | Retained per message-retention policy — unless the line also has **ephemeral messages** enabled (see the Messages page), in which case the message's text, formatting, and attachment references are no longer retrievable through the API after that account's configured retention window (60 minutes – 24 hours, default 24 hours) from creation. Metadata is retained; see the Messages page for details |
|
|
170
185
|
* | Audit log of deletions | Retained per platform retention policy | Retained per platform retention policy |
|
|
171
186
|
*
|
|
172
187
|
* **In transit:** TLS 1.2+ everywhere. **At rest:** AES-256 (server-side encryption).
|
|
@@ -178,7 +193,7 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
178
193
|
* - Allowlist exactly one outbound domain: `cdn.linqapp.com`.
|
|
179
194
|
* - Decide whether you need ephemeral attachments (high-sensitivity content) — request enablement through your Linq support contact.
|
|
180
195
|
* - Implement `DELETE /v3/attachments/{attachmentId}` calls in your deletion workflow.
|
|
181
|
-
* - Persist any attachments your application needs long-term — Linq is the authoritative source until you delete, but the ephemeral tier auto-purges
|
|
196
|
+
* - Persist any attachments your application needs long-term — Linq is the authoritative source until you delete, but the ephemeral tier auto-purges within roughly 24–48 hours of upload.
|
|
182
197
|
* - For audit: every deletion is logged on Linq's side. Surface a confirmation in your application UI based on the `204` response.
|
|
183
198
|
* - For end-user "right to delete" requests: enumerate attachment ids and `DELETE` each. The platform does not provide a partner-wide wipe endpoint — deletion is per-attachment by design.
|
|
184
199
|
*/
|
|
@@ -188,8 +203,11 @@ export class Attachments extends APIResource {
|
|
|
188
203
|
* your message's media part — no pre-upload required. Use this endpoint only when
|
|
189
204
|
* you want to upload a file ahead of time for reuse or latency optimization.
|
|
190
205
|
*
|
|
191
|
-
* Returns a presigned upload URL and a
|
|
192
|
-
* in future messages.
|
|
206
|
+
* Returns a presigned upload URL and a reusable `attachment_id` you can reference
|
|
207
|
+
* in future messages. Attachments stored on the **ephemeral attachments tier**
|
|
208
|
+
* (and their URLs) are removed within roughly 24–48 hours of upload, independently
|
|
209
|
+
* of any message retention window. Attachments on the persistent tier are kept
|
|
210
|
+
* until you `DELETE` them, regardless of message expiry.
|
|
193
211
|
*
|
|
194
212
|
* ## Step 1: Request an upload URL
|
|
195
213
|
*
|
|
@@ -203,7 +221,7 @@ export class Attachments extends APIResource {
|
|
|
203
221
|
* }
|
|
204
222
|
* ```
|
|
205
223
|
*
|
|
206
|
-
* The response includes an `upload_url` (valid for 15 minutes) and a
|
|
224
|
+
* The response includes an `upload_url` (valid for 15 minutes) and a reusable
|
|
207
225
|
* `attachment_id`.
|
|
208
226
|
*
|
|
209
227
|
* ## Step 2: Upload the file
|
|
@@ -227,7 +245,9 @@ export class Attachments extends APIResource {
|
|
|
227
245
|
* ## Step 3: Send a message with the attachment
|
|
228
246
|
*
|
|
229
247
|
* Reference the `attachment_id` in a media part with `POST /v3/chats`. The ID
|
|
230
|
-
*
|
|
248
|
+
* stays valid for as many messages as you want — unless the attachment is stored
|
|
249
|
+
* on the ephemeral attachments tier, in which case it is removed within roughly
|
|
250
|
+
* 24–48 hours of upload.
|
|
231
251
|
*
|
|
232
252
|
* ```json
|
|
233
253
|
* {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.mjs","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C
|
|
1
|
+
{"version":3,"file":"attachments.mjs","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkMG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqFG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,mBAAmB,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAoB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,mBAAmB,YAAY,EAAE,EAAE;YAChE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -28,35 +28,39 @@ import { RequestOptions } from "../../internal/request-options.mjs";
|
|
|
28
28
|
*
|
|
29
29
|
* ## Ephemeral Messages (Privacy Tier)
|
|
30
30
|
*
|
|
31
|
-
* 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
|
|
31
|
+
* 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 given a **retention window configured for your account**. After that window, the message's text, formatting, and attachment references are no longer retrievable through the API — see the Attachments row below for how the attachment media itself is handled. Metadata about the message is retained: message identifiers, timestamps, phone numbers, and delivery state. Metadata retention is not bounded by this window. Bounded operational copies, such as backups and delivery queues, expire on their own separate schedules. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
32
|
+
*
|
|
33
|
+
* The window can be set anywhere from **60 minutes to 24 hours**, and defaults to **24 hours**. Ask your Linq support contact to configure a shorter window; it cannot be changed through the API.
|
|
32
34
|
*
|
|
33
35
|
* You can request it at two scopes:
|
|
34
36
|
*
|
|
35
37
|
* | Scope | Effect |
|
|
36
38
|
* |---|---|
|
|
37
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account
|
|
38
|
-
* | **Per phone number** | Only the specified phone numbers have
|
|
39
|
+
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account has its content removed from the API surface after your configured window. Metadata is retained. |
|
|
40
|
+
* | **Per phone number** | Only the specified phone numbers have message content removed from the API surface this way. The rest follow the standard message-retention policy. |
|
|
39
41
|
*
|
|
40
42
|
* **Behavioral differences vs the standard default:**
|
|
41
43
|
*
|
|
42
44
|
* | Aspect | Standard | Ephemeral |
|
|
43
45
|
* |---|---|---|
|
|
44
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours
|
|
45
|
-
* | After expiry | Message stays retrievable | Message is
|
|
46
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are
|
|
46
|
+
* | Retention | Retained per the standard message-retention policy | **Hard backstop: your configured window** (60 minutes – 24 hours, default 24 hours) from when the message is created |
|
|
47
|
+
* | After expiry | Message stays retrievable | Message content is no longer retrievable — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
48
|
+
* | Content on expiry | N/A | Text, formatting, and attachment references are removed from the API surface, not blanked out in place. Metadata (identifiers, timestamps, phone numbers, delivery state) is retained; its retention is not bounded by this window |
|
|
49
|
+
* | Attachments | Retained | Media sent on the **ephemeral attachments tier** is removed on its own storage backstop — within roughly 24–48 hours of upload — independently of the message window, so it can outlast a window shorter than a day. Attachments on the persistent tier (including pre-uploads via `POST /v3/attachments`) are kept until you `DELETE` them |
|
|
47
50
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
48
51
|
*
|
|
49
|
-
* **How the
|
|
52
|
+
* **How the retention window works:**
|
|
50
53
|
*
|
|
51
|
-
* - The window
|
|
52
|
-
* -
|
|
54
|
+
* - The window runs from **message creation** (`created_at`). It is configured for your account (60 minutes – 24 hours, default 24 hours) and cannot be set per message.
|
|
55
|
+
* - Attachment media follows its own storage backstop rather than the message window — see the Attachments row above.
|
|
53
56
|
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
57
|
+
* - **Deletion happens shortly *after* the window, not exactly at it.** A background sweep runs every ~5 minutes, so a message typically stops being retrievable within about 5 minutes of its expiry, and longer while a backlog is being worked through. Treat the window as the guaranteed *minimum* retention, never as an exact deletion time or an upper bound.
|
|
54
58
|
*
|
|
55
59
|
* **What you observe:**
|
|
56
60
|
*
|
|
57
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time.
|
|
61
|
+
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time, and they do not report your configured window either — so if you are on a window shorter than 24 hours you cannot derive a message's expiry from the API today. Track the window you agreed with your Linq support contact and compute `created_at + window` yourself.
|
|
58
62
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
59
|
-
* - **The backstop
|
|
63
|
+
* - **The attachment backstop is separate from the message window.** API retrievability (the `404` behavior above) ends at your configured window. Ephemeral-tier media objects are removed on their own storage backstop — within roughly 24–48 hours of upload — which is independent of the message window and can outlast a window shorter than a day. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
60
64
|
* - **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.
|
|
61
65
|
*
|
|
62
66
|
* **When to choose ephemeral:**
|
|
@@ -65,7 +69,7 @@ import { RequestOptions } from "../../internal/request-options.mjs";
|
|
|
65
69
|
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
66
70
|
* - 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.
|
|
67
71
|
*
|
|
68
|
-
* **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
|
|
72
|
+
* **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 once its window passes, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
69
73
|
*/
|
|
70
74
|
export declare class Messages extends APIResource {
|
|
71
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,KAAK,oBAAoB,iCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,iCAA6B;AACtE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,kCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE
|
|
1
|
+
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,KAAK,oBAAoB,iCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,iCAA6B;AACtE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,kCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAM,EAAE,MAAM,EACd,KAA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AM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;QAEzC;;WAEG;QACH,IAAI,EAAE,UAAU,CAAC;QAEjB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;CAAG;AAE1E,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;IAEjC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
|
|
@@ -28,35 +28,39 @@ import { RequestOptions } from "../../internal/request-options.js";
|
|
|
28
28
|
*
|
|
29
29
|
* ## Ephemeral Messages (Privacy Tier)
|
|
30
30
|
*
|
|
31
|
-
* 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
|
|
31
|
+
* 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 given a **retention window configured for your account**. After that window, the message's text, formatting, and attachment references are no longer retrievable through the API — see the Attachments row below for how the attachment media itself is handled. Metadata about the message is retained: message identifiers, timestamps, phone numbers, and delivery state. Metadata retention is not bounded by this window. Bounded operational copies, such as backups and delivery queues, expire on their own separate schedules. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
32
|
+
*
|
|
33
|
+
* The window can be set anywhere from **60 minutes to 24 hours**, and defaults to **24 hours**. Ask your Linq support contact to configure a shorter window; it cannot be changed through the API.
|
|
32
34
|
*
|
|
33
35
|
* You can request it at two scopes:
|
|
34
36
|
*
|
|
35
37
|
* | Scope | Effect |
|
|
36
38
|
* |---|---|
|
|
37
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account
|
|
38
|
-
* | **Per phone number** | Only the specified phone numbers have
|
|
39
|
+
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account has its content removed from the API surface after your configured window. Metadata is retained. |
|
|
40
|
+
* | **Per phone number** | Only the specified phone numbers have message content removed from the API surface this way. The rest follow the standard message-retention policy. |
|
|
39
41
|
*
|
|
40
42
|
* **Behavioral differences vs the standard default:**
|
|
41
43
|
*
|
|
42
44
|
* | Aspect | Standard | Ephemeral |
|
|
43
45
|
* |---|---|---|
|
|
44
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours
|
|
45
|
-
* | After expiry | Message stays retrievable | Message is
|
|
46
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are
|
|
46
|
+
* | Retention | Retained per the standard message-retention policy | **Hard backstop: your configured window** (60 minutes – 24 hours, default 24 hours) from when the message is created |
|
|
47
|
+
* | After expiry | Message stays retrievable | Message content is no longer retrievable — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
48
|
+
* | Content on expiry | N/A | Text, formatting, and attachment references are removed from the API surface, not blanked out in place. Metadata (identifiers, timestamps, phone numbers, delivery state) is retained; its retention is not bounded by this window |
|
|
49
|
+
* | Attachments | Retained | Media sent on the **ephemeral attachments tier** is removed on its own storage backstop — within roughly 24–48 hours of upload — independently of the message window, so it can outlast a window shorter than a day. Attachments on the persistent tier (including pre-uploads via `POST /v3/attachments`) are kept until you `DELETE` them |
|
|
47
50
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
48
51
|
*
|
|
49
|
-
* **How the
|
|
52
|
+
* **How the retention window works:**
|
|
50
53
|
*
|
|
51
|
-
* - The window
|
|
52
|
-
* -
|
|
54
|
+
* - The window runs from **message creation** (`created_at`). It is configured for your account (60 minutes – 24 hours, default 24 hours) and cannot be set per message.
|
|
55
|
+
* - Attachment media follows its own storage backstop rather than the message window — see the Attachments row above.
|
|
53
56
|
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
57
|
+
* - **Deletion happens shortly *after* the window, not exactly at it.** A background sweep runs every ~5 minutes, so a message typically stops being retrievable within about 5 minutes of its expiry, and longer while a backlog is being worked through. Treat the window as the guaranteed *minimum* retention, never as an exact deletion time or an upper bound.
|
|
54
58
|
*
|
|
55
59
|
* **What you observe:**
|
|
56
60
|
*
|
|
57
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time.
|
|
61
|
+
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time, and they do not report your configured window either — so if you are on a window shorter than 24 hours you cannot derive a message's expiry from the API today. Track the window you agreed with your Linq support contact and compute `created_at + window` yourself.
|
|
58
62
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
59
|
-
* - **The backstop
|
|
63
|
+
* - **The attachment backstop is separate from the message window.** API retrievability (the `404` behavior above) ends at your configured window. Ephemeral-tier media objects are removed on their own storage backstop — within roughly 24–48 hours of upload — which is independent of the message window and can outlast a window shorter than a day. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
60
64
|
* - **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.
|
|
61
65
|
*
|
|
62
66
|
* **When to choose ephemeral:**
|
|
@@ -65,7 +69,7 @@ import { RequestOptions } from "../../internal/request-options.js";
|
|
|
65
69
|
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
66
70
|
* - 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.
|
|
67
71
|
*
|
|
68
|
-
* **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
|
|
72
|
+
* **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 once its window passes, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
69
73
|
*/
|
|
70
74
|
export declare class Messages extends APIResource {
|
|
71
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,KAAK,oBAAoB,gCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,gCAA6B;AACtE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,iCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,KAAK,oBAAoB,gCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,gCAA6B;AACtE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,iCAA8B;AAC/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,UAAU,CAAC,EAAE,MAAM,CAAC;YAEpB;;eAEG;YACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAE1B;;eAEG;YACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;SAC9B;KACF;IAED;;OAEG;IACH,UAAiB,mBAAmB;QAClC;;WAEG;QACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;QAEzC;;WAEG;QACH,IAAI,EAAE,UAAU,CAAC;QAEjB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;CAAG;AAE1E,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;OAUG;IACH,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;IAEjC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
|
|
@@ -27,35 +27,39 @@ const path_1 = require("../../internal/utils/path.js");
|
|
|
27
27
|
*
|
|
28
28
|
* ## Ephemeral Messages (Privacy Tier)
|
|
29
29
|
*
|
|
30
|
-
* 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
|
|
30
|
+
* 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 given a **retention window configured for your account**. After that window, the message's text, formatting, and attachment references are no longer retrievable through the API — see the Attachments row below for how the attachment media itself is handled. Metadata about the message is retained: message identifiers, timestamps, phone numbers, and delivery state. Metadata retention is not bounded by this window. Bounded operational copies, such as backups and delivery queues, expire on their own separate schedules. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
31
|
+
*
|
|
32
|
+
* The window can be set anywhere from **60 minutes to 24 hours**, and defaults to **24 hours**. Ask your Linq support contact to configure a shorter window; it cannot be changed through the API.
|
|
31
33
|
*
|
|
32
34
|
* You can request it at two scopes:
|
|
33
35
|
*
|
|
34
36
|
* | Scope | Effect |
|
|
35
37
|
* |---|---|
|
|
36
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account
|
|
37
|
-
* | **Per phone number** | Only the specified phone numbers have
|
|
38
|
+
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account has its content removed from the API surface after your configured window. Metadata is retained. |
|
|
39
|
+
* | **Per phone number** | Only the specified phone numbers have message content removed from the API surface this way. The rest follow the standard message-retention policy. |
|
|
38
40
|
*
|
|
39
41
|
* **Behavioral differences vs the standard default:**
|
|
40
42
|
*
|
|
41
43
|
* | Aspect | Standard | Ephemeral |
|
|
42
44
|
* |---|---|---|
|
|
43
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours
|
|
44
|
-
* | After expiry | Message stays retrievable | Message is
|
|
45
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are
|
|
45
|
+
* | Retention | Retained per the standard message-retention policy | **Hard backstop: your configured window** (60 minutes – 24 hours, default 24 hours) from when the message is created |
|
|
46
|
+
* | After expiry | Message stays retrievable | Message content is no longer retrievable — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
47
|
+
* | Content on expiry | N/A | Text, formatting, and attachment references are removed from the API surface, not blanked out in place. Metadata (identifiers, timestamps, phone numbers, delivery state) is retained; its retention is not bounded by this window |
|
|
48
|
+
* | Attachments | Retained | Media sent on the **ephemeral attachments tier** is removed on its own storage backstop — within roughly 24–48 hours of upload — independently of the message window, so it can outlast a window shorter than a day. Attachments on the persistent tier (including pre-uploads via `POST /v3/attachments`) are kept until you `DELETE` them |
|
|
46
49
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
47
50
|
*
|
|
48
|
-
* **How the
|
|
51
|
+
* **How the retention window works:**
|
|
49
52
|
*
|
|
50
|
-
* - The window
|
|
51
|
-
* -
|
|
53
|
+
* - The window runs from **message creation** (`created_at`). It is configured for your account (60 minutes – 24 hours, default 24 hours) and cannot be set per message.
|
|
54
|
+
* - Attachment media follows its own storage backstop rather than the message window — see the Attachments row above.
|
|
52
55
|
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
56
|
+
* - **Deletion happens shortly *after* the window, not exactly at it.** A background sweep runs every ~5 minutes, so a message typically stops being retrievable within about 5 minutes of its expiry, and longer while a backlog is being worked through. Treat the window as the guaranteed *minimum* retention, never as an exact deletion time or an upper bound.
|
|
53
57
|
*
|
|
54
58
|
* **What you observe:**
|
|
55
59
|
*
|
|
56
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time.
|
|
60
|
+
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time, and they do not report your configured window either — so if you are on a window shorter than 24 hours you cannot derive a message's expiry from the API today. Track the window you agreed with your Linq support contact and compute `created_at + window` yourself.
|
|
57
61
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
58
|
-
* - **The backstop
|
|
62
|
+
* - **The attachment backstop is separate from the message window.** API retrievability (the `404` behavior above) ends at your configured window. Ephemeral-tier media objects are removed on their own storage backstop — within roughly 24–48 hours of upload — which is independent of the message window and can outlast a window shorter than a day. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
59
63
|
* - **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.
|
|
60
64
|
*
|
|
61
65
|
* **When to choose ephemeral:**
|
|
@@ -64,7 +68,7 @@ const path_1 = require("../../internal/utils/path.js");
|
|
|
64
68
|
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
65
69
|
* - 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.
|
|
66
70
|
*
|
|
67
|
-
* **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
|
|
71
|
+
* **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 once its window passes, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
68
72
|
*/
|
|
69
73
|
class Messages extends resource_1.APIResource {
|
|
70
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAClC,CAAA,mCAAoD,CAAA,EACpD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAvFD,4BAuFC"}
|
|
@@ -24,35 +24,39 @@ import { path } from "../../internal/utils/path.mjs";
|
|
|
24
24
|
*
|
|
25
25
|
* ## Ephemeral Messages (Privacy Tier)
|
|
26
26
|
*
|
|
27
|
-
* 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
|
|
27
|
+
* 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 given a **retention window configured for your account**. After that window, the message's text, formatting, and attachment references are no longer retrievable through the API — see the Attachments row below for how the attachment media itself is handled. Metadata about the message is retained: message identifiers, timestamps, phone numbers, and delivery state. Metadata retention is not bounded by this window. Bounded operational copies, such as backups and delivery queues, expire on their own separate schedules. There is no per-message flag; ephemerality is applied automatically based on your configuration.
|
|
28
|
+
*
|
|
29
|
+
* The window can be set anywhere from **60 minutes to 24 hours**, and defaults to **24 hours**. Ask your Linq support contact to configure a shorter window; it cannot be changed through the API.
|
|
28
30
|
*
|
|
29
31
|
* You can request it at two scopes:
|
|
30
32
|
*
|
|
31
33
|
* | Scope | Effect |
|
|
32
34
|
* |---|---|
|
|
33
|
-
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account
|
|
34
|
-
* | **Per phone number** | Only the specified phone numbers have
|
|
35
|
+
* | **Partner-wide** | Every outbound and inbound message on every phone number under your account has its content removed from the API surface after your configured window. Metadata is retained. |
|
|
36
|
+
* | **Per phone number** | Only the specified phone numbers have message content removed from the API surface this way. The rest follow the standard message-retention policy. |
|
|
35
37
|
*
|
|
36
38
|
* **Behavioral differences vs the standard default:**
|
|
37
39
|
*
|
|
38
40
|
* | Aspect | Standard | Ephemeral |
|
|
39
41
|
* |---|---|---|
|
|
40
|
-
* | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours
|
|
41
|
-
* | After expiry | Message stays retrievable | Message is
|
|
42
|
-
* | Content on expiry | N/A | Text, formatting, and attachment references are
|
|
42
|
+
* | Retention | Retained per the standard message-retention policy | **Hard backstop: your configured window** (60 minutes – 24 hours, default 24 hours) from when the message is created |
|
|
43
|
+
* | After expiry | Message stays retrievable | Message content is no longer retrievable — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
|
|
44
|
+
* | Content on expiry | N/A | Text, formatting, and attachment references are removed from the API surface, not blanked out in place. Metadata (identifiers, timestamps, phone numbers, delivery state) is retained; its retention is not bounded by this window |
|
|
45
|
+
* | Attachments | Retained | Media sent on the **ephemeral attachments tier** is removed on its own storage backstop — within roughly 24–48 hours of upload — independently of the message window, so it can outlast a window shorter than a day. Attachments on the persistent tier (including pre-uploads via `POST /v3/attachments`) are kept until you `DELETE` them |
|
|
43
46
|
* | Cross-partner isolation | Enforced | Enforced |
|
|
44
47
|
*
|
|
45
|
-
* **How the
|
|
48
|
+
* **How the retention window works:**
|
|
46
49
|
*
|
|
47
|
-
* - The window
|
|
48
|
-
* -
|
|
50
|
+
* - The window runs from **message creation** (`created_at`). It is configured for your account (60 minutes – 24 hours, default 24 hours) and cannot be set per message.
|
|
51
|
+
* - Attachment media follows its own storage backstop rather than the message window — see the Attachments row above.
|
|
49
52
|
* - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
|
|
53
|
+
* - **Deletion happens shortly *after* the window, not exactly at it.** A background sweep runs every ~5 minutes, so a message typically stops being retrievable within about 5 minutes of its expiry, and longer while a backlog is being worked through. Treat the window as the guaranteed *minimum* retention, never as an exact deletion time or an upper bound.
|
|
50
54
|
*
|
|
51
55
|
* **What you observe:**
|
|
52
56
|
*
|
|
53
|
-
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time.
|
|
57
|
+
* - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time, and they do not report your configured window either — so if you are on a window shorter than 24 hours you cannot derive a message's expiry from the API today. Track the window you agreed with your Linq support contact and compute `created_at + window` yourself.
|
|
54
58
|
* - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
|
|
55
|
-
* - **The backstop
|
|
59
|
+
* - **The attachment backstop is separate from the message window.** API retrievability (the `404` behavior above) ends at your configured window. Ephemeral-tier media objects are removed on their own storage backstop — within roughly 24–48 hours of upload — which is independent of the message window and can outlast a window shorter than a day. Removal of the corresponding entries from the sending device happens asynchronously and can complete after the backstop.
|
|
56
60
|
* - **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
61
|
*
|
|
58
62
|
* **When to choose ephemeral:**
|
|
@@ -61,7 +65,7 @@ import { path } from "../../internal/utils/path.mjs";
|
|
|
61
65
|
* - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
|
|
62
66
|
* - 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
67
|
*
|
|
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
|
|
68
|
+
* **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 once its window passes, persist anything you need to keep from the webhook payload at the time it is delivered.
|
|
65
69
|
*/
|
|
66
70
|
export class Messages extends APIResource {
|
|
67
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAMlD,OAAO,EACL,sBAAsB,GAGvB,kCAA8B;AAE/B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAMlD,OAAO,EACL,sBAAsB,GAGvB,kCAA8B;AAE/B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,aAAa,MAAM,WAAW,EAClC,CAAA,sBAAoD,CAAA,EACpD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|