Persons-2
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
GET | |
GET | |
GET | |
PATCH | |
GET | |
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
POST | |
POST | |
GET | |
GET | |
GET | |
POST |
Create environments 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:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:environment_id /persons /reset_person_distinct_idExample response
Status 200 No response body
Retrieve environments persons trends
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.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:environment_id /persons /trendsExample response
Status 200 No response body
Retrieve environments persons values
Also available via the PostHog MCP server:
persons-values-retrieve— Get person property 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:readQuery parameters
- formatstringOne of:
"csv""json" - keystring
- valuestring
Example request
GET /api /environments /:environment_id /persons /valuesExample response
Status 200 No response body
List all persons
Also available via the PostHog MCP server:
persons-list— List persons
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:readQuery parameters
- distinct_idstring
- emailstring
- formatstringOne of:
"csv""json" - limitinteger
- offsetinteger
- propertiesarray
- searchstring
Response
Example request
GET /api /projects /:project_id /personsExample response
Status 200
Retrieve persons
Also available via the PostHog MCP server:
persons-retrieve— Get person
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:readPath parameters
- idstring
Query parameters
- formatstringOne of:
"csv""json"
Response
Example request
GET /api /projects /:project_id /persons /:idExample response
Status 200
Update persons
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:writePath parameters
- idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Response
Example request
PATCH /api /projects /:project_id /persons /:idExample response
Status 200
Retrieve persons activity
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
activity_log:readPath parameters
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /:id /activityExample response
Status 200 No response body
Create persons delete property
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:writePath parameters
- idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- $unsetstring
Example request
POST /api /projects /:project_id /persons /:id /delete_propertyExample response
Status 200 No response body
Retrieve persons properties timeline
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
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /:id /properties_timelineExample response
Status 200 No response body
Create persons split
Split distinct_ids off a merged person. Two mutually exclusive modes:
distinct_ids_to_split(recommended for surgical edits): moves only the listed distinct_ids off this person onto new single-id persons. The original person keeps every other distinct_id and its properties.main_distinct_id(legacy semantics): keeps only the specified distinct_id on this person; moves every other distinct_id off onto its own new person. If omitted, the person's properties are wiped and the first distinct_id is treated as the one to keep.
The split runs asynchronously: a 201 response means the task was enqueued. Newly-created split-off persons get a deterministic UUID derived from (team_id, distinct_id), so they can be located client-side without polling. If you need to delete a split-off person after this call, prefer looking it up by that deterministic UUID rather than by distinct_id, since the latter still resolves to the original merged person until the async task completes.
Required API key scopes
person:writePath parameters
- idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- main_distinct_idstringnull
- distinct_ids_to_splitarraynull
Response
Example request
POST /api /projects /:project_id /persons /:id /splitExample response
Status 201
Create persons update property
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:writePath parameters
- idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- keystring
- value
Example request
POST /api /projects /:project_id /persons /:id /update_propertyExample response
Status 200 No response body
Retrieve persons all activity
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
activity_log:readQuery parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /activityExample response
Status 200 No response body
Create persons batch by distinct ids
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.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /batch_by_distinct_idsExample response
Status 200 No response body
Create persons batch by uuids
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.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /batch_by_uuidsExample response
Status 200 No response body
Create persons bulk delete
This endpoint allows you to bulk delete persons, either by the PostHog person IDs or by distinct IDs. You can pass in a maximum of 1000 IDs per call. Only events captured before the request will be deleted.
Required API key scopes
person:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- idsarray
- distinct_idsarray
- delete_eventsbooleanDefault:
false - delete_recordingsbooleanDefault:
false - keep_personbooleanDefault:
false
Response
Example request
POST /api /projects /:project_id /persons /bulk_deleteExample response
Status 202
Retrieve persons cohorts
Also available via the PostHog MCP server:
persons-cohorts-retrieve— Get person cohorts
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:readcohort:readQuery parameters
- formatstringOne of:
"csv""json" - person_idstring
Example request
GET /api /projects /:project_id /persons /cohortsExample response
Status 200 No response body
List all persons deletion status
List the status of queued event deletions for persons. When you delete a person with delete_events=true, an async deletion is queued. Use this endpoint to check whether those deletions are still pending or have been completed.
Required API key scopes
person:readQuery parameters
- formatstringOne of:
"csv""json" - limitinteger
- offsetinteger
- person_uuidstring
- statusstringOne of:
"all""completed""pending"
Response
Example request
GET /api /projects /:project_id /persons /deletion_statusExample response
Status 200
Retrieve persons funnel
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.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /funnelExample response
Status 200 No response body
Create persons funnel
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.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /funnel