feishu-api-lookup

Look up Feishu Open API documentation. Activate when: needing to find a specific Feishu API endpoint, understanding API parameters/response, writing scripts that call Feishu APIs, or troubleshooting Feishu API errors. Uses web_search + web_fetch to find and extract API docs in real-time.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "feishu-api-lookup" with this command: npx skills add deadblue22/feishu-api-lookup

Feishu API Lookup

Query Feishu Open Platform API documentation on demand. Since the Feishu docs site is a SPA that can't be statically scraped, this skill uses web search + page fetch to find API docs in real-time.

When to Use

  • Need to find a Feishu API endpoint (e.g., "how to forward a thread")
  • Need to understand API parameters, request/response format
  • Writing a Python/Node script that calls Feishu APIs
  • Troubleshooting Feishu API error codes
  • The built-in OpenClaw feishu plugin doesn't support the needed operation

How to Look Up

Step 1: Search for the API

Use web_search with targeted queries:

web_search("飞书 open API {你要找的功能} site:open.feishu.cn")

Search tips:

  • Use Chinese keywords for better results: "发送消息", "转发话题", "合并转发", "创建文档", "多维表格"
  • Add site:open.feishu.cn to limit to official docs
  • Add POST /im/v1/ or similar path patterns if you know the API domain
  • Alternative: search site:feishu.apifox.cn for the Apifox mirror (sometimes more accessible)

Common API domains:

DomainPath prefixDescription
消息 (IM)/im/v1/Messages, threads, reactions, pins
通讯录/contact/v3/Users, departments, groups
云文档/drive/v1/, /docx/v1/Docs, sheets, files
多维表格/bitable/v1/Bitable (multidimensional tables)
知识库/wiki/v2/Wiki spaces, nodes
日历/calendar/v4/Calendars, events
审批/approval/v4/Approvals
任务/task/v2/Tasks
群组/im/v1/chats/Chat groups
权限/drive/v1/permissions/File permissions
应用/application/v6/App management

Step 2: Fetch the API doc page

Use web_fetch to get the doc content:

web_fetch("https://open.feishu.cn/document/server-docs/im-v1/message/create", maxChars=15000)

⚠️ The official docs site is SPA-rendered — web_fetch may return empty content.

Fallbacks when web_fetch fails:

  1. Try the Apifox mirror: https://feishu.apifox.cn (search for the API there)
  2. Search for the Chinese doc URL pattern: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/...
  3. Use web_search with more specific queries to find the exact parameters

Step 3: Extract key information

From the doc, extract:

  • HTTP Method + URL: e.g., POST /open-apis/im/v1/messages/{message_id}/forward
  • Headers: Usually Authorization: Bearer {tenant_access_token} + Content-Type: application/json
  • Path params: Variables in the URL
  • Query params: Required/optional query parameters
  • Request body: JSON structure with field types and descriptions
  • Response body: Expected response format
  • Error codes: Common errors and fixes
  • Required permissions: Which scopes are needed

Authentication

Almost all Feishu APIs need a tenant_access_token. Get it from:

import json, urllib.request

with open('/root/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
app_id = cfg['channels']['feishu']['appId']
app_secret = cfg['channels']['feishu']['appSecret']

req = urllib.request.Request(
    'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
    data=json.dumps({"app_id": app_id, "app_secret": app_secret}).encode(),
    headers={"Content-Type": "application/json"}
)
token = json.loads(urllib.request.urlopen(req).read())['tenant_access_token']

Common Patterns

Send a request to Feishu API

req = urllib.request.Request(
    f'https://open.feishu.cn/open-apis/{api_path}',
    data=json.dumps(body).encode(),
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {token}"
    }
)
try:
    resp = json.loads(urllib.request.urlopen(req).read())
except urllib.error.HTTPError as e:
    resp = json.loads(e.read().decode())

Pagination pattern

Many list APIs use cursor-based pagination:

page_token = None
all_items = []
while True:
    url = f'https://open.feishu.cn/open-apis/{path}?page_size=50'
    if page_token:
        url += f'&page_token={page_token}'
    resp = fetch(url)
    all_items.extend(resp['data']['items'])
    if not resp['data'].get('has_more'):
        break
    page_token = resp['data']['page_token']

Frequently Used APIs (Quick Reference)

Messages (IM)

ActionMethodPath
Send messagePOST/im/v1/messages?receive_id_type={type}
Reply to messagePOST/im/v1/messages/{message_id}/reply
Forward messagePOST/im/v1/messages/{message_id}/forward?receive_id_type={type}
Merge forwardPOST/im/v1/messages/merge_forward?receive_id_type={type}
Forward threadPOST/im/v1/threads/{thread_id}/forward?receive_id_type={type}
Get messageGET/im/v1/messages/{message_id}
List messagesGET/im/v1/messages?container_id_type=chat&container_id={id}
Delete messageDELETE/im/v1/messages/{message_id}
Update messagePATCH/im/v1/messages/{message_id}
Add reactionPOST/im/v1/messages/{message_id}/reactions
Get message fileGET/im/v1/messages/{message_id}/resources/{file_key}?type={type}

Groups (Chat)

ActionMethodPath
Create groupPOST/im/v1/chats
Get group infoGET/im/v1/chats/{chat_id}
List membersGET/im/v1/chats/{chat_id}/members
Add membersPOST/im/v1/chats/{chat_id}/members

Docs

ActionMethodPath
Create documentPOST/docx/v1/documents
Get document contentGET/docx/v1/documents/{document_id}/raw_content
List blocksGET/docx/v1/documents/{document_id}/blocks
Create blockPOST/docx/v1/documents/{document_id}/blocks/{block_id}/children
Update blockPATCH/docx/v1/documents/{document_id}/blocks/{block_id}
Delete blockDELETE/docx/v1/documents/{document_id}/blocks/{block_id}/children/batch_delete

Drive

ActionMethodPath
Upload filePOST/drive/v1/medias/upload_all
List folderGET/drive/v1/files?folder_token={token}
Get file infoGET/drive/v1/metas/batch_query
Move filePOST/drive/v1/files/{file_token}/move

Bitable

ActionMethodPath
List recordsGET/bitable/v1/apps/{app_token}/tables/{table_id}/records
Create recordPOST/bitable/v1/apps/{app_token}/tables/{table_id}/records
Update recordPUT/bitable/v1/apps/{app_token}/tables/{table_id}/records/{record_id}
List fieldsGET/bitable/v1/apps/{app_token}/tables/{table_id}/fields
Search recordsPOST/bitable/v1/apps/{app_token}/tables/{table_id}/records/search

Wiki

ActionMethodPath
List spacesGET/wiki/v2/spaces
Get nodeGET/wiki/v2/spaces/get_node?token={token}
List nodesGET/wiki/v2/spaces/{space_id}/nodes
Create nodePOST/wiki/v2/spaces/{space_id}/nodes

Permissions

ActionMethodPath
List permissionsGET/drive/v1/permissions/{token}/members?type={type}
Add permissionPOST/drive/v1/permissions/{token}/members?type={type}
Remove permissionDELETE/drive/v1/permissions/{token}/members/{member_id}?type={type}

Error Handling

Common error codes:

  • 99991663 — Invalid tenant_access_token (expired or wrong)
  • 99991668 — Invalid user_access_token
  • 230001 — Invalid request parameter
  • 230002 — Bot not in group
  • 230013 — User not in bot's availability scope
  • 230020 — Rate limit exceeded
  • 230027 — Insufficient permissions

Tips

  1. Always use the /open-apis/ prefix in the full URL: https://open.feishu.cn/open-apis/im/v1/messages
  2. Token expires in 2 hours — cache it but refresh before expiry
  3. receive_id_type mattersopen_id for users, chat_id for groups, union_id for cross-app
  4. File uploads use multipart/form-data, not JSON
  5. Feishu vs Lark — same API, different domain (open.feishu.cn vs open.larksuite.com)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Cclaw

Open-source comedy AI + video editing + poster generation. Create standup/sketch/manzai/scripts, edit videos via FFmpeg, and generate comedy posters via canv...

Registry SourceRecently Updated
General

Dlazy Seedance 1.5 Pro

Convert images into dynamic dance videos using Doubao Seedance 1.5 Pro.

Registry SourceRecently Updated
General

Pod Template Pack

Use when user needs ready-to-use POD (Print on Demand) design keywords, title templates, and listing copy. Use when creating POD product listings for TikTok,...

Registry SourceRecently Updated
General

Dlazy Mj.Imagine

Generate artistic images using Midjourney (MJ) model. Supports text-to-image.

Registry SourceRecently Updated