Update Form
Endpoint
PUT /v1/forms/{id}
Description
This endpoint allows the update of a form with the given ID. The form data is provided in the request body in JSON format. Upon successful update, the response body contains details of the updated form, including its ID, creation timestamp, update status, and the form data.
Request
Headers
Content-Type
:application/json
Path Parameters
id
(string): The unique identifier of the form to be updated.
Body
The request body should contain a JSON object with the updated form data.
form
: An object representing the form to be updated.asText
(string, optional): Text representation of the form.form_url
(string, optional): URL of the form.fields
(array of dictionaries, optional): List of form fields.group_instructions
(dictionary, optional): Group instructions for the form.line_by_line_instructions
(dictionary, optional): Line-by-line instructions for the form.
Example
{
"form": {
"asText": "FORM_CONTENT_HERE",
"form_url": "https://example.com/form.pdf",
"fields": [
{
"id": "c3bf",
"name": "Name",
"form_name": "topmostSubform[0].Page1[0].f1_01[0]",
"form_type": "Text"
}
],
"group_instructions": {
"group_name_1": "Instruction 1"
},
"line_by_line_instructions": {
"line_1": "Instruction 1"
}
}
}
Success Response
- Code: 200 OK
- Content:
{
"id": "uf_2835eb75d57b4b7e9efb15b534190744",
"created": "2024-06-19T14:55:21.1091381Z",
"object": "update_form",
"updated": true,
"form": {
"as_text": "FORM_CONTENT_HERE",
"fields": [
{
"id": "c3bf",
"name": "Name",
"form_name": "topmostSubform[0].Page1[0].f1_01[0]",
"form_type": "Text"
},
{
"id": "fac0",
"name": "Surname",
"form_name": "topmostSubform[0].Page1[0].f1_02[0]",
"form_type": "Text"
},
//so on
],
"group_instructions": {
"group_name_1": "Instruction 1"
},
"line_by_line_instructions": {
"line_1": "Instruction 1"
}
}
}
Error Responses
- Code: 403 Forbidden
- Content:
{
"id": "error_c4e1d07d92d24070b0711d7ba4db5171",
"created": "2024-06-19T15:10:24.2215695Z",
"object": "error",
"error_message": "Forbidden. Form doesn't belong to the user."
}