---
title: "Daily affiliate click counts for the click heatmap"
method: GET
path: "/api/admin/affiliate-heatmap"
tags: ["admin-affiliate"]
---

# Daily affiliate click counts for the click heatmap

`GET /api/admin/affiliate-heatmap`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/admin/affiliate-heatmap`
- Auth: HTTP bearer

Counts `component_click_events` created since the start of the day `months` months ago (server local time). Bot and crawler user agents are skipped (`isBotUserAgent`, which also treats a missing or empty `user_agent` as a bot). Keys are UTC dates `YYYY-MM-DD`; days without clicks are absent.

## Query parameters

- `months` integer
- `app` string

## Response `200`

Daily click counts.

- AdminAffiliateHeatmap
  - `dailyCounts` object, required: UTC date (`YYYY-MM-DD`) → human clicks that day; days without clicks are absent.

## Other responses

- `403`: Admin access required. Returned for a missing, invalid or expired bearer token as well as for a valid token whose user lacks `is_admin=true`; admin endpoints never answer 401.
- `500`: PocketBase error, an invalid `months` value, or admin credentials not configured.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
