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

# Retrieve and select an AI variant

> GET, PATCH /qr/{qrid}/ai/{id}/

Reads one AI variant record, and selects it as the QR Code's chosen design.

```
GET    https://api.scanova.io/qr/{qrid}/ai/{id}/
PATCH  https://api.scanova.io/qr/{qrid}/ai/{id}/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
```

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

<ParamField path="id" type="integer" required>
  The AI variant record's id, from [List and generate AI QR Code variants](/api-reference/management-api/qr/ai-list-create).
</ParamField>

`GET` is also the polling endpoint while a generation is in flight — watch `status` until it leaves `generating`.

### Select (PATCH)

<ParamField body="selected" type="boolean">
  The **only** writable field on this resource.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.scanova.io/qr/Qa1b2c3d4e5f6g7h8/ai/501/" \
    -H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
    -H "Content-Type: application/json" \
    -d '{
        "selected": true
    }'
  ```
</RequestExample>

<Warning>
  Setting `selected: true` **deselects every other AI variant** for the same QR Code — exactly one variant is selected at a time. There is no call that selects two, and no need to deselect the previous one first.
</Warning>

## Related

* [List and generate AI QR Code variants](/api-reference/management-api/qr/ai-list-create) — the collection this record belongs to.
* [Retrieve a QR Code](/api-reference/management-api/qr/retrieve) — the QR Code the selected variant applies to.
* [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 GET /qr/{qrid}/ai/{id}/
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}/ai/{id}/:
    get:
      summary: Retrieve an AI QR variant
      description: >-
        Reads one AI variant record, including its current generation `status` —
        the endpoint to poll while a generation is in flight.
      operationId: getAiQrCode
      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`.
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: The AI variant record's id.
      responses:
        '200':
          description: One AI variant.
          content:
            application/json:
              example:
                id: 501
                prompt: cyberpunk city skyline at night
                negative_prompt: blurry, low quality
                weight: 1.2
                qr_code_pattern: null
                preset: illustration
                provider: quickqr
                status: generated
                selected: true
                is_scannable: true
                qr_image_url: https://cdn.scanova.io/ai/501.png
                created: '2026-09-09T09:00:00Z'
        '404':
          description: No such AI record for this QR code.
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.

````