{
    "openapi": "3.1.0",
    "info": {
        "title": "QRflick API",
        "version": "1.5.0",
        "description": "Create and manage dynamic QR codes, render static QR codes, read scan analytics, digital cards and leads, and manage webhooks. Authenticate with an API key from Settings \u2192 Developers: `Authorization: Bearer api_\u2026`. Read-only keys can call every GET endpoint and the static renderer."
    },
    "servers": [
        {
            "url": "https://qrflick.com/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Account"
        },
        {
            "name": "QR codes"
        },
        {
            "name": "Static QR codes"
        },
        {
            "name": "Design"
        },
        {
            "name": "Organization"
        },
        {
            "name": "Cards"
        },
        {
            "name": "Webhooks"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "tags": [
                    "Account"
                ],
                "operationId": "getAccount",
                "summary": "The account, plan, key and limits",
                "responses": {
                    "200": {
                        "description": "Account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/qr-types": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "listQrTypes",
                "summary": "Current types, nested validation rules and payload examples",
                "responses": {
                    "200": {
                        "description": "Type catalogue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/QrType"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/qr-codes/{id}/poll-results": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "getPollResults",
                "summary": "Private poll totals without voter identities",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Results; percentages are shares of all selected options",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/PollResults"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/qr-codes/{id}/form-responses": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "listFormResponses",
                "summary": "Private form answers, newest first (read-only keys accepted)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        },
                        "description": "Only responses strictly newer than this timestamp"
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 80
                        },
                        "description": "Placement slug; - selects the main form; omitted selects every source"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of responses; contains personal data, never fingerprints",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/FormResponse"
                                            }
                                        },
                                        "links": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    },
                    "409": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/design-options": {
            "get": {
                "tags": [
                    "Design"
                ],
                "operationId": "getDesignOptions",
                "summary": "Every value the design object accepts, with labels and plan limits",
                "responses": {
                    "200": {
                        "description": "Design catalogue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/folders": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "operationId": "listFolders",
                "summary": "Folders with their number of codes",
                "responses": {
                    "200": {
                        "description": "Folders",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "qr_codes": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/tags": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "operationId": "listTags",
                "summary": "Tag names in use",
                "responses": {
                    "200": {
                        "description": "Tags",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/qr-codes": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "listQrCodes",
                "summary": "List dynamic QR codes, newest first",
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "Part of the name"
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "url",
                                "whatsapp",
                                "phone",
                                "email",
                                "sms",
                                "maps",
                                "google_review",
                                "link_bio",
                                "menu",
                                "app_store",
                                "event",
                                "coupon",
                                "social",
                                "file",
                                "poll",
                                "form",
                                "card",
                                "profile",
                                "restaurant_menu"
                            ]
                        }
                    },
                    {
                        "name": "folder",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "archived",
                        "in": "query",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        },
                        "description": "Include archived codes"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of codes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/QrCode"
                                            }
                                        },
                                        "links": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            },
            "post": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "createQrCode",
                "summary": "Create a dynamic QR code (needs a read & write key)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Retry-safe key: the same key and body within 24 hours returns the first response instead of creating a duplicate."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "name",
                                    "payload"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "url",
                                            "whatsapp",
                                            "phone",
                                            "email",
                                            "sms",
                                            "maps",
                                            "google_review",
                                            "link_bio",
                                            "menu",
                                            "app_store",
                                            "event",
                                            "coupon",
                                            "social",
                                            "file",
                                            "poll",
                                            "form"
                                        ]
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120
                                    },
                                    "payload": {
                                        "type": "object",
                                        "description": "Content for the type. GET /qr-types lists all nested fields and rules. Includes polls, forms, event agendas and coupon terms. payload.design styles the hosted page; top-level design styles the QR image.",
                                        "examples": [
                                            {
                                                "title": "Which workshop should we run?",
                                                "options": [
                                                    {
                                                        "label": "Photography"
                                                    },
                                                    {
                                                        "label": "Design"
                                                    }
                                                ],
                                                "choice": "single",
                                                "vote_limit": "person",
                                                "results": "after_vote",
                                                "design": {
                                                    "preset": "sage",
                                                    "layout": "rounded",
                                                    "brand_name": "Studio"
                                                }
                                            },
                                            {
                                                "title": "Request a quote",
                                                "fields": [
                                                    {
                                                        "type": "email",
                                                        "label": "Your email",
                                                        "required": true
                                                    },
                                                    {
                                                        "type": "textarea",
                                                        "label": "What do you need?"
                                                    }
                                                ],
                                                "controller": "Example Studio",
                                                "privacy_url": "https://example.com/privacy",
                                                "retention_days": 365,
                                                "thank_you": "Thank you. We will be in touch.",
                                                "design": {
                                                    "preset": "ocean",
                                                    "layout": "editorial"
                                                }
                                            },
                                            {
                                                "title": "Studio open day",
                                                "starts_at": "2030-06-15T10:00",
                                                "ends_at": "2030-06-15T17:00",
                                                "timezone": "Europe/Madrid",
                                                "organizer": "Example Studio",
                                                "venue_name": "Main studio",
                                                "agenda": [
                                                    {
                                                        "time": "10:00",
                                                        "title": "Welcome",
                                                        "speaker": "Studio team"
                                                    }
                                                ],
                                                "design": {
                                                    "preset": "sage"
                                                }
                                            },
                                            {
                                                "title": "Welcome offer",
                                                "code": "WELCOME10",
                                                "offer": "10% off",
                                                "terms": "One use per customer.",
                                                "design": {
                                                    "preset": "clay"
                                                }
                                            }
                                        ]
                                    },
                                    "design": {
                                        "$ref": "#/components/schemas/Design"
                                    },
                                    "domain": {
                                        "type": "string",
                                        "description": "A platform short domain this workspace may use"
                                    },
                                    "folder": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "string",
                                            "maxLength": 50
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/QrCode"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "203": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "204": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "205": {
                        "description": "The platform API switch is off"
                    },
                    "206": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "409": {
                        "description": "A request with the same Idempotency-Key is still running"
                    }
                }
            }
        },
        "/qr-codes/{id}": {
            "parameters": [
                {
                    "name": "id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    },
                    "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                }
            ],
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "getQrCode",
                "summary": "One code, with its saved design",
                "responses": {
                    "200": {
                        "description": "The code",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/QrCode"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            },
            "patch": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "updateQrCode",
                "summary": "Change the destination, name, design, folder, tags, pause or archive state",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "url",
                                            "whatsapp",
                                            "phone",
                                            "email",
                                            "sms",
                                            "maps",
                                            "google_review",
                                            "link_bio",
                                            "menu",
                                            "app_store",
                                            "event",
                                            "coupon",
                                            "social",
                                            "file",
                                            "poll",
                                            "form"
                                        ]
                                    },
                                    "payload": {
                                        "type": "object",
                                        "description": "Replaces the complete payload. Read first and preserve all required fields and stable poll option/form field ids. Omitted payload is unchanged."
                                    },
                                    "design": {
                                        "$ref": "#/components/schemas/Design"
                                    },
                                    "paused": {
                                        "type": "boolean"
                                    },
                                    "archived": {
                                        "type": "boolean"
                                    },
                                    "folder": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/QrCode"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    },
                    "409": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            },
            "delete": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "deleteQrCode",
                "summary": "Delete a code (its short link stays reserved)",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/qr-codes/{id}/image": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "getQrCodeImage",
                "summary": "Download the code as PNG, SVG, PDF or EPS",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "png",
                                "svg",
                                "pdf",
                                "eps"
                            ],
                            "default": "png"
                        }
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 128,
                            "maximum": 4096
                        },
                        "description": "PNG width in pixels"
                    },
                    {
                        "name": "mm",
                        "in": "query",
                        "schema": {
                            "type": "number",
                            "minimum": 10,
                            "maximum": 1000
                        },
                        "description": "Printed width for PDF/EPS"
                    },
                    {
                        "name": "dpi",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                72,
                                150,
                                300,
                                600
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file",
                        "content": {
                            "image/png": [],
                            "image/svg+xml": [],
                            "application/pdf": [],
                            "application/postscript": []
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    },
                    "409": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/qr-codes/{id}/scans": {
            "get": {
                "tags": [
                    "QR codes"
                ],
                "operationId": "getQrCodeScans",
                "summary": "Scans per day and breakdowns (country, city, device, OS, browser, language, referrer, variant)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scan report",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    },
                    "409": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/static-qr-codes": {
            "post": {
                "tags": [
                    "Static QR codes"
                ],
                "operationId": "renderStaticQrCode",
                "summary": "Render a static QR code (content inside the image; nothing is stored)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "fields"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "url",
                                            "text",
                                            "email",
                                            "phone",
                                            "sms",
                                            "whatsapp",
                                            "wifi",
                                            "vcard",
                                            "location",
                                            "event",
                                            "bitcoin",
                                            "paypal"
                                        ]
                                    },
                                    "fields": {
                                        "type": "object",
                                        "description": "Fields per type: url: url; text: text; email: email, subject, body; phone: phone; sms: phone, message; whatsapp: phone, message; wifi: ssid, password, security, hidden; vcard: first_name, last_name, organization, job_title, phone_mobile, phone_work, email, website, street, city, region, postcode, country, note; location: address; event: title, location, start, end, description; bitcoin: btc_address, btc_amount, label, message; paypal: username, amount, currency.",
                                        "additionalProperties": {
                                            "type": [
                                                "string",
                                                "number",
                                                "boolean",
                                                "null"
                                            ]
                                        }
                                    },
                                    "design": {
                                        "$ref": "#/components/schemas/Design"
                                    },
                                    "format": {
                                        "type": "string",
                                        "enum": [
                                            "svg",
                                            "png",
                                            "json"
                                        ],
                                        "default": "svg"
                                    },
                                    "size": {
                                        "type": "integer",
                                        "minimum": 128,
                                        "maximum": 4096,
                                        "default": 1024
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The image, or JSON with the encoded content, warnings and SVG",
                        "content": {
                            "image/svg+xml": [],
                            "image/png": [],
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    },
                    "205": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/uploads/logos": {
            "post": {
                "tags": [
                    "Design"
                ],
                "operationId": "uploadLogo",
                "summary": "Upload a logo (PNG, JPG, WebP or SVG, max 5 MB) for design.logo_upload_id; multipart uploads do not support Idempotency-Key",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "object": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "203": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "204": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "205": {
                        "description": "The platform API switch is off"
                    },
                    "206": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/cards": {
            "get": {
                "tags": [
                    "Cards"
                ],
                "operationId": "listCards",
                "summary": "Digital business cards",
                "responses": {
                    "200": {
                        "description": "Cards",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/cards/{id}": {
            "get": {
                "tags": [
                    "Cards"
                ],
                "operationId": "getCard",
                "summary": "One card",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Card",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/cards/{id}/leads": {
            "get": {
                "tags": [
                    "Cards"
                ],
                "operationId": "listCardLeads",
                "summary": "Contacts collected by a card",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Leads",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "listWebhooks",
                "summary": "Webhook endpoints",
                "responses": {
                    "200": {
                        "description": "Endpoints",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "202": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "203": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "204": {
                        "description": "The platform API switch is off"
                    }
                }
            },
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "createWebhook",
                "summary": "Register an https endpoint for events",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        },
                        "description": "Retry-safe key: the same key and body within 24 hours returns the first response instead of creating a duplicate."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "url",
                                    "events"
                                ],
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "qr_code.created",
                                                "qr_code.updated",
                                                "qr_code.deleted",
                                                "scan.created",
                                                "lead.created"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created; the signing secret is shown once",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "202": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "203": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "204": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "205": {
                        "description": "The platform API switch is off"
                    },
                    "206": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/webhooks/{id}": {
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "operationId": "deleteWebhook",
                "summary": "Remove an endpoint",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Public id of the record, e.g. \"qr_8Fh2kL\"."
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Removed"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "405": {
                        "$ref": "#/components/responses/Unauthenticated"
                    },
                    "406": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "407": {
                        "$ref": "#/components/responses/TooManyRequests"
                    },
                    "408": {
                        "description": "The platform API switch is off"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key from Settings \u2192 Developers (starts with api_)."
            }
        },
        "responses": {
            "Unauthenticated": {
                "description": "Missing, wrong or revoked key",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Read-only key, plan without API access, or not allowed",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "No such record in this account",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "Invalid input or over a plan limit",
                "content": {
                    "application/json": {
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/components/schemas/Error"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "errors": {
                                            "type": "object",
                                            "additionalProperties": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            },
            "TooManyRequests": {
                "description": "Rate limit reached; wait for the Retry-After seconds",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "QrType": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "enum": [
                            "url",
                            "whatsapp",
                            "phone",
                            "email",
                            "sms",
                            "maps",
                            "google_review",
                            "link_bio",
                            "menu",
                            "app_store",
                            "event",
                            "coupon",
                            "social",
                            "file",
                            "poll",
                            "form",
                            "card",
                            "profile",
                            "restaurant_menu"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "creatable": {
                        "type": "boolean"
                    },
                    "hosted": {
                        "type": "boolean"
                    },
                    "payload_fields": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "required_fields": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "validation_rules": {
                        "type": "object",
                        "description": "Server validation constraints: dotted paths are nested fields; * means each array item. Includes required/nullable, string/array/integer/boolean, min/max, in, date_format and regex. Additional business and plan checks apply.",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "example": {
                        "type": [
                            "object",
                            "null"
                        ]
                    }
                }
            },
            "PollResults": {
                "type": "object",
                "properties": {
                    "object": {
                        "type": "string",
                        "const": "poll_results"
                    },
                    "qr_code_id": {
                        "type": "string"
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "upcoming",
                            "open",
                            "closed"
                        ]
                    },
                    "total": {
                        "type": "integer",
                        "description": "Number of ballots, not individual option picks"
                    },
                    "options": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "image_upload_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "votes": {
                                    "type": "integer"
                                },
                                "percent": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "FormResponse": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "object": {
                        "type": "string",
                        "const": "form_response"
                    },
                    "answers": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "label": {
                                    "type": "string"
                                },
                                "value": {
                                    "oneOf": [
                                        {
                                            "type": "string"
                                        },
                                        {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "consent_text": {
                        "type": "string"
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "utm": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                }
            },
            "Design": {
                "type": "object",
                "description": "Every field is optional; omitted fields keep their default. GET /design-options lists the values.",
                "properties": {
                    "foreground": {
                        "type": "string",
                        "pattern": "^#[0-9A-Fa-f]{6}$"
                    },
                    "background": {
                        "type": "string",
                        "pattern": "^#[0-9A-Fa-f]{6}$"
                    },
                    "transparent": {
                        "type": "boolean"
                    },
                    "gradient": {
                        "type": "string",
                        "enum": [
                            "none",
                            "linear",
                            "radial"
                        ]
                    },
                    "gradient_to": {
                        "type": "string"
                    },
                    "gradient_angle": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 359
                    },
                    "dots": {
                        "type": "string",
                        "enum": [
                            "square",
                            "rounded",
                            "dots",
                            "classy",
                            "diamond",
                            "star",
                            "sparkle",
                            "heart",
                            "plus",
                            "cross",
                            "tiny",
                            "bars_h",
                            "bars_v",
                            "connected",
                            "shake"
                        ]
                    },
                    "eye_frame": {
                        "type": "string",
                        "enum": [
                            "square",
                            "rounded",
                            "extra_rounded",
                            "circle",
                            "leaf",
                            "drop",
                            "petal",
                            "chamfer",
                            "dotted",
                            "square_circle"
                        ]
                    },
                    "eye_ball": {
                        "type": "string",
                        "enum": [
                            "square",
                            "rounded",
                            "circle",
                            "leaf",
                            "drop",
                            "petal",
                            "diamond",
                            "star",
                            "plus",
                            "cross",
                            "chamfer",
                            "dots"
                        ]
                    },
                    "eye_color": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "eye_ball_color": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "logo_upload_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "logo_size": {
                        "type": "number",
                        "minimum": 0.12,
                        "maximum": 0.4
                    },
                    "logo_margin": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 3
                    },
                    "logo_mode": {
                        "type": "string",
                        "enum": [
                            "center",
                            "artwork"
                        ]
                    },
                    "artwork_strength": {
                        "type": "number",
                        "minimum": 0.45,
                        "maximum": 0.85
                    },
                    "frame": {
                        "type": "string",
                        "enum": [
                            "none",
                            "bottom",
                            "top",
                            "banner",
                            "balloon_bottom",
                            "balloon_top",
                            "ribbon_bottom",
                            "ribbon_top",
                            "phone"
                        ]
                    },
                    "frame_color": {
                        "type": "string"
                    },
                    "frame_text": {
                        "type": "string",
                        "maxLength": 24
                    },
                    "frame_text_color": {
                        "type": "string"
                    },
                    "include_branding": {
                        "type": "boolean"
                    }
                }
            },
            "QrCode": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "object": {
                        "type": "string",
                        "const": "qr_code"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "payload": {
                        "type": "object"
                    },
                    "short_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "domain": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "destination": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "active, paused, disabled, expired\u2026 or deleted"
                    },
                    "scans": {
                        "type": "integer"
                    },
                    "last_scanned_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "archived": {
                        "type": "boolean"
                    },
                    "folder": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "design": {
                        "$ref": "#/components/schemas/Design"
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "png": {
                                "type": "string"
                            },
                            "svg": {
                                "type": "string"
                            },
                            "pdf": {
                                "type": "string"
                            }
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            }
        }
    }
}