> For the complete documentation index, see [llms.txt](https://docs.omnidesk.io/omnidesk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.omnidesk.io/omnidesk/api-specification/statisticsv2.md).

# Statisticsv2

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

All the endpoints require the `API_STATISTICS` permission, except for:

* `POST` dashboardDelete
* `PUT` dashboard

Which require the `DASHBOARD_CUD` permission.

## options

> \*\*Returns the options available to the statistics showQuery and showData.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/options":{"get":{"tags":["Statisticsv2"],"summary":"options","description":"**Returns the options available to the statistics showQuery and showData.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## dashboard

> \*\*Returns all the dashboard data by the dashboard ID.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/dashboard":{"get":{"tags":["Statisticsv2"],"summary":"dashboard","description":"**Returns all the dashboard data by the dashboard ID.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## dashboard

> \*\*Creates a new dashboard.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/dashboard":{"post":{"tags":["Statisticsv2"],"summary":"dashboard","description":"**Creates a new dashboard.**","requestBody":{"content":{}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## dashboard

> \*\*Updates this dashboard's name.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/dashboard":{"put":{"tags":["Statisticsv2"],"summary":"dashboard","description":"**Updates this dashboard's name.**","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"id":{"type":"string","description":"type: `number`\n\nThe dashboard's ID."},"name":{"type":"string","description":"type: `^[0-9a-zA-Z\\' :+*]+$` = ' '"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## dashboardDelete

> \*\*Deletes this dashboard and its widgets.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/dashboardDelete":{"post":{"tags":["Statisticsv2"],"summary":"dashboardDelete","description":"**Deletes this dashboard and its widgets.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"type: `number`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## dashboards

> \*\*Returns all the dashboards.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/dashboards":{"get":{"tags":["Statisticsv2"],"summary":"dashboards","description":"**Returns all the dashboards.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## widgetData

> \*\*Returns all the data of this widget.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetData":{"get":{"tags":["Statisticsv2"],"summary":"widgetData","description":"**Returns all the data of this widget.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## showData

> \*\*Returns all data of this widget to show.\*\*\
> \
> Widget data specifics can be added how is shown in the example. Adjust to your own needs.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/showData":{"get":{"tags":["Statisticsv2"],"summary":"showData","description":"**Returns all data of this widget to show.**\n\nWidget data specifics can be added how is shown in the example. Adjust to your own needs.","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"}}}}}}}}}
```

## widget

> \*\*Creates a new widget.\*\*\
> \
> See the example for how to write the dataURL.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widget":{"post":{"tags":["Statisticsv2"],"summary":"widget","description":"**Creates a new widget.**\n\nSee the example for how to write the dataURL.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"dashboardID":{"type":"string","description":"type: `number`"},"title":{"type":"string","description":"type: `^[0-9a-zA-Z :+*\\-]+$` = ' '"},"dataURL":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-\\ \\=\\?\\&\\[\\]\\_\\:\\+\\*\\@]+$` \\= ' '\n\nIdentical to the way showData allows these requested paramters in the URL."},"viewType":{"type":"string","description":"type: `^([a-zA-Z]+)$` = 'table'"},"fontSizeTitle":{"type":"string","description":"type: `number` = null"},"fontSizeData":{"type":"string","description":"type: `number` = null"},"pivotOnColumn":{"type":"string","description":"type: `^([0-9]+)$` = 0"},"ticketArchived":{"type":"string","description":"type: `boolean` = false"},"position_x":{"type":"string","description":"type: `number` = 0"},"position_y":{"type":"string","description":"type: `number` = 0"},"width":{"type":"string","description":"type: `number` = 5"},"height":{"type":"string","description":"type: `number` = 5"}}}}}},"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"}}}}}}}}}
```

## widget

> \*\*Updates an existing widget.\*\*\
> \
> See the example for how to write the dataURL. You need to fill in all the data, not just the changed data.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widget":{"put":{"tags":["Statisticsv2"],"summary":"widget","description":"**Updates an existing widget.**\n\nSee the example for how to write the dataURL. You need to fill in all the data, not just the changed data.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"id":{"type":"string","description":"type: `number`"},"title":{"type":"string","description":"type: `^[0-9a-zA-Z :+*\\-]+$` = ' '"},"dataURL":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-\\ \\=\\?\\&\\[\\]\\_\\:\\+\\*\\@]+$` = ' '"},"viewType":{"type":"string","description":"type: `^([a-zA-Z]+)$` = 'table'"},"fontSizeTitle":{"type":"string","description":"type: `number` = null"},"fontSizeData":{"type":"string","description":"type: `number` = null"},"pivotOnColumn":{"type":"string","description":"type: `number` = 0"},"ticketArchived":{"type":"string","description":"type: `boolean` = false"}}}}}},"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"}}}}}}}}}
```

## widgetDelete

> \*\*Deletes this widget.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetDelete":{"post":{"tags":["Statisticsv2"],"summary":"widgetDelete","description":"**Deletes this widget.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"type: `number`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## widgetPosition

> \*\*Updates this widget's position.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetPosition":{"post":{"tags":["Statisticsv2"],"summary":"widgetPosition","description":"**Updates this widget's position.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"type: `number`"},"width":{"type":"string","description":"type: `number` = null"},"height":{"type":"string","description":"type: `number` = null"},"x":{"type":"string","description":"type: `number` = null"},"y":{"type":"string","description":"type: `number` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## widgetAutoRefresh

> \*\*Sets the setting to automatically refresh this widget on or off.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetAutoRefresh":{"put":{"tags":["Statisticsv2"],"summary":"widgetAutoRefresh","description":"**Sets the setting to automatically refresh this widget on or off.**","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"id":{"type":"string","description":"type: `number`"},"state":{"type":"string","description":"type: `^(0|1)$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## widgetSendOptions

> \*\*Returns the info on where this widget's data is being sent to.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetSendOptions":{"get":{"tags":["Statisticsv2"],"summary":"widgetSendOptions","description":"**Returns the info on where this widget's data is being sent to.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## widgetSendOptions

> \*\*Creates a setting to send all widget data to an email.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/widgetSendOptions":{"post":{"tags":["Statisticsv2"],"summary":"widgetSendOptions","description":"**Creates a setting to send all widget data to an email.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"type: `number`"},"sendFrequency":{"type":"string","description":"type: `^([0-9a-zA-Z\\ \\: \\*]+)$`\n\nSet for if you want to send it with a regular interval."},"toAddresses":{"type":"string","description":"type: `^([a-zA-Z0-9 @+-_.,]+)$`\n\nHas to be an email address or multiple email addresses comma-separated"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## downloadData

> \*\*Returns and downloads all data of this widget, or of the data you sent along with the request.\*\*\
> \
> You either need to send the widget/panel ID, or the data in such a way provided in the example.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Statisticsv2","description":"**All the endpoints that can be called on the Statisticsv2 controller.**\n\nAll the endpoints require the `API_STATISTICS` permission, except for:\n\n- `POST` dashboardDelete\n    \n- `PUT` dashboard\n    \n\nWhich require the `DASHBOARD_CUD` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/statisticsv2/downloadData":{"get":{"tags":["Statisticsv2"],"summary":"downloadData","description":"**Returns and downloads all data of this widget, or of the data you sent along with the request.**\n\nYou either need to send the widget/panel ID, or the data in such a way provided in the 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-Disposition":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Keep-Alive":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"Content-Type":{"schema":{"type":"string"}}},"content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
```
