{
  "info": {
    "_postman_id": "30113bbe-8f10-46c1-8f1d-b900622ecee6",
    "name": "fiskaly SAFE flex (Version 1.7.0) Postman Collection",
    "description": "# fiskaly SAFE Postman Collection\n\nThis collection covers the core endpoints of the fiskaly SAFE API — an archiving solution for fiscal documents.\n\n## Prerequisites\n\n- A fiskaly HUB account with an active SAFE organization\n    \n- API Key and API Secret (set in the Postman environment)\n    \n- A PDF file ready to upload (e.g. a receipt)\n    \n\n## Recommended Usage\n\n**Run each request manually, step by step, in the order listed.**\n\nDo not use the Postman Collection Runner — the Upload a file request requires a PDF file to be selected manually in the Body tab, which the Runner cannot handle automatically.\n\n## Request Order\n\n1. **Authentication** — fetches a bearer token (saved automatically)\n    \n2. **Create a configuration** — one-time setup, run once per environment (optional)\n    \n3. **Create a string annotation** — one-time setup, run once per environment (optional)\n    \n4. **Create mix property annotation** — one-time setup, run once per environment\n    \n5. **Upload a file** — select your PDF in the Body tab before sending\n    \n6. **Retrieve a file by id** — uses the file_id saved from the upload\n    \n7. **Retrieve a file by custom id** — uses the custom_identifier saved from the upload\n    \n8. **Download a file data** — downloads the raw file bytes\n    \n9. **Search** — queries files by annotation properties\n    \n10. **Search retrieve** — checks search status\n    \n11. **Search result** — retrieves search results\n    \n12. **Create an export** — packages files into a ZIP\n    \n13. **Retrieve export** — checks export status\n    \n14. **Download exported file** — downloads the ZIP\n    \n15. **Get audit log** — lists all audit events\n    \n\n## Notes\n\n- Requests 2–4 only need to be run once. Re-running them will create new annotation schemas with a different random suffix, which is fine but not necessary.\n    \n- All IDs and tokens are saved automatically as environment variables after each request.\n    \n- The custom_identifier and annotation names are generated randomly via pre-request scripts.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "47349131",
    "_collection_link": "https://go.postman.co/collection/47349131-30113bbe-8f10-46c1-8f1d-b900622ecee6?source=collection_link"
  },
  "item": [
    {
      "name": "tokens (management)",
      "item": [
        {
          "name": "Create a token",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});",
                  "var data = pm.response.json();",
                  "pm.environment.set(\"token\", data.content.access_token.bearer);",
                  ""
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "\n{\n  \"content\": {\n\t\"api_key\": \"{{apiKey}}\",\n\t\"api_secret\": \"{{apiSecret}}\",\n    \"scope_id\": \"{{scopeId}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/auth",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "auth"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "configuration",
      "item": [
        {
          "name": "Create a configuration",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              },
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"configuration\": {\n      \"country_code\": \"DE\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/configuration",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "configuration"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a configuration",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/configuration",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "configuration"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "annotations",
      "item": [
        {
          "name": "Create a string annotation",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "var suffix = Math.floor(Math.random() * 90000) + 10000;",
                  "var annotationName = \"receipt_store_info_\" + suffix;",
                  "pm.environment.set(\"annotationStoreInfoName\", annotationName);"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            },
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var data = pm.response.json();",
                  "var annotationName = data.content.name;",
                  "pm.environment.set(\"annotationStoreInfoName\", annotationName);",
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              },
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"name\": \"{{annotationStoreInfoName}}\",\n    \"properties\": [\n      {\n        \"name\": \"store_id\",\n        \"type\": \"string\",\n        \"min_length\": 1,\n        \"max_length\": 20,\n        \"required\": true,\n        \"description\": \"Unique identifier for the retail store branch\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/annotation",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "annotation"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create mix property annotation",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "var suffix = Math.floor(Math.random() * 90000) + 10000;",
                  "var annotationName = \"receipt_metadata_\" + suffix;",
                  "pm.environment.set(\"annotationMetadataName\", annotationName);"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            },
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var data = pm.response.json();",
                  "var annotationName = data.content.name;",
                  "var annotationId = data.content.identifier;",
                  "pm.environment.set(\"annotationMetadataName\", annotationName);",
                  "pm.environment.set(\"annotationId\", annotationId);",
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              },
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"name\": \"{{annotationMetadataName}}\",\n    \"properties\": [\n      {\n        \"name\": \"cashier_id\",\n        \"display_name\": \"Cashier ID\",\n        \"type\": \"string\",\n        \"min_length\": 0,\n        \"max_length\": 15,\n        \"required\": false,\n        \"description\": \"ID of the cashier who processed the transaction\"\n      },\n      {\n        \"name\": \"total_amount_cents\",\n        \"display_name\": \"Total Amount (cents)\",\n        \"type\": \"integer\",\n        \"min_value\": 0,\n        \"max_value\": 999999,\n        \"required\": false,\n        \"description\": \"Transaction total in cents (e.g. 4599 = 45.99 EUR)\"\n      },\n      {\n        \"name\": \"payment_methods\",\n        \"display_name\": \"Payment Methods\",\n        \"type\": \"string_array\",\n        \"min_length\": 0,\n        \"max_length\": 5,\n        \"min_element_length\": 0,\n        \"max_element_length\": 20,\n        \"required\": false,\n        \"description\": \"Payment methods used (e.g. cash, visa, mastercard)\"\n      },\n      {\n        \"name\": \"transaction_date\",\n        \"display_name\": \"Transaction Date\",\n        \"type\": \"timestamp\",\n        \"min_value\": \"2021-01-01T00:00:00.000Z\",\n        \"max_value\": \"2030-12-31T23:59:59.999Z\",\n        \"required\": false,\n        \"description\": \"Date and time of the transaction\"\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/annotation",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "annotation"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve annotations",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/annotation",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "annotation"
              ],
              "query": [
                {
                  "key": "include_results_from",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve an annotation",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "url": {
              "raw": "{{apiBaseUrl}}/annotation/{{annotationId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "annotation",
                "{{annotationId}}"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "files",
      "item": [
        {
          "name": "Upload a file",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "// Generate random custom_identifier",
                  "var customId = Math.floor(Math.random() * 88000) + 12000;",
                  "pm.environment.set(\"customIdentifier\", customId.toString());",
                  "",
                  "// Generate random PDF name",
                  "var pdfNames = [",
                  "    \"receipt_store_berlin_2024.pdf\",",
                  "    \"invoice_q3_summary.pdf\",",
                  "    \"sales_report_munich.pdf\",",
                  "    \"daily_closing_hamburg.pdf\",",
                  "    \"transaction_log_vienna.pdf\",",
                  "    \"fiscal_doc_cologne.pdf\",",
                  "    \"receipt_batch_frankfurt.pdf\",",
                  "    \"store_closing_dusseldorf.pdf\"",
                  "];",
                  "var randomPdf = pdfNames[Math.floor(Math.random() * pdfNames.length)];",
                  "pm.environment.set(\"pdfName\", randomPdf);",
                  "",
                  "// Build archive_file_request JSON with resolved variable values",
                  "var archiveBody = {",
                  "    content: {",
                  "        created_at: \"2026-02-09T17:46:29.000Z\",",
                  "        retention_period_days: 3650,",
                  "        name: randomPdf,",
                  "        custom_identifier: customId.toString(),",
                  "        annotations: [",
                  "            {",
                  "                name: pm.environment.get(\"annotationStoreInfoName\"),",
                  "                properties: {",
                  "                    store_id: \"STORE-DE-0001\"",
                  "                }",
                  "            },",
                  "            {",
                  "                name: pm.environment.get(\"annotationMetadataName\"),",
                  "                properties: {",
                  "                    cashier_id: \"C-1001\",",
                  "                    total_amount_cents: 450,",
                  "                    payment_methods: [\"cash\"],",
                  "                    transaction_date: \"2026-02-09T17:46:29.000Z\"",
                  "                }",
                  "            }",
                  "        ]",
                  "    }",
                  "};",
                  "pm.environment.set(\"archiveFileRequestBody\", JSON.stringify(archiveBody));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            },
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var data = pm.response.json();",
                  "var fileId = data.content.identifier;",
                  "var customId = pm.environment.get(\"customIdentifier\");",
                  "",
                  "pm.environment.set(\"fileId\", fileId);",
                  "pm.environment.set(\"lastCustomIdentifier\", customId);",
                  "",
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              },
              {
                "key": "Content-Type",
                "value": "application/xml",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "archive_file_request",
                  "value": "{{archiveFileRequestBody}}",
                  "contentType": "application/json",
                  "type": "text",
                  "description": "Metadata for the archived receipt document"
                },
                {
                  "key": "file",
                  "type": "file",
                  "uuid": "9a12fef2-4493-4061-be1a-49551cec5b20",
                  "value": null
                }
              ]
            },
            "url": {
              "raw": "{{apiBaseUrl}}/file",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "file"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a file by ID",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/file/{{fileId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "file",
                "{{fileId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve a file by custom id",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "var customId = pm.environment.get(\"lastCustomIdentifier\");",
                  "if (customId) {",
                  "    var encoded = btoa(customId);",
                  "    pm.environment.set(\"customIdentifierB64\", encoded);",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/file?custom_identifier={{customIdentifierB64}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "file"
              ],
              "query": [
                {
                  "key": "custom_identifier",
                  "value": "{{customIdentifierB64}}",
                  "description": "Base64-encoded custom_identifier from the last uploaded file"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Download a file",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{apiBaseUrl}}/file/{{fileId}}/data",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "file",
                "{{fileId}}",
                "data"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "search",
      "item": [
        {
          "name": "Create a search",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var data = pm.response.json();",
                  "var searchId  = data.content.identifier;",
                  "",
                  "pm.environment.set(\"searchId\", searchId);",
                  "",
                  "",
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "packages": {},
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              },
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"content\": {\n    \"query\": [\n      {\n        \"a\": \"{{annotationMetadataName}}.cashier_id\",\n        \"operator\": \"=\",\n        \"b\": \"C-1001\",\n        \"logical_operator\": \"AND\"\n      },\n      {\n        \"a\": \"{{annotationMetadataName}}.payment_methods\",\n        \"operator\": \"CONTAINS\",\n        \"b\": [\n          \"cash\"\n        ]\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/search",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "search"
              ],
              "query": [
                {
                  "key": "",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve status of search",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/search/{{searchId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "search",
                "{{searchId}}"
              ],
              "query": [
                {
                  "key": "X-Scope-Identifier",
                  "value": null,
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get result of search",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/search/{{searchId}}/result",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "search",
                "{{searchId}}",
                "result"
              ],
              "query": [
                {
                  "key": "include_results_from",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "List searches",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "{{scopeId}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/search",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "search"
              ],
              "query": [
                {
                  "key": "include_results_from",
                  "value": "global",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "30",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "export",
      "item": [
        {
          "name": "Create an export",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "var data = pm.response.json();",
                  "var exportId  = data.content.identifier;",
                  "",
                  "pm.environment.set(\"exportId\", exportId);",
                  "",
                  "",
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            },
            {
              "listen": "prerequest",
              "script": {
                "packages": {},
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              },
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"content\": {\n    \"file_identifiers\": [\n            \"{{fileId}}\"\n    ],\n    \"archive_type\": \"application/tar\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/export",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "export"
              ],
              "query": [
                {
                  "key": "include_results_from",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Retrieve status of export",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/export/{{exportId}}",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "export",
                "{{exportId}}"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Download an export",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/export/{{exportId}}/data",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "export",
                "{{exportId}}",
                "data"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List exports",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "X-Scope-Identifier",
                "value": "",
                "type": "text",
                "disabled": true
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/export",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "export"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "logs",
      "item": [
        {
          "name": "Get audit log",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "pm.test(\"Status code is 200\", function () {",
                  "    pm.response.to.have.status(200);",
                  "});"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "body": {
              "mode": "raw",
              "raw": "",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{apiBaseUrl}}/audit-log",
              "host": [
                "{{apiBaseUrl}}"
              ],
              "path": [
                "audit-log"
              ],
              "query": [
                {
                  "key": "",
                  "value": "",
                  "disabled": true
                }
              ]
            }
          },
          "response": []
        }
      ]
    }
  ]
}