---
title: "Updates sender fields for an envelope."
method: PUT
path: "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields"
tags: ["DocumentGeneration"]
---

# Updates sender fields for an envelope.

`PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields`

This method dynamically generates an envelope's documents by populating its sender fields. The envelope must be in a draft state.

Use the [DocumentGeneration::getEnvelopeDocGenFormFields](/docs/esign-rest-api/reference/envelopes/documentgeneration/getenvelopedocgenformfields/) response to retrieve the list of sender fields for your envelope. Use that list to build the request for this method. For each field, specify the field name and the value to populate.

For example, your request body might look like this:

```json
{
  "docGenFormFields": [
    {
      "documentId": "bf3202e1-xxxx-xxxx-xxxx-af4f41366879",
      "docGenFormFieldList": [
        {
          "name": "Candidate_Name",
          "value": "Peggy Olson"
        },
        {
          "name": "Job_Title",
          "value": "Technical Writer"
        },
        {
          "name": "Manager_Name",
          "value": "Donald Draper"
        },
        {
          "name": "Start_Date",
          "value": "1960-02-28"
        },
        {
          "name": "Salary",
          "value": "3380"
        }
      ]
    }
  ]
}
```

### Important notes

* If `update_docgen_formfields_only` is false (the default), the `documentId` changes after the update.
* This endpoint does not validate number, date, or select data field values. The request can succeed even if a number or date field value is not a valid number or date, or if a select field value is not one of the allowed values.

### Related topics

- [Learn about document generation in the eSignature concepts guide.](/docs/esign-rest-api/esign101/concepts/documents/document-generation/)
- [See this method in use in your preferred coding language](/docs/esign-rest-api/how-to/request-signature-email-document-generation/).

## Path parameters

- `accountId` string, required
- `envelopeId` string, required

## Query parameters

- `update_docgen_formfields_only` string

## Request body

- DocGenFormFieldRequest — This object maps the document generation fields to their values.
  - `docGenFormFields` DocGenFormFields[] — A list of `docGenFormFields` objects.
    - `docGenDocumentStatus` string — The status of the document. This is a read-only property, and not used in [updateEnvelopeDocGenFormFields][docgen update]. Valid values: - `mergesucceeded` - `created` - `hassyntaxerror` [docgen update]: /docs/esign-rest-api/reference/envelopes/documentgeneration/updateenvelopedocgenformfields/
    - `docGenErrors` DocGenSyntaxError[] — A list of `docGenSyntaxError` objects.
      - `errorCode` string — A code associated with the error condition.
      - `message` string — The error message.
      - `tagIdentifier` string — The tag that caused the syntax error. See [Document Generation Syntax](https://support.docusign.com/s/document-item?bundleId=als1679428547895&topicId=ftc1679700030026.html) to learn more about document generation syntax rules.
    - `docGenFormFieldList` DocGenFormField[] — A list of `docGenFormField` objects.
      - `connectedObjectDetails` ConnectedObjectDetails
        - `recordId` string
      - `defaultValue` string
      - `description` string — A description of the field. Displayed with the label.
      - `filter` string — An object used to present a filtered view of the items in a folder.
      - `format` DocGenFormat
        - `expression` string
        - `locale` string — The user's locale code. Valid values are: - `zh_CN` - `zh_TW` - `nl` - `en` - `fr` - `de` - `it` - `ja` - `ko` - `pt` - `pt_BR` - `ru` - `es`
      - `fullyQualifiedPath` string
      - `hidden` string
      - `label` string — A label displayed near the field.
      - `name` string — The name of the sender field. Required for PUT requests.
      - `options` DocGenFormFieldOption[] — When `type` is `Select`, this array describes the available options.
        - `description` string — Description of the selectable option.
        - `label` string — The label for the selectable option.
        - `selected` string — When **true,** the option is selected.
        - `value` string — Specifies the value of the option. This is the value of the form field when this option is selected.
      - `order` string — The order in which to sort the results. Valid values are: * `asc`: Ascending order. * `desc`: Descending order.
      - `predefinedValidation` string — Reserved for Docusign.
      - `readOnly` string
      - `required` string — When **true,** the field is required.
      - `rowValues` DocGenFormFieldRowValue[] — For fields of type `TableRow`, this property represents the sender fields in the row. For GET requests, this array contains a single `docGenFormFieldRowValue` object. That object contains a list of sender fields that will appear in each row. For PUT requests, you must supply a `docGenFormFieldRowValue` object for each row in the table. This populates the data in the table.
        - `docGenFormFieldList` DocGenFormField[] — The sender fields in each row of the table. For GET requests, the `label`, `type`, `required`, and `name` properties will be returned. For POST requests, supply the `name` and `value` for each child object. These correspond to the values in each column.
      - `type` string — The kind of data the sender field holds. Valid values: - `TextBox` - `Date` - `Number` - `Select` - `TableRow`
      - `validation` DocGenFormFieldValidation — Describes how values are validated.
        - `errorMessage` string — The error message when validation fails.
        - `expression` string — The expression used to validate values.
      - `value` string — The value of the sender field. For PUT requests, you must supply either this property (for all fields except `TableRow` types) or `rowValues` (for `TableRow` fields).
    - `documentId` string — The GUID of the document.

## Response `200`

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/revisions/77f1998c313d/schema)
