# Ticket

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

Endpoints that require the `TICKET_READ` permission:

* `GET` index
* `GET` item

Endpoints that require the `TICKET_CREATE` permission:

* `POST` index

Endpoints that require the `TICKET_UPDATE` permission:

* `PUT` item
* `POST` setPriority

Endpoints that require the `TICKET_DELETE` permission:

* `DELETE` item
* `DELETE` multi

Endpoints that require the `SET_STATUS` permission:

* `POST` setStatus
* `PUT` solveUnfinishedTickets

Endpoints that require the `TICKET_BATCH` permission:

* `POST` batch

## index

> \*\*Returns all tickets with optional filters such as search queries, views and result limits.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"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/ticket":{"get":{"tags":["Ticket"],"summary":"index","description":"**Returns all tickets with optional filters such as search queries, views and result limits.**","operationId":"ticketIndexGET","parameters":[{"name":"applyView","in":"query","description":"The view to get the tickets from.","schema":{"type":"string","pattern":"^[0-9a-zA-Z\\-\\_]+$","minLength":2,"default":""}},{"name":"query","in":"query","schema":{"type":"string","minLength":1,"default":""}},{"$ref":"#/components/parameters/itemStart"},{"name":"itemLimit","in":"query","schema":{"type":"number","default":15,"maximum":9999}},{"name":"searchArchived","in":"query","schema":{"type":"string","enum":["yes","no"],"default":"no"}},{"name":"status","in":"query","schema":{"type":"string","enum":["new","open","pending","holding","solved"]}}],"responses":{"200":{"description":""}}}}}}
```

## index

> \*\*Creates a new empty ticket.\*\*\
> \
> Data can be added directly, but also through other /ticket endpoints.

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket":{"post":{"tags":["Ticket"],"summary":"index","description":"**Creates a new empty ticket.**\n\nData can be added directly, but also through other /ticket endpoints.","operationId":"ticketIndexPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brandID","channelID","direction","from","to","title"],"properties":{"brandID":{"type":"number"},"channelID":{"type":"number"},"direction":{"type":"string","enum":["inbound","outbound"]},"from":{"type":"string","minLength":2},"fromName":{"type":"string","minLength":1,"default":""},"to":{"type":"string","minLength":2},"title":{"type":"string","minLength":2},"assignedGroupID":{"type":"number","default":0},"formID":{"type":"number"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/{ticketID}":{"get":{"tags":["Ticket"],"summary":"item","description":"**Returns all the data of this ticket.**","operationId":"ticketItemGET","parameters":[{"name":"reload","in":"query","description":"Checks if the ticket is already open. If not, register that it has been opened.","schema":{"type":"boolean","default":false}},{"name":"getTicketHistory","in":"query","schema":{"description":"Send along this parameter with a value to get the ticket history.","type":"boolean","default":false}}],"responses":{"200":{"description":""}}}}}}
```

## item

> \*\*Updates the fields of this ticket.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/{ticketID}":{"put":{"tags":["Ticket"],"summary":"item","description":"**Updates the fields of this ticket.**","operationId":"ticketItemPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"externalPrimaryID":{"description":"The external primary ID of the customer this ticket belongs to.","type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["solved","closed"]}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

> \*\*Deletes all the data of this ticket.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/{ticketID}":{"delete":{"tags":["Ticket"],"summary":"item","description":"**Deletes all the data of this ticket.**","operationId":"ticketItemDELETE","responses":{"200":{"description":""}}}}}}
```

## multi

> \*\*Deletes multiple tickets given in an array.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/multi":{"delete":{"tags":["Ticket"],"summary":"multi","description":"**Deletes multiple tickets given in an array.**","operationId":"multi","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["ticketIDs"],"properties":{"ticketIDs":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":""}}}}}}
```

## setStatus

> \*\*Sets the status of the tickets given in an array.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/setStatus":{"post":{"tags":["Ticket"],"summary":"setStatus","description":"**Sets the status of the tickets given in an array.**","operationId":"setStatusPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["status","ticketIDs"],"properties":{"status":{"type":"string","enum":["new","open","pending","holding","solved","closed"]},"ticketIDs":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":""}}}}}}
```

## setPriority

> \*\*Sets the priority of the tickets given in an array.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/setPriority":{"post":{"tags":["Ticket"],"summary":"setPriority","description":"**Sets the priority of the tickets given in an array.**","operationId":"setPriorityPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["priority","ticketIDs"],"properties":{"priority":{"type":"string","enum":["low","medium","high","urgent"]},"ticketIDs":{"type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{"description":""}}}}}}
```

## unlinkCustomerFromTicket

> \*\*Unlinks the customer from the ticket provided.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/unlinkCustomerFromTicket":{"post":{"tags":["Ticket"],"summary":"unlinkCustomerFromTicket","description":"**Unlinks the customer from the ticket provided.**","operationId":"unlinkCustomerFromTicketPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["ticketID"],"properties":{"ticketID":{"type":"number"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## batch

> \*\*Performs miscellaneous actions on tickets given in an array.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Ticket","description":"**All the endpoints that can be called on the Ticket controller.**\n\nEndpoints that require the `TICKET_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n\nEndpoints that require the `TICKET_CREATE` permission:\n\n- `POST` index\n    \n\nEndpoints that require the `TICKET_UPDATE` permission:\n\n- `PUT` item\n    \n- `POST` setPriority\n    \n\nEndpoints that require the `TICKET_DELETE` permission:\n\n- `DELETE` item\n    \n- `DELETE` multi\n    \n\nEndpoints that require the `SET_STATUS` permission:\n\n- `POST` setStatus\n    \n- `PUT` solveUnfinishedTickets\n    \n\nEndpoints that require the `TICKET_BATCH` permission:\n\n- `POST` batch"}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/ticket/batch":{"post":{"tags":["Ticket"],"summary":"batch","description":"**Performs miscellaneous actions on tickets given in an array.**","operationId":"batchPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["ticketIDs"],"properties":{"TicketIDs":{"description":"Can be multiple ID's comma-separated (space allowed).","type":"string","pattern":"^[0-9, ]+$"},"actions":{"type":"array","items":{"type":"object","properties":{"actionType":{"description":"Needs to be an action type.","type":"string"},"value":{"description":"Needs to be the value the action would use.","type":"string"}}}}}}}}},"responses":{"200":{"description":""}}}}}}
```
