{
  "info": {
    "_postman_id": "91b9b281-6e26-5783-aeac-357b7bb0d108",
    "name": "Qlara API - Exports",
    "description": "The Exports section of API Reference in the Qlara documentation.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "id": "8ee0eb12-aba8-553e-a5bd-79f8abe6565a",
      "name": "Export contacts",
      "request": {
        "name": "Export contacts",
        "description": {
          "content": "Queues an export of the contacts of your account, as a CSV file (the default) or an Excel file.\n\n- **What to export**: `listIds` for the contacts of one or more contact lists, `contactIds` for specific contacts, or neither for every contact of your account (send an empty object, `{}`).\n- **Exclusions**: with `listIds`, or with neither, `excludeContactIds` leaves those contacts out.\n- **Format**: `exportFormat` is `CSV` or `EXCEL`.\n- **The answer is `202` with an empty body**, so without an export ID: the job is queued, not completed.\n- **Get the file**: poll `GET /exports` every 5-10 seconds. The export is listed only once its file is ready, already with `isAvailableForDownload` true. Then call `GET /exports/{exportId}` with its `id` for the download URL. An export whose generation fails is never listed.\n\n> **A regenerated export is not always the same export.** `POST /exports/{exportId}` does not apply `excludeContactIds` again, and an export of specific `contactIds` comes back as an export of all your contacts. To repeat such an export exactly, call this endpoint again.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "exports",
            "contacts"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "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": "raw",
          "raw": "{\n  \"listIds\": [\n    5206,\n    2016\n  ],\n  \"contactIds\": [\n    178,\n    3110\n  ],\n  \"excludeContactIds\": [\n    8164,\n    7145\n  ],\n  \"exportFormat\": \"CSV\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "id": "befbc3e7-423e-541e-a00a-b9b9e65aff8d",
          "name": "Export queued. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "contacts"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listIds\": [\n    4279,\n    6531\n  ],\n  \"contactIds\": [\n    2949,\n    8243\n  ],\n  \"excludeContactIds\": [\n    2730,\n    658\n  ],\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "609b8a22-184e-53b1-a416-1b553a6a7888",
          "name": "The body is missing or invalid: `listIds` together with `contactIds`, `contactIds` together with `excludeContactIds`, or an unknown `exportFormat`.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "contacts"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listIds\": [\n    4279,\n    6531\n  ],\n  \"contactIds\": [\n    2949,\n    8243\n  ],\n  \"excludeContactIds\": [\n    2730,\n    658\n  ],\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "a51df8a6-f18c-5410-a696-8a73142ad6e3",
          "name": "The API key is missing, invalid, or lacks the `EXPORTS` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "contacts"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listIds\": [\n    4279,\n    6531\n  ],\n  \"contactIds\": [\n    2949,\n    8243\n  ],\n  \"excludeContactIds\": [\n    2730,\n    658\n  ],\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "b635259b-9752-5e55-acc5-ef41cd91b1e3",
          "name": "Unexpected server error.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "contacts"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"listIds\": [\n    4279,\n    6531\n  ],\n  \"contactIds\": [\n    2949,\n    8243\n  ],\n  \"excludeContactIds\": [\n    2730,\n    658\n  ],\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "625a1ab5-2d21-5b61-ac1a-09a7f448aef9",
      "name": "Export delivery reports",
      "request": {
        "name": "Export delivery reports",
        "description": {
          "content": "Queues an export of delivery reports, that is the send and delivery status of each message, as a CSV file (the default) or an Excel file.\n\n- **What to export**: either `campaignId`, for the reports of one campaign, or `startDateTime` and `endDateTime` together, for every report of that period.\n- **`sendType`** narrows the messages to those sent from the web platform (`WEB`), through the API (`API`) or both (`WEB_API`, the same as leaving it out of a date-range export). A `campaignId` can be combined only with `WEB` or with no `sendType`.\n- **Optional filters**: `sender`, `recipient` and `subAccountId`. They do not apply to every message: the table below says which.\n- **Masked destinations**: in the file, the last three characters of every destination are replaced by `***`.\n- **The answer is `202` with an empty body**, so without an export ID: the job is queued, not completed.\n- **Get the file**: poll `GET /exports` every 5-10 seconds. The export is listed only once its file is ready, already with `isAvailableForDownload` true. Then call `GET /exports/{exportId}` with its `id` for the download URL. An export whose generation fails is never listed.\n\n<details>\n<summary>Which messages each optional filter applies to</summary>\n\n| Filter | Applies to |\n|---|---|\n| `recipient` | Every message. |\n| `sender` | On the messages of a campaign or of the web platform, the SMS sender: their RCS and WhatsApp messages are left in. On the messages sent through the API, the SMS sender, the RCS agent or the WhatsApp number. |\n| `subAccountId` | Only the messages sent through the API. |\n\n</details>\n\nAfter the export expires you can regenerate it with `POST /exports/{exportId}`: the new export keeps all of its filters and is listed under a new ID.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "exports",
            "delivery-reports"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "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": "raw",
          "raw": "{\n  \"startDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"endDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"sender\": \"string\",\n  \"recipient\": \"string\",\n  \"campaignId\": 8367,\n  \"sendType\": \"WEB\",\n  \"subAccountId\": \"string\",\n  \"exportFormat\": \"CSV\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "id": "b2c94069-762c-55c1-a2aa-e230c3e247f8",
          "name": "Export queued. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "delivery-reports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"endDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"sender\": \"string\",\n  \"recipient\": \"string\",\n  \"campaignId\": 8367,\n  \"sendType\": \"WEB\",\n  \"subAccountId\": \"string\",\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "b20fbf05-45c8-54bd-a671-0d3ccf6732d7",
          "name": "The body is missing or invalid: neither `campaignId` nor both `startDateTime` and `endDateTime`, only one of the two dates, `campaignId` together with the date range or with `sendType` `API` or `WEB_API`, or a malformed value such as a date in another format or an unknown `sendType`. The response body names the reason.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "delivery-reports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"endDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"sender\": \"string\",\n  \"recipient\": \"string\",\n  \"campaignId\": 8367,\n  \"sendType\": \"WEB\",\n  \"subAccountId\": \"string\",\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "fa2ff08f-014f-5d48-a682-5f06a4dda431",
          "name": "The API key is missing, invalid, or lacks the `EXPORTS` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "delivery-reports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"endDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"sender\": \"string\",\n  \"recipient\": \"string\",\n  \"campaignId\": 8367,\n  \"sendType\": \"WEB\",\n  \"subAccountId\": \"string\",\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "582c94a0-ff9a-5355-a905-2edaf50115f7",
          "name": "Unexpected server error.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                "delivery-reports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"endDateTime\": \"2022-03-10T12:15:50-04:00\",\n  \"sender\": \"string\",\n  \"recipient\": \"string\",\n  \"campaignId\": 8367,\n  \"sendType\": \"WEB\",\n  \"subAccountId\": \"string\",\n  \"exportFormat\": \"CSV\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "4ebc743d-f40e-5426-afd6-8c69ee2ece31",
      "name": "Export send history as CSV",
      "request": {
        "name": "Export send history as CSV",
        "description": {
          "content": "Queues a CSV export of the messages sent through the API in a date range, with every channel in one file.\n\n- **API sends only**: the messages sent from campaigns or from the web console are not included.\n- **Body**: `startDateTime` and `endDateTime` as ISO-8601 date-times with an offset, such as `2025-01-01T00:00:00+01:00`. `sender` and `recipient` are optional filters.\n- **The answer is `202`**: the job is queued, not completed. It can take from a few seconds to several minutes, depending on the volume of the date range.\n- **Get the file**: poll `GET /exports`. The export is listed there once its file is ready; an export that is still running, or that failed, is not listed.\n- **Large ranges are slow**: months of data can take long. If you need a subset, narrow the range or page through `GET /messages/history`.\n\n> **On RCS and WhatsApp the status columns do not follow `deliveryStatus`.** They only say whether a delivery date was recorded: `3`, `Delivered`, when one was, otherwise `1`, `Sent`. A failed message reads `Sent`, and an RCS message that the status API reports as `UNSUPPORTED` or `EXPIRED`, or a WhatsApp one reported as `UNKNOWN`, can read `Delivered`.\n\n<details>\n<summary>Columns of the CSV file</summary>\n\nIn this order:\n\n1. **Row number**.\n2. **DateTime**: the send date.\n3. **Originator**: the SMS sender or the WhatsApp phone number, empty for RCS.\n4. **Destination**: with its last three characters replaced by `***`, on every channel.\n5. **Delivery status**: the numeric code that `Delivery result` spells out.\n6. **IP address**.\n7. **ID SubAccount**: the API user that sent the message.\n8. **SMS cost**: the unit price, on every channel.\n9. **Customer ID**: the `messageId` given at send time, or the identifier generated when none was given.\n10. **Sent type**: `SMS-API`, `RCS-API` or `WHATSAPP-API`.\n11. **Part number**.\n12. **Total parts**.\n13. **Delivery result**: `Sent`, `Rejected`, `Delivered`, `Expired`, `Deleted` or `Undeliverable`.\n\nAn SMS too long for a single part has one row per part. The file has no delivery-date column and does not contain the message text.\n\n</details>",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "messages",
            "history",
            "export"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "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": "raw",
          "raw": "{\n  \"startDateTime\": \"2025-01-01T00:00:00+01:00\",\n  \"endDateTime\": \"2025-01-31T23:59:59+01:00\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "id": "06616ad9-1f37-5cc8-af5a-c843e4fc3267",
          "name": "Export queued. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "messages",
                "history",
                "export"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2025-01-01T00:00:00+01:00\",\n  \"endDateTime\": \"2025-01-31T23:59:59+01:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "b23e9ee1-b586-51e6-a1cf-c32af036476e",
          "name": "The body is missing or malformed, `startDateTime` or `endDateTime` is missing, or `startDateTime` is later than `endDateTime`. Nothing is queued.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "messages",
                "history",
                "export"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2025-01-01T00:00:00+01:00\",\n  \"endDateTime\": \"2025-01-31T23:59:59+01:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "3c70375d-c382-5c08-a7e7-b1ec0e45722e",
          "name": "The API key is missing, invalid, or lacks the `MESSAGES` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "messages",
                "history",
                "export"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2025-01-01T00:00:00+01:00\",\n  \"endDateTime\": \"2025-01-31T23:59:59+01:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "bb68f9df-be0c-57ba-aecb-97fca6ac7351",
          "name": "Unexpected server error. Retry after a short delay.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "messages",
                "history",
                "export"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDateTime\": \"2025-01-01T00:00:00+01:00\",\n  \"endDateTime\": \"2025-01-31T23:59:59+01:00\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "44ecc688-01e5-53c8-a22e-5d8025588020",
      "name": "List exports",
      "request": {
        "name": "List exports",
        "description": {
          "content": "Returns the exports of your account, one page at a time, newest first. It is the polling endpoint of the export workflow.\n\n- **Which exports**: those requested through this API, with any key of your account. Exports requested from the web dashboard are not listed.\n- **Listed only when ready**: an export appears once its file has been generated, already with `isAvailableForDownload` true. A queued or running export is not listed.\n- **Failures are silent**: an export whose generation fails is never listed and reports no error. If no new entry shows up within a reasonable time, request the export again.\n- **Each entry** carries its `type` (`CONTACTS` or `DELIVERY_REPORT`), the parameters of the export in `detail`, `createdAt` and `expiresAt`. `isAvailableForDownload` turns false only once `expiresAt` has passed.\n- **Expired exports** can be regenerated with `POST /exports/{exportId}`: the new export is listed under a new ID once its file is ready, while the expired entry stays in the list.\n- **Pagination**: `page` is 0-based (default 0) and `limit` goes from 1 to 1000 (default 10).\n\n<details>\n<summary>The export workflow, step by step</summary>\n\n1. Request the export with `POST /exports/contacts` or `POST /exports/delivery-reports`. The answer is `202` with an empty body, so without an export ID.\n2. Call this endpoint every 5-10 seconds until a new entry appears, and recognise your export by its `createdAt` and `detail`.\n3. Call `GET /exports/{exportId}` with the `id` of that entry to get the time-limited download URL.\n\n</details>",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "exports"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [
            {
              "disabled": false,
              "key": "limit",
              "value": "10",
              "description": "Results per page, from 1 to 1000. Defaults to 10."
            },
            {
              "disabled": false,
              "key": "page",
              "value": "0",
              "description": "Page number, 0-based. Defaults to 0."
            }
          ],
          "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": "ac72ce06-b896-581c-ad05-02c170428305",
          "name": "One page of exports, newest first.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10"
                },
                {
                  "key": "page",
                  "value": "0"
                }
              ],
              "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\": 42,\n      \"type\": \"DELIVERY_REPORT\",\n      \"detail\": {\n        \"key_0\": 322\n      },\n      \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n      \"expiresAt\": \"2022-03-10T12:15:50-04:00\",\n      \"isAvailableForDownload\": true\n    },\n    {\n      \"id\": 42,\n      \"type\": \"DELIVERY_REPORT\",\n      \"detail\": {\n        \"key_0\": false,\n        \"key_1\": 5508.296564221382\n      },\n      \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n      \"expiresAt\": \"2022-03-10T12:15:50-04:00\",\n      \"isAvailableForDownload\": true\n    }\n  ],\n  \"page\": 0,\n  \"limit\": 10,\n  \"totalCount\": 42,\n  \"totalPages\": 5\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "92d48b91-eec9-54d2-a3ee-059d5854a1ce",
          "name": "`page` is negative, `limit` is below 1 or above 1000, or `page` multiplied by `limit` is above 2147483647.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10"
                },
                {
                  "key": "page",
                  "value": "0"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "3794841f-c289-5323-a882-de55307b35c4",
          "name": "The API key is missing, invalid, or lacks the `EXPORTS` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10"
                },
                {
                  "key": "page",
                  "value": "0"
                }
              ],
              "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"
        },
        {
          "id": "a7429091-c73b-5ace-a330-89c915ce6d26",
          "name": "Unexpected server error.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10"
                },
                {
                  "key": "page",
                  "value": "0"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "46d5d86a-c17e-5e01-ac3e-227e580e5608",
      "name": "Get export download URL",
      "request": {
        "name": "Get export download URL",
        "description": {
          "content": "Returns a pre-signed download URL for the file of an export listed by `GET /exports`.\n\n- **When to call it**: with the `id` of an entry whose `isAvailableForDownload` is true.\n- **The URL is time-limited**: while the export has not expired, call this endpoint again for a fresh URL.\n- **Once the export has expired** (`expiresAt` has passed and `isAvailableForDownload` is false) its file can no longer be downloaded. Regenerate it with `POST /exports/{exportId}`, poll `GET /exports` until the new export is listed under a new ID, and call this endpoint with that ID.\n\n> **An expired export answers `500`** (`Remote server error.`), not `400`. That response cannot be told apart from a real fault, so decide from `isAvailableForDownload` and `expiresAt` in `GET /exports`, not from the status code.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "exports",
            ":exportId"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "exportId",
              "description": "(Required) Export identifier."
            }
          ]
        },
        "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": "22e82a50-137f-5584-af27-116f298c766e",
          "name": "The download URL.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"url\": \"https://storage.example.com/exports/42.csv?token=abc123&expires=1700000000\"\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "56cc6b49-365b-5db6-a512-15f476c68b07",
          "name": "The API key is missing, invalid, or lacks the `EXPORTS` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "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": "c9ac7a88-b207-5308-a5a3-8bff02e535a6",
          "name": "No export with this ID in your account, or the export was requested from the web dashboard.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "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"
        },
        {
          "id": "ed1df8aa-e492-5537-a8b6-74bc5f135081",
          "name": "The export has expired, or unexpected server error.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "1f80897c-1510-58b5-aec3-6479869cc3a1",
      "name": "Regenerate expired export",
      "request": {
        "name": "Regenerate expired export",
        "description": {
          "content": "Queues a new export built from the parameters of an expired one. Use it when an export listed by `GET /exports` has `isAvailableForDownload` false and you still need the data.\n\n- **The answer is `202` with an empty body.** The new export is generated in the background, from the data as it is at that moment.\n- **New ID**: the new export is listed by `GET /exports` once its file is ready. Poll until it appears, recognise it by its `createdAt` and `detail`, and call `GET /exports/{exportId}` with the new `id`.\n- **The expired export keeps its ID and stays expired**, and every further call queues one more export.\n- **Delivery reports** are regenerated with all of their filters.\n- **Contacts are not**: `excludeContactIds` is not applied again, and an export of specific `contactIds` is regenerated as an export of all the contacts of your account (its `detail.type` is `ALL_CONTACTS`). To repeat such an export exactly, request it again with `POST /exports/contacts`.\n\n> **An export that has not expired yet answers `500`** (`Remote server error.`), not `400`. That response cannot be told apart from a real fault, so check `isAvailableForDownload` and `expiresAt` in `GET /exports` before you call this endpoint.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "exports",
            ":exportId"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "exportId",
              "description": "(Required) Export identifier."
            }
          ]
        },
        "header": [
          {
            "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"
            }
          ]
        }
      },
      "response": [
        {
          "id": "8a21e1ee-78c4-5128-ae44-a889d48f18e6",
          "name": "Regeneration queued. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {}
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "533827f4-bae8-554b-a0a3-95cfc87d6a29",
          "name": "The API key is missing, invalid, or lacks the `EXPORTS` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "2ee6f9d1-6661-5edb-ad1f-5ceb0b58d1dc",
          "name": "No export with this ID in your account, or the export was requested from the web dashboard.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "4997019e-55d8-55e0-a217-3f39a789ab2d",
          "name": "The export has not expired yet, or unexpected server error.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "exports",
                ":exportId"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "exportId",
                  "description": "(Required) Export identifier."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {}
          },
          "status": "Internal Server Error",
          "code": 500,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "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"
    }
  ]
}
