> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update QR Code

> Update an existing QR Code. Certain fields — category, qr_type, and custom_domain — cannot be changed once a QR Code is created. Authentication required.

## Behavior / Notes

* Use this endpoint to update mutable fields such as `name`, `info`, `pattern_info`, expiry settings, geo-fencing, lead capture, password, and other advanced toggles.
* Fields that are **immutable after creation**: `category`, `qr_type`, `custom_domain`. Attempting to change them will return a validation error.
* `PUT` replaces the mutable fields you submit — only include fields you want changed. (If your client supports `PATCH`, prefer it for partial updates; otherwise send only the fields you intend to update.)
* Validate new `info` payloads with `POST /qr/validate-info/` before updating to avoid broken landing pages.

## Request Body — Updatable Fields

The following fields may be included in the JSON request body. Only include fields you want to change.

**Common / Editable fields**

| Field                              | Type                 | Description                                                                       |
| :--------------------------------- | :------------------- | :-------------------------------------------------------------------------------- |
| `name`                             | `string`             | New name for the QR Code                                                          |
| `info`                             | `string`             | JSON string containing updated QR content (see Components Reference)              |
| `pattern_info`                     | `object` or `string` | Design updates (pattern, colors, eyes, frame). Serialize if required by client    |
| `expire_on`                        | `string` (date-time) | Expiration timestamp (advanced feature)                                           |
| `expire_on_text`                   | `string` (HTML)      | HTML displayed when QR is expired                                                 |
| `expire_on_timezone`               | `string`             | Timezone for expiration (e.g., `Asia/Kolkata`)                                    |
| `high_accuracy_confirmation`       | `boolean`            | High-accuracy confirmation for location QR codes                                  |
| `high_accuracy_geo_fencing`        | `boolean`            | Toggle geo-fencing                                                                |
| `high_accuracy_geo_fencing_config` | `object`             | Geo-fencing config (displayText, fallback, mapLocation, range, unit, redirectUrl) |
| `high_accuracy_mode`               | `boolean`            | Request location access behavior toggle                                           |
| `high_accuracy_mode_text`          | `string`             | Text shown when requesting location permission                                    |
| `lead_list`                        | `integer` or `null`  | Lead list ID to capture leads. Set `null` to remove link.                         |
| `minimum_age`                      | `integer`            | Minimum age to access content                                                     |
| `password`                         | `string`             | Password to protect QR Code content                                               |

> Tip: Set `lead_list: null` to remove the lead list association.

## Examples

### Update QR Code Name

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated QR Code Name"
  }'
```

### Update QR Code Content

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Website QR Code",
    "info": "{\"type\":\"url\",\"data\":{\"url\":\"https://updated-website.com\"}}"
  }'
```

### Update Advanced Features

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Advanced QR Code",
    "expire_on": "2025-12-31T23:59:59+05:30",
    "expire_on_timezone": "Asia/Kolkata",
    "expire_on_text": "<div style=\"text-align:center\"><p>This QR code has expired</p></div>",
    "high_accuracy_mode": true,
    "high_accuracy_mode_text": "Location access required for this QR code",
    "high_accuracy_confirmation": true,
    "minimum_age": 18,
    "password": "securepassword123"
  }'
```

### Update Geo-fencing Configuration

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "high_accuracy_geo_fencing": true,
    "high_accuracy_geo_fencing_config": {
      "unit": "ft",
      "range": 500,
      "fallback": "message",
      "displayText": "<p>This QR code is location-restricted. Please enable GPS and try again.</p>",
      "mapLocation": {
        "provider": "google",
        "latitude": 40.7127753,
        "longitude": -74.0059728,
        "placeId": "",
        "placeName": "New York"
      },
      "redirectUrl": ""
    }
  }'
```

### Update Lead List

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_list": 1106
  }'
```

### Remove Lead List

```bash theme={null}
curl -X PUT "https://management.scanova.io/qr/Q3493df1c0e074ac7/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_list": null
  }'
```

## Immutable-field errors

If an attempt is made to modify an immutable field (`category`, `qr_type`, `custom_domain`), the API will return a validation error describing the immutability.

## Best Practices & Recommendations

* **Validate before updating**: Use `POST /qr/validate-info/` to confirm `info` payload correctness.
* **Sanitize HTML**: Any HTML fields (`expire_on_text`, `high_accuracy_geo_fencing_config.displayText`) should be sanitized to prevent XSS on landing pages.
* **Minimize update payloads**: Send only the fields you intend to change to avoid accidental overwrites.
* **Audit & versioning**: Log update operations (who changed what and when) if your workflow requires auditability.
* **Plan entitlements**: Confirm advanced features (geo-fencing, expiry, custom domains, lead capture) are enabled in the account plan before updating.
* **Test scanning**: After UI/design changes (`pattern_info`), test scanning across devices and apps to ensure scannability.


## OpenAPI

````yaml PUT /qr/{qrid}/
openapi: 3.1.0
info:
  title: Scanova QR Code API
  description: QR Code management endpoints for creating, updating, and managing QR codes
  version: 1.0.0
servers:
  - url: https://management.scanova.io
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /qr/{qrid}/:
    put:
      tags:
        - QR Code
      summary: Update QR Code
      description: >-
        Updates an existing QR code. Note that certain fields (category,
        qr_type, custom_domain) cannot be updated after creation. Requires
        authentication.
      parameters:
        - name: qrid
          in: path
          required: true
          schema:
            type: string
          description: QR Code ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateQRCodeRequest'
            examples:
              update_name:
                summary: Update QR code name
                value:
                  name: Updated QR Code Name
              update_content:
                summary: Update QR code content
                value:
                  name: Updated Website QR Code
                  info: '{"type":"url","data":{"url":"https://updated-website.com"}}'
              update_advanced_features:
                summary: Update advanced features
                value:
                  name: Advanced QR Code
                  expire_on: '2025-12-31T23:59:59+05:30'
                  expire_on_timezone: Asia/Kolkata
                  expire_on_text: >-
                    <div style="text-align:center"><p>This QR code has
                    expired</p></div>
                  high_accuracy_mode: true
                  high_accuracy_mode_text: Location access required for this QR code
                  high_accuracy_confirmation: true
                  minimum_age: 18
                  password: securepassword123
              update_lead_list:
                summary: Update lead list
                value:
                  lead_list: 1106
              remove_lead_list:
                summary: Remove lead list
                value:
                  lead_list: null
      responses:
        '200':
          description: QR Code updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QRCodeResponse'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationErrorResponse'
        '404':
          description: QR Code not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Not found.
      security:
        - apiKeyAuth: []
components:
  schemas:
    UpdateQRCodeRequest:
      type: object
      description: >-
        Request schema for updating QR codes. Note: category, qr_type, and
        custom_domain cannot be updated after creation.
      properties:
        name:
          type: string
          description: Name of the QR Code
          example: Updated QR Code Name
        info:
          type: string
          description: >-
            JSON data to update QR code content. See [Components
            Reference](/api-reference/references/components) for detailed
            structure examples for each category.
          example: '{"type":"url","data":{"url":"https://updated-example.com"}}'
        pattern_info:
          type: string
          description: >-
            JSON data to update QR code design. See [Pattern Info
            Reference](/api-reference/references/pattern-info) for complete
            customization options and field values.
          example: >-
            {"dataInfo":{"pattern":"lightSquare","gradientStyle":"Diagonal","startColor":"#000","endColor":"#000","logo":null},"backGroundColor":"#ffffff"}
        expire_on:
          type: string
          format: date-time
          description: >-
            Expiration date and time for the QR code (advanced feature -
            requires plan quota)
          example: '2025-12-31T23:59:59+05:30'
        expire_on_text:
          type: string
          description: >-
            Custom HTML text to display when QR code is expired (advanced
            feature - requires plan quota)
          example: <div style="text-align:center"><p>This QR code has expired</p></div>
        expire_on_timezone:
          type: string
          description: >-
            Timezone for expiration date (advanced feature - requires plan
            quota)
          example: Asia/Kolkata
        high_accuracy_confirmation:
          type: boolean
          description: >-
            Enable high accuracy confirmation for location-based QR codes
            (advanced feature - requires plan quota)
          example: true
        high_accuracy_geo_fencing:
          type: boolean
          description: >-
            Enable high accuracy geo-fencing for location-based QR codes
            (advanced feature - requires plan quota)
          example: true
        high_accuracy_geo_fencing_config:
          type: object
          description: >-
            Configuration for high accuracy geo-fencing (advanced feature -
            requires plan quota)
          properties:
            displayText:
              type: string
              description: HTML text to display when location access is restricted
              example: >-
                <p style="text-align:center">This QR Code is
                location-restricted.</p><p style="text-align:center">The content
                linked to this QR Code is only accessible when scanned from a
                specific location. Looks like you are either outside the
                specified area or haven't granted location access.</p><p
                style="text-align:center">Enable GPS location access and try
                again.</p>
            fallback:
              type: string
              description: Fallback behavior when location access is denied
              example: message
            mapLocation:
              type: object
              description: Map location configuration
              properties:
                provider:
                  type: string
                  description: Map provider
                  example: google
                latitude:
                  type: number
                  description: Latitude coordinate
                  example: 40.7127753
                longitude:
                  type: number
                  description: Longitude coordinate
                  example: -74.0059728
                placeId:
                  type: string
                  description: Place ID from map provider
                  example: ''
                placeName:
                  type: string
                  description: Human-readable place name
                  example: New York
            range:
              type: number
              description: Range for geo-fencing in specified units
              example: 500
            redirectUrl:
              type: string
              description: URL to redirect to when location access is denied
              example: ''
            unit:
              type: string
              enum:
                - ft
                - m
                - km
                - mi
              description: Unit for range measurement
              example: ft
        high_accuracy_mode:
          type: boolean
          description: >-
            Enable high accuracy mode for location-based QR codes (advanced
            feature - requires plan quota)
          example: true
        high_accuracy_mode_text:
          type: string
          description: >-
            Text to display when requesting location access (advanced feature -
            requires plan quota)
          example: Location access required for this QR code
        lead_list:
          type: integer
          description: >-
            Lead list ID for capturing leads (advanced feature - requires plan
            quota). Set to null to remove lead list.
          example: 1106
        minimum_age:
          type: integer
          description: >-
            Minimum age requirement for accessing QR code content (advanced
            feature - requires plan quota)
          example: 18
        password:
          type: string
          description: >-
            Password protection for QR code access (advanced feature - requires
            plan quota)
          example: securepassword123
    QRCodeResponse:
      type: object
      properties:
        id:
          type: integer
          description: Internal QR code ID
          example: 2411719
        qrid:
          type: string
          description: Unique QR code identifier
          example: Q3493df1c0e074ac7
        name:
          type: string
          description: Name of the QR code
          example: QR Code
        qr_type:
          type: string
          description: QR code type
          example: dy
        qr_type_display:
          type: string
          description: Human-readable QR code type
          example: Dynamic
        category:
          $ref: '#/components/schemas/Category'
        info:
          type: string
          description: JSON data for QR code content
          example: '{"type":"url","data":{"url":"https://scanova.io"}}'
        dynamic_url_object:
          type: object
          properties:
            url_hash:
              type: string
              description: Short URL hash for the QR code
              example: 9drY
            domain:
              type: string
              description: Domain for the QR code URL
              example: null
            custom_domain:
              type: integer
              description: Custom domain ID if using custom domain
              example: 1903
            high_accuracy_mode:
              type: boolean
              description: Whether high accuracy mode is enabled
              example: false
            high_accuracy_mode_text:
              type: string
              description: Text displayed when requesting location access
              example: ''
            high_accuracy_confirmation:
              type: boolean
              description: Whether high accuracy confirmation is enabled
              example: false
            lead_list:
              type: integer
              description: Lead list ID for capturing leads
              example: null
            expire_on_timezone:
              type: string
              description: Timezone for expiration date
              example: null
            expire_on:
              type: string
              format: date-time
              description: Expiration date and time
              example: null
            expire_on_text:
              type: string
              description: Custom text displayed when QR code is expired
              example: null
            minimum_age:
              type: integer
              description: Minimum age requirement for accessing QR code
              example: null
            visit_count:
              type: integer
              description: Number of visits to the QR code
              example: 0
            created:
              type: string
              format: date-time
              description: Creation timestamp
              example: '2025-10-24T18:54:22.752924+05:30'
            modified:
              type: string
              format: date-time
              description: Last modification timestamp
              example: '2025-10-24T18:54:22.752945+05:30'
            is_custom_hash:
              type: boolean
              description: Whether custom hash is used
              example: false
            is_custom_domain:
              type: boolean
              description: Whether custom domain is used
              example: true
            is_password_protected:
              type: boolean
              description: Whether the QR code is password protected
              example: false
            complete_url:
              type: string
              description: Complete URL for the QR code
              example: https://anuj.sqcg.in/9drY
            is_expired:
              type: boolean
              description: Whether the QR code has expired
              example: false
            is_page:
              type: boolean
              description: Whether this is a page QR code
              example: false
            has_qr:
              type: boolean
              description: Whether QR code image is available
              example: true
            high_accuracy_geo_fencing:
              type: boolean
              description: Whether geo-fencing is enabled
              example: false
            high_accuracy_geo_fencing_config:
              type: object
              description: Geo-fencing configuration
              example: {}
            qr_url:
              type: string
              description: URL to access QR code image
              example: https://anuj.sqcg.in/9drY?qr=1
        pattern_info:
          type: string
          description: QR code design pattern information
          example: null
        svg_code:
          type: string
          description: SVG code for QR code
          example: null
        thumbnail:
          type: string
          description: Thumbnail URL for QR code
          example: null
        is_active:
          type: boolean
          description: Whether the QR code is active
          example: true
        version:
          type: number
          description: QR code version
          example: 1
        created:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2025-10-24T18:54:22.697338+05:30'
        modified:
          type: string
          format: date-time
          description: Last modification timestamp
          example: '2025-10-24T18:54:22.697362+05:30'
        tags_list:
          type: array
          items:
            type: string
          description: List of tags associated with QR code
          example: []
        is_password_protected:
          type: boolean
          description: Whether the QR code is password protected
          example: false
        is_age_restricted:
          type: boolean
          description: Whether the QR code has age restrictions
          example: false
        is_designer:
          type: boolean
          description: Whether the QR code uses designer features
          example: false
        pattern_type:
          type: string
          description: Pattern type for QR code design
          example: null
        created_by:
          type: string
          description: User who created the QR code
          example: null
        password:
          type: string
          description: Password for QR code access
          example: null
        ai_qr_code:
          type: string
          description: AI-generated QR code information
          example: null
        wallet_pass_info:
          type: string
          description: Wallet pass information
          example: null
        is_qr_scannable:
          type: boolean
          description: Whether the QR code is scannable
          example: null
        custom_form_response_count:
          type: integer
          description: Number of custom form responses
          example: 0
        rsvp_form_response_count:
          type: integer
          description: Number of RSVP form responses
          example: 0
        restaurant_feedback_response_count:
          type: integer
          description: Number of restaurant feedback responses
          example: 0
    AuthenticationErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Authentication error message
          example: Invalid token.
    Category:
      type: object
      properties:
        id:
          type: integer
          description: Category ID
          example: 1
        name:
          type: string
          description: Category name
          example: Website URL
        slug:
          type: string
          description: Category slug
          example: url
        description:
          type: string
          description: Category description
          example: When scanned, redirects user to a website.
        preview_image:
          type: string
          description: URL to category preview image
          example: https://qcg-media.scanova.io/qr-category/2020/09/url.png
        allowed_qr_types:
          type: string
          description: Allowed QR code types for this category
          example: bt
        allowed_qr_types_display:
          type: string
          description: Human-readable allowed QR code types
          example: Both
        tags:
          type: string
          description: Comma-separated tags for this category
          example: internet,website,link,url,webpage
        is_active:
          type: boolean
          description: Whether the category is active
          example: true
        is_new:
          type: boolean
          description: Whether this is a new category
          example: false
        has_landing_page:
          type: boolean
          description: Whether the category has a landing page
          example: false
        helpdesk_link:
          type: string
          description: URL to helpdesk documentation for this category
          example: >-
            https://support.scanova.io/hc/en-us/articles/36997331177753-Create-Website-URL-QR-Code
        created:
          type: string
          format: date-time
          description: Category creation timestamp
          example: '2020-09-07T11:37:48.093485+05:30'
        modified:
          type: string
          format: date-time
          description: Category last modification timestamp
          example: '2025-10-16T14:50:48.791993+05:30'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Enter your API key directly in the Authorization
        header.

````