> 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/006__create_form_version.md).

# Create Form Version

GraphQL endpoint: `/company`

Creates a new version of an existing form with the given fields; field order follows the order of the list. The version number increments automatically, and the version stays unpublished unless `published` is set to true.

## Query

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

```

## Variables

```json
{
  "fields": [
    {
      "label": "Updated Name",
      "type": "TEXT"
    },
    {
      "label": "Phone",
      "type": "NUMBER"
    }
  ],
  "formId": "00000000-0000-4000-8000-000000000002"
}
```

## Response

```json
{
  "data": {
    "createFormVersion": {
      "formVersionFields": [
        {
          "label": "Updated Name",
          "order": 0,
          "type": "TEXT"
        },
        {
          "label": "Phone",
          "order": 1,
          "type": "NUMBER"
        }
      ],
      "id": "00000000-0000-4000-8000-000000000001",
      "published": false,
      "version": 2
    }
  }
}
```
