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
metric
enum<string>
default: nb_messages

The metric to be analyzed.

Available options:
sum,
avg,
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. Can be a metadata field, a time field, tagger_name, scorer_name, task_position, None, session_length

Available options:
day,
week,
month,
tagger_name,
scorer_name,
task_position,
session_length
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.

project_id
string
required

Response

200 - application/json
pivot_table
any[]
required