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

# Get QR Code

Generate a QR code image for an attestation. The QR code encodes the full verification URL that anyone can scan to verify the attestation independently.

### Use cases

* Print on certificates, badges, and documents
* Embed in emails or digital proof pages
* Display on screens for instant mobile verification

### Parameters

<ParamField path="id" type="string" required>
  The UUID of the attestation
</ParamField>

<ParamField query="size" type="integer" default="256">
  Image size in pixels (128 to 1024). The QR code is always square.
</ParamField>

### Response

Returns a PNG image with `Content-Type: image/png`.

The response includes aggressive cache headers (`Cache-Control: public, max-age=31536000, immutable`) since QR codes for a given attestation never change.

### Encoded URL format

The QR code encodes:

```
https://verify.truthlocks.com/proof/{attestation_id}
```

Anyone who scans this QR code will be taken directly to the verification page for this attestation.

<RequestExample>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer $API_KEY" \
    "https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/qr?size=512" \
    --output attestation-qr.png
  ```

  ```typescript SDK theme={null}
  const qrImage = await client.attestations.getQRCode(attestationId, { size: 512 });
  fs.writeFileSync('attestation-qr.png', Buffer.from(qrImage));
  ```
</RequestExample>
