# View

**All the endpoints that can be called on the View controller.**

Endpoints that require the `VIEW_READ` permission:

* `GET` index

Endpoints that require the `VIEW_CUD` permission:

* `POST` index
* `POST` item
* `DELETE` item

Endpoints that require the `GROUP_CUD` permission:

* `GET` item

Endpoints that require the `SETTINGS_CRUD` permission:

* `GET` viewCategories

## index

> \*\*Returns all the existing views.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"View","description":"**All the endpoints that can be called on the View controller.**\n\nEndpoints that require the `VIEW_READ` permission:\n\n- `GET` index\n    \n\nEndpoints that require the `VIEW_CUD` permission:\n\n- `POST` index\n    \n- `POST` item\n    \n- `DELETE` item\n    \n\nEndpoints that require the `GROUP_CUD` permission:\n\n- `GET` item\n    \n\nEndpoints that require the `SETTINGS_CRUD` permission:\n\n- `GET` viewCategories"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/view":{"get":{"tags":["View"],"summary":"index","description":"**Returns all the existing views.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## index

> \*\*Creates a new view.\*\*\
> \
> View the example on how to create conditions and columns.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"View","description":"**All the endpoints that can be called on the View controller.**\n\nEndpoints that require the `VIEW_READ` permission:\n\n- `GET` index\n    \n\nEndpoints that require the `VIEW_CUD` permission:\n\n- `POST` index\n    \n- `POST` item\n    \n- `DELETE` item\n    \n\nEndpoints that require the `GROUP_CUD` permission:\n\n- `GET` item\n    \n\nEndpoints that require the `SETTINGS_CRUD` permission:\n\n- `GET` viewCategories"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/view":{"post":{"tags":["View"],"summary":"index","description":"**Creates a new view.**\n\nView the example on how to create conditions and columns.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"type: `^[0-9a-zA-Z \\-\\_]+$`"},"primary_sorting":{"type":"string","description":"type: `^[a-z_]+$` = 'none'"},"primary_sorting_order":{"type":"string","description":"type: `asc|desc` = 'asc'"},"secondary_sorting":{"type":"string","description":"type: `^[a-z_]+$` = 'none'"},"secondary_sorting_order":{"type":"string","description":"type: `asc|desc` = 'asc'"},"view_category_id":{"type":"string","description":"type: `number` = null"},"view_order_id":{"type":"string","description":"type: `number`"},"conditions[]":{"type":"string","description":"type: `condition`\n\nView example"},"columns[]":{"type":"string","description":"type: `columns`\n\nView example"}}}}}},"responses":{"200":{"description":"OK","headers":{"Date":{"schema":{"type":"string"}},"Server":{"schema":{"type":"number"}},"X-Powered-By":{"schema":{"type":"string"}},"X-Frame-Options":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"X-Content-Type-Options":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"type":"string"}},"Pragma":{"schema":{"type":"string"}},"Access-Control-Allow-Orgin":{"schema":{"type":"string"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Keep-Alive":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```

## item

> \*\*Returns the view by its ID.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"View","description":"**All the endpoints that can be called on the View controller.**\n\nEndpoints that require the `VIEW_READ` permission:\n\n- `GET` index\n    \n\nEndpoints that require the `VIEW_CUD` permission:\n\n- `POST` index\n    \n- `POST` item\n    \n- `DELETE` item\n    \n\nEndpoints that require the `GROUP_CUD` permission:\n\n- `GET` item\n    \n\nEndpoints that require the `SETTINGS_CRUD` permission:\n\n- `GET` viewCategories"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/view/{id}":{"get":{"tags":["View"],"summary":"item","description":"**Returns the view by its ID.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

> \*\*Updates this specific view.\*\*\
> \
> View the example of \`POST\` index on how to update the conditions and columns.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"View","description":"**All the endpoints that can be called on the View controller.**\n\nEndpoints that require the `VIEW_READ` permission:\n\n- `GET` index\n    \n\nEndpoints that require the `VIEW_CUD` permission:\n\n- `POST` index\n    \n- `POST` item\n    \n- `DELETE` item\n    \n\nEndpoints that require the `GROUP_CUD` permission:\n\n- `GET` item\n    \n\nEndpoints that require the `SETTINGS_CRUD` permission:\n\n- `GET` viewCategories"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/view/{id}":{"put":{"tags":["View"],"summary":"item","description":"**Updates this specific view.**\n\nView the example of `POST` index on how to update the conditions and columns.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"title":{"type":"string","description":"type: `^[0-9a-zA-Z \\-\\_]+$`"},"primary_sorting":{"type":"string","description":"type: `^[a-z_]+$` = 'none'"},"primary_sorting_order":{"type":"string","description":"type: `asc|desc` = 'asc'"},"secondary_sorting":{"type":"string","description":"type: `^[a-z_]+$` = 'none'"},"secondary_sorting_order":{"type":"string","description":"type: `asc|desc` = 'asc'"},"view_category_id":{"type":"string","description":"type: `number` = null"},"view_order_id":{"type":"string","description":"type: `number`"},"historyReason":{"type":"string","description":"type: `string` = null\n\nHistory reason to add to audit logs."},"conditions[]":{"type":"string"},"columns[]":{"type":"string"}}}}}},"parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

> \*\*Permanently deletes this view by its ID.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"View","description":"**All the endpoints that can be called on the View controller.**\n\nEndpoints that require the `VIEW_READ` permission:\n\n- `GET` index\n    \n\nEndpoints that require the `VIEW_CUD` permission:\n\n- `POST` index\n    \n- `POST` item\n    \n- `DELETE` item\n    \n\nEndpoints that require the `GROUP_CUD` permission:\n\n- `GET` item\n    \n\nEndpoints that require the `SETTINGS_CRUD` permission:\n\n- `GET` viewCategories"}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/view/{id}":{"delete":{"tags":["View"],"summary":"item","description":"**Permanently deletes this view by its ID.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omnidesk.io/omnidesk/api-specification/view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
