---
title: "This endpoint creates a view which is a result-set of the SELECT statement."
method: POST
path: "/api/projects/{projectName}/views"
---

# This endpoint creates a view which is a result-set of the SELECT statement.

`POST /api/projects/{projectName}/views`

Creates a [view](https://docs.mindsdb.com/sql/create/view) from a SELECT statement.

## Path parameters

- `projectName` string, required

## Request body

- object
  - `view` object
    - `name` string — Name of the view
    - `query` string — The SQL query that will save the result-set in a view.

## Response `200`

View created

- View[]
  - `name` string
  - `query` string — SELECT query used to create the view

## Other responses

- `401` — Invalid API key error message
- `404` — Project not found
- `500` — Server error

---

[API](https://skmtc.net/mindsdb/apis/mindsdb-api.md) · [All operations](https://skmtc.net/mindsdb/apis/mindsdb-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mindsdb/mindsdb-api/versions/387ff52538f9/schema)
