@vitrina/api 15.8.0 → 15.9.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.
- package/dist/index.d.cts +1343 -107
- package/dist/index.d.ts +1343 -107
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -125777,7 +125777,9 @@ interface paths {
|
|
|
125777
125777
|
put?: never;
|
|
125778
125778
|
/**
|
|
125779
125779
|
* Send a library voice clip to the customer
|
|
125780
|
-
* @description
|
|
125780
|
+
* @description **Deprecated** — use `POST /conversations/{id}/media-assets/{assetId}/send` (a voice clip is an audio file of the library, same id). Kept working unchanged until it is removed.
|
|
125781
|
+
*
|
|
125782
|
+
* Sends one clip of the workspace «Clip de voz» library (`GET /voice-clips`) into the conversation as a voice note, as the caller: OGG/Opus with the push-to-talk flag on WhatsApp, AAC by public link on Instagram. The clip's transcript is stored on the message row. Everything `POST /conversations/{id}/voice` checks applies — the reply rail, the política de envíos, the Instagram/Messenger 7-day HUMAN_AGENT window and the provider's own refusal.
|
|
125781
125783
|
*
|
|
125782
125784
|
* Refused with 409 `CONFLICT` and `details.code`: `VOICE_CLIP_EXPIRED` (the clip is past `expires_at`; nothing is sent) or `VOICE_NOTE_UNSUPPORTED` (the channel cannot carry audio — email, web chat, Messenger, Marketplace; `details.text` holds the clip's words, or null, so the caller can offer them as a text reply; nothing is sent). Another workspace's clip is 404.
|
|
125783
125785
|
*
|
|
@@ -125936,6 +125938,180 @@ interface paths {
|
|
|
125936
125938
|
patch?: never;
|
|
125937
125939
|
trace?: never;
|
|
125938
125940
|
};
|
|
125941
|
+
"/conversations/{id}/media-assets/{assetId}/send": {
|
|
125942
|
+
parameters: {
|
|
125943
|
+
query?: never;
|
|
125944
|
+
header?: never;
|
|
125945
|
+
path?: never;
|
|
125946
|
+
cookie?: never;
|
|
125947
|
+
};
|
|
125948
|
+
get?: never;
|
|
125949
|
+
put?: never;
|
|
125950
|
+
/**
|
|
125951
|
+
* Send a library file to the customer
|
|
125952
|
+
* @description Sends one file of the workspace library (`GET /media-assets`) into the conversation as its own message, as the caller. Images, videos and PDFs are copied into the conversation (the thread keeps its copy if the library file is later replaced or deleted) and go out with `caption` (omitted = the file’s own caption; null = none). Audio goes out as a voice note with its transcript, exactly like `POST /conversations/{id}/voice`. The message carries `metadata.media_asset_id`, and the send is counted on the file (`send_count`). A file already sent in this conversation may be sent again.
|
|
125953
|
+
*
|
|
125954
|
+
* Refused with `details.code`: 409 `MEDIA_ASSET_NOT_SENDABLE` (`details.reason`: `expired`, or `consent_required` — it shows a person whose consent is not confirmed), 409 `MEDIA_CHANNEL_UNSUPPORTED` (`details.channel`, `details.kind` — e.g. a PDF on Instagram), 409 `VOICE_NOTE_UNSUPPORTED` (audio on a channel without voice notes; `details.text` holds its words so the caller can send them as text), 413 `MEDIA_TOO_LARGE` (over the channel’s per-file cap — email takes 3 MB). Nothing is sent on any refusal. Another workspace’s file is 404.
|
|
125955
|
+
*
|
|
125956
|
+
* Needs `macros:read` (the library) as well as `conversations:write` and `messages:send`.
|
|
125957
|
+
*
|
|
125958
|
+
* Requires `messages:send` in addition to `conversations:write`. Sent by an API key, a personal token or a connected app, it goes through the política de envíos first — 422 `OUTBOUND_BLOCKED`, 409 `OUTBOUND_WARNING` (resend with `acknowledge`) or, for a connected app past its fan-out limit, 202 `pending_approval`. A member in the UI is not checked.
|
|
125959
|
+
*/
|
|
125960
|
+
post: {
|
|
125961
|
+
parameters: {
|
|
125962
|
+
query?: never;
|
|
125963
|
+
header?: {
|
|
125964
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
125965
|
+
"Idempotency-Key"?: string;
|
|
125966
|
+
};
|
|
125967
|
+
path: {
|
|
125968
|
+
id: string;
|
|
125969
|
+
assetId: string;
|
|
125970
|
+
};
|
|
125971
|
+
cookie?: never;
|
|
125972
|
+
};
|
|
125973
|
+
requestBody?: {
|
|
125974
|
+
content: {
|
|
125975
|
+
/**
|
|
125976
|
+
* @example {
|
|
125977
|
+
* "caption": "Resultado real tras 3 sesiones"
|
|
125978
|
+
* }
|
|
125979
|
+
*/
|
|
125980
|
+
"application/json": {
|
|
125981
|
+
/** @description Text sent with the file. Omitted = the file’s own caption; null = none. Ignored for audio. */
|
|
125982
|
+
caption?: string | null;
|
|
125983
|
+
};
|
|
125984
|
+
};
|
|
125985
|
+
};
|
|
125986
|
+
responses: {
|
|
125987
|
+
/** @description The persisted media message */
|
|
125988
|
+
201: {
|
|
125989
|
+
headers: {
|
|
125990
|
+
[name: string]: unknown;
|
|
125991
|
+
};
|
|
125992
|
+
content: {
|
|
125993
|
+
/**
|
|
125994
|
+
* @example {
|
|
125995
|
+
* "data": {
|
|
125996
|
+
* "id": "eeeeeeee-0000-4000-8000-000000000002",
|
|
125997
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
125998
|
+
* "conversation_id": "bbbbbbbb-0000-4000-8000-000000000001",
|
|
125999
|
+
* "content": "Hola Rodrigo, te confirmo la visita del jueves a las 10:00.",
|
|
126000
|
+
* "type": "text",
|
|
126001
|
+
* "sender_role": "assistant",
|
|
126002
|
+
* "sender_type": "api_key",
|
|
126003
|
+
* "sender_id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
126004
|
+
* "correlation_id": null,
|
|
126005
|
+
* "external_message_id": null,
|
|
126006
|
+
* "media_urls": null,
|
|
126007
|
+
* "media_sensitivity": null,
|
|
126008
|
+
* "media_processing_state": null,
|
|
126009
|
+
* "media_expires_at": null,
|
|
126010
|
+
* "derived_context_expires_at": null,
|
|
126011
|
+
* "metadata": null,
|
|
126012
|
+
* "tool_calls": null,
|
|
126013
|
+
* "tool_call_id": null,
|
|
126014
|
+
* "delivery_status": "sent",
|
|
126015
|
+
* "delivery_error": null,
|
|
126016
|
+
* "delivery_attempt": 1,
|
|
126017
|
+
* "next_attempt_at": null,
|
|
126018
|
+
* "delivered_at": null,
|
|
126019
|
+
* "read_at": null,
|
|
126020
|
+
* "author": {
|
|
126021
|
+
* "kind": "api_key",
|
|
126022
|
+
* "id": "c1c1c1c1-0000-4000-8000-000000000001",
|
|
126023
|
+
* "name": "CRM propio"
|
|
126024
|
+
* },
|
|
126025
|
+
* "created_at": "2026-09-22T11:08:10.882Z",
|
|
126026
|
+
* "updated_at": "2026-09-22T11:08:10.882Z"
|
|
126027
|
+
* }
|
|
126028
|
+
* }
|
|
126029
|
+
*/
|
|
126030
|
+
"application/json": {
|
|
126031
|
+
data?: unknown;
|
|
126032
|
+
};
|
|
126033
|
+
};
|
|
126034
|
+
};
|
|
126035
|
+
/** @description Pending approval. A connected app that already wrote to 3 distinct contacts in the last 10 minutes does not write to a new one directly: the message is parked in the approval queue («vía <app>») and goes out when a member approves it. `data.message` is Spanish, for the app to relay to its person. */
|
|
126036
|
+
202: {
|
|
126037
|
+
headers: {
|
|
126038
|
+
[name: string]: unknown;
|
|
126039
|
+
};
|
|
126040
|
+
content: {
|
|
126041
|
+
"application/json": components["schemas"]["PendingApproval"];
|
|
126042
|
+
};
|
|
126043
|
+
};
|
|
126044
|
+
/** @description Validation error */
|
|
126045
|
+
400: {
|
|
126046
|
+
headers: {
|
|
126047
|
+
[name: string]: unknown;
|
|
126048
|
+
};
|
|
126049
|
+
content: {
|
|
126050
|
+
"application/json": components["schemas"]["Error"];
|
|
126051
|
+
};
|
|
126052
|
+
};
|
|
126053
|
+
/** @description Unauthorized */
|
|
126054
|
+
401: {
|
|
126055
|
+
headers: {
|
|
126056
|
+
[name: string]: unknown;
|
|
126057
|
+
};
|
|
126058
|
+
content: {
|
|
126059
|
+
"application/json": components["schemas"]["Error"];
|
|
126060
|
+
};
|
|
126061
|
+
};
|
|
126062
|
+
/** @description Forbidden */
|
|
126063
|
+
403: {
|
|
126064
|
+
headers: {
|
|
126065
|
+
[name: string]: unknown;
|
|
126066
|
+
};
|
|
126067
|
+
content: {
|
|
126068
|
+
"application/json": components["schemas"]["Error"];
|
|
126069
|
+
};
|
|
126070
|
+
};
|
|
126071
|
+
/** @description Not found */
|
|
126072
|
+
404: {
|
|
126073
|
+
headers: {
|
|
126074
|
+
[name: string]: unknown;
|
|
126075
|
+
};
|
|
126076
|
+
content: {
|
|
126077
|
+
"application/json": components["schemas"]["Error"];
|
|
126078
|
+
};
|
|
126079
|
+
};
|
|
126080
|
+
/** @description `OUTBOUND_WARNING` — an Advertencia de envío (quiet hours, a thread a member is handling, a degraded number, loop protection). Nothing was sent. Resend the same request with `acknowledge` naming every code in `error.reasons` to send it anyway; the acknowledgment is recorded. (Also `IDEMPOTENCY_KEY_CONFLICT` on an Idempotency-Key reuse.) */
|
|
126081
|
+
409: {
|
|
126082
|
+
headers: {
|
|
126083
|
+
[name: string]: unknown;
|
|
126084
|
+
};
|
|
126085
|
+
content: {
|
|
126086
|
+
"application/json": components["schemas"]["OutboundVerdictError"];
|
|
126087
|
+
};
|
|
126088
|
+
};
|
|
126089
|
+
/** @description `OUTBOUND_BLOCKED` — a Bloqueo de envío: an opted-out contact (a single free-text reply to a customer who wrote in again after THEIR OWN opt-out passes inside the WhatsApp / Instagram / Messenger 24-hour window, or in the same email thread; a block your team set or a spam complaint still refuses), an active hold, a closed WhatsApp 24-hour window with no template, a template Meta will reject, no channel identity, a disconnected or red account. Never overridable; `error.hint` says what to do instead. */
|
|
126090
|
+
422: {
|
|
126091
|
+
headers: {
|
|
126092
|
+
[name: string]: unknown;
|
|
126093
|
+
};
|
|
126094
|
+
content: {
|
|
126095
|
+
"application/json": components["schemas"]["OutboundVerdictError"];
|
|
126096
|
+
};
|
|
126097
|
+
};
|
|
126098
|
+
/** @description Rate limited */
|
|
126099
|
+
429: {
|
|
126100
|
+
headers: {
|
|
126101
|
+
[name: string]: unknown;
|
|
126102
|
+
};
|
|
126103
|
+
content: {
|
|
126104
|
+
"application/json": components["schemas"]["Error"];
|
|
126105
|
+
};
|
|
126106
|
+
};
|
|
126107
|
+
};
|
|
126108
|
+
};
|
|
126109
|
+
delete?: never;
|
|
126110
|
+
options?: never;
|
|
126111
|
+
head?: never;
|
|
126112
|
+
patch?: never;
|
|
126113
|
+
trace?: never;
|
|
126114
|
+
};
|
|
125939
126115
|
"/conversations/{id}/voice-note": {
|
|
125940
126116
|
parameters: {
|
|
125941
126117
|
query?: never;
|
|
@@ -179454,7 +179630,7 @@ interface paths {
|
|
|
179454
179630
|
*
|
|
179455
179631
|
* Answers `{ macro, executed }`, where `executed` is one `{ type, ok, error }` entry per step in order. **A 200 does not mean the macro worked** — a failed send and a failed label both appear as `ok: false` inside a successful response, and the steps after them still ran. Surface the failures; they are not retried.
|
|
179456
179632
|
*
|
|
179457
|
-
*
|
|
179633
|
+
* `send_attachment` sends a file of the library (`GET /media-assets`): its `value` is the file id (`asset_name` is display-only). It runs in step order, through the same checks as `POST /conversations/{id}/media-assets/{assetId}/send`; a refusal reports its code as `error` (e.g. `MEDIA_ASSET_NOT_SENDABLE`), a value that is not a file id reports `Elige un archivo de la Biblioteca`, and a send parked by the política de envíos reports `status: pending_approval`. `mute_conversation` is accepted by the builder but not implemented and reports `not yet supported`. An unrecognised type reports `unknown action type`.
|
|
179458
179634
|
*
|
|
179459
179635
|
* `run_webhook` is a FLAG rather than a step: its presence anywhere in `actions` makes the whole run fire one `macro.applied` webhook after the loop, with the full step log. Listing it twice still fires once, and its position in the list has no effect.
|
|
179460
179636
|
*
|
|
@@ -179824,7 +180000,7 @@ interface paths {
|
|
|
179824
180000
|
*
|
|
179825
180001
|
* Answers `{ macro, executed }`, where `executed` is one `{ type, ok, error }` entry per step in order. **A 200 does not mean the macro worked** — a failed send and a failed label both appear as `ok: false` inside a successful response, and the steps after them still ran. Surface the failures; they are not retried.
|
|
179826
180002
|
*
|
|
179827
|
-
*
|
|
180003
|
+
* `send_attachment` sends a file of the library (`GET /media-assets`): its `value` is the file id (`asset_name` is display-only). It runs in step order, through the same checks as `POST /conversations/{id}/media-assets/{assetId}/send`; a refusal reports its code as `error` (e.g. `MEDIA_ASSET_NOT_SENDABLE`), a value that is not a file id reports `Elige un archivo de la Biblioteca`, and a send parked by the política de envíos reports `status: pending_approval`. `mute_conversation` is accepted by the builder but not implemented and reports `not yet supported`. An unrecognised type reports `unknown action type`.
|
|
179828
180004
|
*
|
|
179829
180005
|
* `run_webhook` is a FLAG rather than a step: its presence anywhere in `actions` makes the whole run fire one `macro.applied` webhook after the loop, with the full step log. Listing it twice still fires once, and its position in the list has no effect.
|
|
179830
180006
|
*
|
|
@@ -180014,7 +180190,9 @@ interface paths {
|
|
|
180014
180190
|
};
|
|
180015
180191
|
/**
|
|
180016
180192
|
* List voice clips
|
|
180017
|
-
* @description
|
|
180193
|
+
* @description **Deprecated** — use `/media-assets` (voice clips are its audio files, same ids).
|
|
180194
|
+
*
|
|
180195
|
+
* Every clip in the workspace library, newest first, expired ones included and marked `expired: true`.
|
|
180018
180196
|
*
|
|
180019
180197
|
* With `live=true` the answer is only the clips that may be SENT now: not expired, and whose model filter is empty or names `model` (case- and whitespace-insensitive). Without `model`, only clips with no model filter qualify. `tag` (comma-separated) keeps clips carrying any of the tags.
|
|
180020
180198
|
*/
|
|
@@ -180134,8 +180312,799 @@ interface paths {
|
|
|
180134
180312
|
};
|
|
180135
180313
|
put?: never;
|
|
180136
180314
|
/**
|
|
180137
|
-
* Upload a voice clip
|
|
180138
|
-
* @description
|
|
180315
|
+
* Upload a voice clip
|
|
180316
|
+
* @description **Deprecated** — use `/media-assets` (voice clips are its audio files, same ids).
|
|
180317
|
+
*
|
|
180318
|
+
* Uploads the audio (`file`: OGG/Opus, MP3, M4A/AAC, WAV, WebM or AMR, at most 16 MB; 415 for another type, 413 above the cap) with its details. The clip is transcribed on upload unless `transcript` is sent; when speech-to-text fails or hears nothing usable, `transcript` is null and can be filled with `PATCH`. `duration_ms` is measured from the audio. `name` defaults to the file name. Answers 201 with the clip.
|
|
180319
|
+
*
|
|
180320
|
+
* **Or a JSON body** (`application/json`) — what an MCP connector sends through `call_operation`, which cannot build multipart: `{ filename, content, content_encoding?, content_type? }` plus the operation's own form fields. `content` is UTF-8 text by default, or base64 when `content_encoding` is `"base64"` (images, PDF, audio, video). The same byte cap applies to the decoded bytes (413 above it); invalid base64 is a 400; the content type defaults from the filename extension.
|
|
180321
|
+
*/
|
|
180322
|
+
post: {
|
|
180323
|
+
parameters: {
|
|
180324
|
+
query?: never;
|
|
180325
|
+
header?: {
|
|
180326
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
180327
|
+
"Idempotency-Key"?: string;
|
|
180328
|
+
};
|
|
180329
|
+
path?: never;
|
|
180330
|
+
cookie?: never;
|
|
180331
|
+
};
|
|
180332
|
+
requestBody?: {
|
|
180333
|
+
content: {
|
|
180334
|
+
/**
|
|
180335
|
+
* @example {
|
|
180336
|
+
* "file": "(binary audio part)",
|
|
180337
|
+
* "name": "Garantía 6 meses",
|
|
180338
|
+
* "tags": "garantia,cierre",
|
|
180339
|
+
* "when_to_use": "Cuando el cliente pregunta por la garantía."
|
|
180340
|
+
* }
|
|
180341
|
+
*/
|
|
180342
|
+
"multipart/form-data": {
|
|
180343
|
+
/** @description Defaults to the file name without its extension. */
|
|
180344
|
+
name?: string;
|
|
180345
|
+
/** @description Labels for finding the clip (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
180346
|
+
tags?: string[];
|
|
180347
|
+
/** @description «Cuándo usarlo»: when this clip fits, for the team and the agent. */
|
|
180348
|
+
when_to_use?: string;
|
|
180349
|
+
/** Format: date-time */
|
|
180350
|
+
expires_at?: string | null;
|
|
180351
|
+
/** @description Model filter: the model names the clip applies to, spelled as in the catalog (`product.model`, e.g. "iPhone 13 Pro"). Empty = any model. Matched case- and whitespace-insensitively. */
|
|
180352
|
+
models?: string[];
|
|
180353
|
+
/** @description What the clip says. When given, speech-to-text is skipped. */
|
|
180354
|
+
transcript?: string;
|
|
180355
|
+
file?: unknown;
|
|
180356
|
+
};
|
|
180357
|
+
/**
|
|
180358
|
+
* @example {
|
|
180359
|
+
* "filename": "garantia.ogg",
|
|
180360
|
+
* "content": "T2dnUwACAAAAAAAAAAA…",
|
|
180361
|
+
* "content_encoding": "base64",
|
|
180362
|
+
* "name": "Garantía 6 meses",
|
|
180363
|
+
* "tags": [
|
|
180364
|
+
* "garantia",
|
|
180365
|
+
* "cierre"
|
|
180366
|
+
* ],
|
|
180367
|
+
* "when_to_use": "Cuando el cliente pregunta por la garantía.",
|
|
180368
|
+
* "models": [
|
|
180369
|
+
* "iPhone 13",
|
|
180370
|
+
* "iPhone 14"
|
|
180371
|
+
* ],
|
|
180372
|
+
* "expires_at": "2026-12-31T23:59:59-03:00"
|
|
180373
|
+
* }
|
|
180374
|
+
*/
|
|
180375
|
+
"application/json": {
|
|
180376
|
+
/** @description File name with extension; the content type defaults from it. */
|
|
180377
|
+
filename: string;
|
|
180378
|
+
/** @description The file. UTF-8 text by default; base64 when `content_encoding` is "base64" (images, PDF, audio, video). */
|
|
180379
|
+
content: string;
|
|
180380
|
+
/**
|
|
180381
|
+
* @description `utf8` (default) for text, `base64` for binary files.
|
|
180382
|
+
* @enum {string}
|
|
180383
|
+
*/
|
|
180384
|
+
content_encoding?: "utf8" | "base64";
|
|
180385
|
+
/** @description MIME type. Defaults from the extension (.png → image/png, …). */
|
|
180386
|
+
content_type?: string;
|
|
180387
|
+
/** @description Defaults to the file name without its extension. */
|
|
180388
|
+
name?: string;
|
|
180389
|
+
/** @description Labels for finding the clip (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
180390
|
+
tags?: string[];
|
|
180391
|
+
/** @description «Cuándo usarlo»: when this clip fits, for the team and the agent. */
|
|
180392
|
+
when_to_use?: string;
|
|
180393
|
+
/** Format: date-time */
|
|
180394
|
+
expires_at?: string | null;
|
|
180395
|
+
/** @description Model filter: the model names the clip applies to, spelled as in the catalog (`product.model`, e.g. "iPhone 13 Pro"). Empty = any model. Matched case- and whitespace-insensitively. */
|
|
180396
|
+
models?: string[];
|
|
180397
|
+
/** @description What the clip says. When given, speech-to-text is skipped. */
|
|
180398
|
+
transcript?: string;
|
|
180399
|
+
};
|
|
180400
|
+
};
|
|
180401
|
+
};
|
|
180402
|
+
responses: {
|
|
180403
|
+
/** @description The created clip */
|
|
180404
|
+
201: {
|
|
180405
|
+
headers: {
|
|
180406
|
+
[name: string]: unknown;
|
|
180407
|
+
};
|
|
180408
|
+
content: {
|
|
180409
|
+
/**
|
|
180410
|
+
* @example {
|
|
180411
|
+
* "id": "6b0f3c1e-2a4d-4f7e-9b1a-0c2d3e4f5a6b",
|
|
180412
|
+
* "name": "Garantía 6 meses",
|
|
180413
|
+
* "tags": [
|
|
180414
|
+
* "garantia",
|
|
180415
|
+
* "cierre"
|
|
180416
|
+
* ],
|
|
180417
|
+
* "when_to_use": "Cuando el cliente pregunta por la garantía de un seminuevo.",
|
|
180418
|
+
* "expires_at": null,
|
|
180419
|
+
* "expired": false,
|
|
180420
|
+
* "models": [
|
|
180421
|
+
* "iPhone 13",
|
|
180422
|
+
* "iPhone 13 Pro",
|
|
180423
|
+
* "iPhone 14"
|
|
180424
|
+
* ],
|
|
180425
|
+
* "transcript": "Hola, te cuento que todos nuestros equipos tienen seis meses de garantía.",
|
|
180426
|
+
* "mime_type": "audio/ogg",
|
|
180427
|
+
* "byte_size": 48213,
|
|
180428
|
+
* "duration_ms": 12480,
|
|
180429
|
+
* "original_filename": "garantia.ogg",
|
|
180430
|
+
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180431
|
+
* "created_at": "2026-10-28T15:04:05.000Z",
|
|
180432
|
+
* "updated_at": "2026-10-28T15:04:05.000Z"
|
|
180433
|
+
* }
|
|
180434
|
+
*/
|
|
180435
|
+
"application/json": {
|
|
180436
|
+
data?: unknown;
|
|
180437
|
+
};
|
|
180438
|
+
};
|
|
180439
|
+
};
|
|
180440
|
+
/** @description Validation error */
|
|
180441
|
+
400: {
|
|
180442
|
+
headers: {
|
|
180443
|
+
[name: string]: unknown;
|
|
180444
|
+
};
|
|
180445
|
+
content: {
|
|
180446
|
+
"application/json": components["schemas"]["Error"];
|
|
180447
|
+
};
|
|
180448
|
+
};
|
|
180449
|
+
/** @description Unauthorized */
|
|
180450
|
+
401: {
|
|
180451
|
+
headers: {
|
|
180452
|
+
[name: string]: unknown;
|
|
180453
|
+
};
|
|
180454
|
+
content: {
|
|
180455
|
+
"application/json": components["schemas"]["Error"];
|
|
180456
|
+
};
|
|
180457
|
+
};
|
|
180458
|
+
/** @description Forbidden */
|
|
180459
|
+
403: {
|
|
180460
|
+
headers: {
|
|
180461
|
+
[name: string]: unknown;
|
|
180462
|
+
};
|
|
180463
|
+
content: {
|
|
180464
|
+
"application/json": components["schemas"]["Error"];
|
|
180465
|
+
};
|
|
180466
|
+
};
|
|
180467
|
+
/** @description Not found */
|
|
180468
|
+
404: {
|
|
180469
|
+
headers: {
|
|
180470
|
+
[name: string]: unknown;
|
|
180471
|
+
};
|
|
180472
|
+
content: {
|
|
180473
|
+
"application/json": components["schemas"]["Error"];
|
|
180474
|
+
};
|
|
180475
|
+
};
|
|
180476
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
180477
|
+
409: {
|
|
180478
|
+
headers: {
|
|
180479
|
+
[name: string]: unknown;
|
|
180480
|
+
};
|
|
180481
|
+
content: {
|
|
180482
|
+
"application/json": components["schemas"]["Error"];
|
|
180483
|
+
};
|
|
180484
|
+
};
|
|
180485
|
+
/** @description Rate limited */
|
|
180486
|
+
429: {
|
|
180487
|
+
headers: {
|
|
180488
|
+
[name: string]: unknown;
|
|
180489
|
+
};
|
|
180490
|
+
content: {
|
|
180491
|
+
"application/json": components["schemas"]["Error"];
|
|
180492
|
+
};
|
|
180493
|
+
};
|
|
180494
|
+
};
|
|
180495
|
+
};
|
|
180496
|
+
delete?: never;
|
|
180497
|
+
options?: never;
|
|
180498
|
+
head?: never;
|
|
180499
|
+
patch?: never;
|
|
180500
|
+
trace?: never;
|
|
180501
|
+
};
|
|
180502
|
+
"/voice-clips/{id}": {
|
|
180503
|
+
parameters: {
|
|
180504
|
+
query?: never;
|
|
180505
|
+
header?: never;
|
|
180506
|
+
path?: never;
|
|
180507
|
+
cookie?: never;
|
|
180508
|
+
};
|
|
180509
|
+
/**
|
|
180510
|
+
* Fetch one voice clip
|
|
180511
|
+
* @description **Deprecated** — use `GET /media-assets/{id}`.
|
|
180512
|
+
*
|
|
180513
|
+
* The clip with its details, transcript and `expired` state.
|
|
180514
|
+
*/
|
|
180515
|
+
get: {
|
|
180516
|
+
parameters: {
|
|
180517
|
+
query?: never;
|
|
180518
|
+
header?: never;
|
|
180519
|
+
path: {
|
|
180520
|
+
id: string;
|
|
180521
|
+
};
|
|
180522
|
+
cookie?: never;
|
|
180523
|
+
};
|
|
180524
|
+
requestBody?: never;
|
|
180525
|
+
responses: {
|
|
180526
|
+
/** @description The clip */
|
|
180527
|
+
200: {
|
|
180528
|
+
headers: {
|
|
180529
|
+
[name: string]: unknown;
|
|
180530
|
+
};
|
|
180531
|
+
content: {
|
|
180532
|
+
/**
|
|
180533
|
+
* @example {
|
|
180534
|
+
* "id": "6b0f3c1e-2a4d-4f7e-9b1a-0c2d3e4f5a6b",
|
|
180535
|
+
* "name": "Garantía 6 meses",
|
|
180536
|
+
* "tags": [
|
|
180537
|
+
* "garantia",
|
|
180538
|
+
* "cierre"
|
|
180539
|
+
* ],
|
|
180540
|
+
* "when_to_use": "Cuando el cliente pregunta por la garantía de un seminuevo.",
|
|
180541
|
+
* "expires_at": null,
|
|
180542
|
+
* "expired": false,
|
|
180543
|
+
* "models": [
|
|
180544
|
+
* "iPhone 13",
|
|
180545
|
+
* "iPhone 13 Pro",
|
|
180546
|
+
* "iPhone 14"
|
|
180547
|
+
* ],
|
|
180548
|
+
* "transcript": "Hola, te cuento que todos nuestros equipos tienen seis meses de garantía.",
|
|
180549
|
+
* "mime_type": "audio/ogg",
|
|
180550
|
+
* "byte_size": 48213,
|
|
180551
|
+
* "duration_ms": 12480,
|
|
180552
|
+
* "original_filename": "garantia.ogg",
|
|
180553
|
+
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180554
|
+
* "created_at": "2026-10-28T15:04:05.000Z",
|
|
180555
|
+
* "updated_at": "2026-10-28T15:04:05.000Z"
|
|
180556
|
+
* }
|
|
180557
|
+
*/
|
|
180558
|
+
"application/json": {
|
|
180559
|
+
data?: unknown;
|
|
180560
|
+
meta?: {
|
|
180561
|
+
[key: string]: unknown;
|
|
180562
|
+
};
|
|
180563
|
+
};
|
|
180564
|
+
};
|
|
180565
|
+
};
|
|
180566
|
+
/** @description Validation error */
|
|
180567
|
+
400: {
|
|
180568
|
+
headers: {
|
|
180569
|
+
[name: string]: unknown;
|
|
180570
|
+
};
|
|
180571
|
+
content: {
|
|
180572
|
+
"application/json": components["schemas"]["Error"];
|
|
180573
|
+
};
|
|
180574
|
+
};
|
|
180575
|
+
/** @description Unauthorized */
|
|
180576
|
+
401: {
|
|
180577
|
+
headers: {
|
|
180578
|
+
[name: string]: unknown;
|
|
180579
|
+
};
|
|
180580
|
+
content: {
|
|
180581
|
+
"application/json": components["schemas"]["Error"];
|
|
180582
|
+
};
|
|
180583
|
+
};
|
|
180584
|
+
/** @description Forbidden */
|
|
180585
|
+
403: {
|
|
180586
|
+
headers: {
|
|
180587
|
+
[name: string]: unknown;
|
|
180588
|
+
};
|
|
180589
|
+
content: {
|
|
180590
|
+
"application/json": components["schemas"]["Error"];
|
|
180591
|
+
};
|
|
180592
|
+
};
|
|
180593
|
+
/** @description Not found */
|
|
180594
|
+
404: {
|
|
180595
|
+
headers: {
|
|
180596
|
+
[name: string]: unknown;
|
|
180597
|
+
};
|
|
180598
|
+
content: {
|
|
180599
|
+
"application/json": components["schemas"]["Error"];
|
|
180600
|
+
};
|
|
180601
|
+
};
|
|
180602
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
180603
|
+
409: {
|
|
180604
|
+
headers: {
|
|
180605
|
+
[name: string]: unknown;
|
|
180606
|
+
};
|
|
180607
|
+
content: {
|
|
180608
|
+
"application/json": components["schemas"]["Error"];
|
|
180609
|
+
};
|
|
180610
|
+
};
|
|
180611
|
+
/** @description Rate limited */
|
|
180612
|
+
429: {
|
|
180613
|
+
headers: {
|
|
180614
|
+
[name: string]: unknown;
|
|
180615
|
+
};
|
|
180616
|
+
content: {
|
|
180617
|
+
"application/json": components["schemas"]["Error"];
|
|
180618
|
+
};
|
|
180619
|
+
};
|
|
180620
|
+
};
|
|
180621
|
+
};
|
|
180622
|
+
put?: never;
|
|
180623
|
+
post?: never;
|
|
180624
|
+
/**
|
|
180625
|
+
* Delete a voice clip
|
|
180626
|
+
* @description **Deprecated** — use `/media-assets` (voice clips are its audio files, same ids).
|
|
180627
|
+
*
|
|
180628
|
+
* Removes the clip and its audio from the library. Voice notes already sent in conversations stay there. To stop offering a clip without losing it, set `expires_at` instead.
|
|
180629
|
+
*/
|
|
180630
|
+
delete: {
|
|
180631
|
+
parameters: {
|
|
180632
|
+
query?: never;
|
|
180633
|
+
header?: never;
|
|
180634
|
+
path: {
|
|
180635
|
+
id: string;
|
|
180636
|
+
};
|
|
180637
|
+
cookie?: never;
|
|
180638
|
+
};
|
|
180639
|
+
requestBody?: never;
|
|
180640
|
+
responses: {
|
|
180641
|
+
/** @description No content */
|
|
180642
|
+
204: {
|
|
180643
|
+
headers: {
|
|
180644
|
+
[name: string]: unknown;
|
|
180645
|
+
};
|
|
180646
|
+
content?: never;
|
|
180647
|
+
};
|
|
180648
|
+
/** @description Validation error */
|
|
180649
|
+
400: {
|
|
180650
|
+
headers: {
|
|
180651
|
+
[name: string]: unknown;
|
|
180652
|
+
};
|
|
180653
|
+
content: {
|
|
180654
|
+
"application/json": components["schemas"]["Error"];
|
|
180655
|
+
};
|
|
180656
|
+
};
|
|
180657
|
+
/** @description Unauthorized */
|
|
180658
|
+
401: {
|
|
180659
|
+
headers: {
|
|
180660
|
+
[name: string]: unknown;
|
|
180661
|
+
};
|
|
180662
|
+
content: {
|
|
180663
|
+
"application/json": components["schemas"]["Error"];
|
|
180664
|
+
};
|
|
180665
|
+
};
|
|
180666
|
+
/** @description Forbidden */
|
|
180667
|
+
403: {
|
|
180668
|
+
headers: {
|
|
180669
|
+
[name: string]: unknown;
|
|
180670
|
+
};
|
|
180671
|
+
content: {
|
|
180672
|
+
"application/json": components["schemas"]["Error"];
|
|
180673
|
+
};
|
|
180674
|
+
};
|
|
180675
|
+
/** @description Not found */
|
|
180676
|
+
404: {
|
|
180677
|
+
headers: {
|
|
180678
|
+
[name: string]: unknown;
|
|
180679
|
+
};
|
|
180680
|
+
content: {
|
|
180681
|
+
"application/json": components["schemas"]["Error"];
|
|
180682
|
+
};
|
|
180683
|
+
};
|
|
180684
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
180685
|
+
409: {
|
|
180686
|
+
headers: {
|
|
180687
|
+
[name: string]: unknown;
|
|
180688
|
+
};
|
|
180689
|
+
content: {
|
|
180690
|
+
"application/json": components["schemas"]["Error"];
|
|
180691
|
+
};
|
|
180692
|
+
};
|
|
180693
|
+
/** @description Rate limited */
|
|
180694
|
+
429: {
|
|
180695
|
+
headers: {
|
|
180696
|
+
[name: string]: unknown;
|
|
180697
|
+
};
|
|
180698
|
+
content: {
|
|
180699
|
+
"application/json": components["schemas"]["Error"];
|
|
180700
|
+
};
|
|
180701
|
+
};
|
|
180702
|
+
};
|
|
180703
|
+
};
|
|
180704
|
+
options?: never;
|
|
180705
|
+
head?: never;
|
|
180706
|
+
/**
|
|
180707
|
+
* Edit a voice clip
|
|
180708
|
+
* @description **Deprecated** — use `/media-assets` (voice clips are its audio files, same ids).
|
|
180709
|
+
*
|
|
180710
|
+
* Changes the details and the transcript; the audio itself is replaced by uploading a new clip. `tags` and `models` are replaced wholesale. `expires_at: null` removes the expiry (an expired clip becomes sendable again). At least one field is required.
|
|
180711
|
+
*/
|
|
180712
|
+
patch: {
|
|
180713
|
+
parameters: {
|
|
180714
|
+
query?: never;
|
|
180715
|
+
header?: never;
|
|
180716
|
+
path: {
|
|
180717
|
+
id: string;
|
|
180718
|
+
};
|
|
180719
|
+
cookie?: never;
|
|
180720
|
+
};
|
|
180721
|
+
requestBody?: {
|
|
180722
|
+
content: {
|
|
180723
|
+
/**
|
|
180724
|
+
* @example {
|
|
180725
|
+
* "transcript": "Hola, te cuento que todos nuestros equipos tienen seis meses de garantía.",
|
|
180726
|
+
* "expires_at": "2026-11-30T23:59:59-03:00"
|
|
180727
|
+
* }
|
|
180728
|
+
*/
|
|
180729
|
+
"application/json": {
|
|
180730
|
+
name?: string;
|
|
180731
|
+
/** @description Labels for finding the clip (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
180732
|
+
tags?: string[];
|
|
180733
|
+
when_to_use?: string;
|
|
180734
|
+
/**
|
|
180735
|
+
* Format: date-time
|
|
180736
|
+
* @description When the clip stops being offered for sending (ISO 8601). Null = never. An expired clip stays in the library, marked `expired`.
|
|
180737
|
+
*/
|
|
180738
|
+
expires_at?: string | null;
|
|
180739
|
+
/** @description Model filter: the model names the clip applies to, spelled as in the catalog (`product.model`, e.g. "iPhone 13 Pro"). Empty = any model. Matched case- and whitespace-insensitively. */
|
|
180740
|
+
models?: string[];
|
|
180741
|
+
/** @description The corrected transcript. Empty or null clears it. */
|
|
180742
|
+
transcript?: string | null;
|
|
180743
|
+
};
|
|
180744
|
+
};
|
|
180745
|
+
};
|
|
180746
|
+
responses: {
|
|
180747
|
+
/** @description The updated clip */
|
|
180748
|
+
200: {
|
|
180749
|
+
headers: {
|
|
180750
|
+
[name: string]: unknown;
|
|
180751
|
+
};
|
|
180752
|
+
content: {
|
|
180753
|
+
/**
|
|
180754
|
+
* @example {
|
|
180755
|
+
* "id": "6b0f3c1e-2a4d-4f7e-9b1a-0c2d3e4f5a6b",
|
|
180756
|
+
* "name": "Garantía 6 meses",
|
|
180757
|
+
* "tags": [
|
|
180758
|
+
* "garantia",
|
|
180759
|
+
* "cierre"
|
|
180760
|
+
* ],
|
|
180761
|
+
* "when_to_use": "Cuando el cliente pregunta por la garantía de un seminuevo.",
|
|
180762
|
+
* "expires_at": null,
|
|
180763
|
+
* "expired": false,
|
|
180764
|
+
* "models": [
|
|
180765
|
+
* "iPhone 13",
|
|
180766
|
+
* "iPhone 13 Pro",
|
|
180767
|
+
* "iPhone 14"
|
|
180768
|
+
* ],
|
|
180769
|
+
* "transcript": "Hola, te cuento que todos nuestros equipos tienen seis meses de garantía.",
|
|
180770
|
+
* "mime_type": "audio/ogg",
|
|
180771
|
+
* "byte_size": 48213,
|
|
180772
|
+
* "duration_ms": 12480,
|
|
180773
|
+
* "original_filename": "garantia.ogg",
|
|
180774
|
+
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180775
|
+
* "created_at": "2026-10-28T15:04:05.000Z",
|
|
180776
|
+
* "updated_at": "2026-10-28T15:04:05.000Z"
|
|
180777
|
+
* }
|
|
180778
|
+
*/
|
|
180779
|
+
"application/json": {
|
|
180780
|
+
data?: unknown;
|
|
180781
|
+
meta?: {
|
|
180782
|
+
[key: string]: unknown;
|
|
180783
|
+
};
|
|
180784
|
+
};
|
|
180785
|
+
};
|
|
180786
|
+
};
|
|
180787
|
+
/** @description Validation error */
|
|
180788
|
+
400: {
|
|
180789
|
+
headers: {
|
|
180790
|
+
[name: string]: unknown;
|
|
180791
|
+
};
|
|
180792
|
+
content: {
|
|
180793
|
+
"application/json": components["schemas"]["Error"];
|
|
180794
|
+
};
|
|
180795
|
+
};
|
|
180796
|
+
/** @description Unauthorized */
|
|
180797
|
+
401: {
|
|
180798
|
+
headers: {
|
|
180799
|
+
[name: string]: unknown;
|
|
180800
|
+
};
|
|
180801
|
+
content: {
|
|
180802
|
+
"application/json": components["schemas"]["Error"];
|
|
180803
|
+
};
|
|
180804
|
+
};
|
|
180805
|
+
/** @description Forbidden */
|
|
180806
|
+
403: {
|
|
180807
|
+
headers: {
|
|
180808
|
+
[name: string]: unknown;
|
|
180809
|
+
};
|
|
180810
|
+
content: {
|
|
180811
|
+
"application/json": components["schemas"]["Error"];
|
|
180812
|
+
};
|
|
180813
|
+
};
|
|
180814
|
+
/** @description Not found */
|
|
180815
|
+
404: {
|
|
180816
|
+
headers: {
|
|
180817
|
+
[name: string]: unknown;
|
|
180818
|
+
};
|
|
180819
|
+
content: {
|
|
180820
|
+
"application/json": components["schemas"]["Error"];
|
|
180821
|
+
};
|
|
180822
|
+
};
|
|
180823
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
180824
|
+
409: {
|
|
180825
|
+
headers: {
|
|
180826
|
+
[name: string]: unknown;
|
|
180827
|
+
};
|
|
180828
|
+
content: {
|
|
180829
|
+
"application/json": components["schemas"]["Error"];
|
|
180830
|
+
};
|
|
180831
|
+
};
|
|
180832
|
+
/** @description Rate limited */
|
|
180833
|
+
429: {
|
|
180834
|
+
headers: {
|
|
180835
|
+
[name: string]: unknown;
|
|
180836
|
+
};
|
|
180837
|
+
content: {
|
|
180838
|
+
"application/json": components["schemas"]["Error"];
|
|
180839
|
+
};
|
|
180840
|
+
};
|
|
180841
|
+
};
|
|
180842
|
+
};
|
|
180843
|
+
trace?: never;
|
|
180844
|
+
};
|
|
180845
|
+
"/voice-clips/{id}/play-url": {
|
|
180846
|
+
parameters: {
|
|
180847
|
+
query?: never;
|
|
180848
|
+
header?: never;
|
|
180849
|
+
path?: never;
|
|
180850
|
+
cookie?: never;
|
|
180851
|
+
};
|
|
180852
|
+
/**
|
|
180853
|
+
* Get a play URL for a voice clip
|
|
180854
|
+
* @description **Deprecated** — use `/media-assets` (voice clips are its audio files, same ids).
|
|
180855
|
+
*
|
|
180856
|
+
* A short-lived signed URL (15 minutes) to stream or download the audio. Ask for a new one when it expires; do not store it.
|
|
180857
|
+
*/
|
|
180858
|
+
get: {
|
|
180859
|
+
parameters: {
|
|
180860
|
+
query?: never;
|
|
180861
|
+
header?: never;
|
|
180862
|
+
path: {
|
|
180863
|
+
id: string;
|
|
180864
|
+
};
|
|
180865
|
+
cookie?: never;
|
|
180866
|
+
};
|
|
180867
|
+
requestBody?: never;
|
|
180868
|
+
responses: {
|
|
180869
|
+
/** @description `{ url, expires_at, mime_type }` */
|
|
180870
|
+
200: {
|
|
180871
|
+
headers: {
|
|
180872
|
+
[name: string]: unknown;
|
|
180873
|
+
};
|
|
180874
|
+
content: {
|
|
180875
|
+
/**
|
|
180876
|
+
* @example {
|
|
180877
|
+
* "url": "https://storage.example.com/tenants/…/voice-clips/6b0f….ogg?X-Amz-Signature=…",
|
|
180878
|
+
* "expires_at": "2026-10-28T15:19:05.000Z",
|
|
180879
|
+
* "mime_type": "audio/ogg"
|
|
180880
|
+
* }
|
|
180881
|
+
*/
|
|
180882
|
+
"application/json": {
|
|
180883
|
+
data?: unknown;
|
|
180884
|
+
meta?: {
|
|
180885
|
+
[key: string]: unknown;
|
|
180886
|
+
};
|
|
180887
|
+
};
|
|
180888
|
+
};
|
|
180889
|
+
};
|
|
180890
|
+
/** @description Validation error */
|
|
180891
|
+
400: {
|
|
180892
|
+
headers: {
|
|
180893
|
+
[name: string]: unknown;
|
|
180894
|
+
};
|
|
180895
|
+
content: {
|
|
180896
|
+
"application/json": components["schemas"]["Error"];
|
|
180897
|
+
};
|
|
180898
|
+
};
|
|
180899
|
+
/** @description Unauthorized */
|
|
180900
|
+
401: {
|
|
180901
|
+
headers: {
|
|
180902
|
+
[name: string]: unknown;
|
|
180903
|
+
};
|
|
180904
|
+
content: {
|
|
180905
|
+
"application/json": components["schemas"]["Error"];
|
|
180906
|
+
};
|
|
180907
|
+
};
|
|
180908
|
+
/** @description Forbidden */
|
|
180909
|
+
403: {
|
|
180910
|
+
headers: {
|
|
180911
|
+
[name: string]: unknown;
|
|
180912
|
+
};
|
|
180913
|
+
content: {
|
|
180914
|
+
"application/json": components["schemas"]["Error"];
|
|
180915
|
+
};
|
|
180916
|
+
};
|
|
180917
|
+
/** @description Not found */
|
|
180918
|
+
404: {
|
|
180919
|
+
headers: {
|
|
180920
|
+
[name: string]: unknown;
|
|
180921
|
+
};
|
|
180922
|
+
content: {
|
|
180923
|
+
"application/json": components["schemas"]["Error"];
|
|
180924
|
+
};
|
|
180925
|
+
};
|
|
180926
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
180927
|
+
409: {
|
|
180928
|
+
headers: {
|
|
180929
|
+
[name: string]: unknown;
|
|
180930
|
+
};
|
|
180931
|
+
content: {
|
|
180932
|
+
"application/json": components["schemas"]["Error"];
|
|
180933
|
+
};
|
|
180934
|
+
};
|
|
180935
|
+
/** @description Rate limited */
|
|
180936
|
+
429: {
|
|
180937
|
+
headers: {
|
|
180938
|
+
[name: string]: unknown;
|
|
180939
|
+
};
|
|
180940
|
+
content: {
|
|
180941
|
+
"application/json": components["schemas"]["Error"];
|
|
180942
|
+
};
|
|
180943
|
+
};
|
|
180944
|
+
};
|
|
180945
|
+
};
|
|
180946
|
+
put?: never;
|
|
180947
|
+
post?: never;
|
|
180948
|
+
delete?: never;
|
|
180949
|
+
options?: never;
|
|
180950
|
+
head?: never;
|
|
180951
|
+
patch?: never;
|
|
180952
|
+
trace?: never;
|
|
180953
|
+
};
|
|
180954
|
+
"/media-assets": {
|
|
180955
|
+
parameters: {
|
|
180956
|
+
query?: never;
|
|
180957
|
+
header?: never;
|
|
180958
|
+
path?: never;
|
|
180959
|
+
cookie?: never;
|
|
180960
|
+
};
|
|
180961
|
+
/**
|
|
180962
|
+
* List library files
|
|
180963
|
+
* @description The workspace library, newest first (at most 500; deleted files never appear). Every file carries `sendable` / `unsendable_reason` (`expired`, `consent_required` — it shows a person whose consent is not confirmed) and a short-lived `thumb_url` (15 minutes; images and videos). Filters: `kind` and `tag` (comma-separated, any), `topic_id`, `q` (free text over name, «cuándo usarlo», tags and topic names), `ai_enabled`, `status` (`live` | `expired` | `all`, default all).
|
|
180964
|
+
*
|
|
180965
|
+
* With `conversation_id` every file also carries `sent_in_conversation`, `suggested` (linked to a topic the conversation’s contact is about) and `channel_ok` (the conversation’s channel can carry it).
|
|
180966
|
+
*/
|
|
180967
|
+
get: {
|
|
180968
|
+
parameters: {
|
|
180969
|
+
query?: {
|
|
180970
|
+
/** @description Comma-separated kinds: image, video, audio, document. */
|
|
180971
|
+
kind?: string;
|
|
180972
|
+
/** @description Comma-separated tags; a file qualifies when it carries any. */
|
|
180973
|
+
tag?: string;
|
|
180974
|
+
topic_id?: string;
|
|
180975
|
+
/** @description Free text over name, «cuándo usarlo», tags and topic names. */
|
|
180976
|
+
q?: string;
|
|
180977
|
+
ai_enabled?: "true" | "false";
|
|
180978
|
+
/** @description Default `all`. */
|
|
180979
|
+
status?: "live" | "expired" | "all";
|
|
180980
|
+
/** @description Adds `sent_in_conversation`, `suggested` and `channel_ok` for that conversation (the composer picker). */
|
|
180981
|
+
conversation_id?: string;
|
|
180982
|
+
};
|
|
180983
|
+
header?: never;
|
|
180984
|
+
path?: never;
|
|
180985
|
+
cookie?: never;
|
|
180986
|
+
};
|
|
180987
|
+
requestBody?: never;
|
|
180988
|
+
responses: {
|
|
180989
|
+
/** @description Library files */
|
|
180990
|
+
200: {
|
|
180991
|
+
headers: {
|
|
180992
|
+
[name: string]: unknown;
|
|
180993
|
+
};
|
|
180994
|
+
content: {
|
|
180995
|
+
/**
|
|
180996
|
+
* @example [
|
|
180997
|
+
* {
|
|
180998
|
+
* "id": "3f6c2b1a-9d4e-4c7b-8a2f-1e0d9c8b7a65",
|
|
180999
|
+
* "kind": "image",
|
|
181000
|
+
* "name": "Plasma — antes/después 1",
|
|
181001
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181002
|
+
* "caption": "Resultado real tras 3 sesiones",
|
|
181003
|
+
* "tags": [
|
|
181004
|
+
* "antes-despues"
|
|
181005
|
+
* ],
|
|
181006
|
+
* "topics": [
|
|
181007
|
+
* {
|
|
181008
|
+
* "id": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181009
|
+
* "name": "Plasma rico en plaquetas",
|
|
181010
|
+
* "kind": "treatment"
|
|
181011
|
+
* }
|
|
181012
|
+
* ],
|
|
181013
|
+
* "models": [],
|
|
181014
|
+
* "transcript": null,
|
|
181015
|
+
* "mime_type": "image/jpeg",
|
|
181016
|
+
* "byte_size": 412345,
|
|
181017
|
+
* "duration_ms": null,
|
|
181018
|
+
* "width": 1080,
|
|
181019
|
+
* "height": 1350,
|
|
181020
|
+
* "page_count": null,
|
|
181021
|
+
* "original_filename": "IMG_2231.HEIC",
|
|
181022
|
+
* "ai_enabled": true,
|
|
181023
|
+
* "shows_person": true,
|
|
181024
|
+
* "consent_confirmed_at": "2026-10-29T14:00:00.000Z",
|
|
181025
|
+
* "consent_confirmed_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
181026
|
+
* "expires_at": null,
|
|
181027
|
+
* "expired": false,
|
|
181028
|
+
* "sendable": true,
|
|
181029
|
+
* "unsendable_reason": null,
|
|
181030
|
+
* "send_count": 3,
|
|
181031
|
+
* "last_sent_at": "2026-10-29T15:10:00.000Z",
|
|
181032
|
+
* "thumb_url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.thumb.webp?X-Amz-Signature=…",
|
|
181033
|
+
* "thumb_expires_at": "2026-10-29T15:25:00.000Z",
|
|
181034
|
+
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
181035
|
+
* "created_at": "2026-10-29T13:58:00.000Z",
|
|
181036
|
+
* "updated_at": "2026-10-29T14:00:00.000Z"
|
|
181037
|
+
* }
|
|
181038
|
+
* ]
|
|
181039
|
+
*/
|
|
181040
|
+
"application/json": {
|
|
181041
|
+
data?: unknown;
|
|
181042
|
+
meta?: {
|
|
181043
|
+
[key: string]: unknown;
|
|
181044
|
+
};
|
|
181045
|
+
};
|
|
181046
|
+
};
|
|
181047
|
+
};
|
|
181048
|
+
/** @description Validation error */
|
|
181049
|
+
400: {
|
|
181050
|
+
headers: {
|
|
181051
|
+
[name: string]: unknown;
|
|
181052
|
+
};
|
|
181053
|
+
content: {
|
|
181054
|
+
"application/json": components["schemas"]["Error"];
|
|
181055
|
+
};
|
|
181056
|
+
};
|
|
181057
|
+
/** @description Unauthorized */
|
|
181058
|
+
401: {
|
|
181059
|
+
headers: {
|
|
181060
|
+
[name: string]: unknown;
|
|
181061
|
+
};
|
|
181062
|
+
content: {
|
|
181063
|
+
"application/json": components["schemas"]["Error"];
|
|
181064
|
+
};
|
|
181065
|
+
};
|
|
181066
|
+
/** @description Forbidden */
|
|
181067
|
+
403: {
|
|
181068
|
+
headers: {
|
|
181069
|
+
[name: string]: unknown;
|
|
181070
|
+
};
|
|
181071
|
+
content: {
|
|
181072
|
+
"application/json": components["schemas"]["Error"];
|
|
181073
|
+
};
|
|
181074
|
+
};
|
|
181075
|
+
/** @description Not found */
|
|
181076
|
+
404: {
|
|
181077
|
+
headers: {
|
|
181078
|
+
[name: string]: unknown;
|
|
181079
|
+
};
|
|
181080
|
+
content: {
|
|
181081
|
+
"application/json": components["schemas"]["Error"];
|
|
181082
|
+
};
|
|
181083
|
+
};
|
|
181084
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
181085
|
+
409: {
|
|
181086
|
+
headers: {
|
|
181087
|
+
[name: string]: unknown;
|
|
181088
|
+
};
|
|
181089
|
+
content: {
|
|
181090
|
+
"application/json": components["schemas"]["Error"];
|
|
181091
|
+
};
|
|
181092
|
+
};
|
|
181093
|
+
/** @description Rate limited */
|
|
181094
|
+
429: {
|
|
181095
|
+
headers: {
|
|
181096
|
+
[name: string]: unknown;
|
|
181097
|
+
};
|
|
181098
|
+
content: {
|
|
181099
|
+
"application/json": components["schemas"]["Error"];
|
|
181100
|
+
};
|
|
181101
|
+
};
|
|
181102
|
+
};
|
|
181103
|
+
};
|
|
181104
|
+
put?: never;
|
|
181105
|
+
/**
|
|
181106
|
+
* Upload a file to the library
|
|
181107
|
+
* @description Uploads `file` with its details. The kind (image, video, audio, document) is read from the bytes. Accepted files and caps: images JPG/PNG/WebP/HEIC ≤ 10 MB (auto-rotated, every metadata block — EXIF, GPS — removed, long edge ≤ 2560 px, stored as JPEG, or PNG when it was PNG, ≤ 5 MB); videos MP4/MOV/WebM ≤ 50 MB (converted to a WhatsApp-safe MP4 that must end ≤ 16 MB); PDF ≤ 16 MB; audio OGG/Opus, MP3, M4A/AAC, WAV, WebM, AMR ≤ 16 MB (transcribed unless `transcript` is sent). Refusals carry `details.code`: 413 `MEDIA_TOO_LARGE` (`details.limit_bytes`), 415 `MEDIA_UNSUPPORTED_TYPE` (an HEIC the server cannot decode included: convert it to JPG), 422 `MEDIA_EMPTY`. `name` defaults to the file name. `shows_person` defaults to true for images and videos in a healthcare workspace; while it is true and the consent is not confirmed nobody can send the file. A file identical to one already in the library is still created and the answer carries `duplicate_of: {id, name}`. 409 `MEDIA_LIBRARY_FULL` past 500 files; 422 for an unknown topic.
|
|
180139
181108
|
*
|
|
180140
181109
|
* **Or a JSON body** (`application/json`) — what an MCP connector sends through `call_operation`, which cannot build multipart: `{ filename, content, content_encoding?, content_type? }` plus the operation's own form fields. `content` is UTF-8 text by default, or base64 when `content_encoding` is `"base64"` (images, PDF, audio, video). The same byte cap applies to the decoded bytes (413 above it); invalid base64 is a 400; the content type defaults from the filename extension.
|
|
180141
181110
|
*/
|
|
@@ -180153,43 +181122,52 @@ interface paths {
|
|
|
180153
181122
|
content: {
|
|
180154
181123
|
/**
|
|
180155
181124
|
* @example {
|
|
180156
|
-
* "file": "(binary
|
|
180157
|
-
* "name": "
|
|
180158
|
-
* "
|
|
180159
|
-
* "
|
|
181125
|
+
* "file": "(binary part)",
|
|
181126
|
+
* "name": "Plasma — antes/después 1",
|
|
181127
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181128
|
+
* "tags": "antes-despues",
|
|
181129
|
+
* "topic_ids": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181130
|
+
* "shows_person": "true",
|
|
181131
|
+
* "consent_confirmed": "true"
|
|
180160
181132
|
* }
|
|
180161
181133
|
*/
|
|
180162
181134
|
"multipart/form-data": {
|
|
180163
181135
|
/** @description Defaults to the file name without its extension. */
|
|
180164
181136
|
name?: string;
|
|
180165
|
-
/** @description
|
|
180166
|
-
tags?: string[];
|
|
180167
|
-
/** @description «Cuándo usarlo»: when this clip fits, for the team and the agent. */
|
|
181137
|
+
/** @description «Cuándo usarlo»: when this file fits. The agent reads it. */
|
|
180168
181138
|
when_to_use?: string;
|
|
181139
|
+
/** @description Default text sent with the file (not for audio). */
|
|
181140
|
+
caption?: string;
|
|
181141
|
+
/** @description Labels for finding the file (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
181142
|
+
tags?: string[];
|
|
181143
|
+
/** @description Interest topics (treatment, model, product, service) this file illustrates; replaces the set. Unknown ids → 422. */
|
|
181144
|
+
topic_ids?: string[];
|
|
181145
|
+
/** @description «El agente puede enviarlo». Default true. */
|
|
181146
|
+
ai_enabled?: boolean;
|
|
181147
|
+
/** @description «Muestra a una persona / paciente». Default: true for images/videos in a healthcare workspace, else false. While true and consent is not confirmed, nobody can send the file. */
|
|
181148
|
+
shows_person?: boolean;
|
|
181149
|
+
/** @description The uploading member confirms the written consent of the person shown. */
|
|
181150
|
+
consent_confirmed?: boolean;
|
|
180169
181151
|
/** Format: date-time */
|
|
180170
181152
|
expires_at?: string | null;
|
|
180171
|
-
/** @description Model filter: the model names the
|
|
181153
|
+
/** @description Model filter: the model names the file applies to, spelled as in the catalog (`product.model`). Empty = any model. */
|
|
180172
181154
|
models?: string[];
|
|
180173
|
-
/** @description
|
|
181155
|
+
/** @description Audio: what it says. When given, speech-to-text is skipped. */
|
|
180174
181156
|
transcript?: string;
|
|
180175
181157
|
file?: unknown;
|
|
180176
181158
|
};
|
|
180177
181159
|
/**
|
|
180178
181160
|
* @example {
|
|
180179
|
-
* "filename": "
|
|
180180
|
-
* "content": "
|
|
181161
|
+
* "filename": "plasma-1.jpg",
|
|
181162
|
+
* "content": "/9j/4AAQSkZJRgABAQ…",
|
|
180181
181163
|
* "content_encoding": "base64",
|
|
180182
|
-
* "name": "
|
|
181164
|
+
* "name": "Plasma — antes/después 1",
|
|
181165
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
180183
181166
|
* "tags": [
|
|
180184
|
-
* "
|
|
180185
|
-
* "cierre"
|
|
180186
|
-
* ],
|
|
180187
|
-
* "when_to_use": "Cuando el cliente pregunta por la garantía.",
|
|
180188
|
-
* "models": [
|
|
180189
|
-
* "iPhone 13",
|
|
180190
|
-
* "iPhone 14"
|
|
181167
|
+
* "antes-despues"
|
|
180191
181168
|
* ],
|
|
180192
|
-
* "
|
|
181169
|
+
* "shows_person": true,
|
|
181170
|
+
* "consent_confirmed": true
|
|
180193
181171
|
* }
|
|
180194
181172
|
*/
|
|
180195
181173
|
"application/json": {
|
|
@@ -180206,21 +181184,31 @@ interface paths {
|
|
|
180206
181184
|
content_type?: string;
|
|
180207
181185
|
/** @description Defaults to the file name without its extension. */
|
|
180208
181186
|
name?: string;
|
|
180209
|
-
/** @description
|
|
180210
|
-
tags?: string[];
|
|
180211
|
-
/** @description «Cuándo usarlo»: when this clip fits, for the team and the agent. */
|
|
181187
|
+
/** @description «Cuándo usarlo»: when this file fits. The agent reads it. */
|
|
180212
181188
|
when_to_use?: string;
|
|
181189
|
+
/** @description Default text sent with the file (not for audio). */
|
|
181190
|
+
caption?: string;
|
|
181191
|
+
/** @description Labels for finding the file (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
181192
|
+
tags?: string[];
|
|
181193
|
+
/** @description Interest topics (treatment, model, product, service) this file illustrates; replaces the set. Unknown ids → 422. */
|
|
181194
|
+
topic_ids?: string[];
|
|
181195
|
+
/** @description «El agente puede enviarlo». Default true. */
|
|
181196
|
+
ai_enabled?: boolean;
|
|
181197
|
+
/** @description «Muestra a una persona / paciente». Default: true for images/videos in a healthcare workspace, else false. While true and consent is not confirmed, nobody can send the file. */
|
|
181198
|
+
shows_person?: boolean;
|
|
181199
|
+
/** @description The uploading member confirms the written consent of the person shown. */
|
|
181200
|
+
consent_confirmed?: boolean;
|
|
180213
181201
|
/** Format: date-time */
|
|
180214
181202
|
expires_at?: string | null;
|
|
180215
|
-
/** @description Model filter: the model names the
|
|
181203
|
+
/** @description Model filter: the model names the file applies to, spelled as in the catalog (`product.model`). Empty = any model. */
|
|
180216
181204
|
models?: string[];
|
|
180217
|
-
/** @description
|
|
181205
|
+
/** @description Audio: what it says. When given, speech-to-text is skipped. */
|
|
180218
181206
|
transcript?: string;
|
|
180219
181207
|
};
|
|
180220
181208
|
};
|
|
180221
181209
|
};
|
|
180222
181210
|
responses: {
|
|
180223
|
-
/** @description The created
|
|
181211
|
+
/** @description The created file */
|
|
180224
181212
|
201: {
|
|
180225
181213
|
headers: {
|
|
180226
181214
|
[name: string]: unknown;
|
|
@@ -180228,28 +181216,46 @@ interface paths {
|
|
|
180228
181216
|
content: {
|
|
180229
181217
|
/**
|
|
180230
181218
|
* @example {
|
|
180231
|
-
* "id": "
|
|
180232
|
-
* "
|
|
181219
|
+
* "id": "3f6c2b1a-9d4e-4c7b-8a2f-1e0d9c8b7a65",
|
|
181220
|
+
* "kind": "image",
|
|
181221
|
+
* "name": "Plasma — antes/después 1",
|
|
181222
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181223
|
+
* "caption": "Resultado real tras 3 sesiones",
|
|
180233
181224
|
* "tags": [
|
|
180234
|
-
* "
|
|
180235
|
-
* "cierre"
|
|
181225
|
+
* "antes-despues"
|
|
180236
181226
|
* ],
|
|
180237
|
-
* "
|
|
181227
|
+
* "topics": [
|
|
181228
|
+
* {
|
|
181229
|
+
* "id": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181230
|
+
* "name": "Plasma rico en plaquetas",
|
|
181231
|
+
* "kind": "treatment"
|
|
181232
|
+
* }
|
|
181233
|
+
* ],
|
|
181234
|
+
* "models": [],
|
|
181235
|
+
* "transcript": null,
|
|
181236
|
+
* "mime_type": "image/jpeg",
|
|
181237
|
+
* "byte_size": 412345,
|
|
181238
|
+
* "duration_ms": null,
|
|
181239
|
+
* "width": 1080,
|
|
181240
|
+
* "height": 1350,
|
|
181241
|
+
* "page_count": null,
|
|
181242
|
+
* "original_filename": "IMG_2231.HEIC",
|
|
181243
|
+
* "ai_enabled": true,
|
|
181244
|
+
* "shows_person": true,
|
|
181245
|
+
* "consent_confirmed_at": "2026-10-29T14:00:00.000Z",
|
|
181246
|
+
* "consent_confirmed_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180238
181247
|
* "expires_at": null,
|
|
180239
181248
|
* "expired": false,
|
|
180240
|
-
* "
|
|
180241
|
-
*
|
|
180242
|
-
*
|
|
180243
|
-
*
|
|
180244
|
-
*
|
|
180245
|
-
* "
|
|
180246
|
-
* "mime_type": "audio/ogg",
|
|
180247
|
-
* "byte_size": 48213,
|
|
180248
|
-
* "duration_ms": 12480,
|
|
180249
|
-
* "original_filename": "garantia.ogg",
|
|
181249
|
+
* "sendable": true,
|
|
181250
|
+
* "unsendable_reason": null,
|
|
181251
|
+
* "send_count": 3,
|
|
181252
|
+
* "last_sent_at": "2026-10-29T15:10:00.000Z",
|
|
181253
|
+
* "thumb_url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.thumb.webp?X-Amz-Signature=…",
|
|
181254
|
+
* "thumb_expires_at": "2026-10-29T15:25:00.000Z",
|
|
180250
181255
|
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180251
|
-
* "created_at": "2026-10-
|
|
180252
|
-
* "updated_at": "2026-10-
|
|
181256
|
+
* "created_at": "2026-10-29T13:58:00.000Z",
|
|
181257
|
+
* "updated_at": "2026-10-29T14:00:00.000Z",
|
|
181258
|
+
* "duplicate_of": null
|
|
180253
181259
|
* }
|
|
180254
181260
|
*/
|
|
180255
181261
|
"application/json": {
|
|
@@ -180319,7 +181325,7 @@ interface paths {
|
|
|
180319
181325
|
patch?: never;
|
|
180320
181326
|
trace?: never;
|
|
180321
181327
|
};
|
|
180322
|
-
"/
|
|
181328
|
+
"/media-assets/{id}": {
|
|
180323
181329
|
parameters: {
|
|
180324
181330
|
query?: never;
|
|
180325
181331
|
header?: never;
|
|
@@ -180327,8 +181333,8 @@ interface paths {
|
|
|
180327
181333
|
cookie?: never;
|
|
180328
181334
|
};
|
|
180329
181335
|
/**
|
|
180330
|
-
* Fetch one
|
|
180331
|
-
* @description The
|
|
181336
|
+
* Fetch one library file
|
|
181337
|
+
* @description The file with its details, topics, send counters and state. 404 for a deleted file or another workspace’s.
|
|
180332
181338
|
*/
|
|
180333
181339
|
get: {
|
|
180334
181340
|
parameters: {
|
|
@@ -180341,7 +181347,7 @@ interface paths {
|
|
|
180341
181347
|
};
|
|
180342
181348
|
requestBody?: never;
|
|
180343
181349
|
responses: {
|
|
180344
|
-
/** @description The
|
|
181350
|
+
/** @description The file */
|
|
180345
181351
|
200: {
|
|
180346
181352
|
headers: {
|
|
180347
181353
|
[name: string]: unknown;
|
|
@@ -180349,28 +181355,45 @@ interface paths {
|
|
|
180349
181355
|
content: {
|
|
180350
181356
|
/**
|
|
180351
181357
|
* @example {
|
|
180352
|
-
* "id": "
|
|
180353
|
-
* "
|
|
181358
|
+
* "id": "3f6c2b1a-9d4e-4c7b-8a2f-1e0d9c8b7a65",
|
|
181359
|
+
* "kind": "image",
|
|
181360
|
+
* "name": "Plasma — antes/después 1",
|
|
181361
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181362
|
+
* "caption": "Resultado real tras 3 sesiones",
|
|
180354
181363
|
* "tags": [
|
|
180355
|
-
* "
|
|
180356
|
-
* "cierre"
|
|
181364
|
+
* "antes-despues"
|
|
180357
181365
|
* ],
|
|
180358
|
-
* "
|
|
181366
|
+
* "topics": [
|
|
181367
|
+
* {
|
|
181368
|
+
* "id": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181369
|
+
* "name": "Plasma rico en plaquetas",
|
|
181370
|
+
* "kind": "treatment"
|
|
181371
|
+
* }
|
|
181372
|
+
* ],
|
|
181373
|
+
* "models": [],
|
|
181374
|
+
* "transcript": null,
|
|
181375
|
+
* "mime_type": "image/jpeg",
|
|
181376
|
+
* "byte_size": 412345,
|
|
181377
|
+
* "duration_ms": null,
|
|
181378
|
+
* "width": 1080,
|
|
181379
|
+
* "height": 1350,
|
|
181380
|
+
* "page_count": null,
|
|
181381
|
+
* "original_filename": "IMG_2231.HEIC",
|
|
181382
|
+
* "ai_enabled": true,
|
|
181383
|
+
* "shows_person": true,
|
|
181384
|
+
* "consent_confirmed_at": "2026-10-29T14:00:00.000Z",
|
|
181385
|
+
* "consent_confirmed_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180359
181386
|
* "expires_at": null,
|
|
180360
181387
|
* "expired": false,
|
|
180361
|
-
* "
|
|
180362
|
-
*
|
|
180363
|
-
*
|
|
180364
|
-
*
|
|
180365
|
-
*
|
|
180366
|
-
* "
|
|
180367
|
-
* "mime_type": "audio/ogg",
|
|
180368
|
-
* "byte_size": 48213,
|
|
180369
|
-
* "duration_ms": 12480,
|
|
180370
|
-
* "original_filename": "garantia.ogg",
|
|
181388
|
+
* "sendable": true,
|
|
181389
|
+
* "unsendable_reason": null,
|
|
181390
|
+
* "send_count": 3,
|
|
181391
|
+
* "last_sent_at": "2026-10-29T15:10:00.000Z",
|
|
181392
|
+
* "thumb_url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.thumb.webp?X-Amz-Signature=…",
|
|
181393
|
+
* "thumb_expires_at": "2026-10-29T15:25:00.000Z",
|
|
180371
181394
|
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180372
|
-
* "created_at": "2026-10-
|
|
180373
|
-
* "updated_at": "2026-10-
|
|
181395
|
+
* "created_at": "2026-10-29T13:58:00.000Z",
|
|
181396
|
+
* "updated_at": "2026-10-29T14:00:00.000Z"
|
|
180374
181397
|
* }
|
|
180375
181398
|
*/
|
|
180376
181399
|
"application/json": {
|
|
@@ -180440,8 +181463,8 @@ interface paths {
|
|
|
180440
181463
|
put?: never;
|
|
180441
181464
|
post?: never;
|
|
180442
181465
|
/**
|
|
180443
|
-
* Delete a
|
|
180444
|
-
* @description Removes the
|
|
181466
|
+
* Delete a library file
|
|
181467
|
+
* @description Removes the file from the library and deletes its bytes at once (no undo). Conversations where it was already sent keep their own copy. The send history keeps pointing at it. To stop offering a file without losing it, set `expires_at` or turn `ai_enabled` off.
|
|
180445
181468
|
*/
|
|
180446
181469
|
delete: {
|
|
180447
181470
|
parameters: {
|
|
@@ -180520,8 +181543,8 @@ interface paths {
|
|
|
180520
181543
|
options?: never;
|
|
180521
181544
|
head?: never;
|
|
180522
181545
|
/**
|
|
180523
|
-
* Edit a
|
|
180524
|
-
* @description Changes the details
|
|
181546
|
+
* Edit a library file
|
|
181547
|
+
* @description Changes the details; the bytes are replaced with `POST /media-assets/{id}/file`. `tags`, `topic_ids` and `models` replace their sets. `caption: null` and `expires_at: null` clear them. `consent_confirmed: true` records the calling member and now as the consent confirmation (a member only; an API key gets 422), `false` clears it. At least one field is required; an unknown topic is 422.
|
|
180525
181548
|
*/
|
|
180526
181549
|
patch: {
|
|
180527
181550
|
parameters: {
|
|
@@ -180536,29 +181559,39 @@ interface paths {
|
|
|
180536
181559
|
content: {
|
|
180537
181560
|
/**
|
|
180538
181561
|
* @example {
|
|
180539
|
-
* "
|
|
180540
|
-
* "
|
|
181562
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma capilar",
|
|
181563
|
+
* "topic_ids": [
|
|
181564
|
+
* "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586"
|
|
181565
|
+
* ],
|
|
181566
|
+
* "consent_confirmed": true
|
|
180541
181567
|
* }
|
|
180542
181568
|
*/
|
|
180543
181569
|
"application/json": {
|
|
180544
181570
|
name?: string;
|
|
180545
|
-
/** @description Labels for finding the clip (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
180546
|
-
tags?: string[];
|
|
180547
181571
|
when_to_use?: string;
|
|
181572
|
+
caption?: string | null;
|
|
181573
|
+
/** @description Labels for finding the file (stored lower-cased). Multipart: repeat the field, or send a comma-separated or JSON-array string. */
|
|
181574
|
+
tags?: string[];
|
|
181575
|
+
/** @description Interest topics (treatment, model, product, service) this file illustrates; replaces the set. Unknown ids → 422. */
|
|
181576
|
+
topic_ids?: string[];
|
|
181577
|
+
/** @description Model filter: the model names the file applies to, spelled as in the catalog (`product.model`). Empty = any model. */
|
|
181578
|
+
models?: string[];
|
|
181579
|
+
/** @description Audio: the corrected transcript. Empty or null clears it. */
|
|
181580
|
+
transcript?: string | null;
|
|
181581
|
+
ai_enabled?: boolean;
|
|
181582
|
+
shows_person?: boolean;
|
|
181583
|
+
/** @description `true` records the calling member and now as the consent confirmation; `false` clears it. */
|
|
181584
|
+
consent_confirmed?: boolean;
|
|
180548
181585
|
/**
|
|
180549
181586
|
* Format: date-time
|
|
180550
|
-
* @description When the
|
|
181587
|
+
* @description When the file stops being sendable (ISO 8601). Null = never. An expired file stays in the library, marked `expired`.
|
|
180551
181588
|
*/
|
|
180552
181589
|
expires_at?: string | null;
|
|
180553
|
-
/** @description Model filter: the model names the clip applies to, spelled as in the catalog (`product.model`, e.g. "iPhone 13 Pro"). Empty = any model. Matched case- and whitespace-insensitively. */
|
|
180554
|
-
models?: string[];
|
|
180555
|
-
/** @description The corrected transcript. Empty or null clears it. */
|
|
180556
|
-
transcript?: string | null;
|
|
180557
181590
|
};
|
|
180558
181591
|
};
|
|
180559
181592
|
};
|
|
180560
181593
|
responses: {
|
|
180561
|
-
/** @description The updated
|
|
181594
|
+
/** @description The updated file */
|
|
180562
181595
|
200: {
|
|
180563
181596
|
headers: {
|
|
180564
181597
|
[name: string]: unknown;
|
|
@@ -180566,28 +181599,224 @@ interface paths {
|
|
|
180566
181599
|
content: {
|
|
180567
181600
|
/**
|
|
180568
181601
|
* @example {
|
|
180569
|
-
* "id": "
|
|
180570
|
-
* "
|
|
181602
|
+
* "id": "3f6c2b1a-9d4e-4c7b-8a2f-1e0d9c8b7a65",
|
|
181603
|
+
* "kind": "image",
|
|
181604
|
+
* "name": "Plasma — antes/después 1",
|
|
181605
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181606
|
+
* "caption": "Resultado real tras 3 sesiones",
|
|
180571
181607
|
* "tags": [
|
|
180572
|
-
* "
|
|
180573
|
-
* "cierre"
|
|
181608
|
+
* "antes-despues"
|
|
180574
181609
|
* ],
|
|
180575
|
-
* "
|
|
181610
|
+
* "topics": [
|
|
181611
|
+
* {
|
|
181612
|
+
* "id": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181613
|
+
* "name": "Plasma rico en plaquetas",
|
|
181614
|
+
* "kind": "treatment"
|
|
181615
|
+
* }
|
|
181616
|
+
* ],
|
|
181617
|
+
* "models": [],
|
|
181618
|
+
* "transcript": null,
|
|
181619
|
+
* "mime_type": "image/jpeg",
|
|
181620
|
+
* "byte_size": 412345,
|
|
181621
|
+
* "duration_ms": null,
|
|
181622
|
+
* "width": 1080,
|
|
181623
|
+
* "height": 1350,
|
|
181624
|
+
* "page_count": null,
|
|
181625
|
+
* "original_filename": "IMG_2231.HEIC",
|
|
181626
|
+
* "ai_enabled": true,
|
|
181627
|
+
* "shows_person": true,
|
|
181628
|
+
* "consent_confirmed_at": "2026-10-29T14:00:00.000Z",
|
|
181629
|
+
* "consent_confirmed_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180576
181630
|
* "expires_at": null,
|
|
180577
181631
|
* "expired": false,
|
|
180578
|
-
* "
|
|
180579
|
-
*
|
|
180580
|
-
*
|
|
180581
|
-
*
|
|
181632
|
+
* "sendable": true,
|
|
181633
|
+
* "unsendable_reason": null,
|
|
181634
|
+
* "send_count": 3,
|
|
181635
|
+
* "last_sent_at": "2026-10-29T15:10:00.000Z",
|
|
181636
|
+
* "thumb_url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.thumb.webp?X-Amz-Signature=…",
|
|
181637
|
+
* "thumb_expires_at": "2026-10-29T15:25:00.000Z",
|
|
181638
|
+
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
181639
|
+
* "created_at": "2026-10-29T13:58:00.000Z",
|
|
181640
|
+
* "updated_at": "2026-10-29T14:00:00.000Z"
|
|
181641
|
+
* }
|
|
181642
|
+
*/
|
|
181643
|
+
"application/json": {
|
|
181644
|
+
data?: unknown;
|
|
181645
|
+
meta?: {
|
|
181646
|
+
[key: string]: unknown;
|
|
181647
|
+
};
|
|
181648
|
+
};
|
|
181649
|
+
};
|
|
181650
|
+
};
|
|
181651
|
+
/** @description Validation error */
|
|
181652
|
+
400: {
|
|
181653
|
+
headers: {
|
|
181654
|
+
[name: string]: unknown;
|
|
181655
|
+
};
|
|
181656
|
+
content: {
|
|
181657
|
+
"application/json": components["schemas"]["Error"];
|
|
181658
|
+
};
|
|
181659
|
+
};
|
|
181660
|
+
/** @description Unauthorized */
|
|
181661
|
+
401: {
|
|
181662
|
+
headers: {
|
|
181663
|
+
[name: string]: unknown;
|
|
181664
|
+
};
|
|
181665
|
+
content: {
|
|
181666
|
+
"application/json": components["schemas"]["Error"];
|
|
181667
|
+
};
|
|
181668
|
+
};
|
|
181669
|
+
/** @description Forbidden */
|
|
181670
|
+
403: {
|
|
181671
|
+
headers: {
|
|
181672
|
+
[name: string]: unknown;
|
|
181673
|
+
};
|
|
181674
|
+
content: {
|
|
181675
|
+
"application/json": components["schemas"]["Error"];
|
|
181676
|
+
};
|
|
181677
|
+
};
|
|
181678
|
+
/** @description Not found */
|
|
181679
|
+
404: {
|
|
181680
|
+
headers: {
|
|
181681
|
+
[name: string]: unknown;
|
|
181682
|
+
};
|
|
181683
|
+
content: {
|
|
181684
|
+
"application/json": components["schemas"]["Error"];
|
|
181685
|
+
};
|
|
181686
|
+
};
|
|
181687
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
181688
|
+
409: {
|
|
181689
|
+
headers: {
|
|
181690
|
+
[name: string]: unknown;
|
|
181691
|
+
};
|
|
181692
|
+
content: {
|
|
181693
|
+
"application/json": components["schemas"]["Error"];
|
|
181694
|
+
};
|
|
181695
|
+
};
|
|
181696
|
+
/** @description Rate limited */
|
|
181697
|
+
429: {
|
|
181698
|
+
headers: {
|
|
181699
|
+
[name: string]: unknown;
|
|
181700
|
+
};
|
|
181701
|
+
content: {
|
|
181702
|
+
"application/json": components["schemas"]["Error"];
|
|
181703
|
+
};
|
|
181704
|
+
};
|
|
181705
|
+
};
|
|
181706
|
+
};
|
|
181707
|
+
trace?: never;
|
|
181708
|
+
};
|
|
181709
|
+
"/media-assets/{id}/file": {
|
|
181710
|
+
parameters: {
|
|
181711
|
+
query?: never;
|
|
181712
|
+
header?: never;
|
|
181713
|
+
path?: never;
|
|
181714
|
+
cookie?: never;
|
|
181715
|
+
};
|
|
181716
|
+
get?: never;
|
|
181717
|
+
put?: never;
|
|
181718
|
+
/**
|
|
181719
|
+
* Replace the file of a library entry
|
|
181720
|
+
* @description Swaps the bytes and keeps the entry (id, name, topics, send history). The new file must be the same kind (409 `MEDIA_KIND_MISMATCH`). Dimensions, duration, page count and (audio) the transcript are re-computed; the consent is CLEARED when the file shows a person (it may be someone else). Accepted files and caps: images JPG/PNG/WebP/HEIC ≤ 10 MB (auto-rotated, every metadata block — EXIF, GPS — removed, long edge ≤ 2560 px, stored as JPEG, or PNG when it was PNG, ≤ 5 MB); videos MP4/MOV/WebM ≤ 50 MB (converted to a WhatsApp-safe MP4 that must end ≤ 16 MB); PDF ≤ 16 MB; audio OGG/Opus, MP3, M4A/AAC, WAV, WebM, AMR ≤ 16 MB (transcribed unless `transcript` is sent). Refusals carry `details.code`: 413 `MEDIA_TOO_LARGE` (`details.limit_bytes`), 415 `MEDIA_UNSUPPORTED_TYPE` (an HEIC the server cannot decode included: convert it to JPG), 422 `MEDIA_EMPTY`.
|
|
181721
|
+
*
|
|
181722
|
+
* **Or a JSON body** (`application/json`) — what an MCP connector sends through `call_operation`, which cannot build multipart: `{ filename, content, content_encoding?, content_type? }` plus the operation's own form fields. `content` is UTF-8 text by default, or base64 when `content_encoding` is `"base64"` (images, PDF, audio, video). The same byte cap applies to the decoded bytes (413 above it); invalid base64 is a 400; the content type defaults from the filename extension.
|
|
181723
|
+
*/
|
|
181724
|
+
post: {
|
|
181725
|
+
parameters: {
|
|
181726
|
+
query?: never;
|
|
181727
|
+
header?: {
|
|
181728
|
+
/** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
|
|
181729
|
+
"Idempotency-Key"?: string;
|
|
181730
|
+
};
|
|
181731
|
+
path: {
|
|
181732
|
+
id: string;
|
|
181733
|
+
};
|
|
181734
|
+
cookie?: never;
|
|
181735
|
+
};
|
|
181736
|
+
requestBody?: {
|
|
181737
|
+
content: {
|
|
181738
|
+
/**
|
|
181739
|
+
* @example {
|
|
181740
|
+
* "file": "(binary part)"
|
|
181741
|
+
* }
|
|
181742
|
+
*/
|
|
181743
|
+
"multipart/form-data": {
|
|
181744
|
+
/** @description Audio: what the new file says. When given, speech-to-text is skipped. */
|
|
181745
|
+
transcript?: string;
|
|
181746
|
+
file?: unknown;
|
|
181747
|
+
};
|
|
181748
|
+
/**
|
|
181749
|
+
* @example {
|
|
181750
|
+
* "filename": "plasma-1b.jpg",
|
|
181751
|
+
* "content": "/9j/4AAQSkZJRgABAQ…",
|
|
181752
|
+
* "content_encoding": "base64"
|
|
181753
|
+
* }
|
|
181754
|
+
*/
|
|
181755
|
+
"application/json": {
|
|
181756
|
+
/** @description File name with extension; the content type defaults from it. */
|
|
181757
|
+
filename: string;
|
|
181758
|
+
/** @description The file. UTF-8 text by default; base64 when `content_encoding` is "base64" (images, PDF, audio, video). */
|
|
181759
|
+
content: string;
|
|
181760
|
+
/**
|
|
181761
|
+
* @description `utf8` (default) for text, `base64` for binary files.
|
|
181762
|
+
* @enum {string}
|
|
181763
|
+
*/
|
|
181764
|
+
content_encoding?: "utf8" | "base64";
|
|
181765
|
+
/** @description MIME type. Defaults from the extension (.png → image/png, …). */
|
|
181766
|
+
content_type?: string;
|
|
181767
|
+
/** @description Audio: what the new file says. When given, speech-to-text is skipped. */
|
|
181768
|
+
transcript?: string;
|
|
181769
|
+
};
|
|
181770
|
+
};
|
|
181771
|
+
};
|
|
181772
|
+
responses: {
|
|
181773
|
+
/** @description The updated file */
|
|
181774
|
+
200: {
|
|
181775
|
+
headers: {
|
|
181776
|
+
[name: string]: unknown;
|
|
181777
|
+
};
|
|
181778
|
+
content: {
|
|
181779
|
+
/**
|
|
181780
|
+
* @example {
|
|
181781
|
+
* "id": "3f6c2b1a-9d4e-4c7b-8a2f-1e0d9c8b7a65",
|
|
181782
|
+
* "kind": "image",
|
|
181783
|
+
* "name": "Plasma — antes/después 1",
|
|
181784
|
+
* "when_to_use": "Cuando pregunten por resultados del plasma",
|
|
181785
|
+
* "caption": "Resultado real tras 3 sesiones",
|
|
181786
|
+
* "tags": [
|
|
181787
|
+
* "antes-despues"
|
|
180582
181788
|
* ],
|
|
180583
|
-
* "
|
|
180584
|
-
*
|
|
180585
|
-
*
|
|
180586
|
-
*
|
|
180587
|
-
*
|
|
181789
|
+
* "topics": [
|
|
181790
|
+
* {
|
|
181791
|
+
* "id": "8e7d6c5b-4a39-4281-9f0e-d1c2b3a49586",
|
|
181792
|
+
* "name": "Plasma rico en plaquetas",
|
|
181793
|
+
* "kind": "treatment"
|
|
181794
|
+
* }
|
|
181795
|
+
* ],
|
|
181796
|
+
* "models": [],
|
|
181797
|
+
* "transcript": null,
|
|
181798
|
+
* "mime_type": "image/jpeg",
|
|
181799
|
+
* "byte_size": 412345,
|
|
181800
|
+
* "duration_ms": null,
|
|
181801
|
+
* "width": 1080,
|
|
181802
|
+
* "height": 1350,
|
|
181803
|
+
* "page_count": null,
|
|
181804
|
+
* "original_filename": "IMG_2231.HEIC",
|
|
181805
|
+
* "ai_enabled": true,
|
|
181806
|
+
* "shows_person": true,
|
|
181807
|
+
* "consent_confirmed_at": "2026-10-29T14:00:00.000Z",
|
|
181808
|
+
* "consent_confirmed_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
181809
|
+
* "expires_at": null,
|
|
181810
|
+
* "expired": false,
|
|
181811
|
+
* "sendable": true,
|
|
181812
|
+
* "unsendable_reason": null,
|
|
181813
|
+
* "send_count": 3,
|
|
181814
|
+
* "last_sent_at": "2026-10-29T15:10:00.000Z",
|
|
181815
|
+
* "thumb_url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.thumb.webp?X-Amz-Signature=…",
|
|
181816
|
+
* "thumb_expires_at": "2026-10-29T15:25:00.000Z",
|
|
180588
181817
|
* "created_by": "2f1e0d9c-8b7a-4c6d-9e5f-1a2b3c4d5e6f",
|
|
180589
|
-
* "created_at": "2026-10-
|
|
180590
|
-
* "updated_at": "2026-10-
|
|
181818
|
+
* "created_at": "2026-10-29T13:58:00.000Z",
|
|
181819
|
+
* "updated_at": "2026-10-29T14:00:00.000Z"
|
|
180591
181820
|
* }
|
|
180592
181821
|
*/
|
|
180593
181822
|
"application/json": {
|
|
@@ -180654,9 +181883,13 @@ interface paths {
|
|
|
180654
181883
|
};
|
|
180655
181884
|
};
|
|
180656
181885
|
};
|
|
181886
|
+
delete?: never;
|
|
181887
|
+
options?: never;
|
|
181888
|
+
head?: never;
|
|
181889
|
+
patch?: never;
|
|
180657
181890
|
trace?: never;
|
|
180658
181891
|
};
|
|
180659
|
-
"/
|
|
181892
|
+
"/media-assets/{id}/url": {
|
|
180660
181893
|
parameters: {
|
|
180661
181894
|
query?: never;
|
|
180662
181895
|
header?: never;
|
|
@@ -180664,12 +181897,15 @@ interface paths {
|
|
|
180664
181897
|
cookie?: never;
|
|
180665
181898
|
};
|
|
180666
181899
|
/**
|
|
180667
|
-
* Get a
|
|
180668
|
-
* @description A
|
|
181900
|
+
* Get a short-lived URL to a library file
|
|
181901
|
+
* @description A signed URL (15 minutes) to view or download the file (`variant=original`, default) or its thumbnail (`variant=thumb`; 404 when the file has none — PDFs and audio). `disposition=attachment` asks the browser to download it. Ask for a new one when it expires; never store it.
|
|
180669
181902
|
*/
|
|
180670
181903
|
get: {
|
|
180671
181904
|
parameters: {
|
|
180672
|
-
query?:
|
|
181905
|
+
query?: {
|
|
181906
|
+
variant?: "original" | "thumb";
|
|
181907
|
+
disposition?: "inline" | "attachment";
|
|
181908
|
+
};
|
|
180673
181909
|
header?: never;
|
|
180674
181910
|
path: {
|
|
180675
181911
|
id: string;
|
|
@@ -180686,9 +181922,9 @@ interface paths {
|
|
|
180686
181922
|
content: {
|
|
180687
181923
|
/**
|
|
180688
181924
|
* @example {
|
|
180689
|
-
* "url": "https://storage.example.com/tenants/…/
|
|
180690
|
-
* "expires_at": "2026-10-
|
|
180691
|
-
* "mime_type": "
|
|
181925
|
+
* "url": "https://storage.example.com/tenants/…/media/3f6c…/l9x2.jpg?X-Amz-Signature=…",
|
|
181926
|
+
* "expires_at": "2026-10-29T15:25:00.000Z",
|
|
181927
|
+
* "mime_type": "image/jpeg"
|
|
180692
181928
|
* }
|
|
180693
181929
|
*/
|
|
180694
181930
|
"application/json": {
|