DocuSign (Apps step)

Updated Nov 23, 2026
DataMagik Automate

DocuSign

Sends DocuSign envelopes from templates, follows their status, lists envelopes and templates, and downloads signed documents through the DocuSign eSignature REST API.

Use it to put signatures into a plant process: send a supplier agreement or a customer deviation approval for signature from a template, follow it until it is completed, and file the signed PDF.

Beta. This step has not yet been checked against a live DocuSign account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. In DocuSign, open Settings › Apps and Keys, note the API Account ID and the Account Base URI (such as https://na3.docusign.net), click Add App and Integration Key, add a secret key, and add the Redirect URI the DataMagik credential shows.
  2. In DataMagik, open Script Engine › Credentials, add the OAuth 2.0 credential described below with the Integration Key as the client ID and the secret key as the client secret, save, and click Connect to sign in as the DocuSign user who sends the envelopes.
  3. Add your account's host (such as na3.docusign.net) to Allowed Domains in the workflow's Script settings.

Credential: An OAuth 2.0 credential for a DocuSign app (Integration Key) that a DocuSign user has signed in to with Connect.

Signing in with OAuth 2.0

Grant typeSign in with the provider (authorization code). Save the credential, then click Connect on it.
Sign-in (authorization) URLhttps://account.docusign.com/oauth/auth
Token URLhttps://account.docusign.com/oauth/token
Scopesignature

Register the Redirect URI the credential form shows in the provider's app settings.

A developer (sandbox) account signs in at account-d.docusign.com: use https://account-d.docusign.com/oauth/auth and https://account-d.docusign.com/oauth/token, and host demo.docusign.net. Send the client as a Basic header (the credential's default). DocuSign's refresh token lasts 30 days, so a credential that is not used for a month must be Connected again; adding the scope extended keeps it renewing while it is used.

Hosts it calls: *.docusign.net

Connection

FieldRequiredWhat to put
Account hostYesThe host of your account's Base URI from Settings › Apps and Keys, without https://, such as na3.docusign.net; demo.docusign.net for a developer account. For example na3.docusign.net.
API Account IDYesThe API Account ID from Settings › Apps and Keys, a GUID. For example a1b2c3d4-….

Operations

OperationWhat it does
Envelope › Send from templateCreates an envelope from a template with the signers filled in, and sends it or saves it as a draft.
Envelope › GetReads one envelope's status and dates by its ID.
Envelope › ListLists the account's envelopes changed since a date, 100 per request, following every page up to the step's page limit.
Envelope › Download documentsDownloads all of an envelope's documents as one PDF, signed when the envelope is completed.
Template › ListLists the templates the signed-in user can use.

Envelope › Send from template

Creates an envelope from a template with the signers filled in, and sends it or saves it as a draft.

Calls POST /envelopes.

FieldRequiredWhat to put
TemplateYesThe template's ID, a GUID; choose it from the list or copy it from the template's page in DocuSign. For example 8f1e2d3c-…. Choose from list beside the field fetches the choices from your account.
SignersYesA JSON list with one entry per role on the template: its roleName exactly as on the template, and the person's name and email. For example [{"roleName": "Customer", "name": "{{ $json.contact }}", "email": "{{ $json.email }}"}].
Email subjectNoThe subject of the email the signers get. Leave empty to use the template's. For example Please sign: Deviation {{ $json.deviation_no }}.
Send nowNoSend it now emails the signers; Save as a draft keeps it in DocuSign's drafts for someone to check and send. One of: Send it now, Save as a draft.

What comes out: One item: {{ $json.envelopeId }} (keep it to follow the envelope), {{ $json.status }} (sent or created), {{ $json.statusDateTime }} and {{ $json.uri }}.

Example: Send the Supplier Quality Agreement template to each new supplier's contact and save {{ $json.envelopeId }} on the supplier's lookup table row.

Envelope › Get

Reads one envelope's status and dates by its ID.

Calls GET /envelopes/{envelopeId}.

FieldRequiredWhat to put
Envelope IDYesThe envelope's ID, a GUID, as Send from template or List put it out. For example 4b2c8e1a-….

What comes out: One item: the envelope, with {{ $json.envelopeId }}, {{ $json.status }} (created, sent, delivered, completed, declined or voided), {{ $json.emailSubject }}, {{ $json.sentDateTime }} and {{ $json.completedDateTime }}.

Example: Each morning, read every open agreement's envelope and remind the buyer when it has been sent for more than a week without being completed.

Envelope › List

Lists the account's envelopes changed since a date, 100 per request, following every page up to the step's page limit.

Calls GET /envelopes. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
Changed sinceYesOnly envelopes whose status changed on or after this date; DocuSign requires it. The default is a week ago. For example 2026-11-01.
StatusNoOnly envelopes with these statuses, separated by commas: created, sent, delivered, completed, declined, voided. Leave empty for all. For example completed.
SearchNoOnly the envelopes (by subject, sender or recipient) or templates (by name) that contain this text. Leave empty for all.

What comes out: One item per envelope: {{ $json.envelopeId }}, {{ $json.status }}, {{ $json.emailSubject }}, {{ $json.sentDateTime }}, {{ $json.completedDateTime }} and {{ $json.statusChangedDateTime }}.

Example: With status completed, list the envelopes completed this week and download each one's signed PDF for the quality records.

Envelope › Download documents

Downloads all of an envelope's documents as one PDF, signed when the envelope is completed.

Calls GET /envelopes/{envelopeId}/documents/combined. Puts out the downloaded file in {{ $json.file }}.

FieldRequiredWhat to put
Envelope IDYesThe envelope's ID, a GUID, as Send from template or List put it out. For example 4b2c8e1a-….
Add the certificate of completionNoOn, DocuSign's certificate of completion (who signed, when and from where) is added at the end of the PDF.

What comes out: One item: {{ $json.file }}, the PDF (with filename, mimeType and size), ready for Send Email attachments or an upload, plus {{ $json.status }}. A download is held in the run, so files larger than 10 MB cannot be downloaded here.

Example: Download {{ $json.envelopeId }}'s signed PDF and upload it to the supplier's folder in SharePoint.

Template › List

Lists the templates the signed-in user can use.

Calls GET /templates.

FieldRequiredWhat to put
SearchNoOnly the envelopes (by subject, sender or recipient) or templates (by name) that contain this text. Leave empty for all.

What comes out: One item per template: {{ $json.templateId }}, {{ $json.name }}, {{ $json.description }}, {{ $json.folderName }} and {{ $json.lastModified }}.

Example: List the templates to find the ID of the Supplier Quality Agreement template.

Trigger: DocuSign: New Items

Under Triggers in the palette. It looks at DocuSign on a schedule (every 15 minutes unless you change Look every) with one of these operations: Envelope › List, and starts the workflow with the items it has not seen on an earlier look, one item each. Saving the workflow sets up the schedule.

  • New means: not seen before, by the item's id (or the field you name in Item field), or newer than the newest one last time, by a date or increasing number.
  • On the first run it only remembers what is there, unless you choose Start with everything.
  • Test runs show what would be new without remembering it. It remembers the last 5000 ids, so filter the list to keep it shorter than that.

Example

When a deviation request is approved in the app, DocuSign › Envelope › Send from template sends the Customer Deviation template to the customer's quality contact; a DocuSign: New Items trigger on Envelope › List with status completed downloads each signed PDF and uploads it to SharePoint.

Tips

  • Each template role is the role name on the template (such as Customer) with the signer's name and email: [{"roleName": "Customer", "name": "{{ $json.contact }}", "email": "{{ $json.email }}"}]. Template fields go in a role's tabs.
  • Envelope status goes created (draft), sent, delivered (opened), completed; declined and voided end it early.
  • Envelopes sent from a developer account are watermarked and not legally binding; switch the credential and host to production once DocuSign has approved the app (Go-Live).
  • Sending from a template sends real email to the signers on test runs too; choose Save as a draft while building.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

DocuSign's own API documentation: https://developers.docusign.com/docs/esign-rest-api/reference/

Was this page helpful?