Query
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
Create query
Path Parameters
- project_idstringProject ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/. 
Query Parameters
- asyncboolean(Experimental) Whether to run the query asynchronously. Defaults to False. If True, the idof the query can be used to check the status and to cancel it.
- client_query_idstringClient provided query ID. Can be used to retrieve the status or cancel the query. 
- querystringSubmit 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. 
Request
POST 
Response
Status 200 Query results
Retrieve query
(Experimental)
Path Parameters
- idstring
- project_idstringProject ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/. 
Request
GET 
Response
Status 200 Query status
Delete query
(Experimental)
Path Parameters
- idstring
- project_idstringProject ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/. 
Request
DELETE 
Response
Status 204 No response body
Retrieve query draft sql
Path Parameters
- project_idstringProject ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/. 
Request
GET