# Create a saved view

## `POST /v1/objects/{object}/views`

Requires the `write` scope.

```json
{
  "tags": [
    "Views"
  ],
  "operationId": "create-view",
  "summary": "Create a saved view",
  "description": "Requires the `write` scope.",
  "x-retainer-scope": "write",
  "parameters": [
    {
      "in": "path",
      "name": "object",
      "required": true,
      "description": "Object API name.",
      "example": "company",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "kind": {
              "type": "string",
              "enum": [
                "table",
                "board",
                "calendar"
              ]
            },
            "visibility": {
              "default": "workspace",
              "type": "string",
              "enum": [
                "workspace",
                "private"
              ]
            },
            "position": {
              "type": "number"
            },
            "filter": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                {
                  "type": "null"
                }
              ]
            },
            "sort": {
              "anyOf": [
                {
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "direction": {
                        "default": "asc",
                        "type": "string",
                        "enum": [
                          "asc",
                          "desc"
                        ]
                      }
                    },
                    "required": [
                      "field"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "columns": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "order": {
                      "maxItems": 200,
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "widths": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": 40,
                        "maximum": 2000
                      }
                    },
                    "aggregates": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string",
                        "enum": [
                          "countEmpty",
                          "countNotEmpty",
                          "percentEmpty",
                          "percentNotEmpty",
                          "countUnique",
                          "sum",
                          "avg",
                          "min",
                          "max"
                        ]
                      }
                    }
                  },
                  "required": [
                    "order"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "groupBy": {
              "type": [
                "string",
                "null"
              ]
            },
            "hiddenGroups": {
              "anyOf": [
                {
                  "maxItems": 200,
                  "type": "array",
                  "items": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "groupAggregate": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "countEmpty",
                        "countNotEmpty",
                        "percentEmpty",
                        "percentNotEmpty",
                        "countUnique",
                        "sum",
                        "avg",
                        "min",
                        "max"
                      ]
                    }
                  },
                  "required": [
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "dateField": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "name",
            "kind"
          ],
          "additionalProperties": false
        },
        "example": {
          "name": "Pipeline",
          "kind": "table",
          "visibility": "workspace"
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Successful response.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/SavedView"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "default": {
      "$ref": "#/components/responses/ApiError"
    }
  }
}
```

[Full OpenAPI contract](/openapi.json)
