Data

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

Endpoints

GET
GET
GET

Retrieve data warehouse running activity

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

Query parameters

  • cutoff_days
    integer
    Default: 30
  • kind
    string
    Default: all
    One of: "all""import""model"
  • limit
    integer
    Default: 20
  • offset
    integer
    Default: 0

Response


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
RESPONSE
{
"results": [
{
"id": "string",
"type": "string",
"name": "string",
"status": "string",
"rows": 0,
"created_at": "2019-08-24T14:15:22Z",
"finished_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"workflow_run_id": "string",
"origin": "string",
"source_id": "string"
}
],
"next": "string",
"previous": "string"
}
Status 500 The activity query failed.
RESPONSE
{
"error": "string"
}

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.

Response


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
RESPONSE
{
"billing_available": true,
"billing_interval": "string",
"billing_period_start": "2019-08-24T14:15:22Z",
"billing_period_end": "2019-08-24T14:15:22Z",
"total_rows": 0,
"tracked_billing_rows": 0,
"pending_billing_rows": 0,
"materialized_rows_in_billing_period": 0,
"breakdown_of_rows_by_source": {
"property1": 0,
"property2": 0
}
}
Status 500 Billing could not be reached.
RESPONSE
{
"error": "string"
}

Retrieve data warehouse warehouse status

Get the current provisioning status of the managed warehouse, with this project's onboarding 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"
},
"trino": {
"state": "not_enabled",
"ready_at": "2019-08-24T14:15:22Z",
"connection": {
"host": "string",
"port": 0,
"catalog": "string",
"username": "string"
}
},
"has_backfill": true,
"table_suffix": "string",
"team_onboarded": true,
"schema_name": "string"
}