---
title: "POST /views"
method: POST
path: "/views"
tags: ["views"]
---

# POST /views

`POST /views`

## Request

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

Creates a view, a named APL query that you can query like a dataset. Axiom derives `datasets` from `aplQuery`. The name can't match an existing dataset or view, and the query can't reference views or use wildcards.

## Request body

- View
  - `aplQuery` string, required: APL query that defines the view
  - `datasets` string[]: Datasets the view queries. Axiom derives this from `aplQuery` and ignores it in requests.
  - `description` string
  - `edgeDeployment` string: Region of the source datasets; ignored in requests
  - `edgeDeploymentUrl` string: URL of the edge deployment; ignored in requests
  - `name` string, required: Name of the view. Use it as the view ID and to query the view like a dataset.
  - `sharedByOrg` string: ID of the org that shared this resource, if it's shared
  - `sharedByOrgName` string: The name of the org that shared this resource, if it's shared

## Response `200`

Created view.

- View
  - `aplQuery` string, required: APL query that defines the view
  - `datasets` string[]: Datasets the view queries. Axiom derives this from `aplQuery` and ignores it in requests.
  - `description` string
  - `edgeDeployment` string: Region of the source datasets; ignored in requests
  - `edgeDeploymentUrl` string: URL of the edge deployment; ignored in requests
  - `name` string, required: Name of the view. Use it as the view ID and to query the view like a dataset.
  - `sharedByOrg` string: ID of the org that shared this resource, if it's shared
  - `sharedByOrgName` string: The name of the org that shared this resource, if it's shared

## Other responses

- `400`: Invalid view, for example an APL parse error, a name that's already in use, or a query that references a view or datasets in different regions.
- `403`: You don't have query access to a dataset that `aplQuery` references.

## Changes

- **2026-11-02** (v2) `e3baf3b85e8d`: 4 info
  - added the new optional request property `edgeDeployment`
  - added the new optional request property `edgeDeploymentUrl`
  - added the optional property `edgeDeployment` to the response with the `200` status
  - added the optional property `edgeDeploymentUrl` to the response with the `200` status
- **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/views/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)
