Data

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

Endpoints

GET
POST
POST
GET
GET
GET

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 organization (shared by all its teams).

Required API key scopes

warehouse_view:write

Request parameters

  • database_name
    string
  • table_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",\
-d table_name="string"

Example response

Status 202
RESPONSE
{
"status": "string",
"org": "string",
"username": "string",
"password": "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, with this project's backfill state.

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
{
"org_id": "string",
"state": "pending",
"status_message": "string",
"s3_state": "string",
"metadata_store_state": "string",
"identity_state": "string",
"secrets_state": "string",
"ready_at": "2019-08-24T14:15:22Z",
"failed_at": "2019-08-24T14:15:22Z",
"connection": {
"host": "string",
"port": 0,
"database": "string",
"username": "string"
},
"has_backfill": true,
"table_suffix": "string"
}

Community questions

Questions about this page? or post a community question.