Skip to main content
Partially update a saved query. Only include the fields you want to change.
Authorization
string
required
Bearer token obtained from the authenticate endpoint.
query_id
string
required
Unique identifier of the saved query to update.
title
string
New display title for the query.
query
string
New natural language query text.
sql
string
New raw SQL to associate with the query.

Response

Returns the updated saved query object.
id
string
required
Unique identifier for the query.
organization_id
string
required
Organization the query belongs to.
title
string
required
Updated display title.
query
string
required
Updated natural language query text.
sql
string
Updated raw SQL.
last_updated_by
string
required
Member ID of the user who made this update.
updated_at
string
required
ISO 8601 timestamp of this update.
curl -X PATCH https://api.trellis.sh/v1/queries/sq_002 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Top 20 Customers",
    "query": "Who are our top 20 customers by total spend?"
  }'
{
  "id": "sq_002",
  "organization_id": "org_abc123",
  "title": "Top 20 Customers",
  "query": "Who are our top 20 customers by total spend?",
  "sql": null,
  "last_updated_by": "member_xyz789",
  "created_at": "2025-01-11T10:00:00Z",
  "updated_at": "2025-01-11T11:00:00Z"
}