Warehouse View

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

Endpoints

GET
POST
GET
PATCH
DELETE
POST

Create warehouse view links

Create, Read, Update and Delete View Columns.

Required API key scopes

warehouse_view:write

Request parameters

  • deleted
    boolean | null
  • source_table_name
    string
  • source_table_key
    string
  • joining_table_name
    string
  • joining_table_key
    string
  • field_name
    string
  • configuration

Response


Example request

POST /api/projects/:project_id/warehouse_view_links
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/warehouse_view_links/\
-d source_table_name="string",\
-d source_table_key="string",\
-d joining_table_name="string",\
-d joining_table_key="string",\
-d field_name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"deleted": true,
"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",
"source_table_name": "string",
"source_table_key": "string",
"joining_table_name": "string",
"joining_table_key": "string",
"field_name": "string",
"configuration": null
}




Create warehouse view links validate

Create, Read, Update and Delete View Columns.

Request parameters

  • joining_table_name
    string
  • joining_table_key
    string
  • source_table_name
    string
  • source_table_key
    string

Response


Example request

POST /api/projects/:project_id/warehouse_view_links/validate
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/warehouse_view_links/validate/\
-d joining_table_name="string",\
-d joining_table_key="string",\
-d source_table_name="string",\
-d source_table_key="string"

Example response

Status 200
RESPONSE
{
"is_valid": true,
"msg": "string",
"hogql": "string",
"columns": [
"string"
],
"results": [
[
null
]
],
"total_rows": 0,
"matched_rows": 0,
"match_rate": 0
}
Status 400 The join does not compile or reference valid fields.
RESPONSE
{
"attr": "string",
"code": "string",
"detail": "string",
"type": "string",
"hogql": "string"
}
Status 500 Validation failed with an internal query error.
RESPONSE
{
"attr": "string",
"code": "string",
"detail": "string",
"type": "string",
"hogql": "string"
}