---
title: "Track Scan"
method: POST
path: "/qr-tracking/scan"
tags: ["qr-tracking"]
---

# Track Scan

`POST /qr-tracking/scan`

## Request

- Base URL: `https://api.projectindi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.projectindi.com/qr-tracking/scan`
- Auth: none declared

Record a QR code scan - upserts qr_code_analytics.

No authentication required. Called from /start and /joinclinic landing pages.
Auto-creates the analytics row on first scan.

Two-step: ensure row exists (idempotent upsert), then increment scans_count.
The read-then-write increment can lose a count under heavy concurrency on the
same QR code, but that's acceptable for analytics - no business logic depends
on exact counts.

## Request body

- TrackScanRequest
  - `qr_code` string, required

## Response `200`

Successful Response

- TrackScanResponse
  - `qr_code` string, required
  - `scans_count` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles.md) - [All operations](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles/llms.txt) - [OpenAPI document](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles/revisions/25a7813e21fd?raw)
