# Save a view of a page

Saves a view on a record page: its `key` (a slug), `label` (up to 80 characters), and the `filter`, `sort` and `columnIds` it restores. `scope` defaults to `user`, which is the caller's own private view; `workspace` makes it everyone's and needs a workspace admin. A key already used in that scope is a 409. This is the one write under a page's shape that an ordinary member may make, because a user view is theirs.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/views`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "columnIds": [
      "string"
    ],
    "filter": {},
    "key": "string",
    "label": "string",
    "scope": "user",
    "sort": {}
  },
  "params": {
    ":key": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "columnIds": [
      "string"
    ],
    "crmUserId": 1,
    "filter": {},
    "id": "",
    "key": "string",
    "label": "string",
    "position": 1,
    "scope": "string",
    "sort": {}
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
