{
  "info": {
    "name": "PaperClean API",
    "description": "Document image cleanup and enhancement API. PaperClean removes shadows, fixes contrast, corrects perspective, and produces clean, high-quality scans from photos of documents taken with any camera or phone.\n\nFeatures:\n- **2-pass enhancement** for superior quality (shadows removed, contrast optimized)\n- **Perspective correction** with 4-corner coordinates\n- **Configurable pipeline** (combine crop + enhance in one call)\n- **Fast processing** powered by Rust backend\n- **Multiple formats** supported: JPG, PNG, WebP, TIFF",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Full document cleanup",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/v1/clean",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "clean"
          ]
        },
        "description": "Applies the full PaperClean pipeline: 2-pass enhancement that removes shadows, fixes contrast and produces a clean document scan. This is the recommended endpoint for most use cases.",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "image",
              "type": "file",
              "description": "Document image file (JPG, PNG, WebP, or TIFF). Max 32MB."
            },
            {
              "key": "passes",
              "type": "text",
              "value": "",
              "description": "Number of enhancement passes. 2 gives best results (default), 1 is faster."
            },
            {
              "key": "scales",
              "type": "text",
              "value": "",
              "description": "Number of scales for enhancement algorithm. Higher = more detail but slower. Range: 1-8."
            },
            {
              "key": "gamma",
              "type": "text",
              "value": "",
              "description": "Gamma correction value. Lower values darken, higher values lighten. Range: 0.1-3.0."
            }
          ]
        }
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    },
    {
      "name": "Perspective correction",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/v1/crop",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "crop"
          ]
        },
        "description": "Corrects perspective distortion using 4-corner coordinates. Provide the coordinates of the document corners as fractions (0-1) relative to image dimensions. The image will be transformed to a flat, rectangular view.",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "image",
              "type": "file",
              "description": "Document image file (JPG, PNG, WebP, or TIFF). Max 32MB."
            },
            {
              "key": "tl_x",
              "type": "text",
              "value": "",
              "description": "Top-left corner X coordinate (fraction 0-1)"
            },
            {
              "key": "tl_y",
              "type": "text",
              "value": "",
              "description": "Top-left corner Y coordinate (fraction 0-1)"
            },
            {
              "key": "tr_x",
              "type": "text",
              "value": "",
              "description": "Top-right corner X coordinate (fraction 0-1)"
            },
            {
              "key": "tr_y",
              "type": "text",
              "value": "",
              "description": "Top-right corner Y coordinate (fraction 0-1)"
            },
            {
              "key": "br_x",
              "type": "text",
              "value": "",
              "description": "Bottom-right corner X coordinate (fraction 0-1)"
            },
            {
              "key": "br_y",
              "type": "text",
              "value": "",
              "description": "Bottom-right corner Y coordinate (fraction 0-1)"
            },
            {
              "key": "bl_x",
              "type": "text",
              "value": "",
              "description": "Bottom-left corner X coordinate (fraction 0-1)"
            },
            {
              "key": "bl_y",
              "type": "text",
              "value": "",
              "description": "Bottom-left corner Y coordinate (fraction 0-1)"
            }
          ]
        }
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    },
    {
      "name": "Configurable pipeline",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/v1/pipeline",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "pipeline"
          ]
        },
        "description": "Combines crop and enhance in a single call. The pipeline first applies perspective correction (if coordinates are provided), then enhancement. Use passes=0 to skip enhancement and only crop.",
        "body": {
          "mode": "formdata",
          "formdata": [
            {
              "key": "image",
              "type": "file",
              "description": "Document image file (JPG, PNG, WebP, or TIFF). Max 32MB."
            },
            {
              "key": "tl_x",
              "type": "text",
              "value": "",
              "description": "Top-left corner X (fraction 0-1). Optional: omit all coordinates to skip crop."
            },
            {
              "key": "tl_y",
              "type": "text",
              "value": "",
              "description": "Top-left corner Y (fraction 0-1)"
            },
            {
              "key": "tr_x",
              "type": "text",
              "value": "",
              "description": "Top-right corner X (fraction 0-1)"
            },
            {
              "key": "tr_y",
              "type": "text",
              "value": "",
              "description": "Top-right corner Y (fraction 0-1)"
            },
            {
              "key": "br_x",
              "type": "text",
              "value": "",
              "description": "Bottom-right corner X (fraction 0-1)"
            },
            {
              "key": "br_y",
              "type": "text",
              "value": "",
              "description": "Bottom-right corner Y (fraction 0-1)"
            },
            {
              "key": "bl_x",
              "type": "text",
              "value": "",
              "description": "Bottom-left corner X (fraction 0-1)"
            },
            {
              "key": "bl_y",
              "type": "text",
              "value": "",
              "description": "Bottom-left corner Y (fraction 0-1)"
            },
            {
              "key": "passes",
              "type": "text",
              "value": "",
              "description": "Enhancement passes: 0 = crop only, 1 = single pass, 2 = full quality (default)"
            },
            {
              "key": "scales",
              "type": "text",
              "value": "",
              "description": "Enhancement scales (1-8)"
            },
            {
              "key": "gamma",
              "type": "text",
              "value": "",
              "description": "Gamma correction (0.1-3.0)"
            }
          ]
        }
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    },
    {
      "name": "Check usage and limits",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/v1/usage",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "usage"
          ]
        },
        "description": "Returns your current plan, usage count, remaining requests, and period end date."
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    },
    {
      "name": "Register for a free API key",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/v1/register",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "register"
          ]
        },
        "description": "Self-service registration. Provide your email to get a free API key with 50 images/month. If a key already exists for the email, it returns the existing key.",
        "body": {
          "mode": "raw",
          "raw": "{}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    },
    {
      "name": "Health check",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/api/health",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "health"
          ]
        },
        "description": "Returns API health status and system checks."
      },
      "response": [
        {
          "name": "Success",
          "status": "OK",
          "code": 200,
          "header": [],
          "body": ""
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://paperclean.ip1.cc",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "YOUR_API_KEY_HERE",
      "type": "string"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  }
}