{
  "openapi": "3.0.3",
  "info": {
    "title": "QRTRAC API",
    "description": "# Overview\n\nWelcome to the **QRTRAC API** — a powerful, enterprise-grade REST API for creating, managing, and tracking QR codes at scale. Built for developers who need reliable, flexible QR code management with advanced features like team collaboration, bulk operations, and comprehensive analytics.\n\n## What is QRTRAC?\n\nQRTRAC is a comprehensive platform that enables businesses to generate, manage, and track QR codes programmatically. Whether you're building a marketing campaign, implementing contactless solutions, or managing digital assets, QRTRAC provides the infrastructure and tools you need.\n\n**Key Features:**\n\n- **Multiple QR Code Types**: Short Links, List Of Links, Website URL, Digital Business Card, PDF Document, Multi-Language Redirect, Image Gallery, Social Bio Page, App Download, Restaurant Menu, Coupon Codes, and Location Tracking. See [qrtrac.com](https://qrtrac.com) for more details.\n- **Team Collaboration**: Multi-user support with role-based access control (Owner, Admin, Editor, Viewer)\n- **Custom Short URLs**: Create branded, memorable short links for your QR codes\n- **Analytics & Tracking**: Monitor QR code performance and engagement\n- **Enterprise Security**: API key-based authentication with team context isolation\n\n## API Capabilities\n\nThe QRTRAC API is organized into the following functional areas:\n\n### QR Code Management\nFull CRUD operations for QR codes including creation, updates, deletion, duplication, and custom image uploads. Support for pagination, search, filtering, and sorting.\n\n### Analytics & Tracking\nRetrieve detailed scan analytics data for individual QR codes or bulk analytics for multiple QR codes within specified time ranges. Track scan events, device information, geographic data, and engagement metrics.\n\n### Team & Organization Management\nCreate and manage teams within your organization, configure domain preferences, and control access with granular permissions.\n\n### Team Member Management\nInvite, activate, pause, and manage team members with role-based permissions. Support for bulk member operations across multiple teams.\n\n## Getting Started\n\nFollow these steps to start using the QRTRAC API:\n\n### Step 1: Create an Account and Upgrade to a Paid Plan\nSign up at [qrtrac.com/signup](https://qrtrac.com/signup/) and upgrade to a **Business Plus plan or higher** to get API access. API access is available on paid plans only. Check pricing at [qrtrac.com/#pricing](https://qrtrac.com/#pricing).\n\n### Step 2: Get Your API Credentials\nNavigate to [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api) to retrieve your **Client ID** and **Client Secret**. These credentials are required for all API operations.\n\n**Note:** You must have an **Owner or Admin role** and be on a **Business Plus plan or higher** to access the API. Check pricing at [qrtrac.com/#pricing](https://qrtrac.com/#pricing).\n\n### Step 3: Get Your Team ID\nYour Team ID can be obtained from the API page in the application at [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). This team ID is required for most operations.\n\n### Step 4: Create Your First QR Code\nUse the `/qrs-api` POST endpoint to create your first QR code. You'll need your team ID, client ID, and client secret. Specify the QR type, redirect URL, and any custom settings.\n\n### Step 5: Explore the API\nBrowse the available endpoints in the sidebar to discover all available operations. Each endpoint includes detailed request/response examples.\n\n## Quick Example\n\nHere's a complete example of creating a QR code:\n\n```bash\n# Get your Client ID and Client Secret from https://app.qrtrac.com/pages/api\n# Note: Owner/Admin role and Business Plus plan or higher required\n# Then make your API request:\n\ncurl -X POST https://api.qrtrac.com/api/qrs-api \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Product Launch Landing Page\",\n    \"qrType\": \"WEB\",\n    \"displayId\": \"product-launch-2024\",\n    \"qrRedirectUrl\": \"https://acmecorp.com/product-launch\"\n  }'\n```\n\nFor more examples in multiple languages (cURL, Python, Node.js, Java, C#), see the [Create QR Code](#operation/createQr) and [Get QR by ID](#operation/getQrById) endpoints.\n\n## Base URLs\n\nThe API is available at the following base URL:\n\n- **Production**: `https://api.qrtrac.com/api`\n\n## Response Format\n\nAll API responses follow a consistent format:\n\n```json\n{\n  \"success\": true,\n  \"data\": { ... }\n}\n```\n\nError responses include a `message` field:\n\n```json\n{\n  \"success\": false,\n  \"message\": \"Error description\"\n}\n```\n\n## Rate Limits\n\nAPI rate limits are applied per team and vary based on your subscription plan. Rate limit information is included in response headers:\n\n- `X-RateLimit-Limit`: Maximum number of requests allowed\n- `X-RateLimit-Remaining`: Number of requests remaining\n- `X-RateLimit-Reset`: Time when the rate limit resets\n\n### Plan-Based Rate Limits\n\nAPI access is available on the following plans with increasing request limits:\n\n- **Business Plus**: 5 requests per second\n- **Legendary**: 20 requests per second\n- **Agency**: 50 requests per second\n- **Premium**: 100 requests per second\n- **Enterprise**: 200 requests per second (or custom limits based on your needs)\n\nRate limits are enforced on a per-team basis. If you exceed your plan's rate limit, you'll receive a `429 Too Many Requests` response. Contact [support@qrtrac.com](mailto:support@qrtrac.com) to upgrade your plan or discuss custom rate limits for Enterprise customers.\n\n## Support & Resources\n\n- **Documentation**: This API documentation\n- **Support Email**: [support@qrtrac.com](mailto:support@qrtrac.com)\n- **Website**: [qrtrac.com](https://qrtrac.com)\n- **Sign Up**: [qrtrac.com/signup](https://qrtrac.com/signup/)\n\nFor additional help, questions, or to report issues, please contact our support team.\n",
    "version": "2.0.0",
    "contact": {
      "name": "QRTRAC Support",
      "email": "support@qrtrac.com"
    }
  },
  "servers": [
    {
      "url": "https://api.qrtrac.com/api",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "QR Codes",
      "description": "QR code creation, management, and operations"
    },
    {
      "name": "QR Code Design Templates",
      "description": "QR code design template management"
    },
    {
      "name": "Analytics",
      "description": "QR code scan analytics and tracking data"
    },
    {
      "name": "Teams",
      "description": "Team management operations"
    },
    {
      "name": "Team Members",
      "description": "Team member management and operations"
    }
  ],
  "paths": {
    "/qrs-api": {
      "post": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Create QR Code",
        "description": "Create a new QR code. Requires authentication using client ID and client secret, along with team context.\n\n**Required Headers:**\n- `x-request-team-id: <team_id>` - Team ID for the request context\n- `x-request-client-id: <client_id>` - Client ID from API menu\n- `x-request-client-secret: <client_secret>` - Client Secret from API menu\n\n**Note:** Client ID and Client Secret can be obtained from [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). Owner/Admin role and Business Plus plan or higher required. Check pricing at [qrtrac.com/#pricing](https://qrtrac.com/#pricing).\n\n**Optional Parameters:**\n- `templateId`: Template ID for QR code design. Can be found at [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). If not provided, default template is used.\n- `baseUrl`: Custom domain base URL for QR codes. Must end with '/'. Prerequisite: Custom domain must be configured in the application. Can be found at [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). Example: If main domain is `qrtrac.com` and custom domain subdomain `qr.qrtrac.com` is configured, the baseUrl would be `https://qr.qrtrac.com/`. If not provided, default domain is used.\n\n**Middleware:** `checkQrLimit`, `canAddUpdateQr`\n\n## Supported QR Types\n\n| Type | Description |\n|------|-------------|\n| `WEB` | Simple URL redirect |\n| `PDF` | PDF document viewer |\n| `VCARD` | Digital business card |\n| `MULTI_LOCALE` | Multi-language URLs |\n| `APP_DOWNLOAD` | App store links |\n| `LINK_LIST` | Multiple links page |\n| `SHORT_LINK` | URL shortener |\n| `COUPON_CODE` | Coupon codes |\n| `IMAGE_GALLERY` | Image gallery |\n| `SOCIAL_BIO` | Social bio page |\n| `VIDEO_PREVIEW` | Video preview |\n| `RESTAURANT_MENU` | Restaurant menu |\n",
        "operationId": "createQr",
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X POST https://api.qrtrac.com/api/qrs-api \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Product Launch Landing Page\",\n    \"qrType\": \"WEB\",\n    \"displayId\": \"product-launch-2024\",\n    \"qrRedirectUrl\": \"https://acmecorp.com/product-launch\",\n    \"templateId\": \"qwrIYX8iLAuDHSBCiKZl\",\n    \"baseUrl\": \"https://qr.qrtrac.com/\"\n  }'\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nurl = \"https://api.qrtrac.com/api/qrs-api\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\",\n    \"Content-Type\": \"application/json\"\n}\ndata = {\n    \"name\": \"Product Launch Landing Page\",\n    \"qrType\": \"WEB\",\n    \"displayId\": \"product-launch-2024\",\n    \"qrRedirectUrl\": \"https://acmecorp.com/product-launch\",\n    \"templateId\": \"qwrIYX8iLAuDHSBCiKZl\",\n    \"baseUrl\": \"https://qr.qrtrac.com/\"\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst url = 'https://api.qrtrac.com/api/qrs-api';\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>',\n    'Content-Type': 'application/json'\n};\nconst data = {\n    name: 'Product Launch Landing Page',\n    qrType: 'WEB',\n    displayId: 'product-launch-2024',\n    qrRedirectUrl: 'https://acmecorp.com/product-launch',\n    templateId: 'qwrIYX8iLAuDHSBCiKZl',\n    baseUrl: 'https://qr.qrtrac.com/'\n};\n\naxios.post(url, data, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nString json = \"{\\\"name\\\":\\\"Product Launch Landing Page\\\",\\\"qrType\\\":\\\"WEB\\\",\\\"displayId\\\":\\\"product-launch-2024\\\",\\\"qrRedirectUrl\\\":\\\"https://acmecorp.com/product-launch\\\",\\\"templateId\\\":\\\"qwrIYX8iLAuDHSBCiKZl\\\",\\\"baseUrl\\\":\\\"https://qr.qrtrac.com/\\\"}\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/qrs-api\"))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(HttpRequest.BodyPublishers.ofString(json))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar data = new {\n    name = \"Product Launch Landing Page\",\n    qrType = \"WEB\",\n    displayId = \"product-launch-2024\",\n    qrRedirectUrl = \"https://acmecorp.com/product-launch\",\n    templateId = \"qwrIYX8iLAuDHSBCiKZl\",\n    baseUrl = \"https://qr.qrtrac.com/\"\n};\n\nvar json = JsonConvert.SerializeObject(data);\nvar content = new StringContent(json, Encoding.UTF8, \"application/json\");\n\nvar response = await client.PostAsync(\"https://api.qrtrac.com/api/qrs-api\", content);\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQrRequest"
              },
              "examples": {
                "web": {
                  "summary": "WEB - Simple URL Redirect",
                  "description": "Redirect to any URL when scanned",
                  "value": {
                    "name": "My Website",
                    "qrType": "WEB",
                    "qrRedirectUrl": "https://example.com"
                  }
                },
                "vcard": {
                  "summary": "VCARD - Digital Business Card",
                  "description": "Creates a downloadable contact card",
                  "value": {
                    "name": "John's Business Card",
                    "qrType": "VCARD",
                    "firstName": "John",
                    "lastName": "Doe",
                    "company": "Acme Corp",
                    "designation": "Software Engineer",
                    "email": "john.doe@acme.com",
                    "mobile": "+1-555-123-4567",
                    "landline": "+1-555-987-6543",
                    "fax": "+1-555-111-2222",
                    "website": "https://johndoe.com",
                    "address": "123 Main Street",
                    "street": "Main Street",
                    "city": "San Francisco",
                    "state": "California",
                    "postalCode": "94102",
                    "country": "USA",
                    "bio": "Full-stack developer with 10+ years experience"
                  }
                },
                "pdf": {
                  "summary": "PDF - Document Viewer",
                  "description": "Display a PDF document with optional download",
                  "value": {
                    "name": "Product Brochure",
                    "qrType": "PDF",
                    "pdfTitle": "2024 Product Catalog",
                    "pdfDescription": "Browse our complete product lineup",
                    "pdfUrl": "https://storage.example.com/catalog-2024.pdf",
                    "metadata": {
                      "allowDownload": true,
                      "showTitle": true
                    }
                  }
                },
                "imageGallery": {
                  "summary": "IMAGE_GALLERY - Image Gallery",
                  "description": "Display single or multiple images",
                  "value": {
                    "name": "Product Gallery",
                    "qrType": "IMAGE_GALLERY",
                    "metadata": {
                      "images": [
                        {
                          "url": "https://storage.example.com/img1.jpg",
                          "caption": "Front View"
                        },
                        {
                          "url": "https://storage.example.com/img2.jpg",
                          "caption": "Side View"
                        }
                      ],
                      "title": "Product Images",
                      "enableDownload": true
                    }
                  }
                },
                "couponCode": {
                  "summary": "COUPON_CODE - Coupon Codes",
                  "description": "Create digital coupon codes with tracking and analytics",
                  "value": {
                    "name": "Summer Sale Coupon",
                    "qrType": "COUPON_CODE",
                    "metadata": {
                      "couponCode": "SUMMER20",
                      "discount": "20%",
                      "description": "Get 20% off on all items",
                      "expiryDate": 1735689600000
                    }
                  }
                },
                "restaurantMenu": {
                  "summary": "RESTAURANT_MENU - Restaurant Menu",
                  "description": "Create and manage restaurant menu using menu builder",
                  "value": {
                    "name": "Restaurant Menu",
                    "qrType": "RESTAURANT_MENU",
                    "metadata": {
                      "restaurantName": "Fine Dining Restaurant",
                      "menuItems": [
                        {
                          "name": "Appetizers"
                        }
                      ],
                      "items": [
                        {
                          "name": "Caesar Salad",
                          "price": "$12",
                          "description": "Fresh romaine lettuce with caesar dressing"
                        },
                        {
                          "name": "Bruschetta",
                          "price": "$10",
                          "description": "Toasted bread with tomatoes and basil"
                        }
                      ]
                    }
                  }
                },
                "socialBio": {
                  "summary": "SOCIAL_BIO - Social Bio Page",
                  "description": "Landing page with all social media profiles",
                  "value": {
                    "name": "My Social Bio",
                    "qrType": "SOCIAL_BIO"
                  },
                  "metadata": {
                    "title": "Connect with Us",
                    "subtitle": "Follow us on social media",
                    "profileImage": "https://storage.example.com/profile.jpg",
                    "links": [
                      {
                        "platform": "facebook",
                        "url": "https://facebook.com/mycompany"
                      },
                      {
                        "platform": "twitter",
                        "url": "https://twitter.com/mycompany"
                      },
                      {
                        "platform": "instagram",
                        "url": "https://instagram.com/mycompany"
                      },
                      {
                        "platform": "linkedin",
                        "url": "https://linkedin.com/company/mycompany"
                      },
                      {
                        "platform": "youtube",
                        "url": "https://youtube.com/@mycompany"
                      }
                    ]
                  }
                },
                "videoPreview": {
                  "summary": "VIDEO_PREVIEW - Video Preview",
                  "description": "Preview video from YouTube, Vimeo, or direct URL",
                  "value": {
                    "name": "Product Demo Video",
                    "qrType": "VIDEO_PREVIEW",
                    "metadata": {
                      "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
                      "title": "Product Demo",
                      "description": "Watch our product in action",
                      "autoplay": false,
                      "showControls": true
                    }
                  }
                },
                "linkList": {
                  "summary": "LINK_LIST - Multiple Links",
                  "description": "Landing page with multiple clickable links",
                  "value": {
                    "name": "Resource Links",
                    "qrType": "LINK_LIST",
                    "metadata": {
                      "title": "Helpful Resources",
                      "subtitle": "Click any link below",
                      "links": [
                        {
                          "title": "Documentation",
                          "url": "https://docs.example.com",
                          "icon": "book"
                        },
                        {
                          "title": "Support Portal",
                          "url": "https://support.example.com",
                          "icon": "headset"
                        },
                        {
                          "title": "Community Forum",
                          "url": "https://forum.example.com",
                          "icon": "users"
                        }
                      ]
                    }
                  }
                },
                "appDownload": {
                  "summary": "APP_DOWNLOAD - App Store Links",
                  "description": "Smart redirect to iOS App Store or Google Play",
                  "value": {
                    "name": "Download Our App",
                    "qrType": "APP_DOWNLOAD",
                    "metadata": {
                      "appName": "My Awesome App",
                      "appIcon": "https://storage.example.com/app-icon.png",
                      "iosUrl": "https://apps.apple.com/app/id123456789",
                      "androidUrl": "https://play.google.com/store/apps/details?id=com.example.app",
                      "fallbackUrl": "https://example.com/download"
                    }
                  }
                },
                "multiLocale": {
                  "summary": "MULTI_LOCALE - Multi-Language URLs",
                  "description": "Redirect based on user's browser language",
                  "value": {
                    "name": "Multi-language Website",
                    "qrType": "MULTI_LOCALE",
                    "defaultQrRedirectUrl": "https://example.com/en",
                    "qrRedirectUrls": [
                      {
                        "locale": "en",
                        "qrRedirectUrl": "https://example.com/en"
                      },
                      {
                        "locale": "es",
                        "qrRedirectUrl": "https://example.com/es"
                      },
                      {
                        "locale": "fr",
                        "qrRedirectUrl": "https://example.com/fr"
                      },
                      {
                        "locale": "de",
                        "qrRedirectUrl": "https://example.com/de"
                      },
                      {
                        "locale": "ja",
                        "qrRedirectUrl": "https://example.com/ja"
                      }
                    ]
                  }
                },
                "shortLink": {
                  "summary": "SHORT_LINK - URL Shortener",
                  "description": "Simple URL shortening without landing page",
                  "value": {
                    "name": "Short Link",
                    "qrType": "SHORT_LINK",
                    "qrRedirectUrl": "https://very-long-url.example.com/path/to/resource?param=value",
                    "displayId": "promo2024"
                  }
                },
                "withAdvancedSettings": {
                  "summary": "With Advanced Settings",
                  "description": "QR code with password, age gate, and campaign schedule",
                  "value": {
                    "name": "Protected Content",
                    "qrType": "WEB",
                    "qrRedirectUrl": "https://example.com/exclusive",
                    "settings": {
                      "passwordEnabled": true,
                      "password": "secret123",
                      "ageGating": true,
                      "minAge": 21,
                      "scheduleCampaign": true,
                      "campaignStart": 1704067200000,
                      "campaignEnd": 1735689600000,
                      "locationEnabled": true
                    },
                    "tags": [
                      "campaign",
                      "exclusive",
                      "2024"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "QR code created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/duplicate/{id}": {
      "post": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Duplicate QR Code",
        "description": "Create a copy of an existing QR code with a new ID",
        "operationId": "duplicateQr",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "QR code ID to duplicate"
          }
        ],
        "responses": {
          "201": {
            "description": "QR code duplicated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid QR or unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/availability/{id}": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Check QR ID Availability",
        "description": "Check if a custom QR display ID is available",
        "operationId": "checkQrAvailability",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Custom display ID to check"
          }
        ],
        "responses": {
          "200": {
            "description": "Availability status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "true if available, false if taken"
                    },
                    "data": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/{id}": {
      "put": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Update QR Code",
        "description": "Update an existing QR code",
        "operationId": "updateQr",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQrRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "QR code updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or display ID taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Delete QR Code",
        "description": "Soft delete a QR code (moves to deleted collection)",
        "operationId": "deleteQr",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR code deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Qr"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/{id}/tags": {
      "put": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Update QR Tags",
        "description": "Update tags for a specific QR code",
        "operationId": "updateQrTags",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "examples": {
                "updateTags": {
                  "summary": "Add Tags to QR Code",
                  "value": {
                    "tags": [
                      "marketing",
                      "product-launch",
                      "q4-2024"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tags updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/{id}/title": {
      "patch": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Update QR Title",
        "description": "Update only the title/name of a QR code",
        "operationId": "updateQrTitle",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "examples": {
                "updateTitle": {
                  "summary": "Update QR Code Title",
                  "value": {
                    "title": "Summer Campaign - Homepage"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Title updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/v2/teams/": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Get Paginated Team QR Codes",
        "description": "Retrieve QR codes with pagination, search, sorting, and folder filtering.\nThis is the recommended endpoint for listing QR codes.\n",
        "operationId": "getTeamQrsPaginated",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of items per page"
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "Page number"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Search by name or displayId"
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "updatedAt",
              "enum": [
                "createdAt",
                "updatedAt",
                "name"
              ]
            },
            "description": "Field to sort by"
          },
          {
            "name": "sortOrder",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Sort direction"
          },
          {
            "name": "folderId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by folder ID (Coming Soon)"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedQrResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/teams/{id}": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Get QR by ID",
        "description": "Retrieve a specific QR code by its ID",
        "operationId": "getQrById",
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X GET https://api.qrtrac.com/api/qrs-api/teams/{id} \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\"\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nqr_id = \"<qr_id>\"\nurl = f\"https://api.qrtrac.com/api/qrs-api/teams/{qr_id}\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\"\n}\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst qrId = '<qr_id>';\nconst url = `https://api.qrtrac.com/api/qrs-api/teams/${qrId}`;\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>'\n};\n\naxios.get(url, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nString qrId = \"<qr_id>\";\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/qrs-api/teams/\" + qrId))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar qrId = \"<qr_id>\";\nvar response = await client.GetAsync($\"https://api.qrtrac.com/api/qrs-api/teams/{qrId}\");\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "QR code details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrResponse"
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/teams/fromTime/{fromTime}": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Get Team QRs Updated After Time",
        "description": "Retrieve QR codes updated after a specific timestamp",
        "operationId": "getTeamQrsFromTime",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "name": "fromTime",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Unix timestamp in milliseconds"
          }
        ],
        "responses": {
          "200": {
            "description": "List of QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Qr"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/qrs-api/all/fromTime/{fromTime}": {
      "get": {
        "tags": [
          "QR Codes"
        ],
        "summary": "Get All QRs Updated After Time",
        "description": "Retrieve all QR codes (across teams) updated after a specific timestamp",
        "operationId": "getAllQrsFromTime",
        "parameters": [
          {
            "name": "fromTime",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Unix timestamp in milliseconds"
          }
        ],
        "responses": {
          "200": {
            "description": "List of QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Qr"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/qr-templates-api": {
      "get": {
        "tags": [
          "QR Code Design Templates"
        ],
        "summary": "Get QR Code Design Templates for Team",
        "description": "Retrieve all QR code design templates available for a team",
        "operationId": "getQrTemplatesByTeam",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          }
        ],
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X GET https://api.qrtrac.com/api/qr-templates-api \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\"\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nurl = \"https://api.qrtrac.com/api/qr-templates-api\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\"\n}\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst url = 'https://api.qrtrac.com/api/qr-templates-api';\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>'\n};\n\naxios.get(url, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/qr-templates-api\"))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar response = await client.GetAsync(\"https://api.qrtrac.com/api/qr-templates-api\");\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "responses": {
          "200": {
            "description": "List of QR code design templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Template ID"
                          },
                          "name": {
                            "type": "string",
                            "description": "Template name"
                          },
                          "description": {
                            "type": "string",
                            "description": "Template description"
                          },
                          "previewUrl": {
                            "type": "string",
                            "description": "Template preview image URL"
                          },
                          "createdAt": {
                            "type": "integer",
                            "description": "Creation timestamp in milliseconds"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/analytics-api/detailed/{id}": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get QR Code Scan Analytics",
        "description": "Retrieve detailed scan analytics data for a specific QR code by its ID.\n\n**Required Headers:**\n- `x-request-team-id: <team_id>` - Team ID for the request context\n- `x-request-client-id: <client_id>` - Client ID from API menu\n- `x-request-client-secret: <client_secret>` - Client Secret from API menu\n\n**Note:** For total scan counts, use the `/analytics-api/overviews` endpoint.\n",
        "operationId": "getQrAnalytics",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "QR code ID (qrId) to get scan data for"
          }
        ],
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X GET https://api.qrtrac.com/api/analytics-api/detailed/{qrId} \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\"\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nqr_id = \"<qr_id>\"\nurl = f\"https://api.qrtrac.com/api/analytics-api/detailed/{qr_id}\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\"\n}\n\nresponse = requests.get(url, headers=headers)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst qrId = '<qr_id>';\nconst url = `https://api.qrtrac.com/api/analytics-api/detailed/${qrId}`;\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>'\n};\n\naxios.get(url, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nString qrId = \"<qr_id>\";\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/analytics-api/detailed/\" + qrId))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar qrId = \"<qr_id>\";\nvar response = await client.GetAsync($\"https://api.qrtrac.com/api/analytics-api/detailed/{qrId}\");\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Array of scan events for the QR code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanEventsResponse"
                },
                "examples": {
                  "scanEventsResponse": {
                    "summary": "Scan Events Response",
                    "description": "Example response showing array of scan events",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "qrId": "dgj",
                          "scanTime": 1768412112787,
                          "device": "mobile",
                          "browser": "Chrome",
                          "os": "iOS",
                          "country": "US",
                          "city": "San Francisco",
                          "ipAddress": "192.168.1.1",
                          "referrer": "https://example.com"
                        },
                        {
                          "qrId": "dgj",
                          "scanTime": 1768412000000,
                          "device": "desktop",
                          "browser": "Safari",
                          "os": "macOS",
                          "country": "US",
                          "city": "New York",
                          "ipAddress": "192.168.1.2",
                          "referrer": ""
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid QR ID or unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/analytics-api/detailed/all": {
      "post": {
        "tags": [
          "Analytics"
        ],
        "summary": "Bulk fetch QR Code Analytics",
        "description": "Retrieve scan analytics data for multiple QR codes within a specified time range.\n\n**Required Headers:**\n- `x-request-team-id: <team_id>` - Team ID for the request context\n- `x-request-client-id: <client_id>` - Client ID from API menu\n- `x-request-client-secret: <client_secret>` - Client Secret from API menu\n\n**Time Format:**\n- `startTime` and `endTime` must be provided as epoch timestamps in milliseconds.\n\n**Note:** For total scan counts, use the `/analytics-api/overviews` endpoint.\n",
        "operationId": "getBulkQrAnalytics",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkAnalyticsRequest"
              },
              "examples": {
                "bulkAnalytics": {
                  "summary": "Get Analytics for Multiple QR Codes",
                  "description": "Fetch scan data for multiple QR codes between two timestamps",
                  "value": {
                    "qrIds": [
                      "qr_abc123",
                      "qr_def456",
                      "qr_ghi789"
                    ],
                    "startTime": 1704067200000,
                    "endTime": 1735689600000
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X POST https://api.qrtrac.com/api/analytics-api/detailed/all \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"qrIds\": [\"qr_abc123\", \"qr_def456\"],\n    \"startTime\": 1704067200000,\n    \"endTime\": 1735689600000\n  }'\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nurl = \"https://api.qrtrac.com/api/analytics-api/detailed/all\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\",\n    \"Content-Type\": \"application/json\"\n}\ndata = {\n    \"qrIds\": [\"qr_abc123\", \"qr_def456\"],\n    \"startTime\": 1704067200000,\n    \"endTime\": 1735689600000\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst url = 'https://api.qrtrac.com/api/analytics-api/detailed/all';\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>',\n    'Content-Type': 'application/json'\n};\nconst data = {\n    qrIds: ['qr_abc123', 'qr_def456'],\n    startTime: 1704067200000,\n    endTime: 1735689600000\n};\n\naxios.post(url, data, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nString json = \"{\\\"qrIds\\\":[\\\"qr_abc123\\\",\\\"qr_def456\\\"],\\\"startTime\\\":1704067200000,\\\"endTime\\\":1735689600000}\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/analytics-api/detailed/all\"))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(HttpRequest.BodyPublishers.ofString(json))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar data = new {\n    qrIds = new[] { \"qr_abc123\", \"qr_def456\" },\n    startTime = 1704067200000L,\n    endTime = 1735689600000L\n};\n\nvar json = JsonConvert.SerializeObject(data);\nvar content = new StringContent(json, Encoding.UTF8, \"application/json\");\n\nvar response = await client.PostAsync(\"https://api.qrtrac.com/api/analytics-api/detailed/all\", content);\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Array of scan events for the requested QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanEventsResponse"
                },
                "examples": {
                  "bulkScanEventsResponse": {
                    "summary": "Bulk Scan Events Response",
                    "description": "Example response showing array of scan events for multiple QR codes",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "qrId": "qr_abc123",
                          "scanTime": 1768412112787,
                          "device": "mobile",
                          "browser": "Chrome",
                          "os": "iOS",
                          "country": "US",
                          "city": "San Francisco",
                          "ipAddress": "192.168.1.1",
                          "referrer": "https://example.com"
                        },
                        {
                          "qrId": "qr_abc123",
                          "scanTime": 1768412000000,
                          "device": "desktop",
                          "browser": "Safari",
                          "os": "macOS",
                          "country": "US",
                          "city": "New York",
                          "ipAddress": "192.168.1.2",
                          "referrer": ""
                        },
                        {
                          "qrId": "qr_def456",
                          "scanTime": 1768411900000,
                          "device": "mobile",
                          "browser": "Firefox",
                          "os": "Android",
                          "country": "UK",
                          "city": "London",
                          "ipAddress": "192.168.1.3",
                          "referrer": "https://example.org"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (missing required fields or invalid time range)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/analytics-api/overviews": {
      "post": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get Total Scans Overview",
        "description": "Retrieve total scan counts for multiple QR codes. This endpoint returns aggregate scan data without requiring time range parameters.\n\n**Required Headers:**\n- `x-request-team-id: <team_id>` - Team ID for the request context\n- `x-request-client-id: <client_id>` - Client ID from API menu\n- `x-request-client-secret: <client_secret>` - Client Secret from API menu\n\n**Note:** Unique scans are computed client-side from scan data and are not provided via API endpoints.\n",
        "operationId": "getTotalScansOverview",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverviewAnalyticsRequest"
              },
              "examples": {
                "overviewAnalytics": {
                  "summary": "Get Total Scans for Multiple QR Codes",
                  "description": "Fetch total scan counts for multiple QR codes",
                  "value": {
                    "qrIds": [
                      "qr_abc123",
                      "qr_def456",
                      "qr_ghi789"
                    ]
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "curl",
            "source": "curl -X POST https://api.qrtrac.com/api/analytics-api/overviews \\\n  -H \"x-request-team-id: <team_id>\" \\\n  -H \"x-request-client-id: <client_id>\" \\\n  -H \"x-request-client-secret: <client_secret>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"qrIds\": [\"qr_abc123\", \"qr_def456\"]\n  }'\n"
          },
          {
            "lang": "Python",
            "source": "import requests\n\nurl = \"https://api.qrtrac.com/api/analytics-api/overviews\"\nheaders = {\n    \"x-request-team-id\": \"<team_id>\",\n    \"x-request-client-id\": \"<client_id>\",\n    \"x-request-client-secret\": \"<client_secret>\",\n    \"Content-Type\": \"application/json\"\n}\ndata = {\n    \"qrIds\": [\"qr_abc123\", \"qr_def456\"]\n}\n\nresponse = requests.post(url, headers=headers, json=data)\nprint(response.json())\n"
          },
          {
            "lang": "Node.js",
            "source": "const axios = require('axios');\n\nconst url = 'https://api.qrtrac.com/api/analytics-api/overviews';\nconst headers = {\n    'x-request-team-id': '<team_id>',\n    'x-request-client-id': '<client_id>',\n    'x-request-client-secret': '<client_secret>',\n    'Content-Type': 'application/json'\n};\nconst data = {\n    qrIds: ['qr_abc123', 'qr_def456']\n};\n\naxios.post(url, data, { headers })\n    .then(response => console.log(response.data))\n    .catch(error => console.error(error));\n"
          },
          {
            "lang": "Java",
            "source": "import java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\nimport java.net.URI;\nimport java.time.Duration;\n\nHttpClient client = HttpClient.newBuilder()\n    .connectTimeout(Duration.ofSeconds(10))\n    .build();\n\nString json = \"{\\\"qrIds\\\":[\\\"qr_abc123\\\",\\\"qr_def456\\\"]}\";\n\nHttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.qrtrac.com/api/analytics-api/overviews\"))\n    .header(\"x-request-team-id\", \"<team_id>\")\n    .header(\"x-request-client-id\", \"<client_id>\")\n    .header(\"x-request-client-secret\", \"<client_secret>\")\n    .header(\"Content-Type\", \"application/json\")\n    .POST(HttpRequest.BodyPublishers.ofString(json))\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n"
          },
          {
            "lang": "C#",
            "source": "using System;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\n\nvar client = new HttpClient();\nclient.DefaultRequestHeaders.Add(\"x-request-team-id\", \"<team_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-id\", \"<client_id>\");\nclient.DefaultRequestHeaders.Add(\"x-request-client-secret\", \"<client_secret>\");\n\nvar data = new {\n    qrIds = new[] { \"qr_abc123\", \"qr_def456\" }\n};\n\nvar json = JsonConvert.SerializeObject(data);\nvar content = new StringContent(json, Encoding.UTF8, \"application/json\");\n\nvar response = await client.PostAsync(\"https://api.qrtrac.com/api/analytics-api/overviews\", content);\nvar result = await response.Content.ReadAsStringAsync();\nConsole.WriteLine(result);\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Total scans overview for requested QR codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewAnalyticsResponse"
                },
                "examples": {
                  "overviewResponse": {
                    "summary": "Overview Analytics Response",
                    "description": "Example response showing scan and lead analytics for QR codes",
                    "value": {
                      "success": true,
                      "data": [
                        {
                          "id": "dgj",
                          "leadsTodayCount": 0,
                          "totalLeadsCount": 0,
                          "createdAt": 1766771093365,
                          "leadsUpdatedAt": 1766771093365,
                          "leadsTodayDate": "12/26/2025",
                          "leadsYesterdayCount": 0,
                          "yesterdayScans": 1,
                          "todayDate": "1/14/2026",
                          "totalScans": 9,
                          "todayScans": 3,
                          "updatedAt": 1768412112787
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (missing required fields)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Get All Teams",
        "description": "Retrieve all teams the authenticated user belongs to",
        "operationId": "getAllTeams",
        "responses": {
          "200": {
            "description": "List of teams with members",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Create Team",
        "description": "Create a new team within the organization",
        "operationId": "createTeam",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Team name",
                    "example": "Sales & Marketing"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid team name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Get Team by ID",
        "description": "Retrieve a specific team with its members",
        "operationId": "getTeamById",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team details with members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Team not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Teams"
        ],
        "summary": "Update Team",
        "description": "Update team name (requires Admin or Owner role)",
        "operationId": "updateTeam",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New team name"
                  }
                }
              },
              "examples": {
                "updateTeam": {
                  "summary": "Rename Team",
                  "value": {
                    "name": "Sales & Marketing - Q4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid team name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/domainPreferences": {
      "put": {
        "tags": [
          "Teams"
        ],
        "summary": "Update Domain Preferences",
        "description": "Update team's default domain and allowed domains",
        "operationId": "updateDomainPreferences",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "defaultDomain",
                  "domains"
                ],
                "properties": {
                  "defaultDomain": {
                    "type": "string",
                    "description": "Default domain for QR codes",
                    "example": "qr.acmecorp.com"
                  },
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of allowed domains"
                  }
                }
              },
              "examples": {
                "updateDomains": {
                  "summary": "Configure Team Domains",
                  "value": {
                    "defaultDomain": "qr.acmecorp.com",
                    "domains": [
                      "qr.acmecorp.com",
                      "campaign.acmecorp.com",
                      "promo.acmecorp.com"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain preferences updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members": {
      "put": {
        "tags": [
          "Team Members"
        ],
        "summary": "Add Team Member",
        "description": "Add a new member to a team or update existing member's role.\nIf the user doesn't exist, creates a new user and sends an invite email.\n",
        "operationId": "addTeamMember",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "role"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Member's full name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Member's email address"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "editor",
                      "viewer"
                    ],
                    "description": "Member's role (owner cannot be assigned)"
                  }
                }
              },
              "examples": {
                "addMember": {
                  "summary": "Add Team Member",
                  "value": {
                    "name": "Sarah Johnson",
                    "email": "sarah.johnson@acmecorp.com",
                    "role": "editor"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Member added/updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid member details or user from different org",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/members/bulk": {
      "post": {
        "tags": [
          "Team Members"
        ],
        "summary": "Bulk Add Member to Teams",
        "description": "Add a member to multiple teams at once",
        "operationId": "bulkAddMember",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "teams"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Member's full name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "teams": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "teamId",
                        "role"
                      ],
                      "properties": {
                        "teamId": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "admin",
                            "editor",
                            "viewer"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "examples": {
                "bulkAddMember": {
                  "summary": "Add Member to Multiple Teams",
                  "value": {
                    "name": "Michael Chen",
                    "email": "michael.chen@acmecorp.com",
                    "teams": [
                      {
                        "teamId": "team_abc123",
                        "role": "admin"
                      },
                      {
                        "teamId": "team_def456",
                        "role": "editor"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Member added to teams",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members/{email}/activate": {
      "put": {
        "tags": [
          "Team Members"
        ],
        "summary": "Activate Team Member",
        "description": "Reactivate a paused member's access to the team",
        "operationId": "activateMember",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Member activated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Member not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members/{email}/pause": {
      "put": {
        "tags": [
          "Team Members"
        ],
        "summary": "Pause Team Member",
        "description": "Temporarily pause a member's access to the team",
        "operationId": "pauseMember",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Member paused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Cannot pause (member must have at least one active team)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members/{email}/changeRole": {
      "put": {
        "tags": [
          "Team Members"
        ],
        "summary": "Change Member Role",
        "description": "Update a member's role in the team",
        "operationId": "changeMemberRole",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "editor",
                      "viewer"
                    ],
                    "description": "New role (owner cannot be assigned)"
                  }
                }
              },
              "examples": {
                "changeRole": {
                  "summary": "Promote Member to Admin",
                  "value": {
                    "role": "admin"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Role updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid role or member not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members/{email}": {
      "delete": {
        "tags": [
          "Team Members"
        ],
        "summary": "Remove Member from Team",
        "description": "Remove a member from a specific team (member retains access to other teams)",
        "operationId": "removeMemberFromTeam",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Member removed from team",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Cannot remove (owner or last team)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/{id}/members/{email}/delete": {
      "delete": {
        "tags": [
          "Team Members"
        ],
        "summary": "Delete Member Completely",
        "description": "Permanently delete a member from the organization.\n**Requires Owner role.** Cannot delete users with Owner role.\n",
        "operationId": "deleteMember",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          },
          {
            "$ref": "#/components/parameters/ClientId"
          },
          {
            "$ref": "#/components/parameters/ClientSecret"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Member deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string",
                      "example": "Member deleted successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Cannot delete (owner or not found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized (only owners can delete)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/teams-api/resend/invite/{email}": {
      "get": {
        "tags": [
          "Team Members"
        ],
        "summary": "Resend Invite Email",
        "description": "Resend the invitation email to a pending member",
        "operationId": "resendInvite",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invite sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid member or max resend limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "TeamId": {
        "name": "x-request-team-id",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Team ID for the request context"
      },
      "ClientId": {
        "name": "x-request-client-id",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Client ID obtained from app.qrtrac.com/pages/api. Owner/Admin role and Business Plus plan or higher required."
      },
      "ClientSecret": {
        "name": "x-request-client-secret",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Client Secret obtained from app.qrtrac.com/pages/api. Owner/Admin role and Business Plus plan or higher required."
      }
    },
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "isEnterpriseUser": {
            "type": "boolean"
          },
          "organisation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "currentPlan": {
                "type": "object"
              }
            }
          },
          "teams": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "teamId": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              }
            }
          },
          "team": {
            "type": "object",
            "description": "Current team details"
          }
        }
      },
      "CreateQrRequest": {
        "type": "object",
        "required": [
          "qrType"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "QR code name (defaults to \"Untitled\")",
            "example": "Product Launch Landing Page"
          },
          "qrType": {
            "type": "string",
            "description": "Type of QR code",
            "enum": [
              "WEB",
              "PDF",
              "VCARD",
              "MULTI_LOCALE",
              "APP_DOWNLOAD",
              "LINK_LIST",
              "SHORT_LINK",
              "COUPON_CODE",
              "IMAGE_GALLERY",
              "SOCIAL_BIO",
              "VIDEO_PREVIEW",
              "RESTAURANT_MENU"
            ],
            "example": "WEB"
          },
          "displayId": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\-_.~%]+$",
            "description": "Custom short URL ID (alphanumeric, hyphens, underscores)",
            "example": "product-launch-2024"
          },
          "qrRedirectUrl": {
            "type": "string",
            "format": "uri",
            "description": "Redirect URL (required for web type)",
            "example": "https://acmecorp.com/product-launch"
          },
          "metadata": {
            "type": "object",
            "description": "Custom metadata"
          },
          "settings": {
            "type": "object",
            "description": "QR code settings"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "folderId": {
            "type": "string",
            "description": "Folder ID to place the QR code in (Coming Soon)"
          },
          "folderIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Folder hierarchy (Coming Soon)"
          },
          "templateId": {
            "type": "string",
            "description": "Template ID for QR code design. Can be found at [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). If not provided, default template is used.",
            "example": "qwrIYX8iLAuDHSBCiKZl"
          },
          "baseUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://.*/$",
            "description": "Custom domain base URL for QR codes. Must end with '/'. Prerequisite: Custom domain must be configured in the application. Can be found at [app.qrtrac.com/pages/api](https://app.qrtrac.com/pages/api). Example: If main domain is `qrtrac.com` and custom domain subdomain `qr.qrtrac.com` is configured, the baseUrl would be `https://qr.qrtrac.com/`. If not provided, default domain is used.\n",
            "example": "https://qr.qrtrac.com/"
          }
        }
      },
      "UpdateQrRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CreateQrRequest"
          }
        ],
        "description": "QR code update payload"
      },
      "Qr": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "qrType": {
            "type": "string"
          },
          "teamId": {
            "type": "string"
          },
          "orgId": {
            "type": "string"
          },
          "qrRedirectUrl": {
            "type": "string"
          },
          "qrImageUrl": {
            "type": "string"
          },
          "qrImageHash": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "settings": {
            "type": "object"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "folderId": {
            "type": "string",
            "description": "Folder ID (Coming Soon)"
          },
          "folderIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Folder hierarchy (Coming Soon)"
          },
          "batchId": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "expiryDate": {
            "type": "integer",
            "description": "Expiry timestamp in milliseconds"
          },
          "createdAt": {
            "type": "integer",
            "description": "Creation timestamp in milliseconds"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedAt": {
            "type": "integer",
            "description": "Last update timestamp in milliseconds"
          },
          "updatedBy": {
            "type": "string"
          }
        }
      },
      "QrResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Qr"
          }
        }
      },
      "PaginatedQrResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "qrs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Qr"
                }
              },
              "totalCount": {
                "type": "integer",
                "description": "Total number of matching QR codes"
              },
              "page": {
                "type": "integer",
                "description": "Current page number"
              },
              "limit": {
                "type": "integer",
                "description": "Items per page"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string",
            "example": "Invalid credentials!"
          }
        }
      },
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "orgId": {
            "type": "string"
          },
          "defaultDomain": {
            "type": "string"
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamMember"
            }
          },
          "createdAt": {
            "type": "integer",
            "description": "Creation timestamp in milliseconds"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedAt": {
            "type": "integer",
            "description": "Last update timestamp in milliseconds"
          },
          "updatedBy": {
            "type": "string"
          }
        }
      },
      "TeamMember": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "editor",
              "viewer"
            ]
          }
        }
      },
      "TeamResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Team"
          }
        }
      },
      "BulkAnalyticsRequest": {
        "type": "object",
        "required": [
          "qrIds",
          "startTime",
          "endTime"
        ],
        "properties": {
          "qrIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of QR code IDs to fetch analytics for",
            "example": [
              "qr_abc123",
              "qr_def456"
            ]
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "description": "Start time in epoch milliseconds",
            "example": 1704067200000
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "description": "End time in epoch milliseconds",
            "example": 1735689600000
          }
        }
      },
      "ScanData": {
        "type": "object",
        "description": "Individual scan event data",
        "properties": {
          "qrId": {
            "type": "string",
            "description": "QR code ID"
          },
          "scanTime": {
            "type": "integer",
            "format": "int64",
            "description": "Scan timestamp in epoch milliseconds"
          },
          "device": {
            "type": "string",
            "description": "Device type (e.g., \"mobile\", \"desktop\", \"tablet\")"
          },
          "browser": {
            "type": "string",
            "description": "Browser name"
          },
          "os": {
            "type": "string",
            "description": "Operating system"
          },
          "country": {
            "type": "string",
            "description": "Country code"
          },
          "city": {
            "type": "string",
            "description": "City name"
          },
          "ipAddress": {
            "type": "string",
            "description": "IP address (may be anonymized)"
          },
          "referrer": {
            "type": "string",
            "description": "Referrer URL"
          }
        }
      },
      "AnalyticsData": {
        "type": "object",
        "description": "Analytics data for a single QR code",
        "properties": {
          "qrId": {
            "type": "string",
            "description": "QR code ID"
          },
          "scans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanData"
            },
            "description": "Array of individual scan events"
          },
          "timeRange": {
            "type": "object",
            "properties": {
              "startTime": {
                "type": "integer",
                "format": "int64",
                "description": "Start time in epoch milliseconds"
              },
              "endTime": {
                "type": "integer",
                "format": "int64",
                "description": "End time in epoch milliseconds"
              }
            }
          }
        }
      },
      "ScanEventsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanData"
            },
            "description": "Array of scan events for the QR code"
          }
        }
      },
      "AnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ScanData"
          }
        }
      },
      "BulkAnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsData"
            },
            "description": "Array of analytics data for each requested QR code"
          }
        }
      },
      "OverviewAnalyticsRequest": {
        "type": "object",
        "required": [
          "qrIds"
        ],
        "properties": {
          "qrIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of QR code IDs to fetch total scans for",
            "example": [
              "qr_abc123",
              "qr_def456"
            ]
          }
        }
      },
      "OverviewAnalyticsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "QR code ID"
                },
                "totalScans": {
                  "type": "integer",
                  "description": "Total number of scans for this QR code"
                },
                "todayScans": {
                  "type": "integer",
                  "description": "Number of scans today"
                },
                "yesterdayScans": {
                  "type": "integer",
                  "description": "Number of scans yesterday"
                },
                "totalLeadsCount": {
                  "type": "integer",
                  "description": "Total number of leads"
                },
                "leadsTodayCount": {
                  "type": "integer",
                  "description": "Number of leads today"
                },
                "leadsYesterdayCount": {
                  "type": "integer",
                  "description": "Number of leads yesterday"
                },
                "createdAt": {
                  "type": "integer",
                  "format": "int64",
                  "description": "QR code creation timestamp in epoch milliseconds"
                },
                "updatedAt": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Last scanned date and time in epoch milliseconds"
                },
                "leadsUpdatedAt": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Last leads update timestamp in epoch milliseconds"
                },
                "todayDate": {
                  "type": "string",
                  "description": "Today's date in MM/DD/YYYY format"
                },
                "leadsTodayDate": {
                  "type": "string",
                  "description": "Leads today date in MM/DD/YYYY format"
                }
              }
            },
            "description": "Array of overview analytics data for each requested QR code"
          }
        }
      }
    }
  }
}
