Twilee Docs

Scans Resource

The ScanLog resource exposes individual scan events captured for a QR code. Use it to build analytics dashboards, troubleshoot distribution campaigns, or audit recent scans for a code.


Resource Representation

Collection responses include one entry per scan ordered from most recent to oldest. Each log captures the timestamp of the scan, the QR code identifier, and the country derived from the visitor's IP.

{
  "id": "68d026db486dd2e1ae0ad518",
  "datetime": "2025-09-21T16:24:59+00:00",
  "qrCode": "/qr_codes/68cdbbe0ed096c7b590277c6",
  "country": "FR"
}

Field reference

Field Type Description
id string Unique identifier of the scan entry.
datetime datetime ISO 8601 timestamp indicating when the scan occurred.
qrCode string IRI of the QR code associated with the scan.
country string|null Two-letter country code inferred from the scan IP.

Note: IP address, timezone, and user agent are collected internally but are not exposed through the public API.


List Scan Logs — GET /qr_codes/{id}/scans

Retrieve the scan history for a specific QR code that belongs to your team. Results are sorted by datetime in descending order so the newest scan appears first.

curl -X GET "https://api.twilee.com/qr_codes/68cdbbe0ed096c7b590277c6/scans" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Response (JSON-LD)

{
  "@context": "/contexts/ScanLog",
  "@id": "/qr_codes/68cdbbe0ed096c7b590277c6/scans",
  "@type": "Collection",
  "totalItems": 7,
  "member": [
    {
      "@id": "/scan_logs/68d026db486dd2e1ae0ad518",
      "@type": "ScanLog",
      "datetime": "2025-09-21T16:24:59+00:00",
      "qrCode": "/qr_codes/68cdbbe0ed096c7b590277c6",
      "country": "FR"
    }
  ]
}

Use the page query parameter to paginate through the collection:

GET /qr_codes/{id}/scans?page=2

Pagination follows the default API Platform paging behaviour.