Teable
by @killgfat
Manage Teable resources with full CRUD for records, bases, spaces, tables, dashboards, and trash via API and command-line scripts.
Create a Record with Typecast
# Enable typecast for automatic type conversion
python3 scripts/teable_record.py create \
--table-id "tblABC123" \
--fields '{"Name":"John","Age":"30","Completed":"yes","DueDate":"2024-01-15"}' \
--typecast
Batch Create Records
python3 scripts/teable_record.py create \
--table-id "tblABC123" \
--fields '[{"Name":"Alice"},{"Name":"Bob"},{"Name":"Charlie"}]'
List Records with Pagination
# Get first 100 records
python3 scripts/teable_record.py list --table-id "tblABC123" --take 100Get next 100 (skip first 100)
python3 scripts/teable_record.py list --table-id "tblABC123" --take 100 --skip 100
Filter and Sort Records
python3 scripts/teable_record.py list \
--table-id "tblABC123" \
--filter '{"operator":"and","filterSet":[{"fieldId":"fld1","operator":"is","value":"Active"}]}' \
--order-by '[{"fieldId":"fld2","order":"asc"}]'
Complete Workflow Example
# 1. Create a space
python3 scripts/teable_space.py create --name "Project Alpha" --icon "π"2. Create a base in the space
python3 scripts/teable_base.py create --space-id "spcXXX" --name "Task Manager"3. Create a table in the base
python3 scripts/teable_table.py create --base-id "bseXXX" --name "Tasks"4. Add records
python3 scripts/teable_record.py create \
--table-id "tblXXX" \
--fields '{"Task":"Design","Status":"In Progress","Priority":"High"}'
Install the required Python package:
pipx install requests
or globally
pip3 install requests
Environment Variables
Required: Set the TEABLE_API_KEY environment variable before using any scripts:
# Temporary (current shell session)
export TEABLE_API_KEY="your_personal_access_token_here"Permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export TEABLE_API_KEY="your_personal_access_token_here"' >> ~/.bashrc
source ~/.bashrc
Getting Your Teable API Token: 1. Log in to your Teable instance 2. Go to Settings β Access Token 3. Create a new Personal Access Token 4. Copy and save the token (shown only once)
Optional: For self-hosted Teable instances, set TEABLE_URL:
export TEABLE_URL="https://your-teable-instance.com"
Default: https://app.teable.ai
401 Unauthorized
Check that TEABLE_API_KEY is correctly set:
echo $TEABLE_API_KEY
403 Forbidden
Your token lacks the required permissions. Create a new token with appropriate scopes in Teable settings.
404 Not Found
Verify that IDs are correct (spaceId, baseId, tableId, recordId, etc.) and match the expected format.
Connection Timeout
TEABLE_URL is accessibleproxychains proxychains python3 scripts/teable_record.py list --table-id "tblXXX"
Typecast Not Working
Ensure the --typecast flag is included in your command:
python3 scripts/teable_record.py create \
--table-id "tblXXX" \
--fields '{"Age":"30"}' \
--typecast # Required for string-to-number conversion
clawhub install teable-api