Set Envelope DocGen Form Fields
PUT/restapi/v2.1/accounts/:accountId/envelopes/:envelopeId/docGenFormFields
Stages sender-side merge field values on a draft envelope.
Translates the DocuSign EnvelopeDocGenFormFields request body into
a { name → value } override map and persists it on the agreement's
formFieldsJson JSON column under a namespaced sub-key.
Only allowed while the envelope is in CREATED (DocuSign draft)
status — any other status returns 400 ENVELOPE_NOT_DRAFT because
the source documents have already been rendered + sent.
Accepts either documents[] or envelopeDocGenFormFields[] at the
top level (DocuSign Apex SDK has historically posted both).
Audit: writes docgen.compat.docusign_gen.formfields_set with
{ envelopeId, fieldCount } — field names and values are never
logged or persisted in audit metadata.
Request
Responses
- 200
- 400
- 404
- 422
Echo of the resolved field model with applied overrides.
Envelope is past CREATED status (ENVELOPE_NOT_DRAFT) or path parameter missing.
Envelope not found, or compat flag disabled.
Envelope is not configured for DocGen rendering.