Data

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

Endpoints

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

Create environments warehouse saved queries ancestors

Return the ancestors of this saved query.

By default, we return the immediate parents. The level parameter can be used to look further back into the ancestor tree. If level overshoots (i.e. points to only ancestors beyond the root), we return an empty list.

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/:id/ancestors
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/environments/:environment_id/warehouse_saved_queries/:id/ancestors/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries cancel

Cancel a running saved query workflow.

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/: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/environments/:environment_id/warehouse_saved_queries/:id/cancel/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Retrieve environments warehouse saved queries dependencies

Return the count of immediate upstream and downstream dependencies for this saved query.

Path parameters

  • id
    string

Response


Example request

GET /api/environments/:environment_id/warehouse_saved_queries/:id/dependencies
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/warehouse_saved_queries/:id/dependencies/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries descendants

Return the descendants of this saved query.

By default, we return the immediate children. The level parameter can be used to look further ahead into the descendants tree. If level overshoots (i.e. points to only descendants further than a leaf), we return an empty list.

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/:id/descendants
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/environments/:environment_id/warehouse_saved_queries/:id/descendants/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries materialize

Enable materialization for this saved query with a 24-hour sync frequency.

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/:id/materialize
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/environments/:environment_id/warehouse_saved_queries/:id/materialize/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries revert materialization

Undo materialization, revert back to the original view. (i.e. delete the materialized table and the schedule)

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/:id/revert_materialization
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/environments/:environment_id/warehouse_saved_queries/:id/revert_materialization/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries run

Run this saved query.

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/:id/run
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/environments/:environment_id/warehouse_saved_queries/:id/run/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Retrieve environments warehouse saved queries run history

Return the recent run history (up to 5 most recent) for this materialized view.

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string

Response


Example request

GET /api/environments/:environment_id/warehouse_saved_queries/:id/run_history
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/warehouse_saved_queries/:id/run_history/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

Create environments warehouse saved queries resume schedules

Resume paused materialization schedules for multiple matviews.

Accepts a list of view IDs in the request body: {"view_ids": ["id1", "id2", ...]} This endpoint is idempotent - calling it on already running or non-existent schedules is safe.

Request parameters

  • deleted
    booleannull
  • name
    string
  • query
    object
  • folder_id
    stringnull
  • edited_history_id
    stringnull
  • soft_update
    booleannull
  • dag_id
    stringnull
  • is_test
    boolean

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_queries/resume_schedules
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/environments/:environment_id/warehouse_saved_queries/resume_schedules/\
-d name="string",\
-d query="object"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": {
"kind": "HogQLQuery",
"query": "string"
},
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": [
{}
],
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"managed_viewset_kind": "string",
"folder_id": "7695bac3-9397-4ec2-9335-45a2a16f1901",
"folder_name": "string",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": 0,
"soft_update": true,
"dag_id": "42728853-0f3b-405e-82ac-865eb391bcdb",
"is_materialized": true,
"origin": "data_warehouse",
"is_test": true,
"expires_at": "2019-08-24T14:15:22Z",
"user_access_level": "string"
}

List all environments warehouse saved query folders

Required API key scopes

warehouse_view:read

Example request

GET /api/environments/:environment_id/warehouse_saved_query_folders
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/warehouse_saved_query_folders/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"view_count": 0,
"user_access_level": "string"
}

Create environments warehouse saved query folders

Required API key scopes

warehouse_view:write

Request parameters

  • name
    string

Response


Example request

POST /api/environments/:environment_id/warehouse_saved_query_folders
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/environments/:environment_id/warehouse_saved_query_folders/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"view_count": 0,
"user_access_level": "string"
}

Retrieve environments warehouse saved query folders

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"view_count": 0,
"user_access_level": "string"
}

Update environments warehouse saved query folders

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • name
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"view_count": 0,
"user_access_level": "string"
}

Delete environments warehouse saved query folders

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Example request

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

Example response

Status 204 No response body

List all data modeling jobs

List data modeling jobs which are "runs" for our saved queries.

Required API key scopes

warehouse_view:read

Query parameters

  • cursor
    string
  • limit
    integer
  • saved_query_id
    string

Response


Example request

GET /api/projects/:project_id/data_modeling_jobs
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_jobs/

Example response

Status 200
RESPONSE
{
"next": "http://api.example.org/accounts/?cursor=cD00ODY%3D\"",
"previous": "http://api.example.org/accounts/?cursor=cj0xJnA9NDg3",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"status": "Cancelled",
"rows_materialized": 0,
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_run_at": "2019-08-24T14:15:22Z",
"workflow_id": "string",
"workflow_run_id": "string",
"rows_expected": 0
}
]
}

Retrieve data modeling jobs

List data modeling jobs which are "runs" for our saved queries.

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/data_modeling_jobs/: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/data_modeling_jobs/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"status": "Cancelled",
"rows_materialized": 0,
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_run_at": "2019-08-24T14:15:22Z",
"workflow_id": "string",
"workflow_run_id": "string",
"rows_expected": 0
}

Retrieve data modeling jobs recent

Get the most recent non-running job for each saved query from the v2 backend.

Response


Example request

GET /api/projects/:project_id/data_modeling_jobs/recent
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_jobs/recent/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"status": "Cancelled",
"rows_materialized": 0,
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_run_at": "2019-08-24T14:15:22Z",
"workflow_id": "string",
"workflow_run_id": "string",
"rows_expected": 0
}

Retrieve data modeling jobs running

Get all currently running jobs from the v2 backend.

Response


Example request

GET /api/projects/:project_id/data_modeling_jobs/running
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_jobs/running/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query_id": "841a020c-dad2-4bac-a071-aaf3f5af0641",
"status": "Cancelled",
"rows_materialized": 0,
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_run_at": "2019-08-24T14:15:22Z",
"workflow_id": "string",
"workflow_run_id": "string",
"rows_expected": 0
}

Retrieve data warehouse check database name

Check if a database name is available.

Query parameters

  • name
    string

Response


Example request

GET /api/projects/:project_id/data_warehouse/check-database-name
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/check-database-name/

Example response

Status 200
RESPONSE
{
"name": "string",
"available": true
}

Retrieve data warehouse completed activity

Returns completed/non-running activities (jobs with status 'Completed'). Supports pagination and cutoff time filtering.

Example request

GET /api/projects/:project_id/data_warehouse/completed_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/completed_activity/

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.