> ## 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.

# Change a QR Code's short-URL slug

> PATCH /qr/{qrid}/url-hash/

Repoints a Dynamic QR Code's short URL to a new slug.

```
PATCH  https://api.scanova.io/qr/{qrid}/url-hash/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
```

<ParamField path="qrid" type="string" required>
  The QR Code's `qrid`.
</ParamField>

<ParamField body="url_hash" type="string" required>
  The new slug. Must match `^[a-zA-Z0-9\-_]{3,50}$` and be free on this QR Code's domain.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.scanova.io/qr/Qa1b2c3d4e5f6g7h8/url-hash/" \
    -H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
    -H "Content-Type: application/json" \
    -d '{
        "url_hash": "summer-sale-2026"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "url_hash": "summer-sale-2026",
    "complete_url": "https://scnv.io/summer-sale-2026",
    "warning": "Any QR codes already printed with the previous short URL will stop working."
  }
  ```
</ResponseExample>

<Warning>
  **Every QR Code already printed with the previous slug stops working.** The old short URL is not kept as a redirect. The API returns this as an explicit `warning` field in the success response — surface it to the user rather than swallowing it. Only change a slug for a QR Code that has not been distributed yet.
</Warning>

A successful change marks the QR Code as using a custom hash and invalidates the landing app's cache for both the old and the new slug, so the switch takes effect immediately. `400` means the slug is malformed; `409` means it is already taken on this domain.

## Related

* [Check hash availability](/api-reference/management-api/qr/hash-check) — confirm the slug is free before calling this.
* [Generate an available hash](/api-reference/management-api/qr/hash-generate) — have the server pick a free slug.
* [Retrieve a QR Code](/api-reference/management-api/qr/retrieve) — read the current `dynamic_url_object.url_hash`.
* [QR Manager overview](/api-reference/management-api/qr/overview) — the quotas, role permissions, and Trash model shared by every endpoint in this module.
* [Management API overview](/api-reference/management-api/overview) — the auth scheme and quota rules that apply to this endpoint.


## OpenAPI

````yaml api-reference/openapi/management-api.json PATCH /qr/{qrid}/url-hash/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.scanova.io (QR codes, folders, tags, leads, forms, analytics, plans,
    shared users & roles), plus the token-creation and usage-stats endpoints
    used to authenticate against it. Every path and request/response shape below
    was verified live against a real API key and the actual running backend
    (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /qr/{qrid}/url-hash/:
    patch:
      summary: Change a QR code's short-URL slug
      description: >-
        Repoints a Dynamic QR code's short URL to a new slug, validated against
        ^[a-zA-Z0-9\-_]{3,50}$ and checked for conflicts within the QR code's
        domain. Sets is_custom_hash to true and invalidates the landing-app
        cache for both the old and the new slug. The response carries an
        explicit warning: already-printed QR codes encoding the previous slug
        stop working.
      operationId: updateQrUrlHash
      parameters:
        - name: qrid
          in: path
          required: true
          schema:
            type: string
          description: >-
            The QR code's `qrid` — the opaque public identifier returned by the
            list endpoint, not the numeric `id`.
      requestBody:
        content:
          application/json:
            example:
              url_hash: summer-sale-2026
      responses:
        '200':
          description: Slug changed.
          content:
            application/json:
              example:
                url_hash: summer-sale-2026
                complete_url: https://scnv.io/summer-sale-2026
                warning: >-
                  Any QR codes already printed with the previous short URL will
                  stop working.
        '400':
          description: The slug fails the format rules.
        '404':
          description: No QR code with this `qrid` owned by this account.
        '409':
          description: The slug is already taken on this domain.
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````