External Data
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
GET | |
PATCH | |
DELETE | |
POST | |
DELETE | |
GET | |
PATCH | |
POST | |
GET | |
POST | |
POST |
List all external data schemas
Also available via the PostHog MCP server:
external-data-schemas-list— List data warehouse table schemas (imported tables)
Required API key scopes
external_data_source:readQuery parameters
- limitinteger
- offsetinteger
- searchstring
Response
Example request
GET /api /projects /:project_id /external_data_schemasExample response
Status 200
Retrieve external data schemas
Also available via the PostHog MCP server:
external-data-schemas-retrieve— Get data warehouse table schema
Required API key scopes
external_data_source:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /external_data_schemas /:idExample response
Status 200
Update external data schemas
Also available via the PostHog MCP server:
external-data-schemas-partial-update— Update data warehouse table schema sync config
Required API key scopes
external_data_source:writePath parameters
- idstring
Request parameters
- should_syncboolean
- sync_type
- incremental_fieldstringnull
- incremental_field_type
- incremental_field_lookback_secondsintegernull
- sync_frequency
- sync_time_of_daystringnull
- primary_key_columnsarraynull
- cdc_table_mode
- enabled_columnsarraynull
- row_filtersarraynull
- api_versionstringnull
Response
Example request
PATCH /api /projects /:project_id /external_data_schemas /:idExample response
Status 200
Delete external data schemas
Required API key scopes
external_data_source:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /external_data_schemas /:idExample response
Status 204 No response body
Create external data schemas cancel
Required API key scopes
external_data_source:writePath parameters
- idstring
Example request
POST /api /projects /:project_id /external_data_schemas /:id /cancelExample response
Status 200 The running sync was cancelled. v3 pipeline jobs are marked Failed immediately; for older pipeline versions the cancelled workflow records the final status. When no sync was actually running but the schema was stuck reporting Running, the schema status is corrected instead and the response says so.
Status 400 No running sync to cancel, or the sync already finished.
Delete external data schemas delete data
Required API key scopes
external_data_source:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /external_data_schemas /:id /delete_dataExample response
Status 204 No response body
Retrieve external data schemas destinations
Read or replace this table's destination override.
Send destination_ids: null to clear the override so the table follows its source again.
Required API key scopes
external_data_source:writePath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /external_data_schemas /:id /destinationsExample response
Status 200
Update external data schemas destinations
Read or replace this table's destination override.
Send destination_ids: null to clear the override so the table follows its source again.
Required API key scopes
external_data_source:writePath parameters
- idstring
Request parameters
- destination_idsarraynull
Response
Example request
PATCH /api /projects /:project_id /external_data_schemas /:id /destinationsExample response
Status 200
Create external data schemas incremental fields
Also available via the PostHog MCP server:
external-data-schemas-incremental-fields-create— Refresh candidate incremental fields for a schema
Required API key scopes
external_data_source:writePath parameters
- idstring
Request parameters
- should_syncboolean
- sync_type
- incremental_fieldstringnull
- incremental_field_type
- incremental_field_lookback_secondsintegernull
- sync_frequency
- sync_time_of_daystringnull
- primary_key_columnsarraynull
- cdc_table_mode
- enabled_columnsarraynull
- row_filtersarraynull
- api_versionstringnull
Example request
POST /api /projects /:project_id /external_data_schemas /:id /incremental_fieldsExample response
Status 200 No response body
Retrieve external data schemas logs
Required API key scopes
external_data_source:readPath parameters
- idstring
Query parameters
- afterstring
- beforestring
- instance_idstring
- levelstring
- limitintegerDefault:
50 - searchstring
Example request
GET /api /projects /:project_id /external_data_schemas /:id /logsExample response
Status 200 No response body
Create external data schemas reload
Trigger a sync for the schema using its configured sync method. Most methods keep the existing warehouse table and add or merge new rows, but a full-refresh schema rebuilds the whole table on every run. To force a rebuild from the source, use resync.
Required API key scopes
external_data_source:writePath parameters
- idstring
Example request
POST /api /projects /:project_id /external_data_schemas /:id /reloadExample response
Status 200 The sync was triggered.
Status 400 The sync could not be started.
Create external data schemas resync
Request a full resync of the schema. For sources that can backfill, this drops the warehouse table and re-imports every row from the source, so existing data is deleted first. A webhook-only schema cannot backfill, so it keeps its existing table and resumes ingestion instead. To sync without requesting a rebuild, use reload.
Required API key scopes
external_data_source:writePath parameters
- idstring
Example request
POST /api /projects /:project_id /external_data_schemas /:id /resync