---
title: "POST /apl-starred-queries"
method: POST
path: "/apl-starred-queries"
tags: ["starred"]
---

# POST /apl-starred-queries

`POST /apl-starred-queries`

## Request

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

Saves an APL query for the authenticated user. Axiom sets `who` to the caller and `kind` to `apl`. If you omit `dataset`, Axiom uses the alphabetically first dataset that `query.apl` references.

## 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`

Created 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`.
- `403`: You don't have permission to create saved queries on the dataset.

## Changes

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

[Operation history](https://skmtc.dev/axiom/apis/axiom-public-api/changes/apl-starred-queries/post.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)
