Leena AI Connector
Overview
The Leena AI connector enables your AI Colleagues 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, workflow out-of-office delegation, 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, workflows, 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:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "Leena AI" and select it from the list to add its new connector
- The connector is pre-configured with internal authentication and does not require additional credential setup
- 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
Mandatory
| Name | Description |
|---|---|
| To: | Select the audience type: Employees or Audience |
| Priority | Notification priority level: Low, Medium, Normal, High, or Critical |
| Message | Main message content of the notification |
Optional
| Name | Description |
|---|---|
| Employees Email ID | Email ID of the employee to notify (visible when To: is set to Employees) |
| Audience | Select a pre-defined audience group (visible when To: is set to Audience) |
| Subject | Subject line of the notification |
| Attachment URL | URL of an attachment to include with the notification |
| Long description | Enable to add extended content with title and text |
| Buttons | Add interactive buttons with types: Webview, Web URL, Quick Reply, or Callback |
| Scheduled At | Date 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
Mandatory
| Name | Description |
|---|---|
| To: | Select the audience type: Employees or Audience |
| Employees Email ID | Email ID of the employee to notify (required and visible when To: is set to Employees) |
| Priority | Notification priority level: Low, Medium, Normal, High, or Critical |
| From email | Sender's email address |
| From name | Sender's display name |
| Subject | Email subject line |
Optional
| Name | Description |
|---|---|
| Audience | Select a pre-defined audience group (visible when To: is set to Audience) |
| Body | HTML email body content using the email template editor |
| Attachments | List of attachments with filename, Base-64 content, or File URL |
| Scheduled At | Date 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"
}
]
},
"scheduledAt": "2025-08-27T10:00:00Z"
}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
Mandatory
| Name | Description |
|---|---|
| Category | Select the ticket category based on the chosen instance |
| Description | Detailed description of the issue or request |
Optional
| Name | Description |
|---|---|
| Instance | Select the ticket instance (e.g., IT Support, HR Services) |
| Sub Category | Select the sub-category based on the chosen category (visible once a Category is selected) |
| Raised by | Employee ID of the person raising the ticket |
| On behalf | Employee ID of the person on whose behalf the ticket is raised |
| Priority | Ticket priority: Low, Normal, or High |
| Extra fields | Additional 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
Mandatory
| Name | Description |
|---|---|
| Type of unique attribute | Select the identifier type: Email ID, Employee ID, or User ID |
| Value of unique attribute | The 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
Mandatory
| Name | Description |
|---|---|
| Filters | Array of filter conditions with key, operator, and value |
| Employee attributes to return | Comma-separated list of employee fields to include in the response |
Filter Configuration
Each filter consists of:
| Field | Description |
|---|---|
| Employee master attribute | The employee field to filter on (e.g., profile.department, designation) |
| Condition | Comparison operator: Match Any of, Equal to, Greater Than or Equal to, Less Than or Equal to, Not Equal to, Not in List, Regular Expression |
| Value | The 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
Mandatory
| Name | Description |
|---|---|
| Table ID | Select or enter the Master Table identifier |
Optional
| Name | Description |
|---|---|
| Filters | Array of filter conditions to narrow down results |
Filter Configuration
Each filter consists of:
| Field | Description |
|---|---|
| Column name | The column to filter on |
| Condition | Comparison operator: Equal to, Not Equal to, Contains, Less than, Less than or Equal to, Greater than, Greater than or Equal to |
| Value | The 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
Mandatory
| Name | Description |
|---|---|
| Table Id Dynamic ? | Toggle to choose between dropdown selection or dynamic input |
| Table ID | Select or enter the Master Table identifier |
| Data | JSON 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
Optional
| Name | Description |
|---|---|
| Multiple | Toggle to enable multiple file conversion |
| URL | File URL to convert (when Multiple is disabled) |
| URLs | Array 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 an accessible URL by uploading the file to Leena AI's storage. Supports both single and bulk file operations, with an optional link expiry.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| File Mode | Select Single File or Bulk Files mode |
For Single File Mode
| Name | Description |
|---|---|
| File name | Name of the file with extension |
| Base 64 Content | Base64 encoded content of the file |
For Bulk Files Mode
| Name | Description |
|---|---|
| Bulk Files (JSON) | JSON array of files with fileName and content properties |
Optional
| Name | Description |
|---|---|
| Set link expiry | Toggle on to make the file URL stop working after a set period. Off (default) keeps the URL permanent |
| Link expires after | 30 days (default), 60 days, 90 days, Custom (days), or Custom (hours) (visible when Set link expiry is on) |
| Custom expiry (days) | Number of days, 1–3650 (visible when Link expires after is Custom (days)) |
| Custom expiry (hours) | Number of hours, 1–87,600 (visible when Link expires after is Custom (hours)) |
Here is a sample JSON input:
// Single file
{
"fileMode": "single",
"fileName": "report.pdf",
"content": "JVBERi0xLjQKJeLjz9MKMyAwIG9...",
"setExpiry": true,
"expiryOption": "30"
}
// Bulk files, link valid for 48 hours
{
"fileMode": "bulk",
"files": [
{"fileName": "file1.pdf", "content": "JVBERi0xLjQK..."},
{"fileName": "file2.png", "content": "iVBORw0KGgo..."}
],
"setExpiry": true,
"expiryOption": "custom_hours",
"customExpiryHours": 48
}Response
Upon successful execution, the action returns:
- HTTP status code
- File URL(s) for the uploaded content
- Attachment details, including a SHA-256 hash of each file (best effort)
Get Attachment Hash (SHA-256)
Computes the SHA-256 hash of an attachment supplied as a URL or Base64 string. Useful for detecting duplicate attachments or verifying file integrity. Supports single and multiple attachments.
Input Parameters
Optional
| Name | Description |
|---|---|
| Multiple | Toggle to hash multiple attachments |
| Attachment Name | Name of the attachment, returned with the result (when Multiple is disabled) |
| Attachment URL | URL of the attachment to hash (when Multiple is disabled) |
| Base 64 Content | Base64 encoded content of the attachment, used instead of a URL (when Multiple is disabled) |
| Attachments | Array of attachments, each with Attachment Name, Attachment URL, or Base 64 Content (when Multiple is enabled) |
Here is a sample JSON input:
// Single attachment
{
"multi": false,
"name": "invoice.pdf",
"url": "https://example.com/invoice.pdf"
}
// Multiple attachments
{
"multi": true,
"items": [
{"name": "invoice.pdf", "url": "https://example.com/invoice.pdf"},
{"name": "receipt.png", "content": "iVBORw0KGgo..."}
]
}Response
Upon successful execution, the action returns:
- HTTP status code
- For each attachment: name, source (url or base64), algorithm (sha256), hash in hex and Base64, and byte length
- An error message for any attachment that could not be hashed (in multiple mode, the action succeeds if at least one attachment is hashed)
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
Mandatory
| Name | Description |
|---|---|
| JSON Payload | Structured JSON data containing sheets, sections, headings, and data |
| File Format | Output 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
Mandatory
| Name | Description |
|---|---|
| File Data (Url/Base64) | URL or Base64 encoded content of the Excel/CSV file |
| Sheet Name | Name of the sheet to read (case-sensitive) |
Optional
| Name | Description |
|---|---|
| Select Row No. to read columns | Row 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
Convert File to PDF
Converts a file (from URL or Base64) to PDF format using Leena AI's document conversion service.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| File URL Or Base64 String | URL 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
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
Mandatory
| Name | Description |
|---|---|
| Input Type | Choose input method: Field Array or JSON Array |
| Files | File data as URL or Base64 (format depends on Input Type selected) |
| Output File Name | Name for the combined PDF output file |
Optional
| Name | Description |
|---|---|
| Output Format | Output format: Base64 or URL |
| Set link expiry | Toggle on to make the output URL expire (visible when Output Format is URL). Off (default) keeps the URL permanent |
| Link expires after | 30 days (default), 60 days, 90 days, Custom (days), or Custom (hours) |
| Custom expiry (days) | Number of days, 1–3650 (visible when Link expires after is Custom (days)) |
| Custom expiry (hours) | Number of hours, 1–87,600 (visible when Link expires after is Custom (hours)) |
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",
"setExpiry": true,
"expiryOption": "60"
}Response
Upon successful execution, the action returns:
- HTTP status code
- File name
- Combined PDF as Base64 or URL (based on output format selection)
Parse EML file
Parses an email (.eml) file and extracts its text content, headers, metadata, and attachments. Attachments are uploaded to Leena AI's storage and returned as URLs.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| EML file URL or Base64 | URL of the .eml file or its Base64 encoded content |
Optional
| Name | Description |
|---|---|
| Set link expiry | Toggle on to make the attachment URLs expire. Off (default) keeps the URLs permanent |
| Link expires after | 30 days (default), 60 days, 90 days, Custom (days), or Custom (hours) (visible when Set link expiry is on) |
| Custom expiry (days) | Number of days, 1–3650 (visible when Link expires after is Custom (days)) |
| Custom expiry (hours) | Number of hours, 1–87,600 (visible when Link expires after is Custom (hours)) |
Here is a sample JSON input:
{
"input": "https://example.com/emails/leave-request.eml",
"setExpiry": true,
"expiryOption": "90"
}Response
Upon successful execution, the action returns:
- HTTP status code
- Email body as plain text (HTML bodies are converted to text)
- All email headers
- Metadata: subject, from, to, cc, bcc, reply-to, date, and message ID
- Attachments (inline images excluded), each with file name, MIME type, URL, size, and SHA-256 hash
- HTTP 422 with an error message if the input is not a valid EML file
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
Mandatory
| Name | Description |
|---|---|
| Input String | The text or data to encode in the QR code |
| QR Code Format | Output format: Base64 or URL |
Optional
| Name | Description |
|---|---|
| QR Code Error Correction Level | Error correction level: Low, Medium, Quartile (default), or High |
| QR Code Width | Width of the QR code in pixels (default: 200) |
| QR Code Margin | Margin around the QR code in modules (default: 4) |
| Set link expiry | Toggle on to make the QR code URL expire (visible when QR Code Format is URL). Off (default) keeps the URL permanent |
| Link expires after | 30 days (default), 60 days, 90 days, Custom (days), or Custom (hours) |
| Custom expiry (days) | Number of days, 1–3650 (visible when Link expires after is Custom (days)) |
| Custom expiry (hours) | Number of hours, 1–87,600 (visible when Link expires after is Custom (hours)) |
Here is a sample JSON input:
{
"inputString": "https://example.com/verify?id=12345",
"errorCorrectionLevel": "Q",
"width": 300,
"margin": 4,
"qrCodeFormat": "URL",
"setExpiry": false
}Response
Upon successful execution, the action returns:
- HTTP status code
- QR code image as Base64 data URL or URL (based on format selection)
Generate letter
Generates a letter/document using Leena AI's letter generation service from a template, returned as a file (PDF or .docx) or an image (PNG or JPG). The letter can be delivered as a private (access-controlled) URL, a public URL that always expires, or inline Base64.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| Output type of the generated letter | Private URL (access-controlled link), Public URL (with expiry) (anyone with the link can open it until it expires), or Base64 (file content returned inline) |
| Output file format | File (PDF/.docx) or Image (PNG/JPG generated from the PDF) |
| Tag | Letter template tag identifier |
| Letter body | JSON data to populate the letter template |
| Filename | Base name for the output file; the extension (.pdf, .docx, .png, or .jpg) is set automatically from the selected format. Should be unique for each document — if 2 files are generated with the same name, the newer one replaces the older one |
| Public link expires after | Required when Output type is Public URL (with expiry): 30 days, 60 days, 90 days, Custom (days), or Custom (hours). A public link can never be permanent |
Optional
| Name | Description |
|---|---|
| Output file format as .DOCX | Toggle to return .docx instead of PDF (only when the template is .docx; visible when Output file format is File) |
| Image format | PNG (recommended for letters with text) or JPG (visible when Output file format is Image) |
| Password | Password-protects the generated .docx (visible when Output file format as .DOCX is on) |
| Set link expiry | Toggle on to make the letter URL expire (visible when Output type is Private URL). Off (default) keeps the URL permanent |
| Link expires after | 30 days (default), 60 days, 90 days, Custom (days), or Custom (hours) (visible when Set link expiry is on) |
| Custom expiry (days) | Number of days, 1–3650 (visible when the selected expiry is Custom (days); applies to both Private and Public URL) |
| Custom expiry (hours) | Number of hours, 1–87,600 (visible when the selected expiry is Custom (hours); applies to both Private and Public URL) |
Here is a sample JSON input:
// Private URL with optional 30-day expiry
{
"outputType": "privateUrl",
"fileFormat": "file",
"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",
"setExpiry": true,
"expiryOption": "30"
}
// Public URL that expires after 72 hours
{
"outputType": "publicUrl",
"fileFormat": "file",
"tag": "offer_letter_template",
"letterBody": {
"employeeName": "John Doe",
"position": "Software Engineer"
},
"filename": "offer_letter_john_doe_public",
"publicExpiryOption": "custom_hours",
"publicCustomExpiryHours": 72
}Response
Upon successful execution, the action returns:
- HTTP status code
- For Private URL or Public URL: file type, URL, and file name
- For Base64: the generated letter content
- HTTP 400 if Output type is Public URL and no valid link expiry is set
Sign JWT Token
Generates a signed JWT (JSON Web Token) using the specified payload, secret key, and algorithm.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| Payload | JSON payload to encode in the token |
| Secret/Private Key | Secret key or private key for signing the token |
Optional
| Name | Description |
|---|---|
| Algorithm | Signing 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
Mandatory
| Name | Description |
|---|---|
| otpLength | Length of the OTP to generate (numeric value) |
| otpExpiry | Expiry time in seconds for the OTP |
| maxOTPs | Maximum number of OTPs allowed per session |
| maxRetries | Maximum 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
Mandatory
| Name | Description |
|---|---|
| sessionId | The session ID returned from Generate OTP action |
| otp | The OTP value to validate |
Optional
| Name | Description |
|---|---|
| matchCriteria | OTP 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
Mandatory
| Name | Description |
|---|---|
| sessionId | The 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
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
Mandatory
| Name | Description |
|---|---|
| Employee'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
Get workflow item IDs
Fetches the IDs of workflow items initiated for a Leena AI workflow app. Results can be narrowed to a specific user and to one or more item statuses.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| App ID | ID of the workflow app whose initiated items to fetch |
Optional
| Name | Description |
|---|---|
| User ID | Return only items initiated by this user |
| Status | One or more item statuses: Completed, Failed, In Progress, Rejected, Withdrawn, or Blocked |
Here is a sample JSON input:
{
"appId": "65f1c2a9b8e4d70012ab34cd",
"userId": "64a7e1f3c2b9a80011de56fa",
"status": ["inProgress", "blocked"]
}Response
Upon successful execution, the action returns:
- HTTP status code
- List of initiated workflow item IDs matching the filters
Withdraw workflow items
Withdraws one or more workflow items of a Leena AI workflow app in bulk, with an optional comment. Pairs with Get workflow item IDs to withdraw items that match a filter.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| App ID | ID of the workflow app the items belong to |
| User ID | ID of the user performing the withdrawal |
Optional
| Name | Description |
|---|---|
| Item IDs | Array of item IDs or comma-separated item IDs to withdraw. If empty, no items are withdrawn |
| Comment | Reason for the withdrawal, recorded against the items |
Here is a sample JSON input:
{
"appId": "65f1c2a9b8e4d70012ab34cd",
"itemIds": ["66b2d4e1a9c3f50013bc78de", "66b2d4e1a9c3f50013bc78df"],
"userId": "64a7e1f3c2b9a80011de56fa",
"comment": "Withdrawn as the request was raised in error."
}Response
Upon successful execution, the action returns:
- HTTP status code
- Withdrawal result for the submitted items
Create workflow out-of-office delegation
Marks a user out of office and names a delegate. While the delegation is live, any new Approval or Input task that would be assigned to the user is routed to the delegate instead, who can act on it exactly as the original assignee would. Tasks assigned before the window began stay with the user. The Agent can leverage this action to set up cover for a user's workflow tasks in advance, for example from a bot flow where the employee asks to set their out-of-office.
A delegation covers either one app or all apps (global). If both cover the same moment, the app-specific delegation takes precedence. The date range is inclusive: it runs from the start of the From date to the end of the To date in the given timezone.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| User ID | ID of the user who will be out of office |
| App ID | ID of the app the delegation is scoped to (required and visible when Apply to all apps is off) |
| Delegate ID | ID of the user who will act on the absent user's tasks during the absence |
| From date | First day away, in YYYY-MM-DD format |
| To date | Last day away (inclusive), in YYYY-MM-DD format |
| Timezone (IANA) | IANA timezone name the dates are in (e.g., Asia/Kolkata, America/New_York) |
Optional
| Name | Description |
|---|---|
| Apply to all apps | Toggle on to apply the delegation to every app. App ID is not used when this is on |
Here is a sample JSON input:
// Delegation for one app
{
"userId": "64a7e1f3c2b9a80011de56fa",
"isGlobal": false,
"appId": "65f1c2a9b8e4d70012ab34cd",
"delegateId": "64a7e1f3c2b9a80011de57ab",
"fromDate": "2026-11-10",
"toDate": "2026-11-14",
"timezone": "Asia/Kolkata"
}
// Delegation across all apps
{
"userId": "64a7e1f3c2b9a80011de56fa",
"isGlobal": true,
"delegateId": "64a7e1f3c2b9a80011de57ab",
"fromDate": "2026-12-22",
"toDate": "2027-01-02",
"timezone": "America/New_York"
}Response
Upon successful execution, the action returns:
- HTTP status code
- The created delegation record, including its absence ID (
_id), user ID, delegate ID, app ID or global flag, date range, timezone, and status. Pass the absence ID to the Update and Cancel actions - An error if the request is invalid: the user delegates to themselves, the date range is inverted or entirely in the past, either user is not an employee of the bot, or the window overlaps an existing live delegation for the same app (a global delegation overlaps any other)
Update workflow out-of-office delegation
Changes the delegate or dates of an active or upcoming out-of-office delegation. Only a live delegation (active and not yet ended) can be updated. Fields left blank keep their current value, and the updated window goes through the same overlap and validity checks as a new delegation.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| Absence ID | ID of the delegation record to update |
Optional
| Name | Description |
|---|---|
| Delegate ID | ID of the new delegate |
| From date | New first day away, in YYYY-MM-DD format |
| To date | New last day away (inclusive), in YYYY-MM-DD format |
| Timezone (IANA) | IANA timezone the new dates are in. Requires both From date and To date to be set |
Set at least one of Delegate ID, From date, or To date.
Here is a sample JSON input:
{
"absenceId": "6720f4b1c9a8e30012fe90ab",
"delegateId": "64a7e1f3c2b9a80011de58cd",
"fromDate": "2026-11-11",
"toDate": "2026-11-15",
"timezone": "Asia/Kolkata"
}Response
Upon successful execution, the action returns:
- HTTP status code
- The updated delegation record
- An error if the delegation has already ended or been cancelled, no field to change is set, or the new window fails validation
Cancel workflow out-of-office delegation
Cancels an active or upcoming out-of-office delegation. New tasks route to the user again from that point; tasks already handed to the delegate stay with the delegate until closed. A delegation that has already ended can't be cancelled.
Input Parameters
Mandatory
| Name | Description |
|---|---|
| Absence ID | ID of the delegation record to cancel |
Here is a sample JSON input:
{
"absenceId": "6720f4b1c9a8e30012fe90ab"
}Response
Upon successful execution, the action returns:
- HTTP status code
- The cancelled delegation record, with status
cancelled
List workflow out-of-office delegations
Lists a user's active and upcoming out-of-office delegations (records that are still live or haven't started yet), sorted by start date. Use this to look up the absence ID for an update or cancel, or to show a user their current cover before changing it.
Input Parameters
Optional
| Name | Description |
|---|---|
| User ID | List delegations of this user only. When left blank, the acting user's own delegations are listed, so the action must run with a user context if this is left blank |
| App ID | List only delegations that apply to this app (the app's own delegations plus global ones) |
Here is a sample JSON input:
{
"userId": "64a7e1f3c2b9a80011de56fa",
"appId": "65f1c2a9b8e4d70012ab34cd"
}Response
Upon successful execution, the action returns:
- HTTP status code
- Array of active and upcoming delegation records, each with its absence ID, user ID, delegate ID, app ID or global flag, date range, timezone, and status
Updated 6 days ago
