{"openapi":"3.1.0","info":{"title":"CountPort integration API","version":"1.0.0","description":"Read-only figures for third-party systems: sites, devices and camera health, footfall, occupancy, queue, dwell and heatmap at 15 minutes, hour and day in site time, each bucket with its coverage. The same numbers as CountPort Cloud's dashboards, reports and exports. Versioning is additive within v1."},"servers":[{"url":"/api/v1"}],"tags":[{"name":"Sites"},{"name":"Devices"},{"name":"Analytics"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key created by the tenant's owner (Settings → API keys): Authorization: Bearer cpk_…"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"The same API key in the X-API-Key header."}},"schemas":{"SiteList":{"type":"object","properties":{"sites":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["sites","nextCursor"]},"Site":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"groupId":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"openingHours":{"type":["object","null"],"properties":{"weekly":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"close":{"type":"string"}},"required":["open","close"]}}},"exceptions":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"close":{"type":"string"}},"required":["open","close"]}}}},"required":["weekly"],"description":"Weekly site-local opening intervals and dated exceptions; null when not set, which CountPort Cloud treats as open 24 hours, 7 days (as a site whose every weekday is 00:00–24:00)."},"occupancyResetTime":{"type":"string","description":"Site-local time occupancy restarts from 0 each day.","example":"04:00"}},"required":["id","name","timezone","groupId","status","openingHours","occupancyResetTime"]},"Error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_argument","unauthenticated","permission_denied","not_found","rate_limited","internal"],"description":"Stable error code."},"message":{"type":"string","description":"What went wrong, for a person."}},"required":["code","message"]},"DeviceList":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/Device"}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["devices","nextCursor"]},"Device":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"siteId":{"type":["string","null"]},"state":{"type":"string","enum":["awaiting_install","commissioned","retired","decommissioned"]},"deviceClass":{"type":"string","enum":["store_pc","camera"]},"packageVersion":{"type":["string","null"]},"os":{"type":["string","null"]},"arch":{"type":["string","null"]},"health":{"type":"object","properties":{"status":{"type":"string","enum":["never_seen","online","degraded","offline","unpaired"],"description":"unpaired: the PC was unpaired on site and reports nothing until it is paired again."},"lastSeenAt":{"type":["string","null"],"format":"date-time","description":"Last heartbeat or control-plane traffic (cloud clock).","example":"2026-10-22T07:00:00Z"},"connected":{"type":"boolean","description":"A control-plane connection is open now."},"issues":{"type":"array","items":{"type":"string","enum":["engine_not_running","camera_not_streaming","backlog","rows_dropped","clock_offset","cpu_high","config_rejected"]}},"unsentMinutes":{"type":["integer","null"],"description":"Minutes of counts still in the device's outbox (last heartbeat)."},"clockOffsetMs":{"type":["integer","null"]}},"required":["status","lastSeenAt","connected","issues","unsentMinutes","clockOffsetMs"]},"cameras":{"type":"array","items":{"$ref":"#/components/schemas/CameraHealth"}}},"required":["id","name","siteId","state","deviceClass","packageVersion","os","arch","health","cameras"]},"CameraHealth":{"type":"object","properties":{"id":{"type":"string","description":"The device's own camera id (the cameraId in analytics)."},"name":{"type":"string"},"enabled":{"type":"boolean"},"state":{"type":"string","enum":["unknown","online","offline","error"]},"streamState":{"type":["string","null"],"enum":["connecting","streaming","backoff","disabled","error",null]},"decodeFps":{"type":["number","null"]},"analysedFps":{"type":["number","null"]},"lastMinuteCoverageSeconds":{"type":["integer","null"]},"lastFrameAt":{"type":["string","null"],"format":"date-time","description":"Last decoded frame (device clock).","example":"2026-10-22T07:00:00Z"},"reconnects":{"type":["integer","null"]}},"required":["id","name","enabled","state","streamState","decodeFps","analysedFps","lastMinuteCoverageSeconds","lastFrameAt","reconnects"]},"FootfallSeries":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"grain":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/EntranceLine"},"description":"Entrance-role lines expected or reporting in the page."},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"Bucket start (UTC), inclusive.","example":"2026-10-22T07:00:00Z"},"end":{"type":"string","format":"date-time","description":"Bucket end (UTC), exclusive.","example":"2026-10-22T07:00:00Z"},"local":{"type":"string","description":"Site-local start with its UTC offset.","example":"2026-10-22T10:00+03:00"},"localDate":{"type":"string","description":"Site-local date of the start.","example":"2026-10-22"},"localStart":{"type":"string","description":"Site-local wall-clock start.","example":"10:00"},"localEnd":{"type":"string","description":"Site-local wall-clock end (\"24:00\" at midnight).","example":"11:00"},"utcOffset":{"type":"string","example":"+03:00"},"fold":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}],"description":"1 for the repeated wall-clock hour on the night the clocks go back."},"inProgress":{"type":"boolean","description":"The bucket contains the time of the read; its figures are still growing."},"value":{"type":["integer","null"],"description":"IN count of every entrance line together; null = not analysed."},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."},"lines":{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"value":{"type":["integer","null"]},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."}},"required":["lineId","deviceId","cameraId","value","coverage","status","analysedSeconds","expectedSeconds"]}}},"required":["start","end","local","localDate","localStart","localEnd","utcOffset","fold","inProgress","value","coverage","status","analysedSeconds","expectedSeconds","lines"]}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["site","grain","lines","buckets","nextCursor"]},"SiteRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string","description":"IANA time zone every bucket is in.","example":"Europe/Istanbul"}},"required":["id","name","timezone"]},"EntranceLine":{"type":"object","properties":{"lineId":{"type":"string"},"name":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"cameraName":{"type":"string"}},"required":["lineId","name","deviceId","cameraId","cameraName"]},"OccupancySeries":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"grain":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"resetTime":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"Bucket start (UTC), inclusive.","example":"2026-10-22T07:00:00Z"},"end":{"type":"string","format":"date-time","description":"Bucket end (UTC), exclusive.","example":"2026-10-22T07:00:00Z"},"local":{"type":"string","description":"Site-local start with its UTC offset.","example":"2026-10-22T10:00+03:00"},"localDate":{"type":"string","description":"Site-local date of the start.","example":"2026-10-22"},"localStart":{"type":"string","description":"Site-local wall-clock start.","example":"10:00"},"localEnd":{"type":"string","description":"Site-local wall-clock end (\"24:00\" at midnight).","example":"11:00"},"utcOffset":{"type":"string","example":"+03:00"},"fold":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}],"description":"1 for the repeated wall-clock hour on the night the clocks go back."},"inProgress":{"type":"boolean","description":"The bucket contains the time of the read; its figures are still growing."},"value":{"type":["integer","null"],"description":"People inside at the bucket's end; null when not analysed."},"peak":{"type":["integer","null"]},"in":{"type":["integer","null"]},"out":{"type":["integer","null"]},"clamped":{"type":"integer","description":"People dropped by the never-below-zero rule in the bucket."},"corrections":{"type":"integer","description":"Manual corrections applied in the bucket."},"uncertain":{"type":"boolean","description":"A quarter hour since the last reset was partial or not analysed."},"businessDate":{"type":"string"},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."}},"required":["start","end","local","localDate","localStart","localEnd","utcOffset","fold","inProgress","value","peak","in","out","clamped","corrections","uncertain","businessDate","coverage","status","analysedSeconds","expectedSeconds"]}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["site","grain","resetTime","buckets","nextCursor"]},"OccupancyLive":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"at":{"type":"string","format":"date-time","description":"Time of the read.","example":"2026-10-22T07:00:00Z"},"value":{"type":["integer","null"]},"status":{"type":"string","enum":["live","stale","no_data","no_entrances"]},"businessDate":{"type":"string"},"resetTime":{"type":"string"},"resetAt":{"type":"string","format":"date-time","description":"The last daily reset.","example":"2026-10-22T07:00:00Z"},"nextResetAt":{"type":"string","format":"date-time","description":"The next daily reset.","example":"2026-10-22T07:00:00Z"},"asOf":{"type":["string","null"],"format":"date-time","description":"End of the newest minute every reporting entrance line delivered.","example":"2026-10-22T07:00:00Z"},"freshnessSeconds":{"type":["integer","null"]},"in":{"type":["integer","null"]},"out":{"type":["integer","null"]},"clampedPeople":{"type":"integer"},"corrections":{"type":"integer"},"uncertain":{"type":"boolean"},"uncertainSince":{"type":["string","null"],"format":"date-time","description":"First quarter hour since the reset that was partial or not analysed.","example":"2026-10-22T07:00:00Z"},"coverage":{"type":["number","null"]},"entranceLines":{"type":"integer"},"linesReporting":{"type":"integer"}},"required":["site","at","value","status","businessDate","resetTime","resetAt","nextResetAt","asOf","freshnessSeconds","in","out","clampedPeople","corrections","uncertain","uncertainSince","coverage","entranceLines","linesReporting"]},"QueueSeries":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"grain":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"zones":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Zone"},{"type":"object","properties":{"capacity":{"type":["number","null"]},"totalCashiers":{"type":["integer","null"]}},"required":["capacity","totalCashiers"]}]}},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"Bucket start (UTC), inclusive.","example":"2026-10-22T07:00:00Z"},"end":{"type":"string","format":"date-time","description":"Bucket end (UTC), exclusive.","example":"2026-10-22T07:00:00Z"},"local":{"type":"string","description":"Site-local start with its UTC offset.","example":"2026-10-22T10:00+03:00"},"localDate":{"type":"string","description":"Site-local date of the start.","example":"2026-10-22"},"localStart":{"type":"string","description":"Site-local wall-clock start.","example":"10:00"},"localEnd":{"type":"string","description":"Site-local wall-clock end (\"24:00\" at midnight).","example":"11:00"},"utcOffset":{"type":"string","example":"+03:00"},"fold":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}],"description":"1 for the repeated wall-clock hour on the night the clocks go back."},"inProgress":{"type":"boolean","description":"The bucket contains the time of the read; its figures are still growing."},"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"avgLength":{"type":["number","null"]},"maxLength":{"type":["integer","null"]},"minLength":{"type":["integer","null"]},"avgWaitSeconds":{"type":["number","null"]},"avgServiceSeconds":{"type":["number","null"]},"entries":{"type":["integer","null"]},"leadEntries":{"type":["integer","null"]},"labelMinutes":{"type":["object","null"],"properties":{"empty":{"type":"integer"},"low":{"type":"integer"},"moderate":{"type":"integer"},"high":{"type":"integer"}},"required":["empty","low","moderate","high"]},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."}},"required":["zoneId","deviceId","cameraId","avgLength","maxLength","minLength","avgWaitSeconds","avgServiceSeconds","entries","leadEntries","labelMinutes","coverage","status","analysedSeconds","expectedSeconds"]}}},"required":["start","end","local","localDate","localStart","localEnd","utcOffset","fold","inProgress","zones"]}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["site","grain","zones","buckets","nextCursor"]},"Zone":{"type":"object","properties":{"zoneId":{"type":"string"},"name":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"cameraName":{"type":"string"}},"required":["zoneId","name","deviceId","cameraId","cameraName"]},"DwellSeries":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"grain":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"zones":{"type":"array","items":{"$ref":"#/components/schemas/Zone"}},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"Bucket start (UTC), inclusive.","example":"2026-10-22T07:00:00Z"},"end":{"type":"string","format":"date-time","description":"Bucket end (UTC), exclusive.","example":"2026-10-22T07:00:00Z"},"local":{"type":"string","description":"Site-local start with its UTC offset.","example":"2026-10-22T10:00+03:00"},"localDate":{"type":"string","description":"Site-local date of the start.","example":"2026-10-22"},"localStart":{"type":"string","description":"Site-local wall-clock start.","example":"10:00"},"localEnd":{"type":"string","description":"Site-local wall-clock end (\"24:00\" at midnight).","example":"11:00"},"utcOffset":{"type":"string","example":"+03:00"},"fold":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}],"description":"1 for the repeated wall-clock hour on the night the clocks go back."},"inProgress":{"type":"boolean","description":"The bucket contains the time of the read; its figures are still growing."},"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"personMinutes":{"type":["number","null"],"description":"Person-minutes spent in the zone."},"visits":{"type":["integer","null"],"description":"Dwell episodes that began in the bucket."},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."}},"required":["zoneId","deviceId","cameraId","personMinutes","visits","coverage","status","analysedSeconds","expectedSeconds"]}}},"required":["start","end","local","localDate","localStart","localEnd","utcOffset","fold","inProgress","zones"]}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["site","grain","zones","buckets","nextCursor"]},"HeatmapSeries":{"type":"object","properties":{"site":{"$ref":"#/components/schemas/SiteRef"},"grain":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"zones":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Zone"},{"type":"object","properties":{"polygon":{"type":"array","items":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"description":"The zone, normalised to the full frame (0..1, y down)."},"referenceWidth":{"type":["number","null"]},"referenceHeight":{"type":["number","null"]}},"required":["polygon","referenceWidth","referenceHeight"]}]}},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"Bucket start (UTC), inclusive.","example":"2026-10-22T07:00:00Z"},"end":{"type":"string","format":"date-time","description":"Bucket end (UTC), exclusive.","example":"2026-10-22T07:00:00Z"},"local":{"type":"string","description":"Site-local start with its UTC offset.","example":"2026-10-22T10:00+03:00"},"localDate":{"type":"string","description":"Site-local date of the start.","example":"2026-10-22"},"localStart":{"type":"string","description":"Site-local wall-clock start.","example":"10:00"},"localEnd":{"type":"string","description":"Site-local wall-clock end (\"24:00\" at midnight).","example":"11:00"},"utcOffset":{"type":"string","example":"+03:00"},"fold":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}],"description":"1 for the repeated wall-clock hour on the night the clocks go back."},"inProgress":{"type":"boolean","description":"The bucket contains the time of the read; its figures are still growing."},"zones":{"type":"array","items":{"type":"object","properties":{"zoneId":{"type":"string"},"deviceId":{"type":"string"},"cameraId":{"type":"string","description":"The device's own camera id."},"gridW":{"type":"integer"},"gridH":{"type":"integer"},"cells":{"type":"array","items":{"type":"array","prefixItems":[{"type":"integer"},{"type":"number"}]},"description":"[row-major cell index, person-minutes] for every cell anyone was seen in, ascending."},"totalPersonMinutes":{"type":["number","null"],"description":"The zone's person-seconds in the bucket summed unrounded, then in person-minutes to 2 decimals (the engine's figure / 60; adding up the rounded `cells` can differ by up to 0.005 per cell); null when the zone was not analysed in the bucket."},"coverage":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Share of the camera-seconds the bucket's lines or zones were expected to analyse that they did analyse (floored to 4 decimals); null when nothing was expected.","example":1},"status":{"type":"string","enum":["complete","partial","no_data"],"description":"complete: coverage ≥ 0.9; partial: some but less; no_data: nothing analysed (every figure is null — a gap, never 0)."},"analysedSeconds":{"type":"integer","description":"Camera-seconds analysed."},"expectedSeconds":{"type":"integer","description":"Camera-seconds expected (installed, signed off, line or zone drawn)."}},"required":["zoneId","deviceId","cameraId","gridW","gridH","cells","totalPersonMinutes","coverage","status","analysedSeconds","expectedSeconds"]}}},"required":["start","end","local","localDate","localStart","localEnd","utcOffset","fold","inProgress","zones"]}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` to read the next page; null on the last page."}},"required":["site","grain","zones","buckets","nextCursor"]}},"parameters":{}},"paths":{"/sites":{"get":{"summary":"List sites","tags":["Sites"],"security":[{"bearer":["sites:read"]},{"apiKeyHeader":["sites:read"]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Items per page (default 100)."},"required":false,"description":"Items per page (default 100).","name":"limit","in":"query"}],"responses":{"200":{"description":"The sites the key may read, ordered by id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteList"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}":{"get":{"summary":"Get a site","tags":["Sites"],"security":[{"bearer":["sites:read"]},{"apiKeyHeader":["sites:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"}],"responses":{"200":{"description":"One site with its time zone, opening hours and occupancy reset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices":{"get":{"summary":"List devices with health","tags":["Devices"],"security":[{"bearer":["devices:read"]},{"apiKeyHeader":["devices:read"]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Items per page (default 100)."},"required":false,"description":"Items per page (default 100).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":64,"description":"Only the devices of this site."},"required":false,"description":"Only the devices of this site.","name":"site","in":"query"}],"responses":{"200":{"description":"Devices (store PCs) the key may read, ordered by id, with their health and their cameras' health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceList"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/{deviceId}":{"get":{"summary":"Get a device with health","tags":["Devices"],"security":[{"bearer":["devices:read"]},{"apiKeyHeader":["devices:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The device's id, from List devices.","example":"dev_8a1e0c5b7d2f4936"},"required":true,"description":"The device's id, from List devices.","name":"deviceId","in":"path"}],"responses":{"200":{"description":"One device with its health and its cameras' health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/footfall":{"get":{"summary":"Footfall","tags":["Analytics"],"security":[{"bearer":["footfall:read"]},{"apiKeyHeader":["footfall:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"},{"schema":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"required":true,"description":"Bucket size in site time.","name":"grain","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","name":"from","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48)."},"required":false,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48).","name":"limit","in":"query"}],"responses":{"200":{"description":"Footfall — the IN count of entrance-role lines only — for the site and for each entrance line, per bucket of site time (15 minutes, hour or day), each bucket with its coverage; a bucket with nothing analysed has null figures and status no_data — a gap, never 0. Buckets that start after the time of the read are not listed; the one containing it is inProgress. Paged by bucket: pass nextCursor as cursor with the same grain, from and to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FootfallSeries"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/occupancy":{"get":{"summary":"Occupancy","tags":["Analytics"],"security":[{"bearer":["occupancy:read"]},{"apiKeyHeader":["occupancy:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"},{"schema":{"type":"string","enum":["15m","hour"],"description":"Occupancy is computed from quarter hours: 15m or hour."},"required":true,"description":"Occupancy is computed from quarter hours: 15m or hour.","name":"grain","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","name":"from","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48)."},"required":false,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48).","name":"limit","in":"query"}],"responses":{"200":{"description":"People inside (entrance IN − OUT since the daily reset, never below 0, with manual corrections) per bucket of site time (15 minutes, hour or day), each bucket with its coverage; a bucket with nothing analysed has null figures and status no_data — a gap, never 0. Buckets that start after the time of the read are not listed; the one containing it is inProgress. Paged by bucket: pass nextCursor as cursor with the same grain, from and to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OccupancySeries"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/occupancy/live":{"get":{"summary":"People inside now","tags":["Analytics"],"security":[{"bearer":["occupancy:read"]},{"apiKeyHeader":["occupancy:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"}],"responses":{"200":{"description":"People inside now, from the minutes committed so far, with their freshness (stale after 6 minutes).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OccupancyLive"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/queue":{"get":{"summary":"Queue","tags":["Analytics"],"security":[{"bearer":["queue:read"]},{"apiKeyHeader":["queue:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"},{"schema":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"required":true,"description":"Bucket size in site time.","name":"grain","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","name":"from","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48)."},"required":false,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48).","name":"limit","in":"query"}],"responses":{"200":{"description":"Queue length, waiting and service time per queue zone per bucket of site time (15 minutes, hour or day), each bucket with its coverage; a bucket with nothing analysed has null figures and status no_data — a gap, never 0. Buckets that start after the time of the read are not listed; the one containing it is inProgress. Paged by bucket: pass nextCursor as cursor with the same grain, from and to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueSeries"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/dwell":{"get":{"summary":"Dwell","tags":["Analytics"],"security":[{"bearer":["heatmap:read"]},{"apiKeyHeader":["heatmap:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"},{"schema":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"required":true,"description":"Bucket size in site time.","name":"grain","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","name":"from","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48)."},"required":false,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48).","name":"limit","in":"query"}],"responses":{"200":{"description":"Person-minutes and visits per dwell zone per bucket of site time (15 minutes, hour or day), each bucket with its coverage; a bucket with nothing analysed has null figures and status no_data — a gap, never 0. Buckets that start after the time of the read are not listed; the one containing it is inProgress. Paged by bucket: pass nextCursor as cursor with the same grain, from and to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DwellSeries"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{siteId}/heatmap":{"get":{"summary":"Heatmap","tags":["Analytics"],"security":[{"bearer":["heatmap:read"]},{"apiKeyHeader":["heatmap:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"The site's id, from List sites.","example":"s_3f9c1a2b4d5e6f70"},"required":true,"description":"The site's id, from List sites.","name":"siteId","in":"path"},{"schema":{"type":"string","enum":["15m","hour","day"],"description":"Bucket size in site time.","example":"hour"},"required":true,"description":"Bucket size in site time.","name":"grain","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting at or after it).","name":"from","in":"query"},{"schema":{"type":"string","description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","example":"2026-10-22"},"required":true,"description":"Site-local date (inclusive) or RFC 3339 instant (buckets starting before it). Use the same form as from.","name":"to","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"nextCursor of the previous page."},"required":false,"description":"nextCursor of the previous page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48)."},"required":false,"description":"Buckets per page (default: a day of 15-minute buckets, a week of hours, a year of days; heatmap 24, at most 48).","name":"limit","in":"query"}],"responses":{"200":{"description":"Person-minutes per grid cell of each heatmap zone (the camera's own grid over the full frame) per bucket of site time (15 minutes, hour or day), each bucket with its coverage; a bucket with nothing analysed has null figures and status no_data — a gap, never 0. Buckets that start after the time of the read are not listed; the one containing it is inProgress. Paged by bucket: pass nextCursor as cursor with the same grain, from and to. The range spans at most 31 days; at most 48 buckets per page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeatmapSeries"}}}},"400":{"description":"Invalid parameters (code invalid_argument).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No valid API key (code unauthenticated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope (code permission_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or outside the key's tenant or site (code not_found).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the key's rate limit (code rate_limited); see Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}