{
  "info": {
    "name": "SmartyLabels API",
    "description": "Create and manage trackable QR codes with SmartyLabels. Dynamic URLs that can be updated without reprinting.\n\n## Getting Started\n1. Sign up at https://smartylabels.com/register\n2. Generate an API key from your dashboard\n3. Replace `{{api_key}}` with your key\n\n## Base URL\n`https://smartylabels.com/api/v1`",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://smartylabels.com/api/v1"
    },
    {
      "key": "api_key",
      "value": "sl_your_api_key_here"
    }
  ],
  "item": [
    {
      "name": "URLs",
      "item": [
        {
          "name": "Create URL",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"My Landing Page\",\n  \"destination\": \"https://example.com/landing\",\n  \"description\": \"Optional description\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/urls",
              "host": ["{{base_url}}"],
              "path": ["urls"]
            },
            "description": "Create a new trackable URL. Returns the short URL and QR code link."
          }
        },
        {
          "name": "List URLs",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/urls?limit=50&offset=0",
              "host": ["{{base_url}}"],
              "path": ["urls"],
              "query": [
                {"key": "limit", "value": "50"},
                {"key": "offset", "value": "0"},
                {"key": "status", "value": "active", "disabled": true}
              ]
            },
            "description": "Get a paginated list of all your URLs."
          }
        },
        {
          "name": "Get URL Details",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/urls/:id",
              "host": ["{{base_url}}"],
              "path": ["urls", ":id"],
              "variable": [
                {"key": "id", "value": "url_id_here"}
              ]
            },
            "description": "Get detailed information about a specific URL."
          }
        },
        {
          "name": "Update URL",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"destination\": \"https://example.com/new-page\",\n  \"status\": \"active\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/urls/:id",
              "host": ["{{base_url}}"],
              "path": ["urls", ":id"],
              "variable": [
                {"key": "id", "value": "url_id_here"}
              ]
            },
            "description": "Update a URL's destination, title, or status. This is how you change where a QR code points without reprinting."
          }
        },
        {
          "name": "Delete URL",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{base_url}}/urls/:id",
              "host": ["{{base_url}}"],
              "path": ["urls", ":id"],
              "variable": [
                {"key": "id", "value": "url_id_here"}
              ]
            },
            "description": "Permanently delete a URL."
          }
        },
        {
          "name": "Get URL Statistics",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/urls/:id/stats",
              "host": ["{{base_url}}"],
              "path": ["urls", ":id", "stats"],
              "variable": [
                {"key": "id", "value": "url_id_here"}
              ]
            },
            "description": "Get click statistics including total clicks, device breakdown, and top referrers."
          }
        }
      ]
    },
    {
      "name": "Batches",
      "item": [
        {
          "name": "Create Batch",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Product Launch Campaign\",\n  \"count\": 100,\n  \"titlePrefix\": \"Product-\",\n  \"description\": \"Q1 2025 launch\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/batches",
              "host": ["{{base_url}}"],
              "path": ["batches"]
            },
            "description": "Create multiple URLs at once for bulk QR code generation. Perfect for printing batches of labels."
          }
        },
        {
          "name": "List Batches",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/batches",
              "host": ["{{base_url}}"],
              "path": ["batches"]
            },
            "description": "Get a list of all your batches."
          }
        },
        {
          "name": "Get Batch Details",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/batches/:batchId",
              "host": ["{{base_url}}"],
              "path": ["batches", ":batchId"],
              "variable": [
                {"key": "batchId", "value": "batch_id_here"}
              ]
            },
            "description": "Get batch information including all URLs in the batch."
          }
        }
      ]
    },
    {
      "name": "Account",
      "item": [
        {
          "name": "Get Account Info",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/account",
              "host": ["{{base_url}}"],
              "path": ["account"]
            },
            "description": "Get information about your account including URL and batch counts."
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Webhook endpoints for Zapier, Make, and other automation platforms",
      "item": [
        {
          "name": "Subscribe to Webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://hooks.zapier.com/hooks/catch/123456/abcdef/\",\n  \"event\": \"url.scanned\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/webhooks/subscribe",
              "host": ["{{base_url}}"],
              "path": ["webhooks", "subscribe"]
            },
            "description": "Subscribe to receive webhook notifications. Events: url.scanned, url.created, url.updated, url.deleted"
          }
        },
        {
          "name": "List Webhooks",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/webhooks",
              "host": ["{{base_url}}"],
              "path": ["webhooks"]
            },
            "description": "Get all your active webhook subscriptions."
          }
        },
        {
          "name": "Unsubscribe Webhook",
          "request": {
            "method": "DELETE",
            "url": {
              "raw": "{{base_url}}/webhooks/:id",
              "host": ["{{base_url}}"],
              "path": ["webhooks", ":id"],
              "variable": [
                {"key": "id", "value": "webhook_id_here"}
              ]
            },
            "description": "Remove a webhook subscription."
          }
        },
        {
          "name": "Test Webhook",
          "request": {
            "method": "POST",
            "url": {
              "raw": "{{base_url}}/webhooks/:id/test",
              "host": ["{{base_url}}"],
              "path": ["webhooks", ":id", "test"],
              "variable": [
                {"key": "id", "value": "webhook_id_here"}
              ]
            },
            "description": "Send a test payload to verify your webhook is configured correctly."
          }
        },
        {
          "name": "Get Sample Data",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/webhooks/sample/:event",
              "host": ["{{base_url}}"],
              "path": ["webhooks", "sample", ":event"],
              "variable": [
                {"key": "event", "value": "url.scanned"}
              ]
            },
            "description": "Get sample webhook payload data for a specific event type."
          }
        }
      ]
    }
  ]
}
