POST
/
export
/
analytics

This is the main endpoint for querying data from phospho. It can be used add an analytics dashboard in your product, query data for further analysis or export to destinations not yet supported by phospho.

Most of the vizualisations in the phospho dashboard are built using this service.

Using temporal dimensions

If the dimension is month, week or day the data will be grouped by the corresponding time unit from the created_at field. The time will be formated in UTC time with the corresponding format: YYYY-MMfor months, YYYY-MM-DD for days,…

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
project_id
string
required
metric
enum<string>
default: nb_messages

The metric to be analyzed.

Available options:
sum,
avg,
count_unique,
nb_messages,
nb_sessions,
tags_count,
avg_scorer_value,
avg_success_rate,
avg_session_length,
tags_distribution
metric_metadata
string | null

The metadata field to be analyzed.

breakdown_by
default: day

The field to break down the metric by. If the metric is a free string, it will be interpreted as a metadata field.

Available options:
day,
week,
month,
tagger_name,
scorer_value,
classifier_value,
task_position,
session_length
breakdown_by_event_id
string | null

When using the scorer_value or classifier_value breakdown_by, this is the EventDefinition.id of the scorer or classifier. Check the id in the Event page URL.

scorer_id
string | null

When using the avg_scorer_value metric, this is the EventDefinition.id of the scorer. Check the id of the scorer in the Event page URL.

filters
object | null

This is a model used to filter tasks, sessions or events in different endpoints.

Response

200 - application/json
pivot_table
any[]
required