Data Modeling

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

Endpoints

GET

List all data modeling usage

Required API key scopes

warehouse_view:read

Query parameters

  • date_from
    string
  • date_to
    string
  • days
    integer
  • engine
    string
    Default: clickhouse
    One of: "all""clickhouse""managed_warehouse"
  • page
    integer
    Default: 1
  • page_size
    integer
    Default: 20
  • saved_query_id
    string
  • saved_query_ids
    string
  • sort_by
    string
    Default: read_bytes
    One of: "name""read_bytes""clickhouse_read_bytes""managed_warehouse_read_bytes""cpu_microseconds""runs"
  • sort_direction
    string
    Default: desc
    One of: "asc""desc"

Response


Example request

GET /api/projects/:project_id/data_modeling_usage
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_modeling_usage/

Example response

Status 200
RESPONSE
{
"date_from": "2019-08-24",
"date_to": "2019-08-24",
"overview": {
"runs": 0,
"measured_runs": 0,
"read_bytes": 0,
"read_rows": 0,
"cpu_microseconds": 0,
"query_count": 0
},
"trends": [
{
"runs": 0,
"measured_runs": 0,
"read_bytes": 0,
"read_rows": 0,
"cpu_microseconds": 0,
"query_count": 0,
"day": "2019-08-24",
"engines": [
{
"runs": 0,
"measured_runs": 0,
"read_bytes": 0,
"read_rows": 0,
"cpu_microseconds": 0,
"query_count": 0,
"engine": "string"
}
]
}
],
"models": [
{
"runs": 0,
"measured_runs": 0,
"read_bytes": 0,
"read_rows": 0,
"cpu_microseconds": 0,
"query_count": 0,
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"name": "string",
"deleted": true,
"engines": [
{
"runs": 0,
"measured_runs": 0,
"read_bytes": 0,
"read_rows": 0,
"cpu_microseconds": 0,
"query_count": 0,
"engine": "string"
}
]
}
],
"count": 0,
"status_breakdown": [
{
"engine": "string",
"status": "string",
"count": 0,
"models": [
{
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"name": "string",
"deleted": true
}
]
}
],
"usage_updated_at": "2019-08-24T14:15:22Z"
}