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:

  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

Mandatory

NameDescription
To:Select the audience type: Employees or Audience
PriorityNotification priority level: Low, Medium, Normal, High, or Critical
MessageMain message content of the notification

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
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

Mandatory

NameDescription
To:Select the audience type: Employees or Audience
Employees Email IDEmail ID of the employee to notify (required and visible when To: is set to Employees)
PriorityNotification priority level: Low, Medium, Normal, High, or Critical
From emailSender's email address
From nameSender's display name
SubjectEmail subject line

Optional

NameDescription
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
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"
      }
    ]
  },
  "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

NameDescription
CategorySelect the ticket category based on the chosen instance
DescriptionDetailed description of the issue or request

Optional

NameDescription
InstanceSelect the ticket instance (e.g., IT Support, HR Services)
Sub CategorySelect the sub-category based on the chosen category (visible once a Category is selected)
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

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

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

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

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

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 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

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

Optional

NameDescription
Set link expiryToggle on to make the file URL stop working after a set period. Off (default) keeps the URL permanent
Link expires after30 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

NameDescription
MultipleToggle to hash multiple attachments
Attachment NameName of the attachment, returned with the result (when Multiple is disabled)
Attachment URLURL of the attachment to hash (when Multiple is disabled)
Base 64 ContentBase64 encoded content of the attachment, used instead of a URL (when Multiple is disabled)
AttachmentsArray 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

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

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

Convert File to PDF

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

Input Parameters

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

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

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
Set link expiryToggle on to make the output URL expire (visible when Output Format is URL). Off (default) keeps the URL permanent
Link expires after30 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

NameDescription
EML file URL or Base64URL of the .eml file or its Base64 encoded content

Optional

NameDescription
Set link expiryToggle on to make the attachment URLs expire. Off (default) keeps the URLs permanent
Link expires after30 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

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)
Set link expiryToggle on to make the QR code URL expire (visible when QR Code Format is URL). Off (default) keeps the URL permanent
Link expires after30 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

NameDescription
Output type of the generated letterPrivate 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 formatFile (PDF/.docx) or Image (PNG/JPG generated from the PDF)
TagLetter template tag identifier
Letter bodyJSON data to populate the letter template
FilenameBase 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 afterRequired 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

NameDescription
Output file format as .DOCXToggle to return .docx instead of PDF (only when the template is .docx; visible when Output file format is File)
Image formatPNG (recommended for letters with text) or JPG (visible when Output file format is Image)
PasswordPassword-protects the generated .docx (visible when Output file format as .DOCX is on)
Set link expiryToggle on to make the letter URL expire (visible when Output type is Private URL). Off (default) keeps the URL permanent
Link expires after30 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

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

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

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

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

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

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

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

NameDescription
App IDID of the workflow app whose initiated items to fetch

Optional

NameDescription
User IDReturn only items initiated by this user
StatusOne 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

NameDescription
App IDID of the workflow app the items belong to
User IDID of the user performing the withdrawal

Optional

NameDescription
Item IDsArray of item IDs or comma-separated item IDs to withdraw. If empty, no items are withdrawn
CommentReason 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

NameDescription
User IDID of the user who will be out of office
App IDID of the app the delegation is scoped to (required and visible when Apply to all apps is off)
Delegate IDID of the user who will act on the absent user's tasks during the absence
From dateFirst day away, in YYYY-MM-DD format
To dateLast 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

NameDescription
Apply to all appsToggle 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

NameDescription
Absence IDID of the delegation record to update

Optional

NameDescription
Delegate IDID of the new delegate
From dateNew first day away, in YYYY-MM-DD format
To dateNew 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

NameDescription
Absence IDID 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

NameDescription
User IDList 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 IDList 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

Did this page help you?