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

# QR codes

> Manage saved QR code images for genie conversation pages

Manage saved QR code images generated for genies. QR codes link directly to genie conversation pages.

<Note>
  Users can only view and manage their own QR codes. There is no admin mode for this resource.
</Note>

***

## List QR codes

Lists all saved QR codes for the authenticated user.

<ParamField body="resource" type="string" required>
  Must be `"qr-code"`.
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"all"`.
</ParamField>

<ParamField body="data" type="object">
  <Expandable title="properties">
    <ParamField body="agentId" type="string">
      Filter to QR codes for a specific genie.
    </ParamField>
  </Expandable>
</ParamField>

<ResponseField name="success" type="boolean" />

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="items" type="array">
      Array of QR code objects. Maximum 100 records, ordered by creation date (newest first).
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -s -X POST https://api.helpgenie.ai/v1/qr-code \
    -H "Authorization: Bearer hg_live_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "action": "all" }'
  ```

  ```json Request body theme={null}
  {
    "resource": "qr-code",
    "action": "all",
    "data": {
      "agentId": "550e8400-e29b-41d4-a716-446655440000"
    }
  }
  ```
</CodeGroup>

***

## Create QR code

Creates a new QR code record.

<ParamField body="resource" type="string" required>
  Must be `"qr-code"`.
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"create"`.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="agent_id" type="string" required>
      Genie this QR code links to.
    </ParamField>

    <ParamField body="storage_path" type="string" required>
      File path in the storage bucket.
    </ParamField>

    <ParamField body="storage_url" type="string" required>
      Public URL of the QR image.
    </ParamField>

    <ParamField body="format" type="string" required>
      Image format (for example `"png"`, `"svg"`).
    </ParamField>

    <ParamField body="file_size" type="number">
      File size in bytes.
    </ParamField>

    <ParamField body="display_config" type="object">
      Custom display configuration.
    </ParamField>

    <ParamField body="target_url" type="string">
      URL the QR code points to.
    </ParamField>

    <ParamField body="filename" type="string">
      Display filename.
    </ParamField>
  </Expandable>
</ParamField>

***

## Delete QR code

Soft-deletes a QR code record (sets `is_deleted` to `true`).

<ParamField body="resource" type="string" required>
  Must be `"qr-code"`.
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"delete"`.
</ParamField>

<ParamField body="id" type="string" required>
  The QR code record ID.
</ParamField>

***

## Increment download

Increments the download counter for a QR code.

<ParamField body="resource" type="string" required>
  Must be `"qr-code"`.
</ParamField>

<ParamField body="action" type="string" required>
  Must be `"increment-download"`.
</ParamField>

<ParamField body="id" type="string" required>
  The QR code record ID.
</ParamField>

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="downloadCount" type="number" required>
      Current download count (will be incremented by 1).
    </ParamField>
  </Expandable>
</ParamField>
