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
Back to Docusign.com


