{
  "info": {
    "name": "Comprestack API",
    "description": "Public Comprestack REST API (`/api/v1`). Same surface as https://www.comprestack.com/docs and OpenAPI 3.1.\n\n**Import:** Postman → Import, or Insomnia → Import → From File.\n\nSet `apiKey` to a dashboard key (`csk_live_…`). Keep keys on the server — never in a browser or mobile app. Pricing and quotas are enforced by the API.\n\nOn HTTP 429 / 503, wait for `Retry-After` (seconds) and retry.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.comprestack.com/api/v1"
    },
    {
      "key": "apiKey",
      "value": "csk_live_"
    },
    {
      "key": "jobId",
      "value": "job_replace_me"
    },
    {
      "key": "fileIndex",
      "value": "0"
    },
    {
      "key": "roomId",
      "value": "acme-images"
    }
  ],
  "item": [
    {
      "name": "Images",
      "item": [
        {
          "name": "Compress images",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "files[]",
                  "type": "file",
                  "src": [],
                  "description": "One or more images (Free: 5, Pro/Business: 10)."
                },
                {
                  "key": "quality",
                  "value": "balanced",
                  "type": "text",
                  "description": "balanced | high | smallest | 1–100 (paid)"
                },
                {
                  "key": "maxWidth",
                  "value": "",
                  "type": "text",
                  "disabled": true
                },
                {
                  "key": "maxHeight",
                  "value": "",
                  "type": "text",
                  "disabled": true
                },
                {
                  "key": "target_kb",
                  "value": "",
                  "type": "text",
                  "disabled": true,
                  "description": "Paid size hint"
                },
                {
                  "key": "lossless",
                  "value": "false",
                  "type": "text",
                  "disabled": true
                },
                {
                  "key": "keep_metadata",
                  "value": "false",
                  "type": "text",
                  "disabled": true
                }
              ]
            },
            "url": "{{baseUrl}}/compress",
            "description": "Shrink images, keep format. Synchronous job."
          }
        },
        {
          "name": "Convert images",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "files[]",
                  "type": "file",
                  "src": []
                },
                {
                  "key": "format",
                  "value": "webp",
                  "type": "text",
                  "description": "Required. e.g. webp, avif, jpeg, png"
                },
                {
                  "key": "quality",
                  "value": "balanced",
                  "type": "text"
                },
                {
                  "key": "maxWidth",
                  "value": "1600",
                  "type": "text",
                  "disabled": true
                }
              ]
            },
            "url": "{{baseUrl}}/convert",
            "description": "`format` is required. Change format and compress in one request."
          }
        }
      ]
    },
    {
      "name": "Jobs",
      "item": [
        {
          "name": "Retrieve a job",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/jobs/{{jobId}}",
            "description": "Jobs complete before compress/convert returns. After ~1 hour this is 404."
          }
        },
        {
          "name": "Download results",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{baseUrl}}/jobs/{{jobId}}/download",
            "description": "ZIP of all outputs, or a single file when the job has one image. Prefer the job `download_url` (includes `token`). Resolve relative paths against https://api.comprestack.com."
          }
        },
        {
          "name": "Download one file",
          "request": {
            "method": "GET",
            "header": [],
            "url": "{{baseUrl}}/jobs/{{jobId}}/files/{{fileIndex}}",
            "description": "Zero-based index from the job `files` array."
          }
        }
      ]
    },
    {
      "name": "Usage",
      "item": [
        {
          "name": "Check usage",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/usage",
            "description": "Plan meters for the authenticated key. Self-serve keys share the website quota."
          }
        }
      ]
    },
    {
      "name": "White label",
      "item": [
        {
          "name": "Billing report",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/rooms/{{roomId}}/report",
            "description": "A room key may only read its own `id`. Do not send `X-Account-Id` with a room key. Charge closed periods only."
          }
        }
      ]
    }
  ]
}
