Environments-24
For instructions on how to authenticate to use this endpoint, see API overview.
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.
Endpoints
POST | |
GET | |
POST | |
GET | |
POST | |
GET | |
GET | |
GET | |
GET | |
POST |
Create environments persons funnel
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /funnelExample response
Status 200 No response body
Create environments persons funnel
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /funnelExample response
Status 200 No response body
Retrieve environments persons funnel correlation
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Retrieve environments persons funnel correlation
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Create environments persons funnel correlation
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Create environments persons funnel correlation
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /funnel /correlationExample response
Status 200 No response body
Retrieve environments persons lifecycle
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /lifecycleExample response
Status 200 No response body
Retrieve environments persons lifecycle
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /lifecycleExample response
Status 200 No response body
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:writePath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /reset_person_distinct_idExample response
Status 200 No response body
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:writePath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- properties
Example request
POST /api /environments /:project_id /persons /reset_person_distinct_idExample response
Status 200 No response body
Retrieve environments persons stickiness
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /stickinessExample response
Status 200 No response body
Retrieve environments persons stickiness
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /stickinessExample response
Status 200 No response body
Retrieve environments persons trends
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /trendsExample response
Status 200 No response body
Retrieve environments persons trends
Path parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /trendsExample response
Status 200 No response body
Retrieve environments persons values
Required API key scopes
person:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /valuesExample response
Status 200 No response body
Retrieve environments persons values
Required API key scopes
person:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /environments /:project_id /persons /valuesExample response
Status 200 No response body
List all environments plugin configs logs
Required API key scopes
plugin:readPath parameters
- plugin_config_idstring
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
Response
Example request
GET /api /environments /:project_id /plugin_configs /:plugin_config_id /logsExample response
Status 200
List all environments plugin configs logs
Required API key scopes
plugin:readPath parameters
- plugin_config_idstring
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
Response
Example request
GET /api /environments /:project_id /plugin_configs /:plugin_config_id /logsExample response
Status 200
Create environments query
Required API key scopes
query:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- asyncboolean
- client_query_idstring
Client provided query ID. Can be used to retrieve the status or cancel the query.
- filters_override
- namestring
Name given to a query. It's used to identify the query in the UI. Up to 128 characters for a name.
- query
Submit a JSON string representing a query for PostHog data analysis, for example a HogQL query.
Example payload:
{"query": {"kind": "HogQLQuery", "query": "select * from events limit 100"}}For more details on HogQL queries, see the PostHog HogQL documentation.
- refreshDefault:
blockingWhether results should be calculated sync or async, and how much to rely on the cache:
'blocking'- calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in the cache'async'- kick off background calculation (returning immediately with a query status), UNLESS there are very fresh results in the cache'lazy_async'- kick off background calculation, UNLESS there are somewhat fresh results in the cache'force_blocking'- calculate synchronously, even if fresh results are already cached'force_async'- kick off background calculation, even if fresh results are already cached'force_cache'- return cached data or a cache miss; always completes immediately as it never calculates Background calculation can be tracked using thequery_statusresponse field.
- variables_overrideobject
Response
Example request
POST /api /environments /:project_id /queryExample response
Status 200
Create environments query
Required API key scopes
query:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request parameters
- asyncboolean
- client_query_idstring
Client provided query ID. Can be used to retrieve the status or cancel the query.
- filters_override
- namestring
Name given to a query. It's used to identify the query in the UI. Up to 128 characters for a name.
- query
Submit a JSON string representing a query for PostHog data analysis, for example a HogQL query.
Example payload:
{"query": {"kind": "HogQLQuery", "query": "select * from events limit 100"}}For more details on HogQL queries, see the PostHog HogQL documentation.
- refreshDefault:
blockingWhether results should be calculated sync or async, and how much to rely on the cache:
'blocking'- calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in the cache'async'- kick off background calculation (returning immediately with a query status), UNLESS there are very fresh results in the cache'lazy_async'- kick off background calculation, UNLESS there are somewhat fresh results in the cache'force_blocking'- calculate synchronously, even if fresh results are already cached'force_async'- kick off background calculation, even if fresh results are already cached'force_cache'- return cached data or a cache miss; always completes immediately as it never calculates Background calculation can be tracked using thequery_statusresponse field.
- variables_overrideobject
Response
Example request
POST /api /environments /:project_id /query