DocuSign
Overview
The DocuSign connector enables your Leena AI Agents to integrate with your organization's DocuSign platform, facilitating automated electronic signature workflows, envelope management, and document signing processes.
DocuSign is the leading electronic signature and agreement cloud platform that enables organizations to automate the agreement process by preparing, signing, acting on, and managing documents digitally. The DocuSign connector allows Leena AI to automate signature workflows, send documents for signing, track envelope status, and manage digital signing processes seamlessly.
API Details
Leena AI integrates with DocuSign via the eSignature REST API v2.1.
Documentation link: https://developers.docusign.com/docs/esign-rest-api/
Setup
The DocuSign connector supports two OAuth 2.0 authentication methods:
- OAuth 2.0 Authorization Code Grant: Recommended when a user is present and able to authenticate interactively
- OAuth 2.0 JWT Bearer: Recommended for server-to-server integrations without user interaction
Prerequisites
Before setting up the DocuSign connector, ensure you have:
- Administrator access to your DocuSign account
- A DocuSign Developer account (for testing) or Production account
- Access to DocuSign Admin Settings > Apps and Keys
- Access to your Leena AI workspace with connector management permissions
Get credentials
Here is how to create an Integration Key (App) in DocuSign:
- Log in to your DocuSign account as an Administrator
- For Demo/Sandbox: https://account-d.docusign.com
- For Production: https://account.docusign.com
- Navigate to Apps and Keys:
- Click on Settings in the top menu bar
- Under Integrations, click Apps and Keys
- Create a New App:
- Click Add App and Integration Key
- Enter a descriptive name for your application (e.g., "Leena AI Integration")
- Click Create App
- Note the Integration Key:
- Copy the Integration Key (this is your Client ID)
- This is a GUID (32-digit hexadecimal number)
- Configure Authentication Settings based on your chosen method:
For OAuth 2.0 Authorization Code Grant:
- Under Authentication, ensure Authorization Code Grant is selected
- Click Add Secret Key to generate a Client Secret
- Copy and securely store the Secret Key (displayed only once)
- Under Redirect URIs, click Add URI
- Add the Callback URL from Leena AI (obtained after initial connector setup)
For OAuth 2.0 JWT Bearer:
- Under Service Integration, click Generate RSA
- Copy and securely store the RSA Private Key (displayed only once)
- Note your User ID (API Username):
- Go to Settings > Users and Groups > Users
- Select your user and copy the API Username (User ID)
- Grant consent for your application:
- Navigate to the consent URL provided during connector setup
- Sign in and grant permission to the application
Note Your Account ID:
- On the Apps and Keys page, find My Account Information
- Copy the API Account ID
Add connection
Here is how to add a connection on Leena AI:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "DocuSign" and select it from the list to add its new connector
- Select Environment:
- Environment: Choose Demo/Sandbox for testing or Production for live use
- Select Authentication Type:
- Auth Type: Choose between "OAuth 2.0 Authorization Code Grant" or "OAuth 2.0 JWT Bearer"
For OAuth 2.0 Authorization Code Grant:
- Configure the connector:
- Integration Key (Client ID): Your DocuSign Integration Key
- Client Secret: The Secret Key generated in DocuSign
- Account ID: Your DocuSign API Account ID
- Save the connector configuration
- Complete OAuth Flow:
- Click Connect or Authorize in Leena AI
- You'll be redirected to DocuSign authorization page
- Sign in to your DocuSign account if prompted
- Click Allow to grant permissions
- You'll be redirected back to Leena AI with a successful connection
- Copy the Callback URL from Leena AI and add it to your DocuSign App's Redirect URIs
For OAuth 2.0 JWT Bearer:
- Configure the connector:
- Integration Key (Client ID): Your DocuSign Integration Key
- User ID (API Username): The User ID for impersonation
- Account ID: Your DocuSign API Account ID
- RSA Private Key: The complete RSA Private Key including headers
- Grant Consent (required one-time):
- Click the authorization link provided
- Sign in and grant consent to the application
- Save the connector configuration
Actions
The following actions are supported for the DocuSign connector:
Send Envelope for Signature
Sends an envelope containing documents for electronic signature. The Agent can leverage the skill (workflow), which has been designed to send documents for signature through DocuSign, once the user provides the document details and recipient information.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Email Subject | The subject line of the email sent to recipients |
| Documents (JSON Array) | Array of documents to be signed, including base64-encoded content |
| Recipients (JSON Object) | Object containing recipient information including signers and carbon copies |
| Envelope Status | The status of the envelope: "sent" (send immediately) or "created" (save as draft) |
Optional
| Name | Description |
|---|---|
| Email Message | Optional message body included in the email to recipients |
| Brand ID | Brand identifier for customizing the envelope appearance |
Here is a sample JSON input:
{
"emailSubject": "Please sign this agreement",
"emailBlurb": "Please review and sign the attached document at your earliest convenience.",
"documents": [
{
"documentBase64": "JVBERi0xLjQKJeLjz9M...",
"name": "Employment_Agreement.pdf",
"fileExtension": "pdf",
"documentId": "1"
}
],
"recipients": {
"signers": [
{
"email": "[email protected]",
"name": "John Doe",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "200",
"yPosition": "400"
}
],
"dateSignedTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "200",
"yPosition": "450"
}
]
}
}
],
"carbonCopies": [
{
"email": "[email protected]",
"name": "HR Department",
"recipientId": "2",
"routingOrder": "2"
}
]
},
"status": "sent"
}Response
Upon successful creation, the action returns the envelope details including:
- Envelope ID
- Envelope URI
- Status (sent, created)
- Status date/time
Get Envelope Status
Retrieves the current status and details of a specific envelope. The Agent can leverage this skill to check the signing progress, view recipient status, and track document completion. Here are some common use cases:
- Track Signing Progress: Check if recipients have signed
- Monitor Completion: Verify when all signatures are collected
- Audit Trail: Review envelope history and status changes
- Reminder Triggers: Identify envelopes pending action
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Envelope ID | The unique identifier of the envelope to retrieve status for |
Here is a sample JSON input:
{
"envelopeId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Response
The action returns detailed envelope information including:
- Envelope ID
- Status (sent, delivered, completed, declined, voided)
- Status changed date/time
- Sender information
- Recipients and their status
- Documents included
- Created and sent timestamps
- Expiration date (if applicable)
List Envelopes
Retrieves a list of envelopes from your DocuSign account based on specified criteria. This action can be leveraged by Leena AI Orchestrator/Agent to list envelopes within a date range, filter by status, or paginate through results. Here are some common use cases:
- Daily Reports: Get all envelopes sent today
- Status Monitoring: Find all pending or completed envelopes
- Compliance Audits: Retrieve envelopes within a specific period
- Dashboard Data: Populate envelope statistics and metrics
Input Parameters
Here are the input parameters required to set up this action:
Optional
| Name | Description |
|---|---|
| From Date | Start date for filtering envelopes (Format: YYYY-MM-DD) |
| To Date | End date for filtering envelopes (Format: YYYY-MM-DD) |
| Status Filter | Filter by envelope status: sent, delivered, completed, declined, voided, created |
| Count | Number of records to return (default: 100) |
| Start Position | Starting position for pagination (default: 0) |
Here is a sample JSON input:
{
"fromDate": "2025-01-01",
"toDate": "2025-01-31",
"status": "completed",
"count": "50",
"startPosition": "0"
}Response
The action returns a list of envelopes, each containing:
- Envelope ID
- Status
- Email subject
- Sender information
- Sent date/time
- Completed date/time (if applicable)
- Recipient information summary
- Total result set size
- Next page URI (for pagination)
Updated 2 days ago
