Data
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
GET | |
POST | |
GET | |
POST | |
POST | |
GET | |
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET |
Create environments external data sources update webhook inputs
Also available via the PostHog MCP server:
external-data-sources-update-webhook-inputs-create— Update webhook inputs (signing secret, etc.)
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:writePath parameters
- idstring
Request parameters
- created_via
- client_secretstring
- account_idstring
- prefixstringnull
- descriptionstringnull
- job_inputs
Example request
POST /api /environments /:environment_id /external_data_sources /:id /update_webhook_inputsExample response
Status 200 No response body
Retrieve environments external data sources webhook info
Also available via the PostHog MCP server:
external-data-sources-webhook-info-retrieve— Get webhook status for a source
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:readPath parameters
- idstring
Example request
GET /api /environments /:environment_id /external_data_sources /:id /webhook_infoExample response
Status 200 No response body
Create environments external data sources check cdc prerequisites
Also available via the PostHog MCP server:
external-data-sources-check-cdc-prerequisites-create— Check Postgres CDC prerequisites
Validate CDC prerequisites against a live Postgres connection.
Used by the source wizard to surface ✅/❌ checks before source creation, and by the self-managed setup popup to verify user-created publications.
Required API key scopes
external_data_source:writeExample request
POST /api /environments /:environment_id /external_data_sources /check_cdc_prerequisitesExample response
Status 200 Whether the Postgres database satisfies CDC prerequisites.
Status 400 Invalid config, disallowed host, or connection failure.
List all environments external data sources connections
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:readQuery parameters
- limitinteger
- offsetinteger
- searchstring
Response
Example request
GET /api /environments /:environment_id /external_data_sources /connectionsExample response
Status 200
Create environments external data sources database schema
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:writeRequest parameters
- source_type
Example request
POST /api /environments /:environment_id /external_data_sources /database_schemaExample response
Status 200 No response body
Create environments external data sources source prefix
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:writeRequest parameters
- created_via
- client_secretstring
- account_idstring
- prefixstringnull
- descriptionstringnull
- job_inputs
Example request
POST /api /environments /:environment_id /external_data_sources /source_prefixExample response
Status 200 No response body
Retrieve environments external data sources wizard
Create, Read, Update and Delete External data Sources.
Required API key scopes
external_data_source:readExample request
GET /api /environments /:environment_id /external_data_sources /wizardExample response
Status 200 No response body
List all environments insight variables
Required API key scopes
insight_variable:readQuery parameters
- pageinteger
Response
Example request
GET /api /environments /:environment_id /insight_variablesExample response
Status 200
Create environments insight variables
Required API key scopes
insight_variable:writeRequest parameters
- namestring
- type
- default_value
- values
Response
Example request
POST /api /environments /:environment_id /insight_variablesExample response
Status 201
Retrieve environments insight variables
Required API key scopes
insight_variable:readPath parameters
- idstring
Response
Example request
GET /api /environments /:environment_id /insight_variables /:idExample response
Status 200
Update environments insight variables
Required API key scopes
insight_variable:writePath parameters
- idstring
Request parameters
- namestring
- type
- default_value
- values
Response
Example request
PATCH /api /environments /:environment_id /insight_variables /:idExample response
Status 200
Delete environments insight variables
Required API key scopes
insight_variable:writePath parameters
- idstring
Example request
DELETE /api /environments /:environment_id /insight_variables /:idExample response
Status 204 No response body
List all environments warehouse saved queries
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
warehouse_view:readQuery parameters
- pageinteger
- searchstring
Response
Example request
GET /api /environments /:environment_id /warehouse_saved_queriesExample response
Status 200
Create environments warehouse saved queries
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
warehouse_view:writeRequest parameters
- deletedbooleannull
- namestring
- queryobject
- folder_idstringnull
- edited_history_idstringnull
- soft_updatebooleannull
- dag_idstringnull
- is_testboolean
Response
Example request
POST /api /environments /:environment_id /warehouse_saved_queriesExample response
Status 201
Retrieve environments warehouse saved queries
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
warehouse_view:readPath parameters
- idstring
Response
Example request
GET /api /environments /:environment_id /warehouse_saved_queries /:idExample response
Status 200
Update environments warehouse saved queries
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
warehouse_view:writePath parameters
- idstring
Request parameters
- deletedbooleannull
- namestring
- queryobject
- folder_idstringnull
- edited_history_idstringnull
- soft_updatebooleannull
- dag_idstringnull
- is_testboolean
Response
Example request
PATCH /api /environments /:environment_id /warehouse_saved_queries /:idExample response
Status 200
Delete environments warehouse saved queries
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
warehouse_view:writePath parameters
- idstring
Example request
DELETE /api /environments /:environment_id /warehouse_saved_queries /:idExample response
Status 204 No response body
Retrieve environments warehouse saved queries activity
Create, Read, Update and Delete Warehouse Tables.
Required API key scopes
activity_log:readPath parameters
- idstring
Response
Example request
GET /api /environments /:environment_id /warehouse_saved_queries /:id /activity