# DocuSign (/integrations/docusign)





{/* MANUAL-CONTENT-START:intro */}

Use [DocuSign](https://www.docusign.com) to send envelopes for e-signature, create them from templates, inspect recipients and signing status, and download completed documents. Pending envelopes can be voided with a reason.

{/* MANUAL-CONTENT-END */}

## OAuth scopes [#oauth-scopes]

Sim requests these scopes when someone connects a DocuSign account. For a self-hosted deployment, register your own app with the provider using the settings below. See [Integrations and OAuth](/platform/self-hosting/integrations-oauth) for setup.

| Setting | Value |
| - | - |
| Redirect URI | `<NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/docusign` |
| Environment variables | `DOCUSIGN_CLIENT_ID`, `DOCUSIGN_CLIENT_SECRET` |

| Scope | Description |
| - | - |
| `signature` | Send, track, and manage envelopes with the eSignature API |
| `extended` | Keep access active by extending the refresh token lifetime |

## Use the block [#usage-instructions]

Create and send envelopes for e-signature, use templates, check signing status, download signed documents, and manage recipients with DocuSign.

## Actions [#actions]

### Send DocuSign Envelope [#send-docusign-envelope]

Create and send a DocuSign envelope with a document for e-signature

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `emailSubject` | string | Yes | Email subject for the envelope |
  | `emailBody` | string | No | Email body message |
  | `signerEmail` | string | Yes | Email address of the signer |
  | `signerName` | string | Yes | Full name of the signer |
  | `ccEmail` | string | No | Email address of carbon copy recipient |
  | `ccName` | string | No | Full name of carbon copy recipient |
  | `file` | file | No | Document file to send for signature |
  | `status` | string | No | Envelope status: "sent" to send immediately, "created" for draft (default: "sent") |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `envelopeId` | string | Created envelope ID |
  | `status` | string | Envelope status |
  | `statusDateTime` | string | Status change datetime |
  | `uri` | string | Envelope URI |
</ReferenceDetails>

### Send from DocuSign Template [#send-from-docusign-template]

Create and send a DocuSign envelope using a pre-built template

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `templateId` | string | Yes | DocuSign template ID to use |
  | `emailSubject` | string | No | Override email subject (uses template default if not set) |
  | `emailBody` | string | No | Override email body message |
  | `templateRoles` | string | Yes | JSON array of template roles, e.g. \[\{"roleName":"Signer","name":"John","email":"[john@example.com](mailto:john@example.com)"}] |
  | `status` | string | No | Envelope status: "sent" to send immediately, "created" for draft (default: "sent") |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `envelopeId` | string | Created envelope ID |
  | `status` | string | Envelope status |
  | `statusDateTime` | string | Status change datetime |
  | `uri` | string | Envelope URI |
</ReferenceDetails>

### Get DocuSign Envelope [#get-docusign-envelope]

Get the details and status of a DocuSign envelope

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `envelopeId` | string | Yes | The envelope ID to retrieve |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `envelopeId` | string | Envelope ID |
  | `status` | string | Envelope status (created, sent, delivered, completed, declined, voided) |
  | `emailSubject` | string | Email subject line |
  | `sentDateTime` | string | When the envelope was sent |
  | `completedDateTime` | string | When all recipients completed signing |
  | `createdDateTime` | string | When the envelope was created |
  | `statusChangedDateTime` | string | When the status last changed |
  | `voidedReason` | string | Reason the envelope was voided |
  | `signerCount` | number | Number of signers |
  | `documentCount` | number | Number of documents |
</ReferenceDetails>

### List DocuSign Envelopes [#list-docusign-envelopes]

List envelopes from your DocuSign account with optional filters

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `fromDate` | string | No | Start date filter (ISO 8601). Defaults to 30 days ago |
  | `toDate` | string | No | End date filter (ISO 8601) |
  | `envelopeStatus` | string | No | Filter by status: created, sent, delivered, completed, declined, voided |
  | `searchText` | string | No | Search text to filter envelopes |
  | `count` | string | No | Maximum number of envelopes to return (default: 25) |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `envelopes` | array | Array of DocuSign envelopes |
  | ↳ `envelopeId` | string | Unique envelope identifier |
  | ↳ `status` | string | Envelope status (created, sent, delivered, completed, declined, voided) |
  | ↳ `emailSubject` | string | Email subject line |
  | ↳ `sentDateTime` | string | ISO 8601 datetime when envelope was sent |
  | ↳ `completedDateTime` | string | ISO 8601 datetime when envelope was completed |
  | ↳ `createdDateTime` | string | ISO 8601 datetime when envelope was created |
  | ↳ `statusChangedDateTime` | string | ISO 8601 datetime of last status change |
  | `totalSetSize` | number | Total number of matching envelopes |
  | `resultSetSize` | number | Number of envelopes returned in this response |
</ReferenceDetails>

### Void DocuSign Envelope [#void-docusign-envelope]

Void (cancel) a sent DocuSign envelope that has not yet been completed

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `envelopeId` | string | Yes | The envelope ID to void |
  | `voidedReason` | string | Yes | Reason for voiding the envelope |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `envelopeId` | string | Voided envelope ID |
  | `status` | string | Envelope status (voided) |
</ReferenceDetails>

### Download DocuSign Document [#download-docusign-document]

Download a signed document from a completed DocuSign envelope

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `envelopeId` | string | Yes | The envelope ID containing the document |
  | `documentId` | string | No | Specific document ID to download, or "combined" for all documents merged (default: "combined") |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `file` | file | Stored downloaded document file |
  | `base64Content` | string | Deprecated legacy inline content. New downloads return file. |
  | `mimeType` | string | MIME type of the document |
  | `fileName` | string | Original file name |
</ReferenceDetails>

### List DocuSign Templates [#list-docusign-templates]

List available templates in your DocuSign account

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `searchText` | string | No | Search text to filter templates by name |
  | `count` | string | No | Maximum number of templates to return |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `templates` | array | Array of DocuSign templates |
  | ↳ `templateId` | string | Template identifier |
  | ↳ `name` | string | Template name |
  | ↳ `description` | string | Template description |
  | ↳ `shared` | boolean | Whether template is shared |
  | ↳ `created` | string | ISO 8601 creation date |
  | ↳ `lastModified` | string | ISO 8601 last modified date |
  | `totalSetSize` | number | Total number of matching templates |
  | `resultSetSize` | number | Number of templates returned in this response |
</ReferenceDetails>

### List DocuSign Recipients [#list-docusign-recipients]

Get the recipient status details for a DocuSign envelope

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `envelopeId` | string | Yes | The envelope ID to get recipients for |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `signers` | array | Array of DocuSign recipients |
  | ↳ `recipientId` | string | Recipient identifier |
  | ↳ `name` | string | Recipient name |
  | ↳ `email` | string | Recipient email address |
  | ↳ `status` | string | Recipient signing status (sent, delivered, completed, declined) |
  | ↳ `signedDateTime` | string | ISO 8601 datetime when recipient signed |
  | ↳ `deliveredDateTime` | string | ISO 8601 datetime when delivered to recipient |
  | `carbonCopies` | array | Array of carbon copy recipients |
  | ↳ `recipientId` | string | Recipient ID |
  | ↳ `name` | string | Recipient name |
  | ↳ `email` | string | Recipient email |
  | ↳ `status` | string | Recipient status |
</ReferenceDetails>
