{
  "info": {
    "name": "FileWhirl API",
    "description": "Convert & compress files via the FileWhirl REST API. Set the collection variables `base_url` and `api_key` (an `ff_live_…` key from your FileWhirl account), then run 'Create job' and poll 'Get job status'. Docs: https://filewhirl.com/developers",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://fkgvpgpdkktikfzspnib.supabase.co/functions/v1/convert-api", "type": "string" },
    { "key": "api_key", "value": "ff_live_your_key_here", "type": "string" },
    { "key": "job_id", "value": "", "type": "string" },
    { "key": "job_token", "value": "", "type": "string" }
  ],
  "item": [
    {
      "name": "Create job (upload a file)",
      "request": {
        "method": "POST",
        "header": [{ "key": "x-api-key", "value": "{{api_key}}" }],
        "body": {
          "mode": "formdata",
          "formdata": [
            { "key": "file", "type": "file", "src": [], "description": "The input file (up to 2 GB)." },
            { "key": "to", "value": "jpg", "type": "text", "description": "Target format. Same as input = compress." }
          ]
        },
        "url": { "raw": "{{base_url}}", "host": ["{{base_url}}"] },
        "description": "Returns 202 with { id, token, status, billing, status_url }. Copy id/token into the collection variables to poll."
      }
    },
    {
      "name": "Create job (convert from a URL)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "x-api-key", "value": "{{api_key}}" },
          { "key": "content-type", "value": "application/json" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"to\": \"mp3\",\n  \"url\": \"https://example.com/clip.mp4\"\n}"
        },
        "url": { "raw": "{{base_url}}", "host": ["{{base_url}}"] },
        "description": "Provide a public http(s) link instead of uploading. Returns 202 with the job id/token."
      }
    },
    {
      "name": "Get job status",
      "request": {
        "method": "GET",
        "header": [{ "key": "x-api-key", "value": "{{api_key}}" }],
        "url": {
          "raw": "{{base_url}}?id={{job_id}}&token={{job_token}}",
          "host": ["{{base_url}}"],
          "query": [
            { "key": "id", "value": "{{job_id}}" },
            { "key": "token", "value": "{{job_token}}" }
          ]
        },
        "description": "Poll every ~1.5s until status is 'done' (then output_url is a 1-hour signed link) or 'error'."
      }
    }
  ]
}
