---
title: "Creates custom document fields in an existing template document."
method: POST
path: "/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields"
tags: ["TemplateCustomFields"]
---

# Creates custom document fields in an existing template document.

`POST /v2.1/accounts/{accountId}/templates/{templateId}/custom_fields`

Creates custom document fields in an existing template document.

## Path parameters

- `accountId` string, required
- `templateId` string, required

## Request body

- TemplateCustomFields
  - `listCustomFields` ListCustomField[] — An array of list custom fields.
    - `configurationType` string — If you are using merge fields, this property specifies the type of the merge field. The only supported value is `salesforce`.
    - `errorDetails` ErrorDetails — This object describes errors that occur. It is only valid for responses and ignored in requests.
      - `errorCode` string — The code associated with the error condition.
      - `message` string — A brief message describing the error condition.
    - `fieldId` string — The ID of the custom field.
    - `listItems` string[] — An array of strings that represents the options in a list. Maximum length: 2048 characters, but each individual option string can only be a maximum of 100 characters.
    - `name` string — The name of the custom field.
    - `required` string — When **true,** senders are required to select an option from the list before they can send the envelope.
    - `show` string — When **true,** the field displays in the **Envelope Custom Fields** section when a user creates or sends an envelope.
    - `value` string — The value of the custom field. This is the value that the user who creates or sends the envelope selects from the list.
  - `textCustomFields` TextCustomField[] — An array of text custom fields.
    - `configurationType` string — If you are using merge fields, this property specifies the type of the merge field. The only supported value is `salesforce`.
    - `errorDetails` ErrorDetails — This object describes errors that occur. It is only valid for responses and ignored in requests.
      - `errorCode` string — The code associated with the error condition.
      - `message` string — A brief message describing the error condition.
    - `fieldId` string — The ID of the custom field.
    - `name` string — The name of the custom field.
    - `required` string — When **true,** senders are required to enter or select information for the field before they can send the envelope.
    - `show` string — When **true,** the field displays in the **Envelope Custom Fields** section when a user creates or sends an envelope.
    - `value` string — The value of the custom field. The user who creates or sends the envelope provides this value. Maximum length: 100 characters.

## Response `201`

Successful response.

## Other responses

- `400` — Error encountered.

---

[API](https://skmtc.net/docusign/apis/docusign-esignature-rest-api.md) · [All operations](https://skmtc.net/docusign/apis/docusign-esignature-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docusign/docusign-esignature-rest-api/versions/77f1998c313d/schema)
