Skip to main content

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

Echo of the resolved field model with applied overrides.

Response Headers
    X-Request-Id

    Correlation id for this request, returned on every response (success and error). Quote it when contacting support to pinpoint the exact request, and use it to correlate your own logs. It is the same 128-bit id as the trace-id segment of the traceparent header.

    traceparent

    W3C Trace Context identifier for this request, returned on every response. Send your own traceparent on a request to have it adopted, so a multi-call workflow shares one trace. Format: 00-<32-hex trace-id>-<16-hex span-id>-<2-hex flags>.