User Facet

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

Endpoints

GET
PATCH

Retrieve user facet settings

Get the authenticated user's custom facets for a product, within the current team. Pass @me as the UUID.

Required API key scopes

user:read

Path parameters

  • uuid
    string

Query parameters

  • product
    string
    One of: "logs""tracing"

Response


Example request

GET /api/user_facet_settings/:uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/user_facet_settings/:uuid/

Example response

Status 200
RESPONSE
{
"custom_facets": [
{
"key": "string",
"source_type": "attribute"
}
]
}

Retrieve user facet settings

Get the authenticated user's custom facets for a product, within the current team. Pass @me as the UUID.

Required API key scopes

user:read

Path parameters

  • uuid
    string

Query parameters

  • product
    string
    One of: "logs""tracing"

Response


Example request

GET /api/user_facet_settings/:uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/user_facet_settings/:uuid/

Example response

Status 200
RESPONSE
{
"custom_facets": [
{
"key": "string",
"source_type": "attribute"
}
]
}

Update user facet settings

Replace the authenticated user's custom facets for a product, within the current team. Pass @me as the UUID.

Required API key scopes

user:write

Path parameters

  • uuid
    string

Query parameters

  • product
    string
    One of: "logs""tracing"

Request parameters

  • custom_facets
    Click to open
    array

Response


Example request

PATCH /api/user_facet_settings/:uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/user_facet_settings/:uuid/\
-d custom_facets="array"

Example response

Status 200
RESPONSE
{
"custom_facets": [
{
"key": "string",
"source_type": "attribute"
}
]
}

Update user facet settings

Replace the authenticated user's custom facets for a product, within the current team. Pass @me as the UUID.

Required API key scopes

user:write

Path parameters

  • uuid
    string

Query parameters

  • product
    string
    One of: "logs""tracing"

Request parameters

  • custom_facets
    Click to open
    array

Response


Example request

PATCH /api/user_facet_settings/:uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/user_facet_settings/:uuid/\
-d custom_facets="array"

Example response

Status 200
RESPONSE
{
"custom_facets": [
{
"key": "string",
"source_type": "attribute"
}
]
}