NocoDB

Overview

The NocoDB connector enables your AI Colleagues to integrate with your organization's NocoDB platform, facilitating automated database management, record operations, and data workflows.

NocoDB is an open-source, no-code/low-code database platform that transforms databases into smart spreadsheets. It allows users to manage and collaborate on data with a no-code interface. The NocoDB connector allows Leena AI to automate database workflows, manage table records, and interact with NocoDB bases seamlessly.

API Details

Leena AI integrates with NocoDB via REST APIs.

Documentation link: https://docs.nocodb.com/developer-resources/rest-APIs/overview

Setup

The NocoDB connector supports two authentication methods: API Token authentication and User Token authentication.

Prerequisites

Before setting up the NocoDB connector, ensure you have:

  • Access to your NocoDB instance (self-hosted or NocoDB Cloud)
  • Administrator or appropriate user access to your NocoDB base/project
  • Ability to generate API tokens in NocoDB Account Settings
  • Access to your Leena AI workspace with connector management permissions
  • Knowledge of your NocoDB instance Base URL and Project ID

Get credentials

Method 1: API Token Authentication (Recommended)

Here is how to create an API Token in NocoDB:

  1. Log in to your NocoDB instance
  2. Open Account Settings:
    1. Click on the User menu in the bottom left corner of the sidebar
    2. Select Account Settings
  3. Navigate to API Tokens:
    1. Open the Tokens tab
    2. Click Add new API token
  4. Create API Token:
    1. Enter a descriptive name for your token (e.g., "Leena AI Integration")
    2. Click Save
  5. Copy and Save Token:
    1. Copy the generated API Token immediately
    2. Store it securely (the token is displayed only once during creation)

Method 2: User Token Authentication

Here is how to use User Token authentication:

  1. Log in to your NocoDB instance
  2. Use your NocoDB account email and password for authentication
  3. Note: User auth tokens are temporary and valid for a session until logout or for 10 hours

Obtain Project ID (Base ID)

Here is how to find your NocoDB Project ID:

  1. Open your NocoDB project/base in a web browser
  2. Look at the URL in your browser's address bar
  3. The Project ID (Base ID) is the alphanumeric identifier prefixed with p in the URL
    • Example URL: https://your-instance.nocodb.com/#/nc/p1234abcd
    • Project ID: p1234abcd
  4. Alternatively, you can find the Base ID in the base context menu (three dots next to the base name) in the left sidebar

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 "NocoDB" and select it from the list to add its new connector
  4. Start configuring the connector
    1. Base URL: Your NocoDB instance URL (e.g., https://your-instance.nocodb.com or https://app.nocodb.com for NocoDB Cloud)
    2. Project ID: The Base ID/Project ID from your NocoDB URL (prefixed with p)
    3. Auth Type: Select the authentication type:
      • API Token: For API key-based authentication (recommended)
      • User Token: For email/password-based authentication
  5. If API Token is selected:
    1. API Token: Enter your NocoDB API Token generated from Account Settings
  6. If User Token is selected:
    1. Email: Enter your NocoDB account email address
    2. Password: Enter your NocoDB account password
  7. Save the connector configuration

Actions

The following actions are supported for the NocoDB connector:

List Table Records

Retrieves a list of records from a NocoDB table. This action can be leveraged by Leena AI Orchestrator/Agent to list down all the records in a specific table or records matching specific criteria. Here are some common use cases:

  • Data Retrieval: Get all records from a table for reporting
  • Filtered Search: Find records matching specific criteria using filters
  • Paginated Results: Retrieve large datasets in manageable chunks
  • Sorted Data: Get records sorted by specific fields
  • Selected Fields: Retrieve only specific columns for optimized performance

Input Parameters

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

Mandatory

NameDescription
TableThe table from which to retrieve records (dropdown selection)

Optional

NameDescription
LimitThe maximum number of records to retrieve
OffsetThe number of records to skip for pagination
Where (Filter)A SQL-like WHERE clause for filtering records (e.g., (Name,eq,John))
SortA comma-separated list of fields to sort by (prefix with - for descending, e.g., Name,-Age)
FieldsA comma-separated list of fields to include in the response

Here is a sample JSON input:

// Basic List Records

{
  "tableId": "m1234abcd5678",
  "limit": 100,
  "offset": 0
}

// Filtered and Sorted Records

{
  "tableId": "m1234abcd5678",
  "limit": 50,
  "offset": 0,
  "where": "(Status,eq,Active)",
  "sort": "Name,-CreatedAt",
  "fields": "Name,Email,Status,CreatedAt"
}

// Paginated Results

{
  "tableId": "m1234abcd5678",
  "limit": 25,
  "offset": 50,
  "sort": "Id"
}

Response

The action returns a list of table records, each containing:

  • Record ID
  • Field values for each column in the table
  • System fields (created time, updated time, etc.)
  • Pagination information

Create Table Records

Creates new records in a NocoDB table. The Agent can leverage the skill (workflow), which has been designed to add new records to a table, once the user provides the record details. Here are some common use cases:

  • Data Entry: Add new entries to a database table
  • Form Submissions: Capture and store form data
  • Bulk Insert: Add multiple records in a single operation
  • CRM Updates: Create new customer or contact records
  • Event Logging: Log events or activities to a tracking table

Input Parameters

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

Mandatory

NameDescription
TableThe table where new records will be created (dropdown selection)
DataJSON array of record objects to be created, with field names as keys

Here is a sample JSON input:

// Single Record Creation

{
  "tableId": "m1234abcd5678",
  "records": [
    {
      "Name": "John Doe",
      "Email": "[email protected]",
      "Age": 30,
      "Department": "Engineering"
    }
  ]
}

// Multiple Records Creation

{
  "tableId": "m1234abcd5678",
  "records": [
    {
      "Name": "John Doe",
      "Email": "[email protected]",
      "Age": 30,
      "Department": "Engineering"
    },
    {
      "Name": "Jane Smith",
      "Email": "[email protected]",
      "Age": 28,
      "Department": "Marketing"
    },
    {
      "Name": "Bob Wilson",
      "Email": "[email protected]",
      "Age": 35,
      "Department": "Sales"
    }
  ]
}

Response

Upon successful creation, the action returns the created record details including:

  • Record ID(s) of newly created records
  • Created field values
  • System timestamps (created time)
  • HTTP status code indicating success

Update Table Records

Updates existing records in a NocoDB table. The Agent can leverage the skill (workflow), which has been designed to modify existing records in a table, once the user provides the updated record details. Here are some common use cases:

  • Data Correction: Fix or update incorrect information
  • Status Updates: Change record status or state
  • Bulk Updates: Modify multiple records simultaneously
  • Profile Updates: Update customer or user information
  • Inventory Management: Adjust quantities or availability

Input Parameters

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

Mandatory

NameDescription
TableThe table containing the records to be updated (dropdown selection)
Record DataJSON array of record objects with Id and updated field values

Here is a sample JSON input:

// Single Record Update

{
  "tableId": "m1234abcd5678",
  "records": [
    {
      "Id": "1",
      "Name": "John Doe Updated",
      "Email": "[email protected]",
      "Age": 31
    }
  ]
}

// Multiple Records Update

{
  "tableId": "m1234abcd5678",
  "records": [
    {
      "Id": "1",
      "Name": "John Doe Updated",
      "Age": 31,
      "Status": "Active"
    },
    {
      "Id": "2",
      "Name": "Jane Smith Updated",
      "Age": 29,
      "Status": "Active"
    }
  ]
}

// Partial Field Update

{
  "tableId": "m1234abcd5678",
  "records": [
    {
      "Id": "5",
      "Status": "Completed",
      "CompletedDate": "2025-08-27"
    }
  ]
}

Response

Upon successful update, the action returns the updated record details including:

  • Updated record ID(s)
  • Updated field values
  • Modification timestamp
  • HTTP status code indicating success

Delete Table Records

Deletes a specific record from a NocoDB table. The Agent can leverage the skill (workflow), which has been designed to remove a record from a table, once the user specifies the record to be deleted. Here are some common use cases:

  • Data Cleanup: Remove outdated or obsolete records
  • User Requests: Delete records upon user request (GDPR compliance)
  • Error Correction: Remove erroneously created records
  • Archival Process: Delete records after archiving
  • Duplicate Removal: Clean up duplicate entries

Input Parameters

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

Mandatory

NameDescription
TableThe table containing the record to be deleted (dropdown selection)
Record IDThe unique identifier of the record to be deleted

Here is a sample JSON input:

// Basic Record Deletion

{
  "tableId": "m1234abcd5678",
  "recordId": "1"
}

// Delete Specific Record

{
  "tableId": "m1234abcd5678",
  "recordId": "rec_abc123xyz"
}

Response

Upon successful deletion, the action returns:

  • Confirmation of successful deletion
  • Deleted record ID
  • HTTP status code indicating success