---
title: "Update View"
method: PUT
path: "/api/v2/views/{view_id}"
tags: ["Views"]
---

# Update View

`PUT /api/v2/views/{view_id}`

#### Allowed For

* Agents

#### JSON Format

 The PUT request takes one property, a `view` object that lists the values to update. All properties are optional.

**Note**: Updating a condition updates the containing array, clearing the other conditions. Include all your conditions when updating any condition.

| Name        | Description
| ----------- | -----------
| title       | The title of the view
| all         | An array of one or more conditions. A ticket must meet all the conditions to be included in the view. The PUT request replaces all existing conditions. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference)
| any         | An array of one or more conditions. A ticket must meet any of them to be included in the view. At least one `all` condition must be defined with the `any` conditions. The PUT request replaces all existing `any` conditions. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference)
| active      | Allowed values are true or false. Determines if the view is displayed or not
| output      | An object that specifies the columns to display. Example: `"output": {"columns": ["status", "description," "priority"]}`. See [View columns](#view-columns)
| restriction | An object that describes who can access the view. To give all agents access to the view, omit this property

The `restriction` object has the following properties.

| Name | Comment
| ---- | -------
| type | Allowed values are "Group" or "User"
| id   | The numeric ID of a single group or user
| ids  | The numeric IDs of a single or more groups. Recommended for "Group" `type`

If `type` is "Group", the `ids` property is the preferred method of specifying the group id or ids.

You can also update how items are sorted and grouped. See [View sorting](#view-sorting) in Create View.

#### Example Request Body

```js
{
  "view": {
    "title": "Code red tickets",
    "restriction": {
      "type": "Group",
      "ids": [10052, 10057, 10062, 10002]
    },
    "all": [
      {
        "field": "priority",
        "operator": "is",
        "value": "urgent"
      }
    ],
    "output": {
      "columns": ["status", "requester", "assignee", "updated"]
    }
  }
}
```

## Response `200`

Success response

- ViewResponse
  - `columns` object[]
  - `groups` object[]
  - `rows` object[]
  - `view` ViewObject
    - `active` boolean — Whether the view is active
    - `conditions` object — Describes how the view is constructed. See [Conditions reference](/documentation/ticketing/reference-guides/conditions-reference)
    - `created_at` string, date-time — The time the view was created
    - `default` boolean — If true, the view is a default view
    - `description` string — The description of the view
    - `execution` object — Describes how the view should be executed. See [Execution](#execution)
    - `id` integer — Automatically assigned when created
    - `position` integer — The position of the view
    - `restriction` object — Who may access this account. Is null when everyone in the account can access it
    - `title` string — The title of the view
    - `updated_at` string, date-time — The time the view was last updated

---

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