Skip to main content
This document covers docusign_send_envelope, the template-based e-signature send tool exposed through the Agents Platform.

Authentication

DocuSign tools use the DocuSign connector, which authenticates with JWT Grant (server-to-server) rather than the authorization-code flow. Users configure:
  • integration_key — the app’s client id
  • user_id — API Username (GUID) of the user to impersonate
  • private_key — RSA private key, PEM
  • account_id — optional; only needed when the user can reach several accounts
  • environment — optional; demo (default) or prod
The connector signs a fresh assertion whenever the cached access token nears expiry, discovers the account’s REST base URI from /oauth/userinfo, and caches both. See docusign.md for setup, the one-time admin consent step, and why JWT Grant is used.

docusign_send_envelope

Creates an envelope from an existing DocuSign template and sends it, emailing each signer a link to sign. This is a mutating tool. Sending is billed per envelope and cannot be undone.

Inputs

Required:
  • template_id: Id of the template to send.
  • signers: One entry per role the template defines. Each needs role_name, name and email.
Optional:
  • email_subject: Overrides the template’s subject.
  • expire_after_days: Stop reminders and block signing this many days after sending.
  • reply_to_email, reply_to_name: Reply-to overrides on the signing email.
  • reference: Your own correlation id, stored on the envelope as a reference custom field.
  • dry_run: Preview without sending. Defaults to false.

role_name must match the template

DocuSign binds each signer to a role declared in the template. Role names are trimmed before sending, but a name the template doesn’t declare leaves DocuSign with no recipient to bind — supply the exact role (e.g. Patient).

Use reference

Matching a completed envelope back to the record that caused it by signer name or email is unreliable — names are entered inconsistently and one person can have several records. Passing your own id (an appointment id, an order number) stores it on the envelope, so completion can be correlated exactly.

Dry run

dry_run: true renders what would be sent and makes no network call — it does not even construct a client. A preview must never be billable.

Output

On success, structured content includes:
  • status: success or dry_run
  • envelope_id: the created envelope’s id
  • envelope: the envelope object (id, status, subject, timestamps)
  • reference: echoed back for correlation

Notes

  • There is no idempotency. Calling twice sends two envelopes and bills twice. Check docusign_get_envelope for an existing envelope before re-sending.
  • expire_after_days maps to DocuSign’s envelope expiration; the warning window is disabled so the only effect is a hard stop.