Saved Query Column

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

Endpoints

GET
POST
GET
PATCH
DELETE

List all saved query column annotations

Read and edit semantic descriptions of data-modelling views and columns surfaced to the AI agent.

List can be filtered to one view with ?saved_query_id=<uuid>. Any create or update is treated as a user edit (is_user_edited=True), which protects the row from being overwritten by automatic enrichment. Create upserts on (saved_query, column_name); the view cannot be changed after creation.

Required API key scopes

warehouse_view:read

Query parameters

  • limit
    integer
  • offset
    integer
  • saved_query_id
    string

Response


Example request

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

Example 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",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"column_name": "string",
"description": "string",
"description_source": "canonical",
"ai_model": "string",
"is_user_edited": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create saved query column annotations

Read and edit semantic descriptions of data-modelling views and columns surfaced to the AI agent.

List can be filtered to one view with ?saved_query_id=<uuid>. Any create or update is treated as a user edit (is_user_edited=True), which protects the row from being overwritten by automatic enrichment. Create upserts on (saved_query, column_name); the view cannot be changed after creation.

Required API key scopes

warehouse_view:write

Request parameters

  • saved_query
    string
  • column_name
    string
  • description
    string

Response


Example request

POST /api/projects/:project_id/saved_query_column_annotations
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/saved_query_column_annotations/\
-d saved_query="string",\
-d description="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"column_name": "string",
"description": "string",
"description_source": "canonical",
"ai_model": "string",
"is_user_edited": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve saved query column annotations

Read and edit semantic descriptions of data-modelling views and columns surfaced to the AI agent.

List can be filtered to one view with ?saved_query_id=<uuid>. Any create or update is treated as a user edit (is_user_edited=True), which protects the row from being overwritten by automatic enrichment. Create upserts on (saved_query, column_name); the view cannot be changed after creation.

Required API key scopes

warehouse_view:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"column_name": "string",
"description": "string",
"description_source": "canonical",
"ai_model": "string",
"is_user_edited": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Update saved query column annotations

Read and edit semantic descriptions of data-modelling views and columns surfaced to the AI agent.

List can be filtered to one view with ?saved_query_id=<uuid>. Any create or update is treated as a user edit (is_user_edited=True), which protects the row from being overwritten by automatic enrichment. Create upserts on (saved_query, column_name); the view cannot be changed after creation.

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Request parameters

  • saved_query
    string
  • column_name
    string
  • description
    string

Response


Example request

PATCH /api/projects/:project_id/saved_query_column_annotations/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/saved_query_column_annotations/:id/\
-d saved_query="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"column_name": "string",
"description": "string",
"description_source": "canonical",
"ai_model": "string",
"is_user_edited": true,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete saved query column annotations

Read and edit semantic descriptions of data-modelling views and columns surfaced to the AI agent.

List can be filtered to one view with ?saved_query_id=<uuid>. Any create or update is treated as a user edit (is_user_edited=True), which protects the row from being overwritten by automatic enrichment. Create upserts on (saved_query, column_name); the view cannot be changed after creation.

Required API key scopes

warehouse_view:write

Path parameters

  • id
    string

Example request

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

Example response

Status 204 No response body

Community questions