> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/api-reference/002_company/013_forms/007__update_form_version.md).

# Update Form Version

GraphQL endpoint: `/company`

Replaces the fields of an existing form version; field order follows the order of the list. Only an unpublished, latest version with no submissions can be edited.

## Query

```graphql
mutation (
  $formId: ID!
  $formVersionId: ID!
  $fields: [FormVersionFieldInput!]!
) {
  updateFormVersion (
    formId: $formId
    formVersionId: $formVersionId
    fields: $fields
  ) {
    id
    version
    formVersionFields {
      label
      type
      order
    }
  }
}

```

## Variables

```json
{
  "fields": [
    {
      "label": "New Field 1",
      "type": "TEXT"
    },
    {
      "label": "New Field 2",
      "type": "EMAIL"
    }
  ],
  "formId": "00000000-0000-4000-8000-000000000002",
  "formVersionId": "00000000-0000-4000-8000-000000000001"
}
```

## Response

```json
{
  "data": {
    "updateFormVersion": {
      "formVersionFields": [
        {
          "label": "New Field 1",
          "order": 0,
          "type": "TEXT"
        },
        {
          "label": "New Field 2",
          "order": 1,
          "type": "EMAIL"
        }
      ],
      "id": "00000000-0000-4000-8000-000000000001",
      "version": 1
    }
  }
}
```
