{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codeqr-io/json-schema/codeqr-io-qr-code-schema-schema.json",
  "title": "QRCode",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codeqr-io-openapi.yml#/components/schemas/QrCodeSchema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the QR code."
    },
    "domain": {
      "type": "string",
      "description": "The domain of the QR code. If not provided, the main domain of the project will be used (or `codeqr.link` if the project does not have domains)."
    },
    "key": {
      "type": "string",
      "description": "The slug of the QR code. If not provided, a random slug of 7 characters will be generated."
    },
    "archived": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code is archived."
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time the QR code will expire in ISO-8601 format. Must be in the future."
    },
    "expiredUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The destination URL when the QR code expires."
    },
    "password": {
      "type": [
        "string",
        "null"
      ],
      "description": "The password required to access the destination URL of the QR code."
    },
    "externalId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The external ID associated with the QR code."
    },
    "trackConversion": {
      "type": "boolean",
      "default": false,
      "description": "[BETA] If should track conversions for the QR code."
    },
    "proxy": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code uses the custom link preview feature."
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "The title of the QR code generated via `api.codeqr.io/metatags`. Will be used for custom link preview if `proxy` is true."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "The description of the QR code generated via `api.codeqr.io/metatags`. Will be used for custom link preview if `proxy` is true."
    },
    "image": {
      "type": [
        "string",
        "null"
      ],
      "description": "The image of the QR code generated via `api.codeqr.io/metatags`. Will be used for custom link preview if `proxy` is true."
    },
    "utm_source": {
      "type": [
        "string",
        "null"
      ],
      "description": "The source UTM of the QR code."
    },
    "utm_medium": {
      "type": [
        "string",
        "null"
      ],
      "description": "The medium UTM of the QR code."
    },
    "utm_campaign": {
      "type": [
        "string",
        "null"
      ],
      "description": "The campaign UTM of the QR code."
    },
    "utm_term": {
      "type": [
        "string",
        "null"
      ],
      "description": "The term UTM of the QR code."
    },
    "utm_content": {
      "type": [
        "string",
        "null"
      ],
      "description": "The content UTM of the QR code."
    },
    "rewrite": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code uses link cloaking."
    },
    "doIndex": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code should be indexed."
    },
    "flexible": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code is flexible."
    },
    "filled": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code is filled."
    },
    "ios": {
      "type": [
        "string",
        "null"
      ],
      "description": "The destination URL for iOS for the QR code for device targeting iOS."
    },
    "android": {
      "type": [
        "string",
        "null"
      ],
      "description": "The destination URL for Android for the QR code for device targeting Android."
    },
    "geo": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Geographic segmentation information for the QR code in the JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://codeqr.link/geo"
    },
    "rules": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "attribute": {
            "type": "string",
            "enum": [
              "device",
              "country",
              "utm_source",
              "utm_medium",
              "utm_campaign",
              "referrer",
              "language",
              "city",
              "region",
              "continent",
              "utm_term",
              "utm_content"
            ]
          },
          "operator": {
            "type": "string",
            "enum": [
              "equals",
              "not_equals"
            ]
          },
          "value": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "attribute",
          "operator",
          "value",
          "url"
        ]
      },
      "description": "Smart rules for conditional destination routing by request attribute."
    },
    "static": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code is static."
    },
    "useDisplayPage": {
      "type": "boolean",
      "default": true,
      "description": "For dynamic QR codes with phone, email, or sms types: if true (default), shows an action page with buttons. If false, redirects directly to tel:/mailto:/sms: URI."
    },
    "type": {
      "type": "string",
      "enum": [
        "url",
        "text",
        "email",
        "wifi",
        "phone",
        "vcard",
        "crypto",
        "sms",
        "facetime",
        "geo",
        "latlog",
        "pix",
        "whatsapp"
      ],
      "description": "The type of the QR code."
    },
    "contentStatic": {
      "type": [
        "string",
        "null"
      ],
      "description": "The static content of the QR code."
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "The text of the QR code."
    },
    "email": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The email information of the QR code."
    },
    "wifi": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The WiFi information of the QR code."
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The URL of the QR code."
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "The phone number of the QR code."
    },
    "vcard": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The vCard information of the QR code."
    },
    "crypto": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The cryptocurrency information of the QR code."
    },
    "sms": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The SMS information of the QR code."
    },
    "whatsapp": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "number": {
          "type": "string",
          "pattern": "^[1-9]\\d{7,14}$"
        },
        "message": {
          "type": "string",
          "maxLength": 1000
        }
      },
      "required": [
        "number"
      ],
      "description": "The WhatsApp click-to-chat info: E.164 number (digits only) and optional prefilled message."
    },
    "facetime": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The FaceTime information of the QR code."
    },
    "latlog": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The latitude and longitude information of the QR code."
    },
    "logo": {
      "type": [
        "string",
        "null"
      ],
      "description": "The logo of the QR code."
    },
    "bgColor": {
      "type": "string",
      "description": "The background color of the QR code."
    },
    "fgColor": {
      "type": "string",
      "description": "The foreground color of the QR code."
    },
    "size": {
      "type": "number",
      "description": "The size of the QR code."
    },
    "level": {
      "type": "string",
      "description": "The level of error correction of the QR code."
    },
    "showLogo": {
      "type": "boolean",
      "default": false,
      "description": "If the logo should be displayed in the QR code."
    },
    "src": {
      "type": [
        "string",
        "null"
      ],
      "description": "The source of the QR code."
    },
    "height": {
      "type": "number",
      "description": "The height of the QR code."
    },
    "width": {
      "type": "number",
      "description": "The width of the QR code."
    },
    "excavate": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code should be excavated."
    },
    "userId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the user that created the QR code."
    },
    "projectId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the project of the QR code."
    },
    "publicStats": {
      "type": "boolean",
      "default": false,
      "description": "If the statistics of the QR code are publicly accessible."
    },
    "scans": {
      "type": "number",
      "default": 0,
      "description": "The number of scans of the QR code."
    },
    "lastClicked": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date and time the QR code was scanned last."
    },
    "leads": {
      "type": "number",
      "default": 0,
      "description": "The number of leads generated by the QR code."
    },
    "sales": {
      "type": "number",
      "default": 0,
      "description": "The number of sales generated by the QR code."
    },
    "saleAmount": {
      "type": "number",
      "default": 0,
      "description": "The amount of the sale generated by the link."
    },
    "createdAt": {
      "type": "string",
      "description": "The date and time the QR code was created."
    },
    "updatedAt": {
      "type": "string",
      "description": "The date and time the QR code was updated last."
    },
    "tagId": {
      "type": [
        "string",
        "null"
      ],
      "description": "[DEPRECATED (use `tags` instead)]: The unique ID of the tag assigned to the QR code.",
      "deprecated": true
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/TagSchema"
      },
      "description": "The tags assigned to the QR code."
    },
    "folderId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The unique ID of the folder assigned to the QR code."
    },
    "comments": {
      "type": [
        "string",
        "null"
      ],
      "description": "The comments for the QR code."
    },
    "frameTextStyles": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "weight": {
          "type": "string",
          "enum": [
            "normal",
            "bold"
          ]
        },
        "style": {
          "type": "string",
          "enum": [
            "normal",
            "italic"
          ]
        },
        "family": {
          "type": "string",
          "enum": [
            "sans",
            "sans-condensed",
            "serif",
            "serif-elegant",
            "mono"
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "s",
            "m",
            "l",
            "xl"
          ]
        }
      },
      "description": "Typographic styles applied to the frame label text. Object with optional keys: `weight` (`normal` | `bold`), `style` (`normal` | `italic`), `family` (`sans` | `sans-condensed` | `serif` | `serif-elegant` | `mono`), `size` (`s` | `m` | `l` | `xl`). Every field is enum-gated on write; omitted keys render with defaults."
    },
    "notificationToken": {
      "type": [
        "string",
        "null"
      ],
      "description": "The notification token of the QR code."
    },
    "preRedirection": {
      "type": "boolean",
      "default": false,
      "description": "If the QR code has pre-redirection."
    },
    "pageId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the page to redirect to before the QR code destination."
    },
    "pageUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The URL of the page to redirect to before the QR code destination."
    },
    "isFormMandatory": {
      "type": "boolean",
      "default": false,
      "description": "If the form is mandatory for the page."
    }
  },
  "required": [
    "id",
    "domain",
    "key",
    "archived",
    "expiresAt",
    "expiredUrl",
    "password",
    "externalId",
    "trackConversion",
    "proxy",
    "title",
    "description",
    "image",
    "utm_source",
    "utm_medium",
    "utm_campaign",
    "utm_term",
    "utm_content",
    "rewrite",
    "doIndex",
    "flexible",
    "filled",
    "ios",
    "android",
    "geo",
    "rules",
    "static",
    "useDisplayPage",
    "type",
    "contentStatic",
    "text",
    "email",
    "wifi",
    "url",
    "phone",
    "vcard",
    "crypto",
    "sms",
    "whatsapp",
    "facetime",
    "latlog",
    "logo",
    "bgColor",
    "fgColor",
    "size",
    "level",
    "showLogo",
    "src",
    "height",
    "width",
    "excavate",
    "userId",
    "projectId",
    "publicStats",
    "scans",
    "lastClicked",
    "leads",
    "sales",
    "saleAmount",
    "createdAt",
    "updatedAt",
    "tagId",
    "tags",
    "folderId",
    "comments",
    "notificationToken",
    "preRedirection",
    "isFormMandatory"
  ],
  "$defs": {
    "TagSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique ID of the tag."
        },
        "name": {
          "type": "string",
          "description": "The name of the tag."
        },
        "color": {
          "type": "string",
          "enum": [
            "red",
            "yellow",
            "green",
            "blue",
            "purple",
            "pink",
            "brown"
          ],
          "description": "The color of the tag."
        }
      },
      "required": [
        "id",
        "name",
        "color"
      ],
      "title": "Tag"
    }
  }
}