Data

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
POST
GET
GET
POST
POST
GET
GET
GET
GET
POST
GET
PATCH
DELETE
POST
DELETE
POST
POST

Retrieve data warehouse data health issues

Also available via the PostHog MCP server:

  • data-warehouse-data-health-issues-retrieveList data pipeline health issues

Returns failed/disabled data pipeline items for the Pipeline status side panel. Includes: materializations, syncs, sources, destinations, and transformations.

Example request

GET /api/projects/:project_id/data_warehouse/data_health_issues
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/data_health_issues/

Example response

Status 200 No response body

Retrieve data warehouse data ops dashboard

Returns the data ops overview dashboard ID for this team, creating it if it doesn't exist yet.

Required API key scopes

warehouse_view:write

Example request

GET /api/projects/:project_id/data_warehouse/data_ops_dashboard
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/data_ops_dashboard/

Example response

Status 200 No response body

Create data warehouse deprovision

Start deprovisioning the managed warehouse for this team.

Required API key scopes

warehouse_view:write

Response


Example request

POST /api/projects/:project_id/data_warehouse/deprovision
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/deprovision/

Example response

Status 200
RESPONSE
{
"status": "string",
"team": "string"
}

Retrieve data warehouse job stats

Returns success and failed job statistics for the last 1, 7, or 30 days. Query parameter 'days' can be 1, 7, or 30 (default: 7).

Example request

GET /api/projects/:project_id/data_warehouse/job_stats
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/job_stats/

Example response

Status 200 No response body

Retrieve data warehouse property values

API endpoints for data warehouse aggregate statistics and operations.

Required API key scopes

query:read

Example request

GET /api/projects/:project_id/data_warehouse/property_values
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/property_values/

Example response

Status 200 No response body

Create data warehouse provision

Start provisioning a managed warehouse for this team.

Required API key scopes

warehouse_view:write

Request parameters

  • database_name
    string

Response


Example request

POST /api/projects/:project_id/data_warehouse/provision
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/provision/\
-d database_name="string"

Example response

Status 200
RESPONSE
{
"status": "string",
"team": "string"
}

Create data warehouse reset password

Reset the root password for the managed warehouse.

Required API key scopes

warehouse_view:write

Response


Example request

POST /api/projects/:project_id/data_warehouse/reset-password
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/reset-password/

Example response

Status 200
RESPONSE
{
"username": "string",
"password": "string"
}

Retrieve data warehouse running activity

Returns currently running activities (jobs with status 'Running'). Supports pagination and cutoff time filtering.

Example request

GET /api/projects/:project_id/data_warehouse/running_activity
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/running_activity/

Example response

Status 200 No response body

Retrieve data warehouse total rows stats

Returns aggregated statistics for the data warehouse total rows processed within the current billing period. Used by the frontend data warehouse scene to display usage information.

Example request

GET /api/projects/:project_id/data_warehouse/total_rows_stats
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/total_rows_stats/

Example response

Status 200 No response body

Retrieve data warehouse warehouse status

Get the current provisioning status of the managed warehouse.

Response


Example request

GET /api/projects/:project_id/data_warehouse/warehouse_status
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/data_warehouse/warehouse_status/

Example response

Status 200
RESPONSE
{
"team_name": "string",
"state": "pending",
"status_message": "string",
"ready_at": "2019-08-24T14:15:22Z",
"failed_at": "2019-08-24T14:15:22Z"
}

List all external data schemas

Also available via the PostHog MCP server:

  • external-data-schemas-listList data import schemas

Required API key scopes

external_data_source:read

Query parameters

  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

GET /api/projects/:project_id/external_data_schemas
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"label": "string",
"table": {},
"should_sync": true,
"last_synced_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"incremental": true,
"status": "string",
"sync_type": "full_refresh",
"incremental_field": "string",
"incremental_field_type": "integer",
"sync_frequency": "never",
"sync_time_of_day": "14:15:22Z",
"description": "string",
"primary_key_columns": [
"string"
],
"cdc_table_mode": "consolidated",
"enabled_columns": [
"string"
],
"available_columns": [
{
"name": "string",
"data_type": "string",
"is_nullable": true
}
]
}
]
}

Create external data schemas

Required API key scopes

external_data_source:write

Request parameters

  • should_sync
    boolean
  • sync_type
  • incremental_field
    stringnull
  • incremental_field_type
  • sync_frequency
  • sync_time_of_day
    stringnull
  • primary_key_columns
    arraynull
  • cdc_table_mode
  • enabled_columns
    arraynull

Response


Example request

POST /api/projects/:project_id/external_data_schemas
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"label": "string",
"table": {},
"should_sync": true,
"last_synced_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"incremental": true,
"status": "string",
"sync_type": "full_refresh",
"incremental_field": "string",
"incremental_field_type": "integer",
"sync_frequency": "never",
"sync_time_of_day": "14:15:22Z",
"description": "string",
"primary_key_columns": [
"string"
],
"cdc_table_mode": "consolidated",
"enabled_columns": [
"string"
],
"available_columns": [
{
"name": "string",
"data_type": "string",
"is_nullable": true
}
]
}

Retrieve external data schemas

Also available via the PostHog MCP server:

  • external-data-schemas-retrieveGet data import schema

Required API key scopes

external_data_source:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/external_data_schemas/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"label": "string",
"table": {},
"should_sync": true,
"last_synced_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"incremental": true,
"status": "string",
"sync_type": "full_refresh",
"incremental_field": "string",
"incremental_field_type": "integer",
"sync_frequency": "never",
"sync_time_of_day": "14:15:22Z",
"description": "string",
"primary_key_columns": [
"string"
],
"cdc_table_mode": "consolidated",
"enabled_columns": [
"string"
],
"available_columns": [
{
"name": "string",
"data_type": "string",
"is_nullable": true
}
]
}

Update external data schemas

Also available via the PostHog MCP server:

  • external-data-schemas-partial-updateUpdate data import schema

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Request parameters

  • should_sync
    boolean
  • sync_type
  • incremental_field
    stringnull
  • incremental_field_type
  • sync_frequency
  • sync_time_of_day
    stringnull
  • primary_key_columns
    arraynull
  • cdc_table_mode
  • enabled_columns
    arraynull

Response


Example request

PATCH /api/projects/:project_id/external_data_schemas/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"label": "string",
"table": {},
"should_sync": true,
"last_synced_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"incremental": true,
"status": "string",
"sync_type": "full_refresh",
"incremental_field": "string",
"incremental_field_type": "integer",
"sync_frequency": "never",
"sync_time_of_day": "14:15:22Z",
"description": "string",
"primary_key_columns": [
"string"
],
"cdc_table_mode": "consolidated",
"enabled_columns": [
"string"
],
"available_columns": [
{
"name": "string",
"data_type": "string",
"is_nullable": true
}
]
}

Delete external data schemas

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/external_data_schemas/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/

Example response

Status 204 No response body

Create external data schemas cancel

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Request parameters

  • should_sync
    boolean
  • sync_type
  • incremental_field
    stringnull
  • incremental_field_type
  • sync_frequency
  • sync_time_of_day
    stringnull
  • primary_key_columns
    arraynull
  • cdc_table_mode
  • enabled_columns
    arraynull

Example request

POST /api/projects/:project_id/external_data_schemas/:id/cancel
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/cancel/\
-d name="string"

Example response

Status 200 No response body

Delete external data schemas delete data

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/external_data_schemas/:id/delete_data
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/delete_data/

Example response

Status 204 No response body

Create external data schemas incremental fields

Also available via the PostHog MCP server:

  • external-data-schemas-incremental-fields-createRefresh candidate incremental fields for a schema

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Request parameters

  • should_sync
    boolean
  • sync_type
  • incremental_field
    stringnull
  • incremental_field_type
  • sync_frequency
  • sync_time_of_day
    stringnull
  • primary_key_columns
    arraynull
  • cdc_table_mode
  • enabled_columns
    arraynull

Example request

POST /api/projects/:project_id/external_data_schemas/:id/incremental_fields
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/incremental_fields/\
-d name="string"

Example response

Status 200 No response body

Create external data schemas reload

Required API key scopes

external_data_source:write

Path parameters

  • id
    string

Request parameters

  • should_sync
    boolean
  • sync_type
  • incremental_field
    stringnull
  • incremental_field_type
  • sync_frequency
  • sync_time_of_day
    stringnull
  • primary_key_columns
    arraynull
  • cdc_table_mode
  • enabled_columns
    arraynull

Example request

POST /api/projects/:project_id/external_data_schemas/:id/reload
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/external_data_schemas/:id/reload/\
-d name="string"

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.