Skip to content
Suomi

The organisation's usage: product events counted by day

GET
/v1/organisation/analytics
Code sample: Shell / cURL
curl --request GET \
--url https://api.whatsbuilt.fi/v1/organisation/analytics \
--header 'Authorization: Bearer <token>'

What the organisation’s admins see on the usage page: each event with its count in [from, to), and per UTC day. Default: the last 30 days. Needs an integration that is an admin of its organisation.

from
string format: date-time

Inclusive; default 30 days before to

to
string format: date-time

Exclusive; default now

The counts

Media typeapplication/json

getOrganisationAnalytics: product events counted in [from, to) and per UTC day.

object
from
required
string
to
required
string
totals
required
Array<object>

One event’s count in the window.

object
event
required
string
count
required
integer format: int64
daily
required
Array<object>

One event’s count on one UTC day.

object
date
required

The UTC day, YYYY-MM-DD

string
event
required
string
count
required
integer format: int64

Example generated

{
"from": "example",
"to": "example",
"totals": [
{
"event": "example",
"count": 1
}
],
"daily": [
{
"date": "example",
"event": "example",
"count": 1
}
]
}

VALIDATION_ERROR for a malformed time, or to before from

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}