---
title: "POST /query/_mpl"
method: POST
path: "/query/_mpl"
tags: ["query"]
---

# POST /query/_mpl

`POST /query/_mpl`

## Request

- Base URL: `https://{axiom-domain}/v1`
- URL: `https://{axiom-domain}/v1/query/_mpl`
- Auth: OAuth 2
  - Authorization code: `https://accounts.google.com/o/oauth2/v2/auth`
  - Token URL: `https://www.googleapis.com/oauth2/v4/token` scopes: `query|read`
- TypeScript: <https://skmtc.dev/axiom/apis/axiom-query/docs/query/_mpl/post.ts> (a function with typed inputs; its response is checked against the schema)

Runs an MPL query against metrics datasets in this edge deployment. The response format follows the `format` parameter or the `Accept` header and defaults to `metrics-v2`. Returns `429` when a query cost limit is exhausted.

## Query parameters

- `format` 'metrics-v1' | 'metrics-v2' | 'metrics-v3' | 'metrics-v4'

## Request body

- MetricsRequestWithOptions
  - `endTime` string, required: End time for the query range
  - `mpl` string: The MPL query.
  - `startTime` string, required: start and end time for the query, these must be specified as RFC3339 strings or using relative time expressions (e.g. now-1h, now-1d, now-1w, etc)

## Response `200`

Query result in the requested format.

- MetricsResult: Metrics query result (streaming binary data)

## Other responses

- `429`: Query limit exceeded. Returned when an org, token, or user query budget is exhausted. The body names the tripped scope with its limit, usage, and reset.
- `default`: User or system error

## Changes

- **2026-10-16** `16be903874f4`: 1 warning, 4 info
  - removed the optional property `error` from the response with the `default` status
  - added the new enum value `metrics-v3` to the `query` request parameter `format`
  - added the new enum value `metrics-v4` to the `query` request parameter `format`
  - added the non-success response with the status `429`
  - …1 more

[Operation history](https://skmtc.dev/axiom/apis/axiom-query/changes/query/_mpl/post.md)

---

[API](https://skmtc.dev/axiom/apis/axiom-query.md) - [All operations](https://skmtc.dev/axiom/apis/axiom-query/llms.txt) - [OpenAPI document](https://skmtc.dev/axiom/apis/axiom-query/revisions/16be903874f4?raw)
