docusign.document-generation.put-envelope-doc-gen-form-fields
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 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. - See this method in use in your preferred coding language.
Updates sender fields for an envelope.
Overview
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-docusign |
| Version | 1.0 |
Input Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Docusign API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
accountid | string | Yes | — | The external account number (int) or account ID GUID. |
envelopeid | string | Yes | — | The envelope's GUID. Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec |
update_docgen_formfields_only | string | No | — | When false or omitted, the documents are updated. When true, only the form fields are updated. The documents are unchanged. |
docgenformfields | list | No | — | A list of docGenFormFields objects. |
Output Schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
base_url | string | Yes | — | Docusign API root, e.g. https://<host>/api |
api_token | string | No | — | Bearer token; omit to use the workflow's token env var |
accountid | string | Yes | — | The external account number (int) or account ID GUID. |
envelopeid | string | Yes | — | The envelope's GUID. Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec |
update_docgen_formfields_only | string | No | — | When false or omitted, the documents are updated. When true, only the form fields are updated. The documents are unchanged. |
docgenformfields | list | No | — | A list of docGenFormFields objects. |
status_code | integer | No | — | HTTP status code of the completed call |
response | json | No | — | Parsed JSON response body |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_at | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Waiting to call PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields |
completed | No | Yes | Yes | — | HTTP call succeeded |
failed | No | Yes | No | — | HTTP call failed |
State Diagram
Transitions
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | Perform PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields |
* (any state) | fail | failed | Record the failure reason |
API Usage
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "docusign.document-generation.put-envelope-doc-gen-form-fields",
"initial_data": {
"base_url": "value",
"accountid": "value",
"envelopeid": "value"
}
}