> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coperniq.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coperniq.io/_mcp/server.

# Update Form Template

PATCH https://api.coperniq.io/v1/form-templates/{form_template_id}
Content-Type: application/json

Update an existing form template. All fields are optional — only provided fields are updated. `formLayouts` is optional — omit it to leave the existing layout untouched.

**formLayouts replacement:** When provided, the `formLayouts` array **fully replaces** all layout groups and their fields on the template. Position is determined by array order.

**IDs are not stable across updates.** Every update internally deletes all existing layout rows and inserts new ones, so every group and field receives a new auto-generated ID after each PATCH. The IDs returned in a GET response are only valid until the next PATCH. Do not store or rely on layout IDs across updates.

**Using `id` in the request:** You can pass `{ "id": <id from a recent GET> }` for a group or field to reference its current data without repeating all attributes — the API will look up the existing name, type, isRequired, etc. and carry them forward. This is a convenience shortcut for the current request only; the ID will be different in the response.

**Assignee (mutually exclusive — use at most one):**

* `assigneeId` — assign a specific user by ID.
* `assigneeProperty` — assign by project property key: `OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`, or a custom PERSON property `keyName`.
* `assigneeTeamId` — assign a team: the team lead becomes the assignee and all other team members are added as collaborators.

**Collaborators:**

* `collaborators` — replaces the list of direct user collaborator IDs.
* `collaboratorProperties` — replaces the list of property-based collaborators. Each value is a standard key (`OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`) or a custom PERSON property `keyName`.
* `collaboratorTeamIds` — team IDs whose members are resolved to user IDs and merged (deduplicated) into collaborators alongside any direct `collaborators` and members from `assigneeTeamId`.

Reference: https://docs.coperniq.io/api-reference/forms/update-form-template

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `form_template_id` (string, required)

### Body (application/json)

This endpoint expects a FormTemplateUpdate.

- `name` (string, optional) — Template name. Optional — omit to leave the existing name untouched.
- `formLayouts` (list of FormTemplateLayoutInput, optional) — Optional. When provided, **fully replaces** all layout groups and their fields. Include existing groups with their `id` to keep/update them; omit the `id` for new groups. Groups not included are removed. Array order determines position. If omitted, the existing layout is left untouched.
- `assigneeId` (integer, optional, nullable) — Direct user ID to assign. Mutually exclusive with `assigneeProperty` and `assigneeTeamId`.
- `assigneeProperty` (string, optional, nullable) — Property-based assignee. Use a standard key (`OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`) or a custom PERSON property keyName. Mutually exclusive with `assigneeId` and `assigneeTeamId`.
- `assigneeTeamId` (integer, optional, nullable) — Assign a team: the team lead becomes the assignee and all other team members are added as collaborators. Mutually exclusive with `assigneeId` and `assigneeProperty`.
- `collaborators` (list of integer, optional) — Replaces the list of direct user collaborator IDs.
- `collaboratorProperties` (list of string, optional) — Property-based collaborators. Each value is a standard key (`OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`) or a custom PERSON property keyName.
- `collaboratorTeamIds` (list of integer, optional) — Team IDs whose members are added as collaborators. Resolved to individual user IDs and merged (deduplicated) with any direct `collaborators` and members from `assigneeTeamId`.
- `labels` (list of integer, optional) — Replaces the list of label IDs applied to the template.
- `dueDateXDaysAfter` (integer, optional, nullable) — Number of days after creation that the form is due.

## Response

### 200

Form template updated successfully

- `id` (integer, optional) — Form template identifier
- `name` (string, optional) — Template name
- `createdAt` (string, optional)
- `updatedAt` (string, optional)
- `assignee` (FormTemplateDetailAssignee, optional, nullable) — Direct user assignment. Null if assigneeProperty is used instead.
- `assigneeProperty` (string, optional, nullable) — Property-based assignee key. Returns a standard key (`OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`) or the keyName of a custom PERSON property. Null if a direct user assignee is set.
- `collaborators` (list of FormTemplateDetailCollaboratorsItems, optional) — Direct user collaborators.
- `collaboratorProperties` (list of string, optional) — Property-based collaborator keys. Each value is a standard key (`OWNER`, `SALES_REP`, `PROJECT_MANAGER`, `CREATED_BY`) or the keyName of a custom PERSON property.
- `labels` (list of FormTemplateDetailLabelsItems, optional)
- `dueDateXDaysAfter` (integer, optional, nullable) — Number of days after creation that the form is due
- `formLayouts` (list of FormTemplateLayout, optional) — Top-level layout items (GROUP sections and standalone COLUMN fields). Only root-level items are returned; child items are nested inside each GROUP's properties array.

## Errors

### 400 Bad Request Error

Invalid request

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `NOT_FOUND`
- `field` (string, optional) — Field that caused the validation error (if applicable)

### 401 Unauthorized Error

Authentication failed

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `NOT_FOUND`

### 404 Not Found Error

Resource not found

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `NOT_FOUND`

## Types

### FormTemplateLayoutInput

A form group containing a title and an ordered list of field properties.

- `id` (integer, optional) — ID of an existing group from a recent GET response. When provided without other fields, the API carries forward the group's current name. Note: IDs change after every update — only use an id obtained from the most recent GET on this template.
- `name` (string, optional, nullable) — Group title displayed above the fields.
- `properties` (list of FormTemplatePropertyInput, optional) — Ordered list of fields inside this group.

### FormTemplateDetailAssignee

Direct user assignment. Null if assigneeProperty is used instead.

- `id` (integer, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)
- `email` (string, optional)

### FormTemplateDetailCollaboratorsItems

- `id` (integer, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)
- `email` (string, optional)

### FormTemplateDetailLabelsItems

- `id` (integer, optional)
- `label` (string, optional)
- `color` (string, optional)

### FormTemplateLayout

- `id` (integer, optional) — Layout row identifier
- `name` (string, optional, nullable) — Group label for GROUP type, null for COLUMN type
- `type` (enum, optional) — GROUP = section header containing child items in properties. COLUMN = an actual form field.
  - Allowed values: `GROUP`, `COLUMN`
- `columnId` (integer, optional, nullable) — Column (property) identifier. Null for GROUP items.
- `column` (FormTemplateLayoutColumn, optional) — Field metadata. Only present for COLUMN type.
- `properties` (list of FormTemplateChildLayout, optional) — Nested child items. Populated for GROUP items (containing COLUMN children). Empty array for COLUMN items.
- `fields` (list of FormTemplateChildLayout, optional, deprecated) — Deprecated alias of properties; kept for backward compatibility. Use properties instead.

### FormTemplatePropertyInput

A single field inside a form group. **Using `projectPropertyKey` (recommended for project-linked fields)** When `projectPropertyKey` is provided, the API looks up the project property by its key and automatically fills in `name`, `type`, `isRequired`, `isReadOnly`, `multiple`, and `options` from the property definition. All other fields become optional overrides — for example, you can pass `isRequired: true` to override the property's default. Example — link to a project property by key: ```json { "projectPropertyKey": "sales_rep" } ``` Example — link and override required: ```json { "projectPropertyKey": "sales_rep", "isRequired": true } ``` **Manual field (no `projectPropertyKey`)** When `projectPropertyKey` is omitted, `type` is required and all other fields (name, isRequired, isReadOnly) should be provided explicitly.

- `id` (integer, optional) — ID of an existing field from a recent GET response. When provided without other fields (and without projectPropertyKey), the API carries forward the field's current name, type, isRequired, and all other attributes. Note: IDs change after every update — only use an id obtained from the most recent GET on this template.
- `projectPropertyKey` (string, optional) — The keyName of an existing project property. When provided, the API resolves the property and auto-populates all field attributes. All other fields on this object become optional overrides.
- `name` (string, optional) — Field label. When projectPropertyKey is used, providing name overrides the property's display name on the form.
- `type` (enum, optional) — Field type. Required when projectPropertyKey is not provided. TEXT = text input, NUMERIC = number input, DROPDOWN = single or multi-select (set multiple: true for multi-select), FILE = file attachment.
  - Allowed values: `TEXT`, `NUMERIC`, `DROPDOWN`, `FILE`
- `isRequired` (boolean, optional) — Whether the field is required. Overrides the property default when projectPropertyKey is used.
- `isReadOnly` (boolean, optional) — Whether the field is read-only. Overrides the property default when projectPropertyKey is used.
- `multiple` (boolean, optional) — When true, allows multiple selections. Applicable to DROPDOWN fields.
- `notes` (string, optional, nullable) — Helper text shown beneath the field.
- `options` (FormTemplatePropertyInputOptions, optional) — Field-type-specific configuration (e.g. dropdown choices).
- `referenceFileIds` (list of integer, optional) — File IDs attached as reference documents to this field.

### FormTemplateLayoutColumn

Field metadata. Only present for COLUMN type.

- `id` (integer, optional)
- `name` (string, optional)
- `type` (string, optional) — Field type: DROPDOWN, NUMERIC, BOOLEAN, DATE, DATETIME, TEXT, LONG_TEXT, PERSON, FILE, SEPARATOR, PROJECT, LINK, TIMERANGEDAYS
- `multiple` (boolean, optional)
- `isRequired` (boolean, optional)
- `isReadOnly` (boolean, optional)

### FormTemplateChildLayout

- `id` (integer, optional) — Layout row identifier
- `name` (string, optional, nullable)
- `type` (enum, optional)
  - Allowed values: `COLUMN`
- `columnId` (integer, optional, nullable) — Column (property) identifier
- `column` (FormTemplateChildLayoutColumn, optional) — Field metadata

### FormTemplatePropertyInputOptions

Field-type-specific configuration (e.g. dropdown choices).

### FormTemplateChildLayoutColumn

Field metadata

- `id` (integer, optional)
- `name` (string, optional)
- `type` (string, optional)
- `multiple` (boolean, optional)
- `isRequired` (boolean, optional)
- `isReadOnly` (boolean, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": 1,
  "name": "string",
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z",
  "assignee": {
    "id": 1,
    "firstName": "string",
    "lastName": "string",
    "email": "string"
  },
  "assigneeProperty": "string",
  "collaborators": [
    {
      "id": 1,
      "firstName": "string",
      "lastName": "string",
      "email": "string"
    }
  ],
  "collaboratorProperties": [
    "string"
  ],
  "labels": [
    {
      "id": 1,
      "label": "string",
      "color": "string"
    }
  ],
  "dueDateXDaysAfter": 1,
  "formLayouts": [
    {
      "id": 1,
      "name": "string",
      "type": "GROUP",
      "columnId": 1,
      "column": {
        "id": 1,
        "name": "string",
        "type": "string",
        "multiple": true,
        "isRequired": true,
        "isReadOnly": true
      },
      "properties": [
        {
          "id": 1,
          "name": "string",
          "type": "COLUMN",
          "columnId": 1,
          "column": {
            "id": 1,
            "name": "string",
            "type": "string",
            "multiple": true,
            "isRequired": true,
            "isReadOnly": true
          }
        }
      ],
      "fields": [
        {
          "id": 1,
          "name": "string",
          "type": "COLUMN",
          "columnId": 1,
          "column": {
            "id": 1,
            "name": "string",
            "type": "string",
            "multiple": true,
            "isRequired": true,
            "isReadOnly": true
          }
        }
      ]
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.coperniq.io/v1/form-templates/form_template_id"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.coperniq.io/v1/form-templates/form_template_id';
const options = {
  method: 'PATCH',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.coperniq.io/v1/form-templates/form_template_id"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.coperniq.io/v1/form-templates/form_template_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.coperniq.io/v1/form-templates/form_template_id")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.coperniq.io/v1/form-templates/form_template_id', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.coperniq.io/v1/form-templates/form_template_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.coperniq.io/v1/form-templates/form_template_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```