NocoDB API
by @dofbi
Connect to NocoDB databases via REST API v3. Query records, manage database structure (tables, fields, views), handle linked records, filters, sorts, and att...
clawhub install nocodb-apiπ About This Skill
name: nocodb description: Connect to NocoDB databases via REST API v3. Query records, manage database structure (tables, fields, views), handle linked records, filters, sorts, and attachments. Use when working with NocoDB (open-source Airtable alternative) to read or manipulate data, create or update records, manage database schema, or upload files. license: AGPL-3.0 metadata: openclaw: requires: env: - NOCODB_TOKEN - NOCODB_URL bins: - curl - jq primaryEnv: NOCODB_TOKEN
NocoDB Skill
CLI wrapper for NocoDB API v3. Supports both NocoDB Cloud (app.nocodb.com) and self-hosted instances.
NocoDB is an open-source Airtable alternative that turns any database into a smart spreadsheet. This skill provides complete access to NocoDB's REST API for managing workspaces, bases, tables, records, and more.
Setup
Required Environment Variables
export NOCODB_TOKEN="your-api-token" # Required - API authentication token
export NOCODB_URL="https://app.nocodb.com" # Optional - defaults to cloud
Getting Your API Token
1. Open NocoDB dashboard
2. Go to Team & Settings β API Tokens
3. Click Add New Token
4. Copy the token and set it as NOCODB_TOKEN
Verification
Test your connection:
nc workspace:list
Quick Start
# List all workspaces
nc workspace:listList bases in a workspace
nc base:list List tables in a base
nc table:list Query records
nc record:list Create a record
nc record:create '{"fields":{"Name":"Alice"}}'
Usage
The skill provides the nc command with a hierarchical structure:
WORKSPACE β BASE β TABLE β VIEW/FIELD β RECORD
Identifier Formats
You can use names (human-readable) or IDs (faster performance):
| Resource | ID Prefix | Example |
|----------|-----------|---------|
| Workspace | w | wabc123xyz |
| Base | p | pdef456uvw |
| Table | m | mghi789rst |
| Field | c | cjkl012opq |
| View | vw | vwmno345abc |
Tip: Use IDs directly for better performance. Set NOCODB_VERBOSE=1 to see ID resolution in action.
Commands
Workspaces
Note: Workspace APIs require Enterprise plan (self-hosted or cloud-hosted).
nc workspace:list
nc workspace:get
nc workspace:create '{"title":"New Workspace"}'
nc workspace:update '{"title":"Renamed"}'
nc workspace:delete
Workspace Collaboration (Enterprise):
nc workspace:members
nc workspace:members:add '{"email":"user@example.com","roles":"workspace-creator"}'
nc workspace:members:update '{"email":"user@example.com","roles":"workspace-viewer"}'
nc workspace:members:remove '{"email":"user@example.com"}'
Bases
nc base:list
nc base:get
nc base:create '{"title":"New Base"}'
nc base:update '{"title":"Renamed"}'
nc base:delete
Base Collaboration (Enterprise):
nc base:members
nc base:members:add '{"email":"user@example.com","roles":"base-editor"}'
nc base:members:update '{"email":"user@example.com","roles":"base-viewer"}'
nc base:members:remove '{"email":"user@example.com"}'
Tables
nc table:list
nc table:get
nc table:create '{"title":"New Table"}'
nc table:update '{"title":"Renamed"}'
nc table:delete
Fields
nc field:list
nc field:get
nc field:create '{"title":"Email","type":"Email"}'
nc field:update '{"title":"Contact Email"}'
nc field:delete
Field Types:
SingleLineText, LongText, Number, Decimal, Currency, Percent
Email, URL, PhoneNumber
Date, DateTime, Time
SingleSelect, MultiSelect
Checkbox, Rating
Attachment, Links, User, JSONViews
Note: View APIs require Enterprise plan.
nc view:list
nc view:get
nc view:create '{"title":"Active Users","type":"grid"}'
nc view:update '{"title":"Renamed"}'
nc view:delete
View Types: grid, gallery, kanban, calendar, form
Records
# List records (pagination)
nc record:list [page] [pageSize] [where] [sort] [fields] [viewId]Get single record
nc record:get [fields]Create record
nc record:create '{"fields":{"Name":"Alice","Email":"alice@example.com"}}'Update record
nc record:update '{"Status":"active"}'Update multiple records
nc record:update-many '[{"id":1,"fields":{"Status":"done"}}]'Delete record
nc record:delete Delete multiple records
nc record:delete '[1,2,3]'Count records
nc record:count [where] [viewId]
Pagination Parameters:
page: Page number (default: 1)
pageSize: Records per page (default: 25)
where: Filter expression (see Filter Syntax)
sort: Sort expression (see Sort Syntax)
fields: Comma-separated field names to return
viewId: Filter by viewLinked Records
# List linked records
nc link:list [page] [pageSize] [where] [sort] [fields]Add links
nc link:add '[{"id":42}]'Remove links
nc link:remove '[{"id":42}]'
Filters & Sorts
View-level Filters:
nc filter:list
nc filter:create '{"field_id":"field123","operator":"eq","value":"active"}'
nc filter:replace ''
nc filter:update ''
nc filter:delete
View-level Sorts:
nc sort:list
nc sort:create '{"field_id":"field123","direction":"desc"}'
nc sort:update ''
nc sort:delete
Attachments
nc attachment:upload
Scripts (Enterprise)
nc script:list
nc script:get
nc script:create '{"title":"My Script"}'
nc script:update ''
nc script:delete
Teams (Enterprise)
nc team:list
nc team:get
nc team:create '{"title":"Engineering"}'
nc team:update ''
nc team:delete
nc team:members:add ''
nc team:members:update ''
nc team:members:remove ''
API Tokens (Enterprise)
nc token:list
nc token:create '{"title":"CI Token"}'
nc token:delete
Filter Syntax
Basic Syntax
(field,operator,value)
Operators
| Operator | Description | Example |
|----------|-------------|---------|
| eq | Equal | (name,eq,John) |
| neq | Not equal | (status,neq,archived) |
| like | Contains (% wildcard) | (name,like,%john%) |
| nlike | Does not contain | (name,nlike,%test%) |
| in | In list | (status,in,active,pending) |
| gt | Greater than | (price,gt,100) |
| lt | Less than | (stock,lt,10) |
| gte | Greater or equal | (rating,gte,4) |
| lte | Less or equal | (age,lte,65) |
| blank | Is null/empty | (notes,blank) |
| notblank | Is not null/empty | (email,notblank) |
| null | Is null | (deleted_at,null) |
| notnull | Is not null | (created_by,notnull) |
| checked | Is checked/true | (is_active,checked) |
| notchecked | Is not checked/false | (is_archived,notchecked) |
Logical Operators
Important: Use tilde prefix (~and, ~or, ~not)
# AND
(name,eq,John)~and(age,gte,18)OR
(status,eq,active)~or(status,eq,pending)NOT
~not(is_deleted,checked)Complex
(status,in,active,pending)~and(country,eq,USA)
Date Filters
# Today
(created_at,eq,today)Past week
(created_at,isWithin,pastWeek)Last 14 days
(created_at,isWithin,pastNumberOfDays,14)Exact date
(event_date,eq,exactDate,2024-06-15)Overdue
(due_date,lt,today)
Complex Examples
# Active users created this month
"(status,eq,active)~and(created_at,isWithin,pastMonth)"Overdue high-priority tasks
"(due_date,lt,today)~and(priority,eq,high)~and(completed,notchecked)"Orders $100-$500 in pending/processing
"(amount,gte,100)~and(amount,lte,500)~and(status,in,pending,processing)"Recently updated, not archived
"(updated_at,isWithin,pastNumberOfDays,14)~and~not(is_archived,checked)"
Sort Syntax
# Single field ascending (default)
'[{"field":"name"}]'Single field descending
'[{"field":"created_at","direction":"desc"}]'Multiple fields
'[{"field":"status"},{"field":"created_at","direction":"desc"}]'
Plan Requirements
Free Plans: Base, Table, Field, Record, Link, Attachment, Filter, Sort APIs
Enterprise Plans (self-hosted or cloud-hosted):
Workspace and Workspace Collaboration APIs
View APIs
Script APIs
Team APIs
API Token APIs
Base Collaboration APIs Examples
Basic Queries
# List all records in a table
nc record:list MyBase UsersGet specific record
nc record:get MyBase Users 42Paginated query
nc record:list MyBase Users 1 50Query with fields selection
nc record:list MyBase Users 1 25 "" "" "name,email,phone"
Filtering
# Simple filter
nc record:list MyBase Users 1 25 "(status,eq,active)"Like search
nc record:list MyBase Users 1 25 "(name,like,%john%)"Combined filters
nc record:list MyBase Users 1 25 "(status,eq,active)~and(age,gte,18)"Date filter
nc record:list MyBase Tasks 1 25 "(due_date,lt,today)"
Sorting
# Sort by name ascending
nc record:list MyBase Users 1 25 "" '[{"field":"name"}]'Sort by date descending
nc record:list MyBase Users 1 25 "" '[{"field":"created_at","direction":"desc"}]'Multiple sorts
nc record:list MyBase Users 1 25 "" '[{"field":"status"},{"field":"name"}]'
Creating Data
# Create single record
nc record:create MyBase Users '{"fields":{"name":"Alice","email":"alice@example.com","status":"active"}}'Create with number fields
nc record:create MyBase Products '{"fields":{"name":"Widget","price":29.99,"quantity":100}}'
Updating Data
# Update single field
nc record:update MyBase Users 42 '{"status":"inactive"}'Update multiple fields
nc record:update MyBase Users 42 '{"status":"active","last_login":"2024-01-15"}'Update multiple records
nc record:update-many MyBase Users '[{"id":1,"fields":{"status":"done"}},{"id":2,"fields":{"status":"done"}}]'
Working with Linked Records
# List linked records
nc link:list MyBase Orders order_items 123Add link
nc link:add MyBase Orders order_items 123 '[{"id":456}]'Remove link
nc link:remove MyBase Orders order_items 123 '[{"id":456}]'
Using Views
# List records through a view
nc record:list MyBase Users 1 25 "" "" "" view123Count records in a view
nc record:count MyBase Users "" view123
Uploading Files
nc attachment:upload MyBase Documents 42 file_field ./report.pdf
Troubleshooting
Connection Issues
# Check environment variables
echo $NOCODB_TOKEN
echo $NOCODB_URLTest connection
nc workspace:list
Verbose Mode
Enable verbose output to see resolved IDs:
export NOCODB_VERBOSE=1
nc field:list MyBase Users
Output: β base: MyBase β pdef5678uvw
β table: Users β mghi9012rst
Common Errors
| Error | Solution |
|-------|----------|
| NOCODB_TOKEN required | Set the environment variable |
| workspace not found | Check workspace name or use ID |
| base not found | Check base name or use ID |
| table not found | Check table name or use ID |
| 401 Unauthorized | Check your API token |
Help
Show complete command reference:
nc
Show filter syntax help:
nc where:help
Resources
NocoDB Documentation: https://docs.nocodb.com/
API Reference: https://docs.nocodb.com/developer-resources/rest-APIs/
GitHub: https://github.com/nocodb/nocodb License
This skill wraps the NocoDB API. NocoDB is open-source under the AGPL-3.0 license.
π‘ Examples
Basic Queries
# List all records in a table
nc record:list MyBase UsersGet specific record
nc record:get MyBase Users 42Paginated query
nc record:list MyBase Users 1 50Query with fields selection
nc record:list MyBase Users 1 25 "" "" "name,email,phone"
Filtering
# Simple filter
nc record:list MyBase Users 1 25 "(status,eq,active)"Like search
nc record:list MyBase Users 1 25 "(name,like,%john%)"Combined filters
nc record:list MyBase Users 1 25 "(status,eq,active)~and(age,gte,18)"Date filter
nc record:list MyBase Tasks 1 25 "(due_date,lt,today)"
Sorting
# Sort by name ascending
nc record:list MyBase Users 1 25 "" '[{"field":"name"}]'Sort by date descending
nc record:list MyBase Users 1 25 "" '[{"field":"created_at","direction":"desc"}]'Multiple sorts
nc record:list MyBase Users 1 25 "" '[{"field":"status"},{"field":"name"}]'
Creating Data
# Create single record
nc record:create MyBase Users '{"fields":{"name":"Alice","email":"alice@example.com","status":"active"}}'Create with number fields
nc record:create MyBase Products '{"fields":{"name":"Widget","price":29.99,"quantity":100}}'
Updating Data
# Update single field
nc record:update MyBase Users 42 '{"status":"inactive"}'Update multiple fields
nc record:update MyBase Users 42 '{"status":"active","last_login":"2024-01-15"}'Update multiple records
nc record:update-many MyBase Users '[{"id":1,"fields":{"status":"done"}},{"id":2,"fields":{"status":"done"}}]'
Working with Linked Records
# List linked records
nc link:list MyBase Orders order_items 123Add link
nc link:add MyBase Orders order_items 123 '[{"id":456}]'Remove link
nc link:remove MyBase Orders order_items 123 '[{"id":456}]'
Using Views
# List records through a view
nc record:list MyBase Users 1 25 "" "" "" view123Count records in a view
nc record:count MyBase Users "" view123
Uploading Files
nc attachment:upload MyBase Documents 42 file_field ./report.pdf
βοΈ Configuration
Required Environment Variables
export NOCODB_TOKEN="your-api-token" # Required - API authentication token
export NOCODB_URL="https://app.nocodb.com" # Optional - defaults to cloud
Getting Your API Token
1. Open NocoDB dashboard
2. Go to Team & Settings β API Tokens
3. Click Add New Token
4. Copy the token and set it as NOCODB_TOKEN
Verification
Test your connection:
nc workspace:list
π Tips & Best Practices
Connection Issues
# Check environment variables
echo $NOCODB_TOKEN
echo $NOCODB_URLTest connection
nc workspace:list
Verbose Mode
Enable verbose output to see resolved IDs:
export NOCODB_VERBOSE=1
nc field:list MyBase Users
Output: β base: MyBase β pdef5678uvw
β table: Users β mghi9012rst
Common Errors
| Error | Solution |
|-------|----------|
| NOCODB_TOKEN required | Set the environment variable |
| workspace not found | Check workspace name or use ID |
| base not found | Check base name or use ID |
| table not found | Check table name or use ID |
| 401 Unauthorized | Check your API token |