Skip to main content
Question

Unable to Pre-fill DocGen Form Fields via API When Sending Envelope

  • May 5, 2026
  • 3 replies
  • 47 views

Forum|alt.badge.img+1

Hello DocuSign Support Team,

I am experiencing an issue with pre-filling document generation (DocGen) form fields when creating and sending an envelope via the REST API. Despite trying multiple approaches, the fields are rendering as unresolved placeholders (e.g., {{Agreement Party}}, {{demo_field}}) in the document instead of showing the values passed through the API.

---

ENVIRONMENT
- API Base URL: https://demo.docusign.net/restapi/v2.1/
- Template ID: 3cfaca9c-ffd5-4c16-a416-992ca05317b0
- Template Name: Final Contract AI
- Document Type: .docx (ACE/DocGen format — isAceGenDocument: true)

---

FIELD DETAILS (from template response)
The template contains two DocGen form fields confirmed via GET /templates/{templateId}:

1. Field Label: Agreement Party
   Internal Name: AgreementParty_displayName_Z2bXgzv
   Fully Qualified Path: com.docusign.platform@1/AgreementParty/displayName
   Type: TextBox

2. Field Label: demo_field
   Internal Name: C_demo_field_value_1Xkjiv
   Fully Qualified Path: account._771d9b65_90d3_4661_8916_9f42a88bc2eb.custom.fields@1/C_demo_field/value
   Type: TextBox

Recipient Role: test_signer
Recipient ID: 55136564

---

APPROACHES ATTEMPTED (all unsuccessful)

1. Standard textTabs with locked: true under signer tabs
   — Fields showed as unresolved {{placeholders}}

2. prefillTabs under signer
   — Error: INVALID_TAB_OPERATION — PrefillTab not allowed for recipient

3. prefillTabs at recipients level inside inlineTemplates
   — Fields still rendered as {{placeholders}}

4. prefillTabs at root envelope level
   — Fields still rendered as {{placeholders}}

5. docGenFormFields at root level with documentId and docGenFormFieldList
   — Fields still rendered as {{placeholders}}

Sample payload used for approach 5:

{
  "emailSubject": "Please sign this contract",
  "status": "sent",
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "serverTemplates": [
        { "sequence": "1", "templateId": "3cfaca9c-ffd5-4c16-a416-992ca05317b0" }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "John Doe",
                "email": "startdeveloper3@gmail.com",
                "recipientId": "55136564",
                "roleName": "test_signer"
              }
            ]
          }
        }
      ]
    }
  ],
  "docGenFormFields": [
    {
      "documentId": "1",
      "docGenFormFieldList": [
        { "name": "AgreementParty_displayName_Z2bXgzv", "value": "John Doe" },
        { "name": "C_demo_field_value_1Xkjiv", "value": "Ritik Test" }
      ]
    }
  ]
}

---

CURRENT BEHAVIOR
The envelope is created and sent successfully (HTTP 201). The signer receives the email and can open the document. However, the fields {{Agreement Party}} and {{demo_field}} remain as unresolved placeholder text in the document body instead of displaying the values provided in the API request.

---

EXPECTED BEHAVIOR
The DocGen form field values provided in the API request should be resolved and rendered as actual text in the document before it is delivered to the signer. The signer should see the pre-filled values (e.g., "John Doe" and "Ritik Test") and should not be able to edit them.

---

QUESTIONS
1. What is the correct API approach to pre-fill DocGen form fields (isAceGenDocument: true) when sending an envelope programmatically via the REST API?
2. Is there a separate DocGen-specific API endpoint that must be called before or instead of POST /envelopes?
3. Does the compositeTemplates approach support DocGen field resolution, or must we use a different envelope creation method?
4. Is there any additional configuration required on the template or account level to enable DocGen field resolution via API?

---

Thank you for your assistance. Please let me know if any additional information, logs, or screenshots are needed.

Best regards,
Ritik Lakhotiya
 

3 replies

karan.kaushik
Docusign Employee
Forum|alt.badge.img+5
  • Docusign Employee
  • May 6, 2026

Hi ​@ritiklakhotiya.gen 

There’s a specific sequence of calls you need to make in order to fill in Document Generation fields. 

  1. Create the envelope as a draft (with status “created” instead of “sent”)
  2. Make a call to DocumentGeneration:getEnvelopeDocGenFormFields to receive a list of the docGenFormFields on the document. You will also need the documentId value returned in the response of this API call to complete the next step.
  3. Update the value of the docGenFormFields specified in the response of the previous step with the appropriate sender data using the DocumentGeneration:updateEnvelopeDocGenFormFields endpoint.
  4. Send the envelope by setting the status to sent using the Envelopes:update endpoint.
    You can also take a look at the example here which runs through these steps in detail. 

Forum|alt.badge.img+1

Hi ​@karan.kaushik, Thank you for your reply.

I switched to standard fields and am now sending the fields in the payload as prefillTabs. However, I am encountering an issue labeled "REQUIRED_TAB_INCOMPLETE." Each time, I receive a new ID for the required field in the error message. I checked all tabs using the following endpoint: https://demo.docusign.net/restapi/v2.1/accounts/47411379/templates/ab6e2d97-f97c-4a81-b0c4-7244c334a76c?include=recipients,tabs. In the response, I found some custom fields and prefillTabs text fields that we created. I also noticed that if I add a default value for this field, it works. However, the default value appears in the document instead of the dynamic value I passed in the payload. I have tried multiple approaches but continue to encounter the same problem. Could you please provide a solution? Thank you!


Forum|alt.badge.img
  • Docusign Employee
  • May 22, 2026

@ritiklakhotiya.gen 

 

What template builder did you use to build the template, Agreement Template Builder or Word Template Assistant?  If you have {{FieldName}} that usually indicates you created with WTA but instead of uploading through the plugin to docusign you uploaded directly via Document Templates or to an Envelope Template which will lose all your field metadata.


Can you confirm?  If you can provide the an example template in a zip file we can also take a look