Leena AI Connector

Overview

The Leena AI connector enables your Leena AI Agents to integrate with various internal Leena AI products and services, facilitating automated workflows for notifications, case management, employee directory access, master table operations, file conversions, and more.

Leena AI is an enterprise AI platform that provides intelligent automation for HR, IT, and employee services. The Leena AI connector allows workflows to access and interact with core Leena AI services including notifications, ticketing, employee data, master tables, document management, and various utility functions.

API Details

Leena AI integrates with its internal services via REST APIs with secure inter-service authentication using shared application secrets (X-App-Secret header).

Documentation link: https://docs.leena.ai

Setup

The Leena AI connector uses internal authentication with shared application secrets for secure server-to-server communication.

Prerequisites

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

  • Administrator access to your Leena AI workspace
  • Access to your Leena AI workspace with connector management permissions
  • Appropriate permissions to configure workflow automations

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 AI" and select it from the list to add its new connector
  4. The connector is pre-configured with internal authentication and does not require additional credential setup
  5. Save the connection configuration

Actions

The following actions are supported for the Leena AI connector:

Send Bot Notification

Sends a notification to employees or audiences through the Leena AI bot. The Agent can leverage this action to send in-app notifications with customizable content, buttons, and scheduling options.

Input Parameters

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

Mandatory

NameDescription
To:Select the audience type: Employees or Audience
PriorityNotification priority level: Low, Medium, Normal, High, or Critical

Optional

NameDescription
Employees Email IDEmail ID of the employee to notify (visible when To: is set to Employees)
AudienceSelect a pre-defined audience group (visible when To: is set to Audience)
SubjectSubject line of the notification
MessageMain message content of the notification
Attachment URLURL of an attachment to include with the notification
Long descriptionEnable to add extended content with title and text
ButtonsAdd interactive buttons with types: Webview, Web URL, Quick Reply, or Callback
Scheduled AtDate and time to schedule the notification for later delivery

Here is a sample JSON input:

{
  "audienceType": "employees",
  "emailId": "[email protected]",
  "priority": "normal",
  "content": {
    "subject": "Policy Update Notification",
    "message": "Please review the updated HR policy document.",
    "attachmentUrl": "https://example.com/policy.pdf"
  },
  "scheduledAt": "2025-08-27T10:00:00Z"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Notification delivery status
  • Notification ID

Send Email Notification

Sends an email notification to employees or audiences through the Leena AI platform. This action enables automated email communications with customizable templates, attachments, and scheduling.

Input Parameters

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

Mandatory

NameDescription
To:Select the audience type: Employees or Audience
PriorityNotification priority level: Low, Medium, Normal, High, or Critical
From emailSender's email address
From nameSender's display name

Optional

NameDescription
Employees Email IDEmail ID of the employee to notify (visible when To: is set to Employees)
AudienceSelect a pre-defined audience group (visible when To: is set to Audience)
BodyHTML email body content using the email template editor
AttachmentsList of attachments with filename, Base-64 content, or File URL
SubjectEmail subject line
Scheduled AtDate and time to schedule the email for later delivery

Here is a sample JSON input:

{
  "audienceType": "employees",
  "emailId": "[email protected]",
  "priority": "normal",
  "mailBody": {
    "from": {
      "email": "[email protected]",
      "name": "HR Department"
    },
    "subject": "Welcome to the Team!",
    "html": "<h1>Welcome!</h1><p>We're excited to have you join us.</p>",
    "attachments": [
      {
        "filename": "onboarding-guide.pdf",
        "path": "https://example.com/onboarding.pdf"
      }
    ]
  }
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Email delivery status
  • Notification ID

Raise Ticket

Creates a new ticket in the Leena AI Case Management system. The Agent can leverage this action to raise support tickets with proper categorization, priority, and assignment.

Input Parameters

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

Mandatory

NameDescription
DescriptionDetailed description of the issue or request

Optional

NameDescription
InstanceSelect the ticket instance (e.g., IT Support, HR Services)
CategorySelect the ticket category based on the chosen instance
Sub CategorySelect the sub-category based on the chosen category
Raised byEmployee ID of the person raising the ticket
On behalfEmployee ID of the person on whose behalf the ticket is raised
PriorityTicket priority: Low, Normal, or High
Extra fieldsAdditional custom fields in JSON format

Here is a sample JSON input:

{
  "instance": "60a1b2c3d4e5f6g7h8i9j0k1",
  "category": {
    "name": "Hardware Issues",
    "subCategory": {
      "name": "Laptop Problems"
    }
  },
  "user": {
    "employeeId": "EMP001"
  },
  "onBehalf": {
    "employeeId": "EMP002"
  },
  "description": "Laptop screen flickering intermittently when connected to external monitor.",
  "priority": "high"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Created ticket details including ticket ID
  • Ticket URL

Fetch details of an employee

Retrieves detailed information about a specific employee using a unique identifier such as email, employee ID, or user ID.

Input Parameters

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

Mandatory

NameDescription
Type of unique attributeSelect the identifier type: Email ID, Employee ID, or User ID
Value of unique attributeThe value of the selected identifier

Here is a sample JSON input:

{
  "filterCriteria": "email",
  "filterValue": "[email protected]"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Complete employee profile including:
    • Employee ID
    • User ID
    • Display name
    • Email
    • Department
    • Designation
    • Location
    • Profile information
    • Termination status

Get Employees (supports filters)

Retrieves a list of employees based on specified filter criteria. This action supports advanced filtering with multiple conditions and operators.

Input Parameters

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

Mandatory

NameDescription
FiltersArray of filter conditions with key, operator, and value
Employee attributes to returnComma-separated list of employee fields to include in the response

Filter Configuration

Each filter consists of:

FieldDescription
Employee master attributeThe employee field to filter on (e.g., profile.department, designation)
ConditionComparison operator: Match Any of, Equal to, Greater Than or Equal to, Less Than or Equal to, Not Equal to, Not in List, Regular Expression
ValueThe value to compare against

Here is a sample JSON input:

{
  "filters": [
    {
      "key": "profile.department",
      "operator": "eq",
      "value": "Engineering"
    },
    {
      "key": "profile.location",
      "operator": "in",
      "value": "New York,San Francisco"
    }
  ],
  "params": "displayName,email,employeeId,userId,department,designation"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Array of matching employees with requested attributes
  • Pagination information (count, page)

Fetch Master Table

Retrieves records from a specified Master Table in Leena AI. Master Tables are centralized data stores for business information like office locations, asset lists, or product catalogs.

Input Parameters

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

Mandatory

NameDescription
Table IDSelect or enter the Master Table identifier

Optional

NameDescription
FiltersArray of filter conditions to narrow down results

Filter Configuration

Each filter consists of:

FieldDescription
Column nameThe column to filter on
ConditionComparison operator: Equal to, Not Equal to, Contains, Less than, Less than or Equal to, Greater than, Greater than or Equal to
ValueThe value to compare against

Here is a sample JSON input:

{
  "tableId": "master_table_12345",
  "filters": [
    {
      "key": "Department",
      "operator": "eq",
      "value": "Sales"
    },
    {
      "key": "Status",
      "operator": "eq",
      "value": "Active"
    }
  ]
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Array of matching Master Table records

Up-sert Master Table record/s

Creates or updates records in a specified Master Table. This action performs an upsert operation—creating new records if they don't exist or updating existing ones based on the primary key.

Input Parameters

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

Mandatory

NameDescription
Table Id Dynamic ?Toggle to choose between dropdown selection or dynamic input
Table IDSelect or enter the Master Table identifier
DataJSON object or array of objects containing the record(s) to upsert

Here is a sample JSON input:

{
  "tableId": "master_table_12345",
  "body": [
    {
      "EmployeeID": "EMP001",
      "Name": "John Doe",
      "Department": "Engineering",
      "Status": "Active"
    },
    {
      "EmployeeID": "EMP002",
      "Name": "Jane Smith",
      "Department": "Marketing",
      "Status": "Active"
    }
  ]
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Array of created or updated records

Get Base 64 content

Converts a file from a URL to Base64 encoded content. This action supports both single file and multiple file conversions.

Input Parameters

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

Optional

NameDescription
MultipleToggle to enable multiple file conversion
URLFile URL to convert (when Multiple is disabled)
URLsArray of file URLs to convert (when Multiple is enabled)

Here is a sample JSON input:

// Single file
{
  "multi": false,
  "url": "https://example.com/document.pdf"
}

// Multiple files
{
  "multi": true,
  "urls": [
    {"url": "https://example.com/file1.pdf"},
    {"url": "https://example.com/file2.png"}
  ]
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Base64 encoded content of the file(s)

Get URL from Base 64

Converts Base64 encoded content to a publicly accessible URL by uploading the file to Leena AI's storage. Supports both single and bulk file operations.

Input Parameters

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

Mandatory

NameDescription
File ModeSelect Single File or Bulk Files mode

For Single File Mode

NameDescription
File nameName of the file with extension
Base 64 ContentBase64 encoded content of the file

For Bulk Files Mode

NameDescription
Bulk Files (JSON)JSON array of files with fileName and content properties

Here is a sample JSON input:

// Single file
{
  "fileMode": "single",
  "fileName": "report.pdf",
  "content": "JVBERi0xLjQKJeLjz9MKMyAwIG9..."
}

// Bulk files
{
  "fileMode": "bulk",
  "files": [
    {"fileName": "file1.pdf", "content": "JVBERi0xLjQK..."},
    {"fileName": "file2.png", "content": "iVBORw0KGgo..."}
  ]
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • File URL(s) for the uploaded content
  • Attachment details

Sign JWT Token

Generates a signed JWT (JSON Web Token) using the specified payload, secret key, and algorithm.

Input Parameters

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

Mandatory

NameDescription
PayloadJSON payload to encode in the token
Secret/Private KeySecret key or private key for signing the token

Optional

NameDescription
AlgorithmSigning algorithm (e.g., HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512)

Here is a sample JSON input:

{
  "payload": "{\"userId\": \"12345\", \"role\": \"admin\", \"exp\": 1735689600}",
  "secretOrPrivateKey": "your-secret-key-here",
  "options": {
    "algorithm": "HS256"
  }
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Signed JWT token string

Generate OTP

Generates a one-time password (OTP) with configurable length, expiry, and retry limits. Creates a new OTP session for validation.

Input Parameters

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

Mandatory

NameDescription
otpLengthLength of the OTP to generate (numeric value)
otpExpiryExpiry time in seconds for the OTP
maxOTPsMaximum number of OTPs allowed per session
maxRetriesMaximum number of validation retry attempts allowed

Here is a sample JSON input:

{
  "otpLength": 6,
  "otpExpiry": 300,
  "maxOTPs": 3,
  "maxRetries": 5
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Generated OTP
  • Session ID for validation

Validate OTP

Validates an OTP against an active session. Checks if the provided OTP matches and is not expired.

Input Parameters

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

Mandatory

NameDescription
sessionIdThe session ID returned from Generate OTP action
otpThe OTP value to validate

Optional

NameDescription
matchCriteriaOTP matching criteria: MATCH_RECENT (only validates the most recent OTP) or MATCH_ANY (validates any OTP in the session)

Here is a sample JSON input:

{
  "sessionId": "sess_abc123xyz789",
  "otp": "456789",
  "matchCriteria": "MATCH_RECENT"
}

Response

Upon successful execution, the action returns:

  • HTTP status code indicating success or failure
  • Validation result message

Regenerate OTP

Generates a new OTP within an existing session. Useful when the user requests a new code without starting a fresh session.

Input Parameters

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

Mandatory

NameDescription
sessionIdThe session ID from an existing OTP session

Here is a sample JSON input:

{
  "sessionId": "sess_abc123xyz789"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • New OTP value

JSON to Excel converter

Converts structured JSON data into an Excel (XLSX) or CSV file. Supports multiple sheets and sections with customizable layouts.

Input Parameters

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

Mandatory

NameDescription
JSON PayloadStructured JSON data containing sheets, sections, headings, and data
File FormatOutput format: XLSX or CSV

Here is a sample JSON input:

{
  "json": {
    "sheets": [
      {
        "name": "Employee Report",
        "sections": [
          {
            "heading": "Active Employees",
            "dataLabel": ["Name", "Department", "Email"],
            "data": [
              {"Name": "John Doe", "Department": "Engineering", "Email": "[email protected]"},
              {"Name": "Jane Smith", "Department": "Marketing", "Email": "[email protected]"}
            ]
          }
        ]
      }
    ]
  },
  "fileFormat": "xlsx"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Base64 encoded file content

Convert form attachment (Excel, CSV) into JSON

Converts an Excel or CSV file into structured JSON data. Supports reading files from URL or Base64 input.

Input Parameters

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

Mandatory

NameDescription
File Data (Url/Base64)URL or Base64 encoded content of the Excel/CSV file
Sheet NameName of the sheet to read (case-sensitive)

Optional

NameDescription
Select Row No. to read columnsRow number to use as column headers (default: 1)

Here is a sample JSON input:

{
  "fileData": "https://example.com/spreadsheet.xlsx",
  "sheetName": "Sheet1",
  "headerRowNumber": 1
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Column labels array
  • Row data as array of objects with column names as keys

Generate letter

Generates a letter/document using Leena AI's letter generation service with customizable templates and output formats.

Input Parameters

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

Mandatory

NameDescription
Output type of the generated letterOutput format: Public URL or Base64
TagLetter template tag identifier
Letter BodyJSON data to populate the letter template
FilenameOutput filename with .pdf or .docx extension

Optional

NameDescription
Output file format as .docxToggle to output as .docx instead of PDF (when template is .docx)

Here is a sample JSON input:

{
  "outputType": "PUBLIC_URL",
  "returnDocx": false,
  "tag": "offer_letter_template",
  "letterBody": {
    "employeeName": "John Doe",
    "position": "Software Engineer",
    "startDate": "2025-09-01",
    "salary": "$120,000"
  },
  "filename": "offer_letter_john_doe.pdf"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Generated letter URL or Base64 content

Fetch Device Mappings

Retrieves device mappings for a specific employee based on their email address. Useful for IT asset management and device tracking.

Input Parameters

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

Mandatory

NameDescription
EmailEmployee's email address to look up device mappings

Here is a sample JSON input:

{
  "email": "[email protected]"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Array of device mappings including:
    • Serial number
    • Device source
    • Username
    • Last online timestamp
  • Pagination information

Combine files (PDF, PNG, JPG) into a single PDF

Combines multiple files (PDF, PNG, JPG, and other supported formats) into a single PDF document. Supports both Field Array and JSON Array input modes.

Input Parameters

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

Mandatory

NameDescription
Input TypeChoose input method: Field Array or JSON Array
FilesFile data as URL or Base64 (format depends on Input Type selected)
Output File NameName for the combined PDF output file

Optional

NameDescription
Output FormatOutput format: Base64 or URL

Here is a sample JSON input:

{
  "inputType": "FIELD_ARRAY",
  "files": [
    {"fileData": "https://example.com/page1.pdf"},
    {"fileData": "https://example.com/image.png"},
    {"fileData": "JVBERi0xLjQK..."}
  ],
  "outputFileName": "combined_document.pdf",
  "outputFormat": "url"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • File name
  • Combined PDF as Base64 or URL (based on output format selection)

Convert File to PDF

Converts a file (from URL or Base64) to PDF format using Leena AI's document conversion service.

Input Parameters

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

Mandatory

NameDescription
File URL Or Base64 StringURL or Base64 encoded content of the file to convert

Here is a sample JSON input:

{
  "templateInput": "https://example.com/document.docx"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • Conversion success status
  • Converted PDF details including:
    • File type
    • URL
    • File name

Get QR Code For a given string

Generates a QR code image for a given input string. Supports customizable error correction levels, dimensions, and output formats.

Input Parameters

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

Mandatory

NameDescription
Input StringThe text or data to encode in the QR code
QR Code FormatOutput format: Base64 or URL

Optional

NameDescription
QR Code Error Correction LevelError correction level: Low, Medium, Quartile (default), or High
QR Code WidthWidth of the QR code in pixels (default: 200)
QR Code MarginMargin around the QR code in modules (default: 4)

Here is a sample JSON input:

{
  "inputString": "https://example.com/verify?id=12345",
  "errorCorrectionLevel": "Q",
  "width": 300,
  "margin": 4,
  "qrCodeFormat": "URL"
}

Response

Upon successful execution, the action returns:

  • HTTP status code
  • QR code image as Base64 data URL or public URL (based on format selection)