Updates the envelope custom fields for draft and in-process envelopes.

You may assign up to three envelope custom fields to an envelope. This limit does not include account (document) custom fields. Each custom field used in an envelope must have a unique name.

Request

HTTP request

POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/custom_fields

Parameters

Parameter NameValueDescription
Path Parameters
accountIdstring

The external account number (int) or account ID GUID.

envelopeIdstring

The envelope's GUID.

Example: 93be49ab-afa0-4adf-933c-f752070d71ec

Responses

CodeDescriptionReference
201

Successful response.

EnvelopeCustomFields
400

Error encountered.

errorDetails

SDK Method

Envelopes::createCustomFields

Definitions

errorDetails

This object describes errors that occur. It is only valid for responses and ignored in requests.

errorCodestring

The code associated with the error condition.

messagestring

A brief message describing the error condition.

listCustomField

This object represents a list custom field from which envelope creators and senders can select custom data.

configurationTypestring

If you are using merge fields, this property specifies the type of the merge field. The only supported value is salesforce.

errorDetailserrorDetails

This object describes errors that occur. It is only valid for responses and ignored in requests.

fieldIdstring

The id of the custom field.

listItems[array]

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.

namestring

The name of the custom field.

requiredstring

When set to true, senders are required to select an option from the list before they can send the envelope.

showstring

When set to true, the field displays in the Envelope Custom Fields section when a user creates or sends an envelope.

valuestring

The value of the custom field. This is the value that the user who creates or sends the envelope selects from the list.

textCustomField

This object represents a free text custom field where envelope creators and senders can enter custom data.

configurationTypestring

If you are using merge fields, this property specifies the type of the merge field. The only supported value is salesforce.

errorDetailserrorDetails

This object describes errors that occur. It is only valid for responses and ignored in requests.

fieldIdstring

The id of the custom field.

namestring

The name of the custom field.

requiredstring

When set to true, senders are required to enter or select information for the field before they can send the envelope.

showstring

When set to true, the field displays in the Envelope Custom Fields section when a user creates or sends an envelope.

valuestring

The value of the custom field. The user who creates or sends the envelope provides this value. Maximum length: 100 characters.

EnvelopeCustomFields

An envelope custom field enables you to collect custom data about envelopes on a per-envelope basis. You can then use the custom data for sorting, organizing, searching, and other downstream processes. For example, you can use custom fields to copy envelopes or data to multiple areas in Salesforce. eOriginal customers can eVault their documents from the web app on a per-envelope basis by setting an envelope custom field with a name like "eVault with eOriginal?" to "Yes" or "No".

When a user creates an envelope, the envelope custom fields display in the Envelope Settings section of the DocuSign console. Envelope recipients do not see the envelope custom fields. For more information, see Envelope Custom Fields.

listCustomFields[listCustomField]

An array of list custom fields.

textCustomFields[textCustomField]

An array of text custom fields.

Examples

Generic JSON Request/Response

Request
{
  "textCustomFields": [
    {
      "fieldId": "sample string 1",
      "name": "sample string 2",
      "show": "sample string 3",
      "required": "sample string 4",
      "value": "sample string 5",
      "configurationType": "sample string 6"
    }
  ],
  "listCustomFields": [
    {
      "listItems": [
        "sample string 1"
      ],
      "fieldId": "sample string 1",
      "name": "sample string 2",
      "show": "sample string 3",
      "required": "sample string 4",
      "value": "sample string 5",
      "configurationType": "sample string 6"
    }
  ]
}
Response
{
  "textCustomFields": [
    {
      "fieldId": "sample string 1",
      "name": "sample string 2",
      "show": "sample string 3",
      "required": "sample string 4",
      "value": "sample string 5",
      "configurationType": "sample string 6",
      "errorDetails": {
        "errorCode": "sample string 1",
        "message": "sample string 2"
      }
    }
  ],
  "listCustomFields": [
    {
      "listItems": [
        "sample string 1"
      ],
      "fieldId": "sample string 1",
      "name": "sample string 2",
      "show": "sample string 3",
      "required": "sample string 4",
      "value": "sample string 5",
      "configurationType": "sample string 6",
      "errorDetails": {
        "errorCode": "SUCCESS",
        "message": ""
      }
    }
  ]
}
Generic XML Request/Response

Request
<customFields xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.com/restapi">
  <listCustomFields>
    <listCustomField>
      <configurationType>sample string 6</configurationType>
      <fieldId>sample string 1</fieldId>
      <name>sample string 2</name>
      <required>sample string 4</required>
      <show>sample string 3</show>
      <value>sample string 5</value>
      <listItems xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
      </listItems>
    </listCustomField>
  </listCustomFields>
  <textCustomFields>
    <textCustomField>
      <configurationType>sample string 6</configurationType>
      <fieldId>sample string 1</fieldId>
      <name>sample string 2</name>
      <required>sample string 4</required>
      <show>sample string 3</show>
      <value>sample string 5</value>
    </textCustomField>
  </textCustomFields>
</customFields> 
Response
<customFields xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.com/restapi">
  <listCustomFields>
    <listCustomField>
      <configurationType>sample string 6</configurationType>
      <errorDetails>
        <errorCode>SUCCESS</errorCode>
        <message></message>
      </errorDetails>
      <fieldId>sample string 1</fieldId>
      <name>sample string 2</name>
      <required>sample string 4</required>
      <show>sample string 3</show>
      <value>sample string 5</value>
      <listItems xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
      </listItems>
    </listCustomField>
  </listCustomFields>
  <textCustomFields>
    <textCustomField>
      <configurationType>sample string 6</configurationType>
      <errorDetails>
        <errorCode>sample string 1</errorCode>
        <message>sample string 2</message>
      </errorDetails>
      <fieldId>sample string 1</fieldId>
      <name>sample string 2</name>
      <required>sample string 4</required>
      <show>sample string 3</show>
      <value>sample string 5</value>
    </textCustomField>
  </textCustomFields>
</customFields> 
}} />