# 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.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form":{"get":{"tags":["Form"],"summary":"index","description":"**Returns all of the existing forms.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## index

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

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form":{"post":{"tags":["Form"],"summary":"index","description":"**Creates a new form for this brand.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"brand_id":{"type":"string","description":"type: `number`"},"title":{"type":"string","description":"type: `^[a-zA-Z0-9 ]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## 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.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"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.","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

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

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form/{id}":{"put":{"tags":["Form"],"summary":"item","description":"**Updates this form by its ID.**","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"brand_id":{"type":"string","description":"type: `number`"},"title":{"type":"string","description":"type: `^[a-zA-Z0-9 ]+$`"}}}}}},"parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## item

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

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form/{id}":{"delete":{"tags":["Form"],"summary":"item","description":"**Permanently deletes this form by its ID.**","parameters":[{"name":"id","in":"path","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## getFormForTicket

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

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form/getFormForTicket":{"get":{"tags":["Form"],"summary":"getFormForTicket","description":"**Returns the form(s) for this ticket.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## saveFormFields

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

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.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":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/form/saveFormFields":{"put":{"tags":["Form"],"summary":"saveFormFields","description":"**Saves the values of the form fields of this ticket.**","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"properties":{"ticketID":{"type":"string","description":"type: `number`"},"fields[0][formFieldID]":{"type":"string","description":"type: `number`"},"fields[0][formFieldValue]":{"type":"string","description":"type: `string` = ' '\n\nCan be a text value, or the ID of a form field option to be selected."}}}}}},"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/form.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.
