RedPlanetHQ/core

New Integration: DocuSign

Aperta

#529 aperta il 24 feb 2026

 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (184 fork)auto 404
enhancementgood first issueintegrationnew-featurenew-integration

Metriche repository

Star
 (1930 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Description

Add DocuSign integration to sync e-signature data including envelopes, signing events, templates, and document status into CORE.

Reference Implementations

Existing Integrations (use as templates)

  • integrations/github/ - OAuth-based API integration
  • integrations/linear/ - Project management integration
  • integrations/slack/ - For reference

Required Files Structure

integrations/docusign/
├── src/
│   ├── index.ts          # Main entry, OAuth spec
│   ├── schedule.ts       # Sync logic
│   ├── utils.ts          # DocuSign eSignature API utilities
│   ├── account-create.ts # OAuth setup
│   └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md

DocuSign eSignature REST API Integration

OAuth Setup

  • Use OAuth 2.0 Authorization Code Grant flow
  • Register app on DocuSign Developer Center (apps-d.docusign.com for sandbox)
  • Authorization URL: https://account-d.docusign.com/oauth/auth (sandbox) / https://account.docusign.com/oauth/auth (production)
  • Token URL: https://account-d.docusign.com/oauth/token (sandbox) / https://account.docusign.com/oauth/token (production)
  • Required scopes: signature, extended, impersonation (for JWT)
  • Also supports JWT Grant for server-to-server authentication

Key Endpoints

  • POST /v2.1/accounts/{accountId}/envelopes - Create and send envelope
  • GET /v2.1/accounts/{accountId}/envelopes - List envelopes
  • GET /v2.1/accounts/{accountId}/envelopes/{envelopeId} - Get envelope details
  • GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/recipients - Get recipients
  • GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents - Get documents
  • GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/audit_events - Audit trail
  • GET /v2.1/accounts/{accountId}/templates - List templates
  • GET /v2.1/accounts/{accountId}/envelopes/{envelopeId}/notification - Notification settings
  • POST /v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient - Embedded signing URL

Events to Track

  1. Envelopes - Envelope creation, sending, voiding, and completion
  2. Signing Events - Recipient viewed, signed, declined, or delegated
  3. Documents - Document uploads, downloads, and certificate of completion
  4. Templates - Template creation and usage
  5. Audit Trail - Complete audit history of envelope actions
  6. Notifications - Reminder and expiration events

Implementation Tasks

  • Set up basic integration structure following integrations/github/src/index.ts pattern
  • Implement OAuth 2.0 flow in account-create.ts (support both Auth Code and JWT Grant)
  • Create API utilities in utils.ts for envelopes, recipients, documents, and templates
  • Implement sync logic in schedule.ts for polling envelope status changes
  • Convert signing events to CORE activity format
  • Add error handling and rate limiting
  • Create integration documentation
  • Add to integrations/README.md

Technical Notes

  • DocuSign has separate sandbox and production environments with different base URLs
  • Supports both OAuth 2.0 Auth Code Grant (user-present) and JWT Grant (server-to-server)
  • Quickstart available in 8 languages for fast bootstrapping
  • Webhook/Connect feature available for real-time envelope status notifications
  • Envelope status lifecycle: created -> sent -> delivered -> signed -> completed
  • Consider using DocuSign Connect (webhooks) instead of polling for real-time updates

Resources

Labels

enhancement, integration, new-feature

Guida contributor