Persons-5

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

Endpoints

GET
GET
POST
GET
GET
GET

Retrieve persons lifecycle

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Retrieve persons lifecycle

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Retrieve persons properties at time

Get person properties as they existed at a specific point in time.

This endpoint reconstructs person properties by querying ClickHouse events for $set and $set_once operations up to the specified timestamp.

Query parameters:

  • distinct_id: The distinct_id of the person
  • timestamp: ISO datetime string for the point in time (e.g., "2023-06-15T14:30:00Z")
  • include_set_once: Whether to handle $set_once operations (default: false)
  • debug: Whether to include debug information with raw events (default: false)

Required API key scopes

person:read

Path parameters

  • project_id
    string

Query parameters

  • debug
    boolean
  • distinct_id
    string
  • format
    string
    One of: "csv""json"
  • include_set_once
    boolean
  • person_id
    string
  • timestamp
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"distinct_ids": [
"string"
],
"properties": {
"property1": "string",
"property2": "string"
},
"created_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"last_seen_at": "2019-08-24T14:15:22Z",
"point_in_time_metadata": {
"queried_timestamp": "string",
"include_set_once": true,
"distinct_id_used": "string",
"person_id_used": "string",
"query_mode": "string",
"distinct_ids_queried": [
"string"
],
"distinct_ids_count": 0
},
"debug": {
"query": "string",
"params": {
"property1": null,
"property2": null
},
"events_found": 0,
"events": [
{
"property1": null,
"property2": null
}
],
"error": "string"
}
}
Status 400
Status 404
Status 500

Retrieve persons properties at time

Get person properties as they existed at a specific point in time.

This endpoint reconstructs person properties by querying ClickHouse events for $set and $set_once operations up to the specified timestamp.

Query parameters:

  • distinct_id: The distinct_id of the person
  • timestamp: ISO datetime string for the point in time (e.g., "2023-06-15T14:30:00Z")
  • include_set_once: Whether to handle $set_once operations (default: false)
  • debug: Whether to include debug information with raw events (default: false)

Required API key scopes

person:read

Path parameters

  • project_id
    string

Query parameters

  • debug
    boolean
  • distinct_id
    string
  • format
    string
    One of: "csv""json"
  • include_set_once
    boolean
  • person_id
    string
  • timestamp
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": 0,
"name": "string",
"distinct_ids": [
"string"
],
"properties": {
"property1": "string",
"property2": "string"
},
"created_at": "2019-08-24T14:15:22Z",
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"last_seen_at": "2019-08-24T14:15:22Z",
"point_in_time_metadata": {
"queried_timestamp": "string",
"include_set_once": true,
"distinct_id_used": "string",
"person_id_used": "string",
"query_mode": "string",
"distinct_ids_queried": [
"string"
],
"distinct_ids_count": 0
},
"debug": {
"query": "string",
"params": {
"property1": null,
"property2": null
},
"events_found": 0,
"events": [
{
"property1": null,
"property2": null
}
],
"error": "string"
}
}
Status 400
Status 404
Status 500

Create persons reset person distinct id

Reset a distinct_id for a deleted person. This allows the distinct_id to be used again.

Required API key scopes

person:write

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Request parameters

  • properties

Example request

POST /api/projects/:project_id/persons/reset_person_distinct_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/persons/reset_person_distinct_id/\
-d name="string"

Example response

Status 200 No response body

Create persons reset person distinct id

Reset a distinct_id for a deleted person. This allows the distinct_id to be used again.

Required API key scopes

person:write

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Request parameters

  • properties

Example request

POST /api/projects/:project_id/persons/reset_person_distinct_id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/persons/reset_person_distinct_id/\
-d name="string"

Example response

Status 200 No response body

Retrieve persons stickiness

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Retrieve persons stickiness

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body



Retrieve persons values

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Required API key scopes

person:read

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Retrieve persons values

This endpoint is meant for reading and deleting persons. To create or update persons, we recommend using the capture API, the $set and $unset properties, or one of our SDKs.

Required API key scopes

person:read

Path parameters

  • project_id
    string

Query parameters

  • format
    string
    One of: "csv""json"

Example request

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

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.