# Form

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

Endpoints that require the `FORM_READ` permission:

* `GET` index
* `GET` item
* `GET` getFormForTicket

Endpoints that require the `FORM_CUD` permission:

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

Additionally, `PUT` saveFormFields requires the `FORM_SAVE` permission.

## index

> \*\*Returns all of the existing forms.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}},"parameters":{"query":{"name":"query","in":"query","schema":{"type":"string","pattern":"^[0-9a-zA-Z ]+$","minLength":1,"default":""}},"itemStart":{"name":"itemStart","in":"query","schema":{"type":"number","default":0}}}},"paths":{"/api/v2/form":{"get":{"tags":["Form"],"summary":"index","description":"**Returns all of the existing forms.**","operationId":"formIndexGET","parameters":[{"$ref":"#/components/parameters/query"},{"$ref":"#/components/parameters/itemStart"},{"name":"itemLimit","in":"query","schema":{"type":"number","maximum":9999,"default":15}}],"responses":{"200":{"description":""}}}}}}
```

## index

> \*\*Creates a new form for this brand.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form":{"post":{"tags":["Form"],"summary":"index","description":"**Creates a new form for this brand.**","operationId":"formIndexPOST","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","required":["brand_id","title"],"properties":{"brand_id":{"type":"number"},"title":{"type":"string","pattern":"^[a-zA-Z0-9 ]+$","minLength":2}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

> \*\*Returns this form by its ID.\*\*\
> \
> Optionally, you can send a ticket ID with it to get the form values for that ticket.

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form/{id}":{"get":{"tags":["Form"],"summary":"item","description":"**Returns this form by its ID.**\n\nOptionally, you can send a ticket ID with it to get the form values for that ticket.","operationId":"formItemGET","parameters":[{"name":"ticketID","in":"query","schema":{"type":"number"}}],"responses":{"200":{"description":""}}}}}}
```

## item

> \*\*Updates this form by its ID.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form/{id}":{"put":{"tags":["Form"],"summary":"item","description":"**Updates this form by its ID.**","operationId":"formItemPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["brand_id","title"],"properties":{"brand_id":{"type":"number"},"title":{"type":"string","pattern":"^[a-zA-Z0-9 ]+$","minLength":2}}}}}},"responses":{"200":{"description":""}}}}}}
```

## item

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

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form/{id}":{"delete":{"tags":["Form"],"summary":"item","description":"**Permanently deletes this form by its ID.**","operationId":"formItemDELETE","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"description":{"description":"Optional parameter if you want to send a description for deletion.","type":"string"}}}}}},"responses":{"200":{"description":""}}}}}}
```

## getFormForTicket

> \*\*Returns the form(s) for this ticket.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form/getFormForTicket":{"get":{"tags":["Form"],"summary":"getFormForTicket","description":"**Returns the form(s) for this ticket.**","operationId":"getFormForTicketGET","parameters":[{"name":"ticketID","in":"query","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":""}}}}}}
```

## saveFormFields

> \*\*Saves the values of the form fields of this ticket.\*\*

```json
{"openapi":"3.0.3","info":{"title":"Omnidesk API documentation","version":"2.0.0"},"tags":[{"name":"Form","description":"**All the endpoints that can be called on the Form controller.**\n\nEndpoints that require the `FORM_READ` permission:\n\n- `GET` index\n    \n- `GET` item\n    \n- `GET` getFormForTicket\n    \n\nEndpoints that require the `FORM_CUD` permission:\n\n- `POST` index\n    \n- `PUT` item\n    \n- `DELETE` item\n    \n\nAdditionally, `PUT` saveFormFields requires the `FORM_SAVE` permission."}],"servers":[{"url":"{{base_url}}"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","name":"apiKey","in":"header"}}},"paths":{"/api/v2/form/saveFormFields":{"put":{"tags":["Form"],"summary":"saveFormFields","description":"**Saves the values of the form fields of this ticket.**","operationId":"saveFormFieldsPUT","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["ticketID"],"properties":{"ticketID":{"type":"number"},"fields":{"type":"array","items":{"type":"object","properties":{"formFieldID":{"type":"string"},"formFieldValue":{"type":"string"}}}}}}}}},"responses":{"200":{"description":""}}}}}}
```
