You can also use the query endpoint to retrieve persons. It enables you to use SQL to query the persons table.
Persons
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
POST | |
POST | |
GET | |
POST | |
POST | |
GET | |
POST | |
GET | |
GET | |
POST | |
GET | |
POST | |
GET |
List all persons
Required API key scopes
person:readPath parameters
- project_idstring
Query 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
Required API key scopes
person:readPath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Response
Example request
GET /api /projects /:project_id /persons /:idExample response
Status 200
Update persons
It is better to use the capture API to update person properties.
This endpoint functionally captures a $set event with a $set property key along with the property values you want to update.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Response
Example request
PATCH /api /projects /:project_id /persons /:idExample response
Status 200
Delete persons
This is the main way to delete data in PostHog.
To learn more, see our data deletion docs.
Use this endpoint to delete individual persons. For bulk deletion, use the bulk_delete endpoint instead.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- delete_eventsbooleanDefault:
false - formatstringOne of:
"csv""json"
Example request
DELETE /api /projects /:project_id /persons /:idExample response
Status 204 No response body
Retrieve persons activity retrieve
Required API key scopes
activity_log:readPath parameters
- idinteger
- project_idstring
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 events
Queue deletion of all events associated with this person. The task runs during non-peak hours.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /:id /delete_eventsExample response
Status 200 No response body
Create persons delete property
It is better to use the capture API to change person properties.
This endpoint functionally captures a $delete_person_property event with an $unset property key along with the property value you want to delete.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- $unsetstring
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /:id /delete_propertyExample response
Status 200 No response body
Create persons delete recordings
Queue deletion of all recordings associated with this person.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /:id /delete_recordingsExample response
Status 200 No response body
Retrieve persons properties timeline
Path parameters
- idinteger
- project_idstring
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
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /:id /splitExample response
Status 200 No response body
Create persons update property
It is better to use the capture API to update person properties.
This endpoint functionally captures a $set event with a $set property key along with the property value you want to update.
Required API key scopes
person:writePath parameters
- idinteger
- project_idstring
Query parameters
- formatstringOne of:
"csv""json" - keystring
- value
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /:id /update_propertyExample response
Status 200 No response body
Retrieve persons activity
Required API key scopes
activity_log:readPath parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /activityExample 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.
Required API key scopes
person:writePath parameters
- project_idstring
Query parameters
- delete_eventsbooleanDefault:
false - distinct_idsobject
- formatstringOne of:
"csv""json" - idsobject
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /bulk_deleteExample response
Status 200 No response body
Retrieve persons cohorts
Required API key scopes
person:readcohort:readPath parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /cohortsExample response
Status 200 No response body
Retrieve persons funnel
Path parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /funnelExample response
Status 200 No response body
Create persons funnel
Path parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /funnelExample response
Status 200 No response body
Retrieve persons funnel correlation
Path parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Create persons funnel correlation
Path parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /projects /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Retrieve persons lifecycle
Path parameters
- project_idstring
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /persons /lifecycle