User Customer Analytics

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
PATCH

Retrieve user customer analytics config

Get the requesting user's account sidebar and task digest configuration for this project. Project defaults are returned until the user saves a personal pinned-property selection.

Required API key scopes

account:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/user_customer_analytics_config/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/user_customer_analytics_config/:id/

Example response

Status 200 The requesting user's account sidebar and notification configuration.
RESPONSE
{
"pinned_properties": [
{
"kind": "custom_property",
"id": "string"
}
],
"task_digest": {
"enabled": true,
"send_time": "14:15:22Z",
"cadence": "weekdays"
},
"account_detail_tabs": {
"ordered_tab_ids": [
"string"
],
"hidden_tab_ids": [
"string"
],
"default_tab_id": "string"
}
}

Update user customer analytics config

Replace the requesting user's ordered account sidebar properties when pinned_properties is provided, and change the task digest email preferences when task_digest is provided. Anything omitted keeps its current value. At most 50 account custom properties, relationships, and account fields can be pinned.

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • pinned_properties
    Click to open
    array
  • task_digest
  • account_detail_tabs

Response


Example request

PATCH /api/projects/:project_id/user_customer_analytics_config/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/user_customer_analytics_config/:id/\
-d pinned_properties="array"

Example response

Status 200 The updated account sidebar configuration.
RESPONSE
{
"pinned_properties": [
{
"kind": "custom_property",
"id": "string"
}
],
"task_digest": {
"enabled": true,
"send_time": "14:15:22Z",
"cadence": "weekdays"
},
"account_detail_tabs": {
"ordered_tab_ids": [
"string"
],
"hidden_tab_ids": [
"string"
],
"default_tab_id": "string"
}
}
Status 400 A pinned definition is invalid for this project.