Skip to main content
GET
/
v1
/
analytics
/
blocks
Get block click analytics
curl --request GET \
  --url https://api.oneofnone.io/v1/analytics/blocks \
  --header 'x-api-key: <api-key>'
{
  "meta": {
    "total_clicks": 1,
    "total_dialog_closes": 1,
    "avg_dialog_duration": 123
  },
  "timeseries": [
    {
      "date": "<string>",
      "total_clicks": 123,
      "unique_users": 123,
      "total_dialog_closes": 123,
      "avg_dialog_duration": 123
    }
  ],
  "top_blocks": [
    {
      "block_id": "<string>",
      "block_type": "<string>",
      "dialog_content_type": "<string>",
      "total_clicks": 1,
      "unique_users": 123,
      "block": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "title": "<string>"
      }
    }
  ],
  "avg_block_index": [
    {
      "block_type": "<string>",
      "avg_block_index": 123,
      "total_clicks": 123
    }
  ]
}

Authorizations

x-api-key
string
header
required

The API key required for accessing protected routes. It should be included in the request headers as x-api-key.

Query Parameters

team_id
string

Filter by team ID. One of team_id, team_slug, team_ids, or team_slugs required.

team_slug
string

Filter by team slug.

team_ids
string

Comma-separated team IDs. Mutually exclusive with team_id/team_slug.

team_slugs
string

Comma-separated team slugs. Mutually exclusive with team_id/team_slug.

date_from
string<date>
required

The start date for the analytics in ISO 8601 format (e.g., "2024-09-01"). Required.

date_to
string<date>

The end date for the analytics in ISO 8601 format (e.g., "2024-09-30"). If not provided, defaults to current date.

aggregation
enum<string>
default:daily

The aggregation level for the data.

Available options:
daily,
weekly,
monthly,
quarterly,
yearly
collection_id
string<uuid>

The collection ID to filter by.

collection_slug
string

The collection slug to filter by.

token_id
integer

The token ID to filter by.

Required range: x >= 1
block_id
string

The block ID to filter by.

block_type
enum<string>

The block type to filter by.

Available options:
external_url,
reward,
dialog,
all
action_type
enum<string>

The action type to filter by.

Available options:
video,
image,
carousel,
post,
iframe,
url,
all
country_code
string

The country code to filter by.

region_code
string

The region code to filter by.

device
enum<string>

The device type to filter by.

Available options:
mobile,
tablet,
desktop,
all
min_block_index
integer

The minimum block index to filter by.

max_block_index
integer

The maximum block index to filter by.

order_by
enum<string>

The field to order by.

Available options:
date,
total_clicks,
unique_users,
avg_dialog_duration
order
enum<string>

The sort order (ascending or descending).

Available options:
asc,
desc
limit
integer
default:50

The number of results per page.

Required range: x >= 1
offset
integer
default:0

The offset for pagination.

Required range: x >= 0

Response

Successfully fetched block analytics.

Structured blocks/analytics response (BFF pattern).

meta
object
required
timeseries
object[]
required
top_blocks
object[]
required
avg_block_index
object[]
required