Gallery Platform API
Reference

Ingest traffic samples

Upserts a batch of anonymous aggregate visitor counts on the unique (sensor_id, bucket_start) key, so replayed at-least-once uplinks are free. Written by a device key holding `traffic:create`. No per-sample event is emitted.

POST
/gallery/traffic/samples

Upserts a batch of anonymous aggregate visitor counts on the unique (sensor_id, bucket_start) key, so replayed at-least-once uplinks are free. Written by a device key holding traffic:create. No per-sample event is emitted.

Authorization

bearerAuth traffic:create
AuthorizationBearer <token>

A gallery API key, sent as Authorization: Bearer gpk_… (or the x-api-key header).

In: header

Scope: traffic:create

Header Parameters

Idempotency-Key?string

Optional. Send a unique key per logical operation to make retries safe: a retry with the same key replays the stored success for 14 days instead of re-running the write. Reusing a key with a different body returns 400.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A batch of anonymous aggregate samples, upserted on (sensor_id, bucket_start).

Items1 <= items <= 1000
[index: integer]?

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

{  "upserted": -9007199254740991}