> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DocuSign Integration

> Automatic sending of documents for electronic signature via DocuSign directly during customer conversations

# DocuSign Integration Template

Integrate DocuSign eSignature services into your Mid-call Actions and enable your AI assistant to automatically send contracts, consent forms, and other documents for electronic signature during customer conversations.

## Overview & Features

<CardGroup cols={2}>
  <Card title="Electronic Signatures" icon="pen-nib">
    * Immediate sending of documents for eSignature
    * Template-based document generation
    * Multi-signer workflows for complex contracts
    * Legally binding electronic signatures (EU eIDAS)
  </Card>

  <Card title="Contract Automation" icon="file-contract">
    * Automatic contract sending upon deal closure
    * Consent forms for GDPR compliance
    * Order confirmations and service agreements
    * Integration with CRM and legal workflows
  </Card>
</CardGroup>

## DocuSign API & Account Setup

### 1. DocuSign Developer Account

<Steps>
  <Step title="Prepare DocuSign Account">
    * Create a DocuSign developer account
    * Go to the developer dashboard
    * Note your account ID
  </Step>

  <Step title="Create Integration">
    ```yaml theme={null}
    Integration-Setup:
      1. "Apps and Keys" → "Add App and Integration Key"
      2. App Name: "Famulor Mid-Call Integration"
      3. Record Integration Key (Client ID)
      4. Generate and securely store Secret Key
    ```
  </Step>

  <Step title="Configure OAuth 2.0">
    ```yaml theme={null}
    OAuth-Flow:
      Authorization URL: https://account-d.docusign.com/oauth/auth
      Token URL: https://account-d.docusign.com/oauth/token
      
    Required Scopes:
      - signature (for eSignature features)
      - extended (for advanced API features)
    ```
  </Step>

  <Step title="Prepare Templates">
    * Create DocuSign templates for frequently used documents
    * Document template IDs for API integration
    * Define signing roles and fields
  </Step>
</Steps>

## Configure DocuSign Tool

### Configuration in Famulor Interface

<Tabs>
  <Tab title="Tool Details">
    | Field                      | Value                                                                                                                                |
    | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
    | **Name**\*                 | `DocuSign Dokument senden`                                                                                                           |
    | **Description**            | "Automatically sends documents for electronic signature via DocuSign"                                                                |
    | **Function Name**\*        | `send_docusign_envelope`                                                                                                             |
    | **Function Description**\* | "Sends a document for signature via DocuSign. Use this for contracts, consent forms, or order confirmations after successful calls." |
    | **HTTP Method**            | `POST`                                                                                                                               |
    | **Timeout (ms)**           | `10000`                                                                                                                              |
    | **Endpoint**\*             | `https://demo.docusign.net/restapi/v2.1/accounts/{account_id}/envelopes`                                                             |
  </Tab>

  <Tab title="Header Configuration">
    ```json theme={null}
    {
      "Authorization": "Bearer {{DOCUSIGN_TOKEN}}",
      "Content-Type": "application/json",
      "User-Agent": "Famulor-MidCall-DocuSign/1.0"
    }
    ```
  </Tab>

  <Tab title="Request Body Template">
    ```json theme={null}
    {
      "emailSubject": "{email_subject}",
      "emailBlurb": "{email_message}",
      "templateId": "{template_id}",
      "templateRoles": [
        {
          "email": "{signer_email}",
          "name": "{signer_name}",
          "roleName": "{role_name}",
          "tabs": {
            "textTabs": [
              {
                "tabLabel": "customer_name",
                "value": "{signer_name}"
              },
              {
                "tabLabel": "date",
                "value": "{current_date}"
              }
            ]
          }
        }
      ],
      "status": "sent",
      "customFields": {
        "textCustomFields": [
          {
            "name": "source",
            "value": "mid_call_tool"
          },
          {
            "name": "call_id",
            "value": "{call_reference}"
          }
        ]
      }
    }
    ```
  </Tab>
</Tabs>

### Parameter Schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "account_id": {
      "type": "string",
      "description": "DocuSign Account ID"
    },
    "email_subject": {
      "type": "string",
      "description": "Email subject for the signer",
      "examples": ["Please sign the contract", "Consent form required", "Order confirmation"]
    },
    "email_message": {
      "type": "string",
      "description": "Accompanying email text for the signer"
    },
    "template_id": {
      "type": "string",
      "description": "DocuSign template ID for the document to send"
    },
    "signer_email": {
      "type": "string",
      "format": "email",
      "description": "Signer's email address"
    },
    "signer_name": {
      "type": "string",
      "description": "Signer's full name"
    },
    "role_name": {
      "type": "string",
      "enum": ["Signer", "Approver", "Witness"],
      "description": "Signer's role in the document",
      "default": "Signer"
    },
    "current_date": {
      "type": "string",
      "format": "date",
      "description": "Current date for automatic filling"
    },
    "call_reference": {
      "type": "string",
      "description": "Call reference ID for audit trail"
    },
    "urgency": {
      "type": "string",
      "enum": ["normal", "urgent"],
      "description": "Urgency of signature",
      "default": "normal"
    }
  },
  "required": ["account_id", "email_subject", "template_id", "signer_email", "signer_name"]
}
```

## Practical Use Cases

### Scenario 1: Closing a Contract After Sales Call

<Steps>
  <Step title="Deal Closing Moment">
    ```yaml theme={null}
    Sales-Context:
      Customer: "Yes, I accept the offer. What happens next?"
      
    AI: "Fantastic! I will send you the contract for electronic signature right away..."

    send_docusign_envelope:
      email_subject: "Service Contract for Signature - Example AG"
      template_id: "abc123-def456-ghi789"  # Service Agreement Template
      signer_email: "max@beispiel.de"
      signer_name: "Max Mustermann"
      role_name: "Signer"
    ```
  </Step>

  <Step title="Customer Communication">
    ```yaml theme={null}
    AI response after envelope sent:
      "The contract has been sent to max@beispiel.de.  
       You will receive an email with the signature link shortly.  
       The contract is pre-filled - you just need to sign electronically."

    Follow-up information:
      "Once you have signed, we will immediately activate all services  
       and you will receive confirmation along with your access data."
    ```
  </Step>
</Steps>

### Scenario 2: GDPR Consent Forms

<AccordionGroup>
  <Accordion title="Privacy Consent Management">
    **Data Protection Compliance Workflow**:

    ```yaml theme={null}
    GDPR-Context:
      New customer relationship requires explicit consent
      
    DocuSign Template Types:
      - Data Processing Agreement (DPA)
      - Marketing Communication Consent
      - Analytics Tracking Consent
      - Third-Party Data Sharing Agreement

    Automation:
      Without consent → services limited  
      With consent → full service activation  
      Consent withdrawal → automatic data purging
    ```
  </Accordion>

  <Accordion title="Multi-Language Support">
    ```yaml theme={null}
    International Contracts:
      DE Template: "template_id_german"
      EN Template: "template_id_english"  
      FR Template: "template_id_french"
      
    Customer Language Detection:
      From conversation → automatic template selection  
      Fallback → English as default
      
    Legal Compliance:
      EU Customers → GDPR-compliant templates  
      US Customers → CCPA-compliant templates  
      International → standard legal templates
    ```
  </Accordion>
</AccordionGroup>

### DocuSign Response Handling

```json theme={null}
{
  "envelopeId": "abc123def456-ghi789-jkl012",
  "status": "sent",
  "statusDateTime": "2024-01-15T10:30:00.000Z",
  "uri": "/envelopes/abc123def456-ghi789-jkl012"
}
```

**Natural Language Integration**:

* **Pre-Action**: `"I am sending the document to {{signer_name}} for signature..."`
* **Success**: `"Document has been sent for signature. Envelope ID: {{response.envelopeId}}"`

***

<Tip>
  Related pages: [Introduction](/en/automation-platform/introduction) and [Building Flows](/en/automation-platform/building-flows), and [Debugging Runs](/en/automation-platform/debugging-runs).
</Tip>

<Tip>
  Need a whole toolset instead of building HTTP actions one by one? Connect an external **MCP server** — tools are discovered automatically. See [MCP Servers](/en/platform/mcp-servers).
</Tip>
