# 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.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}},"parameters":{"itemStart":{"name":"itemStart","in":"query","schema":{"type":"number","default":0}}}},"paths":{"/api/v2/view":{"get":{"tags":["View"],"summary":"index","description":"**Returns all the existing views.**","operationId":"viewIndexGET","parameters":[{"name":"query","in":"query","schema":{"type":"string","pattern":"^[0-9a-zA-Z \\-\\_]+","minLength":1}},{"$ref":"#/components/parameters/itemStart"},{"name":"itemLimit","in":"query","schema":{"type":"number","maximum":9999,"default":15}}],"responses":{"200":{"description":""}}}}}}
```

## index

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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.","operationId":"viewIndexPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["title","conditions","columns"],"properties":{"title":{"type":"string","pattern":"^[0-9a-zA-Z \\-\\_]+$","minLength":4},"primary_sorting":{"type":"string","pattern":"^[a-z_]+$","default":"none"},"primary_sorting_order":{"type":"string","enum":["asc","desc"],"default":"asc"},"secondary_sorting":{"type":"string","pattern":"^[a-z_]+$","default":"none"},"secondary_sorting_order":{"type":"string","enum":["asc","desc"],"default":"asc"},"view_category_id":{"type":"number"},"view_order_id":{"type":"number"},"conditions":{"description":"View example for usage.","type":"object","minProperties":1,"properties":{"all":{"type":"array","minItems":1,"items":{"type":"object","required":["fact","operation","value"],"properties":{"fact":{"type":"string"},"operation":{"type":"string"},"value":{"type":"string"}}}},"any":{"type":"array","minItems":1,"items":{"type":"object","required":["fact","operation","value"],"properties":{"fact":{"type":"string"},"operation":{"type":"string"},"value":{"type":"string"}}}}}},"columns":{"description":"View example for usage.","type":"array","minItems":1,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"index example","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"}}}}}}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/view/{id}":{"get":{"tags":["View"],"summary":"item","description":"**Returns the view by its ID.**","operationId":"viewItemGET","responses":{"200":{"description":""}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"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.","operationId":"viewItemPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["title","conditions","columns"],"properties":{"title":{"type":"string","pattern":"^[0-9a-zA-Z \\-\\_]+$","minLength":4},"primary_sorting":{"type":"string","pattern":"^[a-z_]+$","default":"none"},"primary_sorting_order":{"type":"string","enum":["asc","desc"],"default":"asc"},"secondary_sorting":{"type":"string","pattern":"^[a-z_]+$","default":"none"},"secondary_sorting_order":{"type":"string","enum":["asc","desc"],"default":"asc"},"view_category_id":{"type":"number"},"view_order_id":{"type":"number"},"historyReason":{"type":"string"},"conditions":{"description":"View `POST` example for usage.","type":"object","minProperties":1,"properties":{"all":{"type":"array","minItems":1,"items":{"type":"object","required":["fact","operation","value"],"properties":{"fact":{"type":"string"},"operation":{"type":"string"},"value":{"type":"string"}}}},"any":{"type":"array","minItems":1,"items":{"type":"object","required":["fact","operation","value"],"properties":{"fact":{"type":"string"},"operation":{"type":"string"},"value":{"type":"string"}}}}}},"columns":{"description":"View `POST` example for usage.","type":"array","minItems":1,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"}}}}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.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":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/view/{id}":{"delete":{"tags":["View"],"summary":"item","description":"**Permanently deletes this view by its ID.**","operationId":"viewItemDELETE","responses":{"200":{"description":""}}}}}}
```
