---
title: "PUT /apl-starred-queries/{id}"
method: PUT
path: "/apl-starred-queries/{id}"
tags: ["starred"]
---

# PUT /apl-starred-queries/{id}

`PUT /apl-starred-queries/{id}`

## Request

- Base URL: `https://api.axiom.co/v2`
- URL: `https://api.axiom.co/v2/apl-starred-queries/{id}`
- Auth: OAuth 2
  - Authorization code: `https://accounts.google.com/o/oauth2/v2/auth`
  - Token URL: `https://www.googleapis.com/oauth2/v4/token` scopes: `starredQueries|update`
- TypeScript: <https://skmtc.dev/axiom/apis/axiom-public-api/docs/apl-starred-queries/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Replaces the `name`, `dataset`, `query`, and `metadata` of a saved query. With a personal access token, you can only update queries you saved.

## Path parameters

- `id` string, required

## Request body

- StarredQuery
  - `dataset` string
  - `kind` 'apl', required
  - `metadata` object, required
  - `name` string, required
  - `query` APLRequestWithOptions, required
    - `apl` string, required
    - `cursor` string
    - `defaultLimit` integer
    - `defaultOrder` APLRequestWithOptionsDefaultOrder[]
      - `desc` boolean
      - `field` string
    - `endTime` string
    - `includeCursor` boolean
    - `includeCursorField` boolean
    - `libraries` string[]
    - `queryOptions` QueryOptions
      - `disableCache` boolean
      - `disableStats` boolean
      - `disableTrace` boolean
      - `maxDataPoints` integer
      - `maxSeries` integer
      - `noAggregation` boolean
      - `noFill` boolean
      - `noInterpolation` boolean
      - `priority` 'low' | 'medium' | 'high'
      - `resolution` string
      - `displayNull` 'auto' | 'null' | 'span' | 'zero' | '': Controls how empty intervals are rendered in time series charts. `auto` infers from the query, `null` leaves gaps, `span` connects adjacent points, `zero` fills with zero.
      - `overlayCharts` 'true' | 'false' | ''
      - `shownColumns` string
      - `timeSeriesVariant` 'area' | 'bars' | 'line' | 'lines' | ''
      - `timeSeriesView` 'charts' | 'resultsTable' | 'charts|resultsTable' | ''
    - `startTime` string
    - `variables` object
  - `who` string, required

## Response `200`

Updated saved query.

- StarredQueryWithId
  - `dataset` string
  - `kind` 'apl', required
  - `metadata` object, required
  - `name` string, required
  - `query` APLRequestWithOptions, required
    - `apl` string, required
    - `cursor` string
    - `defaultLimit` integer
    - `defaultOrder` APLRequestWithOptionsDefaultOrder[]
      - `desc` boolean
      - `field` string
    - `endTime` string
    - `includeCursor` boolean
    - `includeCursorField` boolean
    - `libraries` string[]
    - `queryOptions` QueryOptions
      - `disableCache` boolean
      - `disableStats` boolean
      - `disableTrace` boolean
      - `maxDataPoints` integer
      - `maxSeries` integer
      - `noAggregation` boolean
      - `noFill` boolean
      - `noInterpolation` boolean
      - `priority` 'low' | 'medium' | 'high'
      - `resolution` string
      - `displayNull` 'auto' | 'null' | 'span' | 'zero' | '': Controls how empty intervals are rendered in time series charts. `auto` infers from the query, `null` leaves gaps, `span` connects adjacent points, `zero` fills with zero.
      - `overlayCharts` 'true' | 'false' | ''
      - `shownColumns` string
      - `timeSeriesVariant` 'area' | 'bars' | 'line' | 'lines' | ''
      - `timeSeriesView` 'charts' | 'resultsTable' | 'charts|resultsTable' | ''
    - `startTime` string
    - `variables` object
  - `who` string, required
  - `id` string, required

## Other responses

- `400`: Missing `name`, or no `dataset` given and none found in `query.apl`.
- `401`: The saved query belongs to another user.
- `403`: You don't have permission to update saved queries on the current or new dataset.
- `404`: Saved query not found.

## Changes

- **2026-10-16** (v2) `fbc1b8430feb`: 4 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/apl-starred-queries/:id/put.md)

---

[API](https://skmtc.dev/axiom/apis/axiom-public-api.md) - [All operations](https://skmtc.dev/axiom/apis/axiom-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/axiom/apis/axiom-public-api/revisions/7e39a295e3ba?raw)
