Leena Signature

Overview

The Leena Signature connector enables your Leena AI Agents to integrate with Leena AI's internal Signature System, facilitating automated document signing workflows, template management, and multi-signatory processes.

Leena Signature is Leena AI's internal eSignature solution that allows organizations to create, manage, and automate document signing workflows. The connector enables functionality such as sending documents for signatures, managing reusable templates, configuring automated webhooks, and orchestrating complex multi-signatory workflows with customized notifications.

API Details

Leena AI integrates with Leena Signature via internal REST APIs.

Setup

The Leena Signature connector uses internal authentication with a shared secret for secure inter-service communication. No external credentials are required as this is a native Leena AI integration.

Prerequisites

Before setting up the Leena Signature connector, ensure you have:

  • Access to your Leena AI workspace with connector management permissions
  • Appropriate permissions to configure integrations in Leena AI

Add connection

Here is how to add a connection on Leena AI:

  1. Log in to your Leena AI workspace
  2. Navigate to Settings > Integrations
  3. Search for "Leena Signature" and select it from the list to add its new connector
  4. The connector will be automatically configured with the necessary internal authentication
  5. Save the configuration

Actions

The following actions are supported for the Leena Signature connector:

Template: Create template

Creates a new document template in Leena Signature. The Agent can leverage the skill (workflow), which has been designed to upload and create a new reusable document template such as offer letters, policy acknowledgments, or NDAs.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
File NameThe name of the template file
File Data (Url/Base64)The template file data provided as a public URL or Base64-encoded string

Optional

NameDescription
tagUnique identifier for the template used in subsequent API calls. If not provided, an auto-generated ID will be used

Here is a sample JSON input:

{
  "fileName": "offer-letter-template.docx",
  "fileData": "https://company-storage.com/templates/offer-letter.docx",
  "tag": "offer-letter-2025"
}
{
  "fileName": "nda-template.pdf",
  "fileData": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9GaWx0...",
  "tag": "nda-standard"
}

Response

Upon successful creation, the action returns:

  • Template ID
  • Template tag
  • Creation status
  • Template metadata

Template: Update template

Updates an existing document template in Leena Signature. The Agent can leverage the skill (workflow), which has been designed to modify an existing template with a new file while retaining the same template identifier.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
tagThe unique identifier of the template to update (dropdown selection)
File NameThe updated name of the template file
File Data (Url/Base64)The updated template file data as a public URL or Base64-encoded string

Here is a sample JSON input:

{
  "tag": "offer-letter-2025",
  "fileName": "offer-letter-template-v2.docx",
  "fileData": "https://company-storage.com/templates/offer-letter-v2.docx"
}

Response

Upon successful update, the action returns:

  • Updated template details
  • Template tag
  • Update status
  • Modification timestamp

Template: Get templates

Retrieves a list of all available document templates from Leena Signature. This action can be leveraged by Leena AI Orchestrator/Agent to list all templates configured for the organization. Here are some common use cases:

  • Template Discovery: View all available document templates
  • Template Selection: Find the appropriate template for a specific workflow
  • Template Audit: Review configured templates and their tags

Input Parameters

This action does not require any input parameters.

Response

The action returns a list of templates, each containing:

  • Template ID
  • Template tag
  • Template name
  • Template metadata
  • Creation/modification timestamps

Template Settings: Create template settings

Configures advanced settings for a document template, including webhook configurations for automated workflows. The Agent can leverage the skill (workflow) to set up data source webhooks and final webhooks for comprehensive automation.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
tagThe unique identifier of the template to configure (dropdown selection)

Optional

Name

Description

File Name

The name of the template file

DataSource Type (onboarding, off boarding....)

The type of data source such as onboarding or offboarding

DataSource Webhook Available?

Toggle to enable data source webhook configuration. Data source webhook executes before document generation to fetch dynamic data

Data Source Webhook Url

The endpoint URL for the data source webhook (required if webhook is enabled)

Data Source Webhook Method

The HTTP method for the webhook request, options:

  • GET
  • POST
  • PUT
  • DELETE
  • PATCH

Data Source Webhook Headers

Array of key-value pairs for request headers

Data Source Webhook Params

Array of key-value pairs for URL query parameters

Data Source Webhook Payload

JSON payload for POST/PUT webhook requests

Final Webhook Available?

Toggle to enable final webhook configuration. Final webhook executes after all signatories have signed the document

Final Webhook Url

The endpoint URL for the final webhook (required if webhook is enabled)

Final Webhook Method

The HTTP method for the final webhook request

Final Webhook Headers

Array of key-value pairs for request headers

Final Webhook Params

Array of key-value pairs for URL query parameters

Final Webhook Payload

JSON payload for POST/PUT webhook requests

Only Single Document

Whether to delete all other letters and employee letters when single document is selected, options:

  • true
  • false

Date Format

Default date format for signedAt timestamp (default: DD-MM-YYYY)

Here is a sample JSON input:

//Basic Template Settings

{
  "tag": "offer-letter-2025",
  "fileName": "Offer Letter Template",
  "onlySingleDocument": "false",
  "dateFormat": "DD-MM-YYYY"
}

//With Data Source Webhook

{
  "tag": "offer-letter-2025",
  "fileName": "Offer Letter Template",
  "dataSource": {
    "type": "onboarding",
    "webhook": {
      "url": "https://api.company.com/employee-data",
      "httpMethod": "GET",
      "headers": [
        {"key": "Authorization", "value": "Bearer {{token}}"},
        {"key": "Content-Type", "value": "application/json"}
      ],
      "params": [
        {"key": "employeeId", "value": "{{userId}}"}
      ]
    }
  },
  "onlySingleDocument": "false",
  "dateFormat": "DD-MM-YYYY"
}

//With Final Webhook

{
  "tag": "offer-letter-2025",
  "fileName": "Offer Letter Template",
  "finalWebhook": {
    "url": "https://api.company.com/document-signed",
    "httpMethod": "POST",
    "headers": [
      {"key": "Authorization", "value": "Bearer {{token}}"},
      {"key": "Content-Type", "value": "application/json"}
    ],
    "body": {
      "status": "signed",
      "documentId": "{{documentId}}"
    }
  },
  "onlySingleDocument": "false",
  "dateFormat": "DD-MM-YYYY"
}

Response

Upon successful configuration, the action returns:

  • Template settings confirmation
  • Configuration status
  • Webhook configuration details

Document: Generate Document

Generates a document from a template and initiates the signing workflow. The Agent can leverage the skill (workflow), which has been designed to create personalized documents and send them to specified signatories for electronic signature. This is the core action for orchestrating document signing processes. Here are some common use cases:

  • Offer Letter Generation: Create and send offer letters to new hires
  • Policy Acknowledgment: Generate policy documents for employee signatures
  • Contract Signing: Initiate multi-party contract signing workflows
  • NDA Processing: Send NDAs to employees or contractors for signature

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
UserId (First UserId from signatories)The user ID of the primary signatory
tagThe template tag to use for document generation (dropdown selection)
Additional DataJSON object containing dynamic data to populate the document template
SignatoriesArray of signatory configurations (see signatory parameters below)

Signatory Parameters (within Signatories array)

Name

Description

UserId

The unique identifier of the signatory (required)

sequence

The signing order number for sequential signing workflows

Signature height

Height of the signature image (default: 2)

Signature width

Width of the signature image (default: 2)

Template Type is PDF?

Toggle to indicate if the template is a PDF (affects signature placement method)

Signature functionName

For non-PDF templates: The function name placeholder to be replaced with signature (required for DOCX)

coordinates

For PDF templates: JSON array defining exact signature placement with x, y coordinates, page number, dimensions, and optional caption

Instead of Image alt text

Alternative text for the signature image (non-PDF templates)

Image Caption

Caption to display with the signature (non-PDF templates)

Sign here Image dynamic?

Toggle to enable dynamic sign-here image configuration

Image Type?

Type of sign-here image source, options:

  • url: Image provided via URL
  • base64: Image provided as Base64-encoded string

Image extension?

File extension for the sign-here image (default: .jpeg)

Image Data (url/base64)

The sign-here image data as URL or Base64 string

Optional

NameDescription
Document NameCustom name for the generated document (defaults to template tag)

Notification Parameters (Optional)

The action supports configuring notifications at three stages of the signing workflow:

Letter Assignment Notifications (when document is assigned to a signatory):

NameDescription
Letter Assignment Bot Notification Enabled ?Toggle to enable bot notification for letter assignment
Letter Assignment Bot Notification MessageThe message to send via bot when document is assigned
Letter Assignment Bot Notification Webview Button TitleButton title for the webview action in bot notification
Letter Assignment Email Notification Enabled ?Toggle to enable email notification for letter assignment
Letter Assignment Email Notification From EmailSender email address (default: [email protected])
Letter Assignment Email Notification From NameSender display name (default: no-reply)
Letter Assignment Email Notification subjectEmail subject line (default: Document assigned for your signature)
Letter Assignment html available?Toggle to use custom HTML email template
Letter Assignment Email Notification htmlCustom HTML content for the email (if HTML enabled)
Letter Assignment Email Notification Action LabelLabel for the action button in email (if HTML not enabled)
Letter Assignment Email Notification Reminder MessageReminder message text (if HTML not enabled)
Letter Assignment Email Notification Auto Action IdAuto action identifier for email (if HTML not enabled)

Letter Signed Notifications (when a signatory completes signing):

NameDescription
Letter signed Bot Notification Enabled ?Toggle to enable bot notification when letter is signed
Letter Signed Bot Notification MessageThe message to send via bot when document is signed
Letter Signed Bot Notification Webview Button TitleButton title for the webview action in bot notification
Letter Signed Email Notification Enabled ?Toggle to enable email notification when letter is signed
Letter Signed Email Notification From EmailSender email address (default: [email protected])
Letter Signed Email Notification From NameSender display name (default: no-reply)
Letter Signed Email Notification subjectEmail subject line
Letter Signed html available?Toggle to use custom HTML email template
Letter Signed Email Notification htmlCustom HTML content for the email (if HTML enabled)
Letter Signed Email Notification Action LabelLabel for the action button in email (if HTML not enabled)
Letter Signed Email Notification Reminder MessageReminder message text (if HTML not enabled)
Letter Signed Email Notification Auto Action IdAuto action identifier for email (if HTML not enabled)

Final Letter Notifications (when all signatories have completed signing):

NameDescription
Final Letter Bot Notification Enabled ?Toggle to enable bot notification when document is fully executed
Final letter Bot Notification MessageThe message to send via bot when all signatures are complete
Final Letter Bot Notification Webview Button TitleButton title for the webview action in bot notification
FInal letter Email Notification Enabled ?Toggle to enable email notification when document is fully executed
Final letter Email Notification From EmailSender email address (default: [email protected])
Final Letter Email Notification From NameSender display name (default: no-reply)
Final Letter Email Notification subjectEmail subject line
Final Letter html available?Toggle to use custom HTML email template
Final Letter Email Notification htmlCustom HTML content for the email (if HTML enabled)
Final letter Email Notification Action LabelLabel for the action button in email (if HTML not enabled)
Final Letter Email Notification Reminder MessageReminder message text (if HTML not enabled)
Final Letter Email Notification Auto Action IdAuto action identifier for email (if HTML not enabled)

Here is a sample JSON input:

//Basic Document Generation (DOCX Template)

{
  "userId": "emp-12345",
  "templateTag": "offer-letter-2025",
  "documentName": "Offer Letter - John Doe",
  "additionalData": {
    "employeeName": "John Doe",
    "designation": "Software Engineer",
    "department": "Engineering",
    "joiningDate": "2025-02-01",
    "salary": "150000"
  },
  "signatories": [
    {
      "userId": "emp-12345",
      "sequence": 1,
      "jsContext": {
        "height": 2,
        "width": 2,
        "functionName": "employeeSignature"
      }
    }
  ]
}

//Multi-Signatory Document (Sequential Signing)

{
  "userId": "emp-12345",
  "templateTag": "offer-letter-2025",
  "documentName": "Offer Letter - John Doe",
  "additionalData": {
    "employeeName": "John Doe",
    "designation": "Software Engineer",
    "joiningDate": "2025-02-01"
  },
  "signatories": [
    {
      "userId": "emp-12345",
      "sequence": 1,
      "jsContext": {
        "height": 2,
        "width": 2,
        "functionName": "employeeSignature"
      }
    },
    {
      "userId": "mgr-67890",
      "sequence": 2,
      "jsContext": {
        "height": 2,
        "width": 2,
        "functionName": "managerSignature"
      }
    },
    {
      "userId": "hr-11111",
      "sequence": 3,
      "jsContext": {
        "height": 2,
        "width": 2,
        "functionName": "hrSignature"
      }
    }
  ]
}

//PDF Template with Coordinates

{
  "userId": "emp-12345",
  "templateTag": "contract-template-pdf",
  "documentName": "Employment Contract - John Doe",
  "additionalData": {
    "employeeName": "John Doe",
    "contractDate": "2025-01-15"
  },
  "signatories": [
    {
      "userId": "emp-12345",
      "sequence": 1,
      "jsContext": {
        "height": 2,
        "width": 2,
        "coordinates": [
          {
            "pageNumber": 1,
            "width": 70,
            "height": 30,
            "x": 50,
            "y": 220
          },
          {
            "pageNumber": 1,
            "caption": "Employee Signature",
            "captionX": 50,
            "captionY": 180,
            "captionSize": 12
          }
        ]
      }
    }
  ]
}

//With Bot and Email Notifications

{
  "userId": "emp-12345",
  "templateTag": "offer-letter-2025",
  "documentName": "Offer Letter - John Doe",
  "additionalData": {
    "employeeName": "John Doe",
    "designation": "Software Engineer"
  },
  "signatories": [
    {
      "userId": "emp-12345",
      "sequence": 1,
      "jsContext": {
        "height": 2,
        "width": 2,
        "functionName": "employeeSignature"
      }
    }
  ],
  "notification": {
    "letterAssignment": {
      "bot": {
        "botMessage": "You have a new document to sign. Please review and sign the offer letter.",
        "buttonTitle": "View Document"
      },
      "email": {
        "fromEmail": "[email protected]",
        "fromName": "HR Department",
        "subject": "Action Required: Sign Your Offer Letter",
        "actionLabel": "Sign Now",
        "reminderMessage": "Please sign your offer letter at your earliest convenience."
      }
    },
    "finalLetter": {
      "bot": {
        "botMessage": "All signatures have been collected. Your document is now complete.",
        "buttonTitle": "View Signed Document"
      },
      "email": {
        "fromEmail": "[email protected]",
        "fromName": "HR Department",
        "subject": "Document Signing Complete",
        "actionLabel": "Download Document",
        "reminderMessage": "Your signed document is now available for download."
      }
    }
  }
}

Response

Upon successful document generation, the action returns:

  • Document ID
  • Document generation status
  • Signatory information and status
  • Document preview URL
  • Signing workflow initiation confirmation