LoopFour
IntegrationsDocuments

DocuSign

Electronic signature platform for contracts and documents

DocuSign

Connect to DocuSign for electronic signatures, envelope management, and document automation.

Overview

DocuSign is an industry-leading e-signature platform. The integration supports:

  • Envelopes - Create, send, and track signature requests
  • Templates - Use pre-built document templates
  • Recipients - Manage signers and routing
  • Documents - Upload, download, and manage documents
  • Embedded Signing - Generate signing URLs for in-app experiences
  • Audit - Track envelope events and history

Prerequisites

  • DocuSign account (Developer, Standard, or Enterprise)
  • DocuSign Developer account for sandbox testing
  • Connected App configured for OAuth
  • Account ID from DocuSign admin

Authentication

DocuSign uses OAuth 2.0 for authentication via Nango.

# Sandbox
curl "http://localhost:3000/api/v1/connections/docusign-sandbox/auth-url" \
  -H "x-api-key: YOUR_API_KEY"
 
# Production
curl "http://localhost:3000/api/v1/connections/docusign/auth-url" \
  -H "x-api-key: YOUR_API_KEY"

Getting Account ID

Call getUserInfo first to retrieve your account ID:

{
  "action": "docusign.getUserInfo",
  "config": {}
}

Available Actions

Account Actions

getUserInfo

Get user info and available accounts.

{
  "action": "docusign.getUserInfo",
  "config": {
    "providerConfigKey": "docusign-sandbox"
  }
}

Template Actions

listTemplates

List available templates.

{
  "action": "docusign.listTemplates",
  "config": {
    "accountId": "{{input.accountId}}",
    "searchText": "NDA",
    "count": 50,
    "startPosition": 0,
    "order": "desc",
    "orderBy": "modified"
  }
}

getTemplate

Get template details.

{
  "action": "docusign.getTemplate",
  "config": {
    "accountId": "{{input.accountId}}",
    "templateId": "{{input.templateId}}"
  }
}

Envelope Actions

createEnvelope

Create a new envelope (full configuration).

{
  "id": "create-envelope",
  "type": "action",
  "action": "docusign.createEnvelope",
  "config": {
    "accountId": "{{input.accountId}}",
    "templateId": "{{input.templateId}}",
    "emailSubject": "Please sign: {{input.documentName}}",
    "emailBlurb": "Please review and sign this document.",
    "status": "sent",
    "templateRoles": [
      {
        "email": "{{input.signerEmail}}",
        "name": "{{input.signerName}}",
        "roleName": "Signer",
        "routingOrder": "1"
      },
      {
        "email": "{{input.ccEmail}}",
        "name": "{{input.ccName}}",
        "roleName": "CC"
      }
    ],
    "customFields": {
      "textCustomFields": [
        {
          "name": "ContractValue",
          "value": "{{input.contractValue}}"
        }
      ]
    },
    "notification": {
      "useAccountDefaults": false,
      "reminders": {
        "reminderEnabled": true,
        "reminderDelay": 2,
        "reminderFrequency": 2
      },
      "expirations": {
        "expireEnabled": true,
        "expireAfter": 30,
        "expireWarn": 5
      }
    }
  }
}

Parameters:

FieldTypeRequiredDescription
accountIdstringYesDocuSign account ID
templateIdstringNoTemplate to use
documentsarrayNoDocuments (if not using template)
recipientsobjectNoRecipients object
templateRolesarrayNoTemplate role assignments
emailSubjectstringNoEmail subject line
emailBlurbstringNoEmail body message
statusstringNocreated (draft) or sent
customFieldsobjectNoCustom metadata fields
notificationobjectNoReminder/expiration settings
brandIdstringNoBranding theme ID

createEnvelopeFromTemplate

Simplified envelope creation from template.

{
  "action": "docusign.createEnvelopeFromTemplate",
  "config": {
    "accountId": "{{input.accountId}}",
    "templateId": "{{input.templateId}}",
    "recipients": [
      {
        "email": "{{input.email}}",
        "name": "{{input.name}}",
        "roleName": "Signer"
      }
    ],
    "emailSubject": "Contract for {{input.companyName}}",
    "status": "sent"
  }
}

getEnvelope

Get envelope details.

{
  "action": "docusign.getEnvelope",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "include": "recipients,documents"
  }
}

getEnvelopeStatus

Get envelope status.

{
  "action": "docusign.getEnvelopeStatus",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{steps.create.output.envelopeId}}"
  }
}

Envelope Statuses:

StatusDescription
createdDraft, not yet sent
sentSent for signature
deliveredViewed by recipients
signedSigned by all recipients
completedFinished and closed
declinedDeclined by recipient
voidedVoided by sender

listEnvelopes

List envelopes with filters.

{
  "action": "docusign.listEnvelopes",
  "config": {
    "accountId": "{{input.accountId}}",
    "fromDate": "2024-01-01",
    "toDate": "2024-12-31",
    "status": "completed",
    "searchText": "Contract",
    "count": 50,
    "order": "desc",
    "orderBy": "last_modified"
  }
}

updateEnvelope

Update envelope properties.

{
  "action": "docusign.updateEnvelope",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "emailSubject": "Updated: {{input.newSubject}}",
    "resend": true
  }
}

sendEnvelope

Send a draft envelope.

{
  "action": "docusign.sendEnvelope",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}"
  }
}

voidEnvelope

Void an envelope.

{
  "action": "docusign.voidEnvelope",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "voidedReason": "Contract terms changed"
  }
}

sendReminder

Send reminder to recipients.

{
  "action": "docusign.sendReminder",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}"
  }
}

Document Actions

listDocuments

List documents in an envelope.

{
  "action": "docusign.listDocuments",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}"
  }
}

downloadDocument

Download a specific document.

{
  "action": "docusign.downloadDocument",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "documentId": "1",
    "certificate": false,
    "watermark": false
  }
}

downloadCombinedDocument

Download all documents as one PDF.

{
  "action": "docusign.downloadCombinedDocument",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "certificate": true
  }
}

Recipient Actions

getRecipients

Get envelope recipients.

{
  "action": "docusign.getRecipients",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "includeTabs": true,
    "includeExtended": true
  }
}

updateRecipients

Update envelope recipients.

{
  "action": "docusign.updateRecipients",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "recipients": {
      "signers": [
        {
          "recipientId": "1",
          "email": "{{input.newEmail}}",
          "name": "{{input.newName}}"
        }
      ]
    },
    "resendEnvelope": true
  }
}

deleteRecipients

Remove recipients from envelope.

{
  "action": "docusign.deleteRecipients",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "recipients": {
      "signers": [
        { "recipientId": "2" }
      ]
    }
  }
}

Embedded Signing Actions

createRecipientView

Create embedded signing URL.

{
  "id": "get-signing-url",
  "type": "action",
  "action": "docusign.createRecipientView",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{steps.create-envelope.output.envelopeId}}",
    "email": "{{input.signerEmail}}",
    "userName": "{{input.signerName}}",
    "clientUserId": "{{input.userId}}",
    "authenticationMethod": "none",
    "returnUrl": "https://yourapp.com/signing-complete",
    "pingUrl": "https://yourapp.com/webhook/docusign-status",
    "pingFrequency": 60
  }
}

Response:

{
  "url": "https://demo.docusign.net/Signing/...",
  "expires_at": "2024-01-15T12:00:00Z"
}

createSenderView

Create embedded sending URL.

{
  "action": "docusign.createSenderView",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "returnUrl": "https://yourapp.com/sending-complete"
  }
}

createEditView

Create embedded edit URL.

{
  "action": "docusign.createEditView",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "returnUrl": "https://yourapp.com/edit-complete"
  }
}

createCorrectView

Create embedded correction URL.

{
  "action": "docusign.createCorrectView",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}",
    "returnUrl": "https://yourapp.com/correct-complete",
    "suppressNavigation": false
  }
}

Audit Actions

getAuditEvents

Get envelope audit trail.

{
  "action": "docusign.getAuditEvents",
  "config": {
    "accountId": "{{input.accountId}}",
    "envelopeId": "{{input.envelopeId}}"
  }
}

Webhook Triggers

DocuSign Connect webhooks trigger workflows on envelope events.

{
  "trigger": {
    "type": "webhook",
    "provider": "docusign",
    "events": ["envelope-completed", "envelope-declined"]
  }
}

Event Types:

EventDescription
envelope-sentEnvelope sent
envelope-deliveredEnvelope viewed
envelope-completedAll signatures collected
envelope-declinedRecipient declined
envelope-voidedEnvelope voided
recipient-completedIndividual recipient signed

Example Workflow

Contract signing workflow:

{
  "name": "Send Contract on Deal Close",
  "trigger": {
    "type": "webhook",
    "provider": "hubspot",
    "events": ["deal.propertyChange"]
  },
  "steps": [
    {
      "id": "check-stage",
      "type": "condition",
      "config": {
        "conditions": {
          "and": [
            { "left": "{{input[0].propertyName}}", "operator": "eq", "right": "dealstage" },
            { "left": "{{input[0].propertyValue}}", "operator": "eq", "right": "closedwon" }
          ]
        },
        "then": ["get-deal"],
        "else": []
      }
    },
    {
      "id": "get-deal",
      "type": "action",
      "action": "hubspot.getDeal",
      "config": {
        "dealId": "{{input[0].objectId}}",
        "properties": ["dealname", "amount", "closedate"]
      }
    },
    {
      "id": "get-contact",
      "type": "action",
      "action": "hubspot.getAssociations",
      "config": {
        "objectType": "deals",
        "objectId": "{{input[0].objectId}}",
        "toObjectType": "contacts"
      }
    },
    {
      "id": "create-contract",
      "type": "action",
      "action": "docusign.createEnvelopeFromTemplate",
      "config": {
        "accountId": "{{env.DOCUSIGN_ACCOUNT_ID}}",
        "templateId": "{{env.CONTRACT_TEMPLATE_ID}}",
        "recipients": [
          {
            "email": "{{steps.get-contact.output.results[0].email}}",
            "name": "{{steps.get-contact.output.results[0].firstname}} {{steps.get-contact.output.results[0].lastname}}",
            "roleName": "Signer"
          }
        ],
        "emailSubject": "Service Agreement - {{steps.get-deal.output.properties.dealname}}",
        "status": "sent"
      }
    },
    {
      "id": "notify-sales",
      "type": "action",
      "action": "slack.sendMessage",
      "config": {
        "channel": "#sales",
        "text": "Contract sent for {{steps.get-deal.output.properties.dealname}} (${{steps.get-deal.output.properties.amount}})"
      }
    }
  ]
}

Rate Limits

LimitValue
API calls1,000/hour (standard)
Envelopes/dayBased on plan
Embedded signing URLs5 per recipient per envelope

Troubleshooting

Common Errors

ErrorCauseSolution
accountId is requiredMissing account IDCall getUserInfo first
templateId is requiredNo template specifiedProvide templateId or documents
AUTHENTICATION_FAILEDInvalid credentialsCheck OAuth connection
ENVELOPE_NOT_IN_CORRECT_STATEWrong envelope statusCheck status before operation
RECIPIENT_NOT_FOUNDInvalid recipient IDVerify recipient exists

Sandbox vs Production

Use different provider config keys:

  • Sandbox: docusign-sandbox
  • Production: docusign

Configure both in your Nango setup for proper testing.