# Update a form

Updates a form's settings and returns it, the same shape as reading it back.
Fields you leave out keep their current values, so a partial body is safe.
**What is required depends on the form type.** Each type declares its own
required settings on top of the rules below - most types require `form_title` and
`success_content`, so a request that omits them is rejected even though nothing
here marks them required. Read the form first and send those values back with
your change.
**`close_at` is only kept if `close_form` is sent with it.** Send both to schedule
a closing time; send neither and any existing closing time is cleared. This is the
one field on this endpoint that a partial body does not leave alone.
The form type itself cannot be changed after creation and is not accepted here.

Endpoint: PUT /api/v2/form/{id}
Version: 2.0.0
Security: default

## Path parameters:

  - `id` (integer, required)
    The ID of the form.

## Header parameters:

  - `Rosterfy-Platform` (string)

## Request fields (application/json):

  - `close_form` (boolean)
    Whether the form should close automatically. Send it
together with `close_at`; without it the closing time is cleared.

  - `name` (string)
    The name administrators see for this form in the admin console. Not shown to the people filling it in.

  - `form_title` (string)
    The title shown at the top of the form to the people filling it in. May be sent as a plain string, or as an object keyed by locale code to give each language its own title.

  - `success_content` (string)
    HTML shown after the form is submitted successfully. Accepts a locale-keyed object in the same way as the title.

  - `options` (object)
    Form-wide settings. The keys available depend on the form type; send the object back as you read it, changing only what you mean to change.

  - `rules` (object)
    Visibility rules deciding which fields are shown, keyed by field. Sending an invalid rule set is rejected rather than partially applied.

  - `public` (boolean)
    Whether the form may be opened without signing in. Only takes effect on anonymous forms; every other type still requires a signed-in caller.

  - `is_archived` (boolean)
    Whether the form is archived. Archived forms stay readable but are filtered out of the admin console listings.

  - `close_content` (string)
    HTML shown in place of the form once it has closed. Accepts a locale-keyed object in the same way as the title.

  - `form_category_id` (integer)
    The category the form is filed under in the admin console.

  - `close_at` (string)
    When the form stops accepting submissions, as `YYYY-MM-DD HH:MM:SS`. Only honoured when `close_form` is sent with it; without that the value is cleared.

  - `cost` (number)
    What submitting the form costs, for the form types that take a payment.

  - `tax_percentage` (number)
    Tax applied to `cost`, as a percentage between 0 and 100.

## Response 200 fields (application/json):

  - `object` (object)

  - `object.id` (integer)

  - `object.form_type_id` (integer)

  - `object.name` (string)

  - `object.form_title` (string)

  - `object.form_category_id` (string | null)

  - `object.success_content` (string)

  - `object.close_content` (string)

  - `object.options` (array)

  - `object.rules` (array)

  - `object.cost` (string)

  - `object.tax_percentage` (string)

  - `object.close_at` (string | null)

  - `object.public` (integer)

  - `object.is_archived` (integer)

  - `object.token` (string)

  - `object.deleted_at` (string | null)

  - `object.created_at` (string)

  - `object.updated_at` (string)

  - `object.deleted_by` (string | null)

  - `nice` (object)

  - `nice.rrn` (string)

  - `nice.is_open` (string)

  - `nice.close_at` (string | null)

  - `nice.is_foreign_account` (boolean)

  - `relations` (object)

  - `relations.form_type` (object)

  - `relations.form_type.id` (integer)

  - `relations.form_type.name` (string)

  - `relations.form_type.code` (string)

  - `relations.form_type.main_entity` (string)

  - `relations.form_type.entities` (object)

  - `relations.form_type.entities.user_form_submission` (object)

  - `relations.form_type.entities.user_form_submission.create` (boolean)

  - `relations.form_type.public_field` (object)

  - `relations.form_type.public_field.form_title` (object)

  - `relations.form_type.public_field.form_title.rules` (string)

  - `relations.form_type.public_field.form_title.validation` (string)

  - `relations.form_type.public_field.close_content` (object)

  - `relations.form_type.public_field.close_content.rules` (string)

  - `relations.form_type.public_field.close_content.validation` (string)

  - `relations.form_type.public_field.success_content` (object)

  - `relations.form_type.public_field.success_content.rules` (string)

  - `relations.form_type.public_field.success_content.validation` (string)

  - `relations.form_type.access` (string)

  - `permissions` (object)

  - `permissions.read` (boolean)

  - `permissions.update` (boolean)

  - `permissions.delete` (boolean)

  - `permissions.copy` (boolean)

