{
  "info": {
    "_postman_id": "syncgate-developer-collection",
    "name": "SyncGate API",
    "description": "Developer-ready SyncGate S3 API collection.\n\n## Setup\n1. Import this collection\n2. Set collection variables: `base_url`, `api_key`, `client`, `bucket`, `type`, `filename`\n3. Run **Health Check** to verify connectivity\n4. Run **Upload File** then **Download File**\n\n## Authentication\nAll S3 gateway routes require header: `api-key: {{api_key}}`\n\n## Upload\n- POST multipart to `/api/s3`\n- Form fields: `bucket`, `client`, `type`, `files` (file field name)\n\n## Download / Delete\n- Path: `/api/s3/{{bucket}}/{{client}}/{{type}}/{{filename}}`",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://syncgate.test" },
    { "key": "api_key", "value": "YOUR_API_KEY" },
    { "key": "bucket", "value": "syncgate" },
    { "key": "client", "value": "test-tenant" },
    { "key": "type", "value": "docs" },
    { "key": "filename", "value": "sample.pdf" }
  ],
  "item": [
    {
      "name": "Health Check",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{base_url}}/health",
        "description": "Verify SyncGate is running and database is reachable."
      },
      "response": []
    },
    {
      "name": "Upload File",
      "request": {
        "method": "POST",
        "header": [
          { "key": "api-key", "value": "{{api_key}}", "type": "text" }
        ],
        "body": {
          "mode": "formdata",
          "formdata": [
            { "key": "bucket", "value": "{{bucket}}", "type": "text" },
            { "key": "client", "value": "{{client}}", "type": "text" },
            { "key": "type", "value": "{{type}}", "type": "text" },
            { "key": "files", "type": "file", "src": "" }
          ]
        },
        "url": "{{base_url}}/api/s3",
        "description": "Upload a file through the SyncGate S3 gateway.\n\nRequired headers:\n- `api-key`: your tenant API key\n\nRequired form fields:\n- `bucket`, `client` (tenant slug), `type`, `files`"
      },
      "response": []
    },
    {
      "name": "Download File",
      "request": {
        "method": "GET",
        "header": [
          { "key": "api-key", "value": "{{api_key}}", "type": "text" }
        ],
        "url": "{{base_url}}/api/s3/{{bucket}}/{{client}}/{{type}}/{{filename}}",
        "description": "Download a file by bucket, client slug, type, and filename.\n\nFollow redirects (`-L` in curl) or add `?format=json` for a signed URL response."
      },
      "response": []
    },
    {
      "name": "Delete File",
      "request": {
        "method": "DELETE",
        "header": [
          { "key": "api-key", "value": "{{api_key}}", "type": "text" }
        ],
        "url": "{{base_url}}/api/s3/{{bucket}}/{{client}}/{{type}}/{{filename}}",
        "description": "Permanently delete a file. Requires delete permission on the API key."
      },
      "response": []
    }
  ]
}
