{
  "info": {
    "_postman_id": "244f7cc8-a885-56ea-a3a2-65126b79dc81",
    "name": "Qlara API - Media",
    "description": "The Media section of API Reference in the Qlara documentation.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "id": "52b16491-d12e-55b6-ac5a-3980a71fa8cd",
      "name": "Upload a media file",
      "request": {
        "name": "Upload a media file",
        "description": {
          "content": "Uploads a file to your media library and returns the new media item.\n\n- **How to send it**: as `multipart/form-data`, with the binary file in the `file` part. You can add a `name`, a `description` and a `folderId`: without `folderId`, or with `-1`, the file goes in the root of the library.\n- **Any file type is accepted**: its `type` (`IMAGE`, `VIDEO`, `AUDIO`, `DOCUMENT` or `FILE`) is detected from the file content.\n- **Size limit**: the whole request, the file together with the other form fields, may be at most 10240 KiB (about 10 MB). A larger request is refused with `413`.\n- **Large images are scaled down**: an image wider than 2560 or taller than 1440 pixels is scaled to fit within 2560x1440, keeping its aspect ratio, and re-encoded as JPEG. It loses any transparency and animation, while its `name` and `mimeType` keep the original type. Smaller images and all other files are stored as uploaded.\n- **Channel limits are not checked here**: each channel applies its own format and size limits when you send the file.\n- **Storage**: the file counts against the media storage of your subscription plan.\n\nThe response is an array holding the new media item. Store its `id`: it is what you use to attach the file to an outbound message, such as an RCS rich card or a WhatsApp media message, or to the content of a campaign.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "media"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "multipart/form-data"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "POST",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        },
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "file",
              "type": "file",
              "description": "(Required) The file to upload."
            },
            {
              "key": "name",
              "value": "string",
              "type": "text",
              "description": "Name of the media item in the library."
            },
            {
              "key": "description",
              "value": "string",
              "type": "text",
              "description": "Description of the media item."
            },
            {
              "key": "folderId",
              "value": "7217",
              "type": "text",
              "description": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library."
            }
          ]
        }
      },
      "response": [
        {
          "id": "71748ea3-ab22-5735-a4bc-d597a16b0332",
          "name": "Media uploaded. The response is an array holding the new media item.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Created",
          "code": 201,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "[\n  {\n    \"id\": 100,\n    \"key\": \"string\",\n    \"thumbnailKey\": \"string\",\n    \"companyId\": 7481,\n    \"userId\": 1994,\n    \"name\": \"promo-banner\",\n    \"description\": \"string\",\n    \"filename\": \"banner.jpg\",\n    \"size\": 524288,\n    \"type\": \"IMAGE\",\n    \"mimeType\": \"image/jpeg\",\n    \"source\": 1153,\n    \"metadata\": {\n      \"key_0\": {},\n      \"key_1\": {},\n      \"key_2\": {},\n      \"key_3\": {}\n    },\n    \"folderId\": 4440,\n    \"userEmail\": \"string\",\n    \"userFirstName\": \"string\",\n    \"userMiddleName\": \"string\",\n    \"userLastName\": \"string\",\n    \"url\": \"string\",\n    \"thumbnailUrl\": \"string\",\n    \"cdnUrl\": \"string\",\n    \"cdnThumbnailUrl\": \"string\",\n    \"public\": true,\n    \"creationDate\": \"2022-03-10T12:15:50-04:00\",\n    \"lastUpdateDate\": \"2022-03-10T12:15:50-04:00\"\n  },\n  {\n    \"id\": 100,\n    \"key\": \"string\",\n    \"thumbnailKey\": \"string\",\n    \"companyId\": 9056,\n    \"userId\": 2307,\n    \"name\": \"promo-banner\",\n    \"description\": \"string\",\n    \"filename\": \"banner.jpg\",\n    \"size\": 524288,\n    \"type\": \"IMAGE\",\n    \"mimeType\": \"image/jpeg\",\n    \"source\": 5115,\n    \"metadata\": {\n      \"key_0\": {}\n    },\n    \"folderId\": 7198,\n    \"userEmail\": \"string\",\n    \"userFirstName\": \"string\",\n    \"userMiddleName\": \"string\",\n    \"userLastName\": \"string\",\n    \"url\": \"string\",\n    \"thumbnailUrl\": \"string\",\n    \"cdnUrl\": \"string\",\n    \"cdnThumbnailUrl\": \"string\",\n    \"public\": true,\n    \"creationDate\": \"2022-03-10T12:15:50-04:00\",\n    \"lastUpdateDate\": \"2022-03-10T12:15:50-04:00\"\n  }\n]",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "3d23aa2b-1fac-568b-a301-3e786f809c02",
          "name": "The request is malformed, the `file` part is missing, the file is empty, or the folder is read-only.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "3f0225cf-35b7-5725-a9b4-e852fc1a8b2d",
          "name": "The API key is missing, invalid, or lacks the `MEDIA` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "fdb662e4-dd18-5da2-acc1-c6b426b8e90e",
          "name": "`folderId` is not one of your folders, or your company has no active subscription.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "f5f85d23-6e61-5f55-ae06-32eb131803c4",
          "name": "The request is larger than 10240 KiB.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Request Entity Too Large",
          "code": 413,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "9ac450ee-f026-5626-ad2d-441284711c18",
          "name": "The file would take your company past the media storage of its subscription plan.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Too Many Requests",
          "code": 429,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "8a4e920f-6db0-536d-a1a5-feba789a8f76",
          "name": "The media storage service, or the subscription service it checks the storage with, is unavailable. Retry after a short delay.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Bad Gateway",
          "code": 502,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "eda49d28-fd8a-504f-aea4-c3764fb98c22",
          "name": "The media storage service, or the subscription service it checks the storage with, did not answer in time. Retry after a short delay.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "description": {
                    "content": "(Required) The file to upload.",
                    "type": "text/plain"
                  },
                  "key": "file",
                  "type": "file"
                },
                {
                  "description": {
                    "content": "Name of the media item in the library.",
                    "type": "text/plain"
                  },
                  "key": "name",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "Description of the media item.",
                    "type": "text/plain"
                  },
                  "key": "description",
                  "value": "string",
                  "type": "text"
                },
                {
                  "description": {
                    "content": "ID of the folder the file goes in. Leave it out, or send `-1`, for the root of the library.",
                    "type": "text/plain"
                  },
                  "key": "folderId",
                  "value": "7217",
                  "type": "text"
                }
              ]
            }
          },
          "status": "Gateway Timeout",
          "code": 504,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "942e5f98-160d-51f6-a0d8-813ea888e2bc",
      "name": "List company media",
      "request": {
        "name": "List company media",
        "description": {
          "content": "Returns the files of your media library, one page at a time.\n\n- **Each entry** carries the file ID, name, type, MIME type, size and a URL to preview or download the file.\n- **Type**: detected from the file content at upload, one of `IMAGE`, `VIDEO`, `AUDIO`, `DOCUMENT` or `FILE`.\n- **Using a file**: the `id` of an entry is what you reference when you attach the file to a message, such as an RCS card or a WhatsApp media message, or to the content of a campaign.\n- **Pagination and sorting**: `page` is 0-based, `limit` goes from 1 to 1000 (default 10), `sortBy` takes a field such as `id` or `name`, and `sortOrder` is `asc` or `desc`.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "media"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [
            {
              "disabled": false,
              "key": "limit",
              "value": "809",
              "description": "Results per page, from 1 to 1000. Defaults to 10."
            },
            {
              "disabled": false,
              "key": "page",
              "value": "314",
              "description": "Page number, 0-based. Defaults to 0."
            },
            {
              "disabled": false,
              "key": "sortBy",
              "value": "string",
              "description": "Field to sort by. Defaults to `id`."
            },
            {
              "disabled": false,
              "key": "sortOrder",
              "value": "string",
              "description": "Sort order: `asc` or `desc`. Defaults to `asc`."
            }
          ],
          "variable": []
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "GET",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "7441d830-49ba-597b-a808-0cb2422eef5b",
          "name": "One page of media items.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "809"
                },
                {
                  "key": "page",
                  "value": "314"
                },
                {
                  "key": "sortBy",
                  "value": "string"
                },
                {
                  "key": "sortOrder",
                  "value": "string"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"data\": [\n    {\n      \"id\": 100,\n      \"key\": \"string\",\n      \"thumbnailKey\": \"string\",\n      \"companyId\": 2815,\n      \"userId\": 6021,\n      \"name\": \"promo-banner\",\n      \"description\": \"string\",\n      \"filename\": \"banner.jpg\",\n      \"size\": 524288,\n      \"type\": \"IMAGE\",\n      \"mimeType\": \"image/jpeg\",\n      \"source\": 8066,\n      \"metadata\": {\n        \"key_0\": {},\n        \"key_1\": {},\n        \"key_2\": {}\n      },\n      \"folderId\": 2868,\n      \"userEmail\": \"string\",\n      \"userFirstName\": \"string\",\n      \"userMiddleName\": \"string\",\n      \"userLastName\": \"string\",\n      \"url\": \"string\",\n      \"thumbnailUrl\": \"string\",\n      \"cdnUrl\": \"string\",\n      \"cdnThumbnailUrl\": \"string\",\n      \"public\": false,\n      \"creationDate\": \"2022-03-10T12:15:50-04:00\",\n      \"lastUpdateDate\": \"2022-03-10T12:15:50-04:00\"\n    },\n    {\n      \"id\": 100,\n      \"key\": \"string\",\n      \"thumbnailKey\": \"string\",\n      \"companyId\": 7785,\n      \"userId\": 1635,\n      \"name\": \"promo-banner\",\n      \"description\": \"string\",\n      \"filename\": \"banner.jpg\",\n      \"size\": 524288,\n      \"type\": \"IMAGE\",\n      \"mimeType\": \"image/jpeg\",\n      \"source\": 9643,\n      \"metadata\": {\n        \"key_0\": {},\n        \"key_1\": {}\n      },\n      \"folderId\": 6730,\n      \"userEmail\": \"string\",\n      \"userFirstName\": \"string\",\n      \"userMiddleName\": \"string\",\n      \"userLastName\": \"string\",\n      \"url\": \"string\",\n      \"thumbnailUrl\": \"string\",\n      \"cdnUrl\": \"string\",\n      \"cdnThumbnailUrl\": \"string\",\n      \"public\": true,\n      \"creationDate\": \"2022-03-10T12:15:50-04:00\",\n      \"lastUpdateDate\": \"2022-03-10T12:15:50-04:00\"\n    }\n  ],\n  \"page\": 0,\n  \"limit\": 10,\n  \"totalCount\": 42,\n  \"totalPages\": 5\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "4e9272a1-5153-5484-afbc-0ab7f2b1289c",
          "name": "The API key is missing, invalid, or lacks the `MEDIA` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "809"
                },
                {
                  "key": "page",
                  "value": "314"
                },
                {
                  "key": "sortBy",
                  "value": "string"
                },
                {
                  "key": "sortOrder",
                  "value": "string"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "1144263a-f4de-5281-ad82-fe9c67b9b346",
      "name": "Get a media item",
      "request": {
        "name": "Get a media item",
        "description": {
          "content": "Returns the metadata of one media file and the URL to reach it.\n\n- **In the response**: file name, MIME type, size in bytes, creation date and a URL to download or preview the file.\n- **Typical use**: check a media item before you reference it in a message or a campaign.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "media",
            ":id"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "id",
              "description": "(Required) ID of the media item."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "GET",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "df738e1a-3258-5247-a3ab-f48e3b6af593",
          "name": "The media item.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"id\": 100,\n  \"key\": \"string\",\n  \"thumbnailKey\": \"string\",\n  \"companyId\": 7752,\n  \"userId\": 5401,\n  \"name\": \"promo-banner\",\n  \"description\": \"string\",\n  \"filename\": \"banner.jpg\",\n  \"size\": 524288,\n  \"type\": \"IMAGE\",\n  \"mimeType\": \"image/jpeg\",\n  \"source\": 2598,\n  \"metadata\": {\n    \"key_0\": {},\n    \"key_1\": {}\n  },\n  \"folderId\": 1630,\n  \"userEmail\": \"string\",\n  \"userFirstName\": \"string\",\n  \"userMiddleName\": \"string\",\n  \"userLastName\": \"string\",\n  \"url\": \"string\",\n  \"thumbnailUrl\": \"string\",\n  \"cdnUrl\": \"string\",\n  \"cdnThumbnailUrl\": \"string\",\n  \"public\": true,\n  \"creationDate\": \"2022-03-10T12:15:50-04:00\",\n  \"lastUpdateDate\": \"2022-03-10T12:15:50-04:00\"\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "b8651b22-b48e-5c0d-ac41-687d2a3e03aa",
          "name": "The API key is missing, invalid, or lacks the `MEDIA` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "17b51984-2700-54a9-ab3f-5fb59a1b5f89",
          "name": "No media file with this ID in your library.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "f92b786d-f395-5cf6-a315-356b58bd7b32",
      "name": "Delete a media item",
      "request": {
        "name": "Delete a media item",
        "description": {
          "content": "Deletes a media file from your library, permanently. This cannot be undone.\n\n- **Messages already sent are not affected**: the content was delivered when they were sent.\n- **Future sends break**: a message or campaign that references the deleted media ID can no longer resolve the file.\n- **When the delete is refused**: with `409` if the media is public or still referenced by a social media post, with `400` if it is still being uploaded or sits in a read-only folder.\n\n> **Check before you delete.** Make sure that no scheduled campaign, and no message template still to be sent, references the media ID.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "media",
            ":id"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "id",
              "description": "(Required) ID of the media item."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "DELETE",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "584d5f52-6434-50d2-a1b0-373994d03eeb",
          "name": "Media deleted. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "body": {}
          },
          "status": "No Content",
          "code": 204,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "ca7cff40-8889-53bc-a62a-31e04bb74c18",
          "name": "The media is still being uploaded or sits in a read-only folder.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "body": {}
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "5b196b7e-2a81-5e80-a3da-5d32f609c182",
          "name": "The API key is missing, invalid, or lacks the `MEDIA` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "310512e9-5cce-5af1-a021-7c6b3c7cbccf",
          "name": "No media file with this ID in your library.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "800700f0-138b-5e15-a77b-593622b0d047",
          "name": "The media is public or still referenced by a social media post.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "media",
                ":id"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "id",
                  "description": "(Required) ID of the media item."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "DELETE",
            "body": {}
          },
          "status": "Conflict",
          "code": 409,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "24afe06e-0737-5e28-ace2-9d596a869dbb",
      "name": "Download media file",
      "request": {
        "name": "Download media file",
        "description": {
          "content": "Returns a pre-signed (temporary) URL to download a media file received in an inbound message.\n\n**Flow:**\n1. Receive an inbound callback with `mediaKey`\n2. Call this endpoint with the received `mediaKey`\n3. From the response, use the `url` field to download the file\n",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "files",
            ":mediaKey"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [
            {
              "disabled": false,
              "key": "expireMinutes",
              "value": "60",
              "description": "Pre-signed URL validity duration in minutes (1–360: values outside the range are brought back into it)"
            }
          ],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93",
              "key": "mediaKey",
              "description": "(Required) Media file key (received in the inbound callback)"
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "GET",
        "auth": null
      },
      "response": [
        {
          "id": "01436f16-57f5-509c-af8b-39944c74c6d7",
          "name": "Pre-signed URL for download",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "files",
                ":mediaKey"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "expireMinutes",
                  "value": "60"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93",
                  "key": "mediaKey",
                  "description": "(Required) Media file key (received in the inbound callback)"
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"key\": \"4d8f5607/830b788d/9c106b57985ab66cf5c96ca1e9cc95b8\",\n  \"url\": \"https://fs-lora-namespace-public.fsn1.your-objectstorage.com/4d8f5607/830b788d/9c106b57985ab66cf5c96ca1e9cc95b8?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&X-Amz-Signature=...\"\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "78f93f62-c089-5ef8-aabe-a1fcc69cc3c7",
          "name": "Missing or invalid credentials. The body is empty.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "files",
                ":mediaKey"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "expireMinutes",
                  "value": "60"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93",
                  "key": "mediaKey",
                  "description": "(Required) Media file key (received in the inbound callback)"
                }
              ]
            },
            "method": "GET",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "text/plain"
            }
          ],
          "body": "",
          "cookie": [],
          "_postman_previewlanguage": "text"
        },
        {
          "id": "47d8f751-5d2e-5a59-ac5d-a9b7efbce583",
          "name": "File not found",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "files",
                ":mediaKey"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "expireMinutes",
                  "value": "60"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93",
                  "key": "mediaKey",
                  "description": "(Required) Media file key (received in the inbound callback)"
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"status\": \"fail\",\n  \"data\": \"Media with key 'b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93' not found\"\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "d99e5d16-962f-5667-a3f1-fd8d1933b12f",
          "name": "Too many requests: your account exceeded its limit of requests per second, set by your subscription plan. The body is empty: wait one second, as `Retry-After` says, and retry.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "files",
                ":mediaKey"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "expireMinutes",
                  "value": "60"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "b394ab72/efd4987c/39b4879f6fed01f0d622453be1488c93",
                  "key": "mediaKey",
                  "description": "(Required) Media file key (received in the inbound callback)"
                }
              ]
            },
            "method": "GET",
            "body": {}
          },
          "status": "Too Many Requests",
          "code": 429,
          "header": [
            {
              "disabled": false,
              "description": "Seconds to wait before retrying: always `1`",
              "key": "Retry-After",
              "value": "1"
            },
            {
              "key": "Content-Type",
              "value": "text/plain"
            }
          ],
          "body": "",
          "cookie": [],
          "_postman_previewlanguage": "text"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.qlara.ai",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY",
      "type": "string"
    }
  ]
}
