Persons
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
PATCH | |
GET | |
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
POST | |
POST | |
GET | |
GET | |
GET | |
POST | |
GET | |
GET |
List all environments 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 /environments /:environment_id /personsExample response
Status 200
Retrieve environments 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 /environments /:environment_id /persons /:idExample response
Status 200
Update environments 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 /environments /:environment_id /persons /:idExample response
Status 200
Retrieve environments 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 /environments /:environment_id /persons /:id /activityExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /:id /delete_propertyExample response
Status 200 No response body
Retrieve environments 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 /environments /:environment_id /persons /:id /properties_timelineExample response
Status 200 No response body
Create environments persons split
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
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:environment_id /persons /:id /splitExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /:id /update_propertyExample response
Status 200 No response body
Retrieve environments 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 /environments /:environment_id /persons /activityExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /batch_by_distinct_idsExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /batch_by_uuidsExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /bulk_deleteExample response
Status 202
Retrieve environments 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 /environments /:environment_id /persons /cohortsExample response
Status 200 No response body
List all environments 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 /environments /:environment_id /persons /deletion_statusExample response
Status 200
Retrieve environments 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 /environments /:environment_id /persons /funnelExample response
Status 200 No response body
Create environments 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 /environments /:environment_id /persons /funnelExample response
Status 200 No response body
Retrieve environments 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.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:environment_id /persons /lifecycleExample response
Status 200 No response body
Retrieve environments 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)
Required API key scopes
person:readQuery parameters
- distinct_idstring
- formatstringOne of:
"csv""json" - include_set_onceboolean
- person_idstring
- timestampstring
Response
Example request
GET /api /environments /:environment_id /persons /properties_at_timeExample response
Status 200
Status 400
Status 404
Status 500
Retrieve environments 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)
Required API key scopes
person:readQuery parameters
- distinct_idstring
- formatstringOne of:
"csv""json" - include_set_onceboolean
- person_idstring
- timestampstring
Response
Example request
GET /api /environments /:environment_id /persons /properties_at_time