Spoar
SQL

Change a saved query

PATCH
/v2/queries/{query}

Its creator or the owner may change it.

Authorization

AuthorizationBearer <token>

An API token from POST /v2/tokens (at_live_...), or a project's secret key (sk_...) for server-side ingest.

In: header

Path Parameters

query*string

The saved query id (sq_...).

Request Body

Only the fields sent are changed; send at least one.

TypeScript Definitions

Use the request body type in TypeScript.

Only the fields sent are changed; send at least one.

Properties1 <= properties

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v2/queries/string" \  -H "Content-Type: application/json" \  -d '{    "name": "Top routes"  }'
{  "data": {    "id": "sq_6f1c2a4e-8b3d-4c5e-9f70-a1b2c3d4e5f6",    "name": "Top routes this week",    "sql": "select route, count(*) as views from pageviews where is_human and ts >= :from group by 1 order by 2 desc limit 10",    "description": "For the weekly check-in",    "chart": "bar",    "createdBy": {      "kind": "user",      "id": "user_remco"    },    "createdAt": "2026-09-27T16:40:00.000Z",    "updatedAt": "2026-09-27T16:40:00.000Z"  }}