@linqapp/sdk 0.22.1 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts +116 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +116 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +116 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +116 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/log.d.mts.map +1 -1
  11. package/internal/utils/log.d.ts.map +1 -1
  12. package/internal/utils/log.js +2 -0
  13. package/internal/utils/log.js.map +1 -1
  14. package/internal/utils/log.mjs +2 -0
  15. package/internal/utils/log.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/attachments.d.mts +133 -5
  18. package/resources/attachments.d.mts.map +1 -1
  19. package/resources/attachments.d.ts +133 -5
  20. package/resources/attachments.d.ts.map +1 -1
  21. package/resources/attachments.js +137 -2
  22. package/resources/attachments.js.map +1 -1
  23. package/resources/attachments.mjs +137 -2
  24. package/resources/attachments.mjs.map +1 -1
  25. package/resources/chats/chats.d.mts +11 -11
  26. package/resources/chats/chats.d.ts +11 -11
  27. package/resources/phone-numbers.d.mts +43 -0
  28. package/resources/phone-numbers.d.mts.map +1 -1
  29. package/resources/phone-numbers.d.ts +43 -0
  30. package/resources/phone-numbers.d.ts.map +1 -1
  31. package/resources/webhooks.d.mts +23 -15
  32. package/resources/webhooks.d.mts.map +1 -1
  33. package/resources/webhooks.d.ts +23 -15
  34. package/resources/webhooks.d.ts.map +1 -1
  35. package/src/client.ts +116 -0
  36. package/src/internal/utils/log.ts +2 -0
  37. package/src/resources/attachments.ts +140 -5
  38. package/src/resources/chats/chats.ts +11 -11
  39. package/src/resources/phone-numbers.ts +46 -0
  40. package/src/resources/webhooks.ts +25 -15
  41. package/src/version.ts +1 -1
  42. package/version.d.mts +1 -1
  43. package/version.d.ts +1 -1
  44. package/version.js +1 -1
  45. package/version.mjs +1 -1
@@ -64,6 +64,122 @@ import { RequestOptions } from "../internal/request-options.js";
64
64
  *
65
65
  * - **URL-based (`url` field):** 10MB maximum
66
66
  * - **Pre-upload (`attachment_id`):** 100MB maximum
67
+ *
68
+ * ## Security & Ownership
69
+ *
70
+ * Every attachment is bound to the partner account that created or received it. The API enforces ownership on every operation that touches an attachment — sending, retrieving, deleting.
71
+ *
72
+ * **What this means for you:**
73
+ *
74
+ * - An attachment created under your API key can only be referenced by your API key.
75
+ * - Submitting another partner's `attachment_id` returns `404 Not Found`. We do not disclose whether the id exists or belongs to someone else.
76
+ * - Submitting a CDN URL that resolves to another partner's attachment is rejected before the send is attempted.
77
+ * - Ownership enforcement applies uniformly across send, create-chat, voice memo, retrieve, and delete operations.
78
+ *
79
+ * Every attachment-affecting endpoint requires a valid partner API key. Unauthenticated calls return `401 Unauthorized`.
80
+ *
81
+ * ## Attachment URL Patterns
82
+ *
83
+ * Attachment URLs in API responses and webhook payloads use one of two layouts, depending on the attachment's tier:
84
+ *
85
+ * | Tier | URL pattern | TTL |
86
+ * |---|---|---|
87
+ * | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived |
88
+ * | 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 |
89
+ *
90
+ * 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.
91
+ *
92
+ * ## Ephemeral Attachments (Privacy Tier)
93
+ *
94
+ * For regulated or sensitive content, opt in to the **ephemeral attachments** tier by contacting your Linq support contact. You can request it at two scopes:
95
+ *
96
+ * | Scope | Effect |
97
+ * |---|---|
98
+ * | **Partner-wide** | Every outbound and inbound attachment on every phone number under your account is routed through the ephemeral tier. |
99
+ * | **Per phone number** | Only the specified phone numbers route their attachments through the ephemeral tier. The rest stay on the persistent tier. |
100
+ *
101
+ * **Behavioral differences vs the persistent default:**
102
+ *
103
+ * | Aspect | Persistent | Ephemeral |
104
+ * |---|---|---|
105
+ * | Download URL form | Long-lived CDN URL | Pre-signed URL with short TTL |
106
+ * | Retention floor | Indefinite (until you call `DELETE`) | **Hard backstop: 1 day** — even without an explicit `DELETE`, the platform removes the underlying bytes after 24 hours |
107
+ * | URL re-fetch | Not required | Fetch via `GET /v3/attachments/{attachmentId}` for a fresh signed URL after TTL expiry |
108
+ * | Cross-partner isolation | Enforced | Enforced |
109
+ *
110
+ * **When to choose ephemeral:**
111
+ *
112
+ * - Your downstream system processes the file immediately on receipt and does not need to re-read it later.
113
+ * - You have a compliance requirement that the platform must not retain attachments beyond a short window.
114
+ * - The content is high-sensitivity (PHI, financial documents, identity verification) and you do not want it sitting behind a long-lived URL.
115
+ *
116
+ * **Important:** ephemeral applies in *both directions* — outbound files you upload **and** inbound media received by the phone numbers in that scope. Download bytes you need to keep promptly, or fetch a fresh signed URL via the API when needed.
117
+ *
118
+ * ## Deleting an Attachment
119
+ *
120
+ * To permanently remove an attachment you own, use:
121
+ *
122
+ * ```http
123
+ * DELETE /v3/attachments/{attachmentId}
124
+ * Authorization: Bearer <your_api_key>
125
+ * ```
126
+ *
127
+ * **What this does:**
128
+ *
129
+ * 1. Verifies the attachment is owned by your account. Returns `404` otherwise.
130
+ * 2. Removes the underlying file from Linq storage.
131
+ * 3. Records an audit entry (timestamp, partner, attachment id).
132
+ *
133
+ * **Response codes:**
134
+ *
135
+ * | Status | Meaning |
136
+ * |---|---|
137
+ * | `204 No Content` | Deletion succeeded. The attachment is removed from Linq storage. |
138
+ * | `400 Bad Request` | `attachmentId` is not a valid UUID. |
139
+ * | `401 Unauthorized` | Missing or invalid API key. |
140
+ * | `404 Not Found` | Attachment does not exist or is not owned by your account. |
141
+ * | `500 Internal Server Error` | Transient infrastructure issue — safe to retry. |
142
+ *
143
+ * **Effect on message history:**
144
+ *
145
+ * - Messages that referenced the deleted attachment remain visible.
146
+ * - The message part that pointed at the attachment is preserved with no attachment reference.
147
+ * - Webhook payloads previously delivered to you retain the original URL string, but downloads from that URL return `404` going forward.
148
+ *
149
+ * Deletion is **irreversible**. Once `204` is returned, the bytes are gone — there is no undelete.
150
+ *
151
+ * ## Inbound Media Flow
152
+ *
153
+ * When one of your phone numbers receives a message with media (image, video, audio, document), the platform:
154
+ *
155
+ * 1. Stores the file under your partner account.
156
+ * 2. Records metadata linked to the inbound message.
157
+ * 3. Delivers a webhook whose `parts[]` array includes a `media` part with a `url` pointing at `cdn.linqapp.com`.
158
+ * 4. If the receiving phone is opted in to ephemeral, the `url` is a short-TTL signed URL.
159
+ *
160
+ * You can acknowledge the webhook without fetching the file inline, and lazy-load via `GET /v3/attachments/{attachmentId}` later. For ephemeral attachments, retrieving via the API always returns a freshly-signed URL.
161
+ *
162
+ * ## Data Lifecycle Summary
163
+ *
164
+ * | Data | Persistent tier | Ephemeral tier |
165
+ * |---|---|---|
166
+ * | Attachment bytes | Retained until you `DELETE` | **Auto-removed after 1 day**, also removable via `DELETE` |
167
+ * | Attachment metadata (id, filename, mime type, size) | Retained until you `DELETE` | Removed alongside the bytes |
168
+ * | Message body & parts | Retained per message-retention policy | Retained per message-retention policy |
169
+ * | Audit log of deletions | Retained per platform retention policy | Retained per platform retention policy |
170
+ *
171
+ * **In transit:** TLS 1.2+ everywhere. **At rest:** AES-256 (server-side encryption).
172
+ *
173
+ * ## Compliance Checklist
174
+ *
175
+ * If you're integrating Linq under a security or privacy review, here is the short list:
176
+ *
177
+ * - Allowlist exactly one outbound domain: `cdn.linqapp.com`.
178
+ * - Decide whether you need ephemeral attachments (high-sensitivity content) — request enablement through your Linq support contact.
179
+ * - Implement `DELETE /v3/attachments/{attachmentId}` calls in your deletion workflow.
180
+ * - Persist any attachments your application needs long-term — Linq is the authoritative source until you delete, but the ephemeral tier auto-purges after 1 day.
181
+ * - For audit: every deletion is logged on Linq's side. Surface a confirmation in your application UI based on the `204` response.
182
+ * - 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.
67
183
  */
68
184
  export declare class Attachments extends APIResource {
69
185
  /**
@@ -151,8 +267,10 @@ export declare class Attachments extends APIResource {
151
267
  */
152
268
  create(body: AttachmentCreateParams, options?: RequestOptions): APIPromise<AttachmentCreateResponse>;
153
269
  /**
154
- * Retrieve metadata for a specific attachment including its status, file
155
- * information, and URLs for downloading.
270
+ * Retrieve metadata for a specific attachment including file information, and URLs
271
+ * for downloading.
272
+ *
273
+ * `status`: (**deprecated** — will be removed in a future API version)
156
274
  *
157
275
  * @example
158
276
  * ```ts
@@ -162,6 +280,17 @@ export declare class Attachments extends APIResource {
162
280
  * ```
163
281
  */
164
282
  retrieve(attachmentID: string, options?: RequestOptions): APIPromise<AttachmentRetrieveResponse>;
283
+ /**
284
+ * Permanently delete an attachment owned by the authenticated partner.
285
+ *
286
+ * @example
287
+ * ```ts
288
+ * await client.attachments.delete(
289
+ * 'abc12345-1234-5678-9abc-def012345678',
290
+ * );
291
+ * ```
292
+ */
293
+ delete(attachmentID: string, options?: RequestOptions): APIPromise<void>;
165
294
  }
166
295
  /**
167
296
  * Supported MIME types for file attachments and media URLs.
@@ -206,8 +335,7 @@ export declare class Attachments extends APIResource {
206
335
  export type SupportedContentType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/heic' | 'image/heif' | 'image/tiff' | 'image/bmp' | 'image/svg+xml' | 'image/webp' | 'image/x-icon' | 'video/mp4' | 'video/quicktime' | 'video/mpeg' | 'video/mpeg2' | 'video/x-m4v' | 'video/x-msvideo' | 'video/3gpp' | 'audio/mpeg' | 'audio/mp3' | 'audio/x-m4a' | 'audio/mp4' | 'audio/x-caf' | 'audio/x-wav' | 'audio/x-aiff' | 'audio/aiff' | 'audio/aac' | 'audio/midi' | 'audio/amr' | 'application/pdf' | 'text/plain' | 'text/markdown' | 'text/vcard' | 'text/rtf' | 'text/csv' | 'text/html' | 'text/calendar' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'application/x-iwork-pages-sffpages' | 'application/x-iwork-numbers-sffnumbers' | 'application/x-iwork-keynote-sffkey' | 'application/epub+zip' | 'text/xml' | 'application/json' | 'application/zip' | 'application/x-gzip';
207
336
  export interface AttachmentCreateResponse {
208
337
  /**
209
- * Unique identifier for the attachment (for status checks via GET
210
- * /v3/attachments/{id})
338
+ * Unique identifier for the attachment
211
339
  */
212
340
  attachment_id: string;
213
341
  /**
@@ -296,7 +424,7 @@ export interface AttachmentRetrieveResponse {
296
424
  */
297
425
  size_bytes: number;
298
426
  /**
299
- * Current upload/processing status
427
+ * @deprecated status is no longer a useful signal
300
428
  */
301
429
  status: 'pending' | 'complete' | 'failed';
302
430
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkFG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGjG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M,CAAA;KAAE,CAAC;IAE5C;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;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"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Attachments = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
+ const headers_1 = require("../internal/headers.js");
6
7
  const path_1 = require("../internal/utils/path.js");
7
8
  /**
8
9
  * Send files (images, videos, documents, audio) with messages by providing a URL in a media part.
@@ -67,6 +68,122 @@ const path_1 = require("../internal/utils/path.js");
67
68
  *
68
69
  * - **URL-based (`url` field):** 10MB maximum
69
70
  * - **Pre-upload (`attachment_id`):** 100MB maximum
71
+ *
72
+ * ## Security & Ownership
73
+ *
74
+ * Every attachment is bound to the partner account that created or received it. The API enforces ownership on every operation that touches an attachment — sending, retrieving, deleting.
75
+ *
76
+ * **What this means for you:**
77
+ *
78
+ * - An attachment created under your API key can only be referenced by your API key.
79
+ * - Submitting another partner's `attachment_id` returns `404 Not Found`. We do not disclose whether the id exists or belongs to someone else.
80
+ * - Submitting a CDN URL that resolves to another partner's attachment is rejected before the send is attempted.
81
+ * - Ownership enforcement applies uniformly across send, create-chat, voice memo, retrieve, and delete operations.
82
+ *
83
+ * Every attachment-affecting endpoint requires a valid partner API key. Unauthenticated calls return `401 Unauthorized`.
84
+ *
85
+ * ## Attachment URL Patterns
86
+ *
87
+ * Attachment URLs in API responses and webhook payloads use one of two layouts, depending on the attachment's tier:
88
+ *
89
+ * | Tier | URL pattern | TTL |
90
+ * |---|---|---|
91
+ * | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived |
92
+ * | 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
+ *
94
+ * 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.
95
+ *
96
+ * ## Ephemeral Attachments (Privacy Tier)
97
+ *
98
+ * For regulated or sensitive content, opt in to the **ephemeral attachments** tier by contacting your Linq support contact. You can request it at two scopes:
99
+ *
100
+ * | Scope | Effect |
101
+ * |---|---|
102
+ * | **Partner-wide** | Every outbound and inbound attachment on every phone number under your account is routed through the ephemeral tier. |
103
+ * | **Per phone number** | Only the specified phone numbers route their attachments through the ephemeral tier. The rest stay on the persistent tier. |
104
+ *
105
+ * **Behavioral differences vs the persistent default:**
106
+ *
107
+ * | Aspect | Persistent | Ephemeral |
108
+ * |---|---|---|
109
+ * | Download URL form | Long-lived CDN URL | Pre-signed URL with short TTL |
110
+ * | Retention floor | Indefinite (until you call `DELETE`) | **Hard backstop: 1 day** — even without an explicit `DELETE`, the platform removes the underlying bytes after 24 hours |
111
+ * | URL re-fetch | Not required | Fetch via `GET /v3/attachments/{attachmentId}` for a fresh signed URL after TTL expiry |
112
+ * | Cross-partner isolation | Enforced | Enforced |
113
+ *
114
+ * **When to choose ephemeral:**
115
+ *
116
+ * - Your downstream system processes the file immediately on receipt and does not need to re-read it later.
117
+ * - You have a compliance requirement that the platform must not retain attachments beyond a short window.
118
+ * - The content is high-sensitivity (PHI, financial documents, identity verification) and you do not want it sitting behind a long-lived URL.
119
+ *
120
+ * **Important:** ephemeral applies in *both directions* — outbound files you upload **and** inbound media received by the phone numbers in that scope. Download bytes you need to keep promptly, or fetch a fresh signed URL via the API when needed.
121
+ *
122
+ * ## Deleting an Attachment
123
+ *
124
+ * To permanently remove an attachment you own, use:
125
+ *
126
+ * ```http
127
+ * DELETE /v3/attachments/{attachmentId}
128
+ * Authorization: Bearer <your_api_key>
129
+ * ```
130
+ *
131
+ * **What this does:**
132
+ *
133
+ * 1. Verifies the attachment is owned by your account. Returns `404` otherwise.
134
+ * 2. Removes the underlying file from Linq storage.
135
+ * 3. Records an audit entry (timestamp, partner, attachment id).
136
+ *
137
+ * **Response codes:**
138
+ *
139
+ * | Status | Meaning |
140
+ * |---|---|
141
+ * | `204 No Content` | Deletion succeeded. The attachment is removed from Linq storage. |
142
+ * | `400 Bad Request` | `attachmentId` is not a valid UUID. |
143
+ * | `401 Unauthorized` | Missing or invalid API key. |
144
+ * | `404 Not Found` | Attachment does not exist or is not owned by your account. |
145
+ * | `500 Internal Server Error` | Transient infrastructure issue — safe to retry. |
146
+ *
147
+ * **Effect on message history:**
148
+ *
149
+ * - Messages that referenced the deleted attachment remain visible.
150
+ * - The message part that pointed at the attachment is preserved with no attachment reference.
151
+ * - Webhook payloads previously delivered to you retain the original URL string, but downloads from that URL return `404` going forward.
152
+ *
153
+ * Deletion is **irreversible**. Once `204` is returned, the bytes are gone — there is no undelete.
154
+ *
155
+ * ## Inbound Media Flow
156
+ *
157
+ * When one of your phone numbers receives a message with media (image, video, audio, document), the platform:
158
+ *
159
+ * 1. Stores the file under your partner account.
160
+ * 2. Records metadata linked to the inbound message.
161
+ * 3. Delivers a webhook whose `parts[]` array includes a `media` part with a `url` pointing at `cdn.linqapp.com`.
162
+ * 4. If the receiving phone is opted in to ephemeral, the `url` is a short-TTL signed URL.
163
+ *
164
+ * You can acknowledge the webhook without fetching the file inline, and lazy-load via `GET /v3/attachments/{attachmentId}` later. For ephemeral attachments, retrieving via the API always returns a freshly-signed URL.
165
+ *
166
+ * ## Data Lifecycle Summary
167
+ *
168
+ * | Data | Persistent tier | Ephemeral tier |
169
+ * |---|---|---|
170
+ * | Attachment bytes | Retained until you `DELETE` | **Auto-removed after 1 day**, also removable via `DELETE` |
171
+ * | 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 |
173
+ * | Audit log of deletions | Retained per platform retention policy | Retained per platform retention policy |
174
+ *
175
+ * **In transit:** TLS 1.2+ everywhere. **At rest:** AES-256 (server-side encryption).
176
+ *
177
+ * ## Compliance Checklist
178
+ *
179
+ * If you're integrating Linq under a security or privacy review, here is the short list:
180
+ *
181
+ * - Allowlist exactly one outbound domain: `cdn.linqapp.com`.
182
+ * - Decide whether you need ephemeral attachments (high-sensitivity content) — request enablement through your Linq support contact.
183
+ * - 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 after 1 day.
185
+ * - For audit: every deletion is logged on Linq's side. Surface a confirmation in your application UI based on the `204` response.
186
+ * - 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.
70
187
  */
71
188
  class Attachments extends resource_1.APIResource {
72
189
  /**
@@ -156,8 +273,10 @@ class Attachments extends resource_1.APIResource {
156
273
  return this._client.post('/v3/attachments', { body, ...options });
157
274
  }
158
275
  /**
159
- * Retrieve metadata for a specific attachment including its status, file
160
- * information, and URLs for downloading.
276
+ * Retrieve metadata for a specific attachment including file information, and URLs
277
+ * for downloading.
278
+ *
279
+ * `status`: (**deprecated** — will be removed in a future API version)
161
280
  *
162
281
  * @example
163
282
  * ```ts
@@ -169,6 +288,22 @@ class Attachments extends resource_1.APIResource {
169
288
  retrieve(attachmentID, options) {
170
289
  return this._client.get((0, path_1.path) `/v3/attachments/${attachmentID}`, options);
171
290
  }
291
+ /**
292
+ * Permanently delete an attachment owned by the authenticated partner.
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * await client.attachments.delete(
297
+ * 'abc12345-1234-5678-9abc-def012345678',
298
+ * );
299
+ * ```
300
+ */
301
+ delete(attachmentID, options) {
302
+ return this._client.delete((0, path_1.path) `/v3/attachments/${attachmentID}`, {
303
+ ...options,
304
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
305
+ });
306
+ }
172
307
  }
173
308
  exports.Attachments = Attachments;
174
309
  //# sourceMappingURL=attachments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachments.js","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkFG;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;;;;;;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,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAzHD,kCAyHC"}
@@ -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 { buildHeaders } from "../internal/headers.mjs";
3
4
  import { path } from "../internal/utils/path.mjs";
4
5
  /**
5
6
  * Send files (images, videos, documents, audio) with messages by providing a URL in a media part.
@@ -64,6 +65,122 @@ import { path } from "../internal/utils/path.mjs";
64
65
  *
65
66
  * - **URL-based (`url` field):** 10MB maximum
66
67
  * - **Pre-upload (`attachment_id`):** 100MB maximum
68
+ *
69
+ * ## Security & Ownership
70
+ *
71
+ * Every attachment is bound to the partner account that created or received it. The API enforces ownership on every operation that touches an attachment — sending, retrieving, deleting.
72
+ *
73
+ * **What this means for you:**
74
+ *
75
+ * - An attachment created under your API key can only be referenced by your API key.
76
+ * - Submitting another partner's `attachment_id` returns `404 Not Found`. We do not disclose whether the id exists or belongs to someone else.
77
+ * - Submitting a CDN URL that resolves to another partner's attachment is rejected before the send is attempted.
78
+ * - Ownership enforcement applies uniformly across send, create-chat, voice memo, retrieve, and delete operations.
79
+ *
80
+ * Every attachment-affecting endpoint requires a valid partner API key. Unauthenticated calls return `401 Unauthorized`.
81
+ *
82
+ * ## Attachment URL Patterns
83
+ *
84
+ * Attachment URLs in API responses and webhook payloads use one of two layouts, depending on the attachment's tier:
85
+ *
86
+ * | Tier | URL pattern | TTL |
87
+ * |---|---|---|
88
+ * | Persistent (default) | `https://cdn.linqapp.com/attachments/partners/{partner_id}/{attachment_id}/{filename}` | Long-lived |
89
+ * | 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
+ *
91
+ * 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.
92
+ *
93
+ * ## Ephemeral Attachments (Privacy Tier)
94
+ *
95
+ * For regulated or sensitive content, opt in to the **ephemeral attachments** tier by contacting your Linq support contact. You can request it at two scopes:
96
+ *
97
+ * | Scope | Effect |
98
+ * |---|---|
99
+ * | **Partner-wide** | Every outbound and inbound attachment on every phone number under your account is routed through the ephemeral tier. |
100
+ * | **Per phone number** | Only the specified phone numbers route their attachments through the ephemeral tier. The rest stay on the persistent tier. |
101
+ *
102
+ * **Behavioral differences vs the persistent default:**
103
+ *
104
+ * | Aspect | Persistent | Ephemeral |
105
+ * |---|---|---|
106
+ * | Download URL form | Long-lived CDN URL | Pre-signed URL with short TTL |
107
+ * | Retention floor | Indefinite (until you call `DELETE`) | **Hard backstop: 1 day** — even without an explicit `DELETE`, the platform removes the underlying bytes after 24 hours |
108
+ * | URL re-fetch | Not required | Fetch via `GET /v3/attachments/{attachmentId}` for a fresh signed URL after TTL expiry |
109
+ * | Cross-partner isolation | Enforced | Enforced |
110
+ *
111
+ * **When to choose ephemeral:**
112
+ *
113
+ * - Your downstream system processes the file immediately on receipt and does not need to re-read it later.
114
+ * - You have a compliance requirement that the platform must not retain attachments beyond a short window.
115
+ * - The content is high-sensitivity (PHI, financial documents, identity verification) and you do not want it sitting behind a long-lived URL.
116
+ *
117
+ * **Important:** ephemeral applies in *both directions* — outbound files you upload **and** inbound media received by the phone numbers in that scope. Download bytes you need to keep promptly, or fetch a fresh signed URL via the API when needed.
118
+ *
119
+ * ## Deleting an Attachment
120
+ *
121
+ * To permanently remove an attachment you own, use:
122
+ *
123
+ * ```http
124
+ * DELETE /v3/attachments/{attachmentId}
125
+ * Authorization: Bearer <your_api_key>
126
+ * ```
127
+ *
128
+ * **What this does:**
129
+ *
130
+ * 1. Verifies the attachment is owned by your account. Returns `404` otherwise.
131
+ * 2. Removes the underlying file from Linq storage.
132
+ * 3. Records an audit entry (timestamp, partner, attachment id).
133
+ *
134
+ * **Response codes:**
135
+ *
136
+ * | Status | Meaning |
137
+ * |---|---|
138
+ * | `204 No Content` | Deletion succeeded. The attachment is removed from Linq storage. |
139
+ * | `400 Bad Request` | `attachmentId` is not a valid UUID. |
140
+ * | `401 Unauthorized` | Missing or invalid API key. |
141
+ * | `404 Not Found` | Attachment does not exist or is not owned by your account. |
142
+ * | `500 Internal Server Error` | Transient infrastructure issue — safe to retry. |
143
+ *
144
+ * **Effect on message history:**
145
+ *
146
+ * - Messages that referenced the deleted attachment remain visible.
147
+ * - The message part that pointed at the attachment is preserved with no attachment reference.
148
+ * - Webhook payloads previously delivered to you retain the original URL string, but downloads from that URL return `404` going forward.
149
+ *
150
+ * Deletion is **irreversible**. Once `204` is returned, the bytes are gone — there is no undelete.
151
+ *
152
+ * ## Inbound Media Flow
153
+ *
154
+ * When one of your phone numbers receives a message with media (image, video, audio, document), the platform:
155
+ *
156
+ * 1. Stores the file under your partner account.
157
+ * 2. Records metadata linked to the inbound message.
158
+ * 3. Delivers a webhook whose `parts[]` array includes a `media` part with a `url` pointing at `cdn.linqapp.com`.
159
+ * 4. If the receiving phone is opted in to ephemeral, the `url` is a short-TTL signed URL.
160
+ *
161
+ * You can acknowledge the webhook without fetching the file inline, and lazy-load via `GET /v3/attachments/{attachmentId}` later. For ephemeral attachments, retrieving via the API always returns a freshly-signed URL.
162
+ *
163
+ * ## Data Lifecycle Summary
164
+ *
165
+ * | Data | Persistent tier | Ephemeral tier |
166
+ * |---|---|---|
167
+ * | Attachment bytes | Retained until you `DELETE` | **Auto-removed after 1 day**, also removable via `DELETE` |
168
+ * | 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 |
170
+ * | Audit log of deletions | Retained per platform retention policy | Retained per platform retention policy |
171
+ *
172
+ * **In transit:** TLS 1.2+ everywhere. **At rest:** AES-256 (server-side encryption).
173
+ *
174
+ * ## Compliance Checklist
175
+ *
176
+ * If you're integrating Linq under a security or privacy review, here is the short list:
177
+ *
178
+ * - Allowlist exactly one outbound domain: `cdn.linqapp.com`.
179
+ * - Decide whether you need ephemeral attachments (high-sensitivity content) — request enablement through your Linq support contact.
180
+ * - 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 after 1 day.
182
+ * - For audit: every deletion is logged on Linq's side. Surface a confirmation in your application UI based on the `204` response.
183
+ * - 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.
67
184
  */
68
185
  export class Attachments extends APIResource {
69
186
  /**
@@ -153,8 +270,10 @@ export class Attachments extends APIResource {
153
270
  return this._client.post('/v3/attachments', { body, ...options });
154
271
  }
155
272
  /**
156
- * Retrieve metadata for a specific attachment including its status, file
157
- * information, and URLs for downloading.
273
+ * Retrieve metadata for a specific attachment including file information, and URLs
274
+ * for downloading.
275
+ *
276
+ * `status`: (**deprecated** — will be removed in a future API version)
158
277
  *
159
278
  * @example
160
279
  * ```ts
@@ -166,5 +285,21 @@ export class Attachments extends APIResource {
166
285
  retrieve(attachmentID, options) {
167
286
  return this._client.get(path `/v3/attachments/${attachmentID}`, options);
168
287
  }
288
+ /**
289
+ * Permanently delete an attachment owned by the authenticated partner.
290
+ *
291
+ * @example
292
+ * ```ts
293
+ * await client.attachments.delete(
294
+ * 'abc12345-1234-5678-9abc-def012345678',
295
+ * );
296
+ * ```
297
+ */
298
+ delete(attachmentID, options) {
299
+ return this._client.delete(path `/v3/attachments/${attachmentID}`, {
300
+ ...options,
301
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
302
+ });
303
+ }
169
304
  }
170
305
  //# sourceMappingURL=attachments.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachments.mjs","sourceRoot":"","sources":["../src/resources/attachments.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;O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AiB,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"}
@@ -243,9 +243,9 @@ export interface Chat {
243
243
  */
244
244
  handles: Array<Shared.ChatHandle>;
245
245
  /**
246
- * **[BETA]** Current health for a chat. Always present — chats start at `healthy`
246
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
247
247
  * and may shift based on engagement and delivery signals on the conversation. Many
248
- * `at_risk` or `critical` chats on a single line increase the risk of line
248
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
249
249
  * flagging.
250
250
  *
251
251
  * Switch on `status` to gate sends or surface line health in your UI — the enum is
@@ -257,7 +257,7 @@ export interface Chat {
257
257
  */
258
258
  health_status: Chat.HealthStatus;
259
259
  /**
260
- * Whether the chat is archived
260
+ * @deprecated is_archived is no longer a useful signal
261
261
  */
262
262
  is_archived: boolean;
263
263
  /**
@@ -275,9 +275,9 @@ export interface Chat {
275
275
  }
276
276
  export declare namespace Chat {
277
277
  /**
278
- * **[BETA]** Current health for a chat. Always present — chats start at `healthy`
278
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
279
279
  * and may shift based on engagement and delivery signals on the conversation. Many
280
- * `at_risk` or `critical` chats on a single line increase the risk of line
280
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
281
281
  * flagging.
282
282
  *
283
283
  * Switch on `status` to gate sends or surface line health in your UI — the enum is
@@ -297,7 +297,7 @@ export declare namespace Chat {
297
297
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
298
298
  * to react. `doc_url` deep-links to the relevant section.
299
299
  */
300
- status: 'healthy' | 'at_risk' | 'critical' | 'opted_out';
300
+ status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
301
301
  /**
302
302
  * When this status last changed.
303
303
  */
@@ -482,9 +482,9 @@ export declare namespace ChatCreateResponse {
482
482
  */
483
483
  handles: Array<Shared.ChatHandle>;
484
484
  /**
485
- * **[BETA]** Current health for a chat. Always present — chats start at `healthy`
485
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
486
486
  * and may shift based on engagement and delivery signals on the conversation. Many
487
- * `at_risk` or `critical` chats on a single line increase the risk of line
487
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
488
488
  * flagging.
489
489
  *
490
490
  * Switch on `status` to gate sends or surface line health in your UI — the enum is
@@ -510,9 +510,9 @@ export declare namespace ChatCreateResponse {
510
510
  }
511
511
  namespace Chat {
512
512
  /**
513
- * **[BETA]** Current health for a chat. Always present — chats start at `healthy`
513
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
514
514
  * and may shift based on engagement and delivery signals on the conversation. Many
515
- * `at_risk` or `critical` chats on a single line increase the risk of line
515
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
516
516
  * flagging.
517
517
  *
518
518
  * Switch on `status` to gate sends or surface line health in your UI — the enum is
@@ -532,7 +532,7 @@ export declare namespace ChatCreateResponse {
532
532
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
533
533
  * to react. `doc_url` deep-links to the relevant section.
534
534
  */
535
- status: 'healthy' | 'at_risk' | 'critical' | 'opted_out';
535
+ status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
536
536
  /**
537
537
  * When this status last changed.
538
538
  */