Get usage
/v1/usageEvent counts per hour or day over a window (default: the last 30 days), with totals and AR session time. Reads one organization (org_id, or your only one), every one you reach (scope=all), or one product (product_id). Your organization's own traffic is left out unless include_internal=true.
group_by=product adds by_product: the window's best-performing products, ranked by 3D views then AR entries, each with its title. 400 when start is not before end.
Query Parameters
The window's start (ISO 8601). Default: 30 days before end.
The window's end (ISO 8601). Default: now.
The organization to read. With a key, its own organization is read and org_id may be left out. Signed in, it is required unless you belong to one organization or send scope=all.
org (the default) reads one organization. all reads every organization you can reach; it needs a signed-in session (400 with a key).
"org"Value in
- "org"
- "all"
Only this product's events. Its own organization is read, so org_id may be left out.
Only the events of one 3D model from the previous version of the API. Cannot be combined with product_id.
Only events of this type. Left out, every type is counted.
The bucket size: day (the default) or hour.
"day"Value in
- "hour"
- "day"
Also count your organization's own traffic: its members viewing its products. Default false.
falseproduct adds by_product: the window's 20 best-performing products, ranked by 3D views, then AR entries.
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/usage"{ "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "granularity": "hour", "buckets": [ { "period_start": "2019-08-24T14:15:22Z", "event_type": "generation.created", "count": 0, "cost_cents": 0, "duration": { "total_ms": 0, "count": 0 } } ], "totals": { "property1": 0, "property2": 0 }, "durations": { "property1": { "total_ms": 0, "count": 0 }, "property2": { "total_ms": 0, "count": 0 } }, "by_product": [ { "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1", "title": "string", "totals": { "property1": 0, "property2": 0 } } ]}{ "error": { "code": "string", "message": "string", "details": null }}Revoke an API key DELETE
Revokes the key at once; it stays listed with `revoked_at` set. `204` on success; `404` for a key you cannot see.
Record a viewer event POST
Records a view, an AR entry or an AR session's end, as the embed does. Accepts a publishable key from one of your allowed domains. Always answers `204`; only a malformed body is refused (`422`).