Environments-21

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

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.

Create environments warehouse saved queries descendants

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/descendants/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

Create environments warehouse saved queries descendants

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/descendants/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

Create environments warehouse saved queries revert materialization

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

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/revert_materialization/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

Create environments warehouse saved queries revert materialization

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

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/revert_materialization/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

Create environments warehouse saved queries run

Run this saved query.

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/run/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

Create environments warehouse saved queries run

Run this saved query.

Path parameters

  • id
    string

    A UUID string identifying this data warehouse saved query.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • query

    HogQL query

  • edited_history_id
    string
  • soft_update
    boolean

Response


Request

POST /api/environments/:project_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/:project_id/warehouse_saved_queries/:id/run/\
-d name="string"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"query": null,
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"sync_frequency": "string",
"columns": "string",
"status": "Cancelled",
"last_run_at": "2019-08-24T14:15:22Z",
"latest_error": "string",
"edited_history_id": "string",
"latest_history_id": "string",
"soft_update": true
}

List all environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.

  • search
    string

    A search term.

Response


Request

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

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",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}
]
}

List all environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.

  • search
    string

    A search term.

Response


Request

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

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",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}
]
}

Create environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Response


Request

POST /api/environments/:project_id/warehouse_tables
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/:project_id/warehouse_tables/\
-d name="string",\
-d format=undefined,\
-d url_pattern="string",\
-d credential=undefined

Response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Create environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Response


Request

POST /api/environments/:project_id/warehouse_tables
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/:project_id/warehouse_tables/\
-d name="string",\
-d format=undefined,\
-d url_pattern="string",\
-d credential=undefined

Response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Retrieve environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:read

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Response


Request

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

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Retrieve environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:read

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Response


Request

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

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Update environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Response


Request

PATCH /api/environments/:project_id/warehouse_tables/: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/:project_id/warehouse_tables/:id/\
-d deleted="boolean"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Update environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Response


Request

PATCH /api/environments/:project_id/warehouse_tables/: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/:project_id/warehouse_tables/:id/\
-d deleted="boolean"

Response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"name": "string",
"format": "CSV",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"url_pattern": "string",
"credential": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"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": {
"property1": null,
"property2": null
},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"access_key": "string",
"access_secret": "string"
},
"columns": "string",
"external_data_source": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"status": "string",
"source_type": "Stripe"
},
"external_schema": "string"
}

Delete environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request

DELETE /api/environments/:project_id/warehouse_tables/: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/:project_id/warehouse_tables/:id/

Response

Status 204 No response body

Delete environments warehouse tables

Create, Read, Update and Delete Warehouse Tables.

Required API key scopes

warehouse_table:write

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request

DELETE /api/environments/:project_id/warehouse_tables/: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/:project_id/warehouse_tables/:id/

Response

Status 204 No response body

Create environments warehouse tables refresh schema

Create, Read, Update and Delete Warehouse Tables.

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Request

POST /api/environments/:project_id/warehouse_tables/:id/refresh_schema
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/:project_id/warehouse_tables/:id/refresh_schema/\
-d name="string",\
-d format=undefined,\
-d url_pattern="string",\
-d credential=undefined

Response

Status 200 No response body

Create environments warehouse tables refresh schema

Create, Read, Update and Delete Warehouse Tables.

Path parameters

  • id
    string

    A UUID string identifying this data warehouse table.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Request parameters

  • deleted
    boolean
  • name
    string
  • format
  • url_pattern
    string
  • credential

Request

POST /api/environments/:project_id/warehouse_tables/:id/refresh_schema
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/:project_id/warehouse_tables/:id/refresh_schema/\
-d name="string",\
-d format=undefined,\
-d url_pattern="string",\
-d credential=undefined

Response

Status 200 No response body
Next page →

Community questions

Was this page useful?