Install
openclaw skills install feishu-doc-editorFeishu document creation and editing operations using OpenAPI. Activate when user needs to create, edit, or read Feishu documents programmatically.
openclaw skills install feishu-doc-editorThis skill provides comprehensive guidance for creating and editing Feishu documents using the Feishu OpenAPI.
Create enterprise self-built app: Login to Feishu Open Platform, create an app and add "Bot" capability.
Apply for API permissions: In "Permission Management", apply for the following permissions:
docx:document:write_onlydocx:document:readonlyPublish app: Submit version and publish, ensuring the app coverage includes target users/departments.
Call the self-built app get tenant_access_token interface:
curl -X POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal \
-H "Content-Type: application/json" \
-d '{"app_id": "your_app_id", "app_secret": "your_app_secret"}'
Response example:
{
"code": 0,
"tenant_access_token": "t-xxx",
"expire": 7200
}
Get document_id from document URL:
Example URL: https://bigdatacenter.feishu.cn/docx/HpK2dtGu9omhMAxV12zcB6i7ngd
document_id = HpK2dtGu9omhMAxV12zcB6i7ngd
Manually add collaborator:
Interface: Create Block
Path parameters: document_id = document ID, block_id = document ID (root node is the document itself)
Request headers:
Authorization: Bearer {tenant_access_token}
Content-Type: application/json
Request body example (write "hello"):
{
"index": -1,
"children": [
{
"block_type": 2,
"text": {
"elements": [
{
"text_run": {
"content": "hello"
}
}
]
}
}
]
}
Interface: Get Document Plain Text
curl -X GET "https://open.feishu.cn/open-apis/docx/v1/documents/{document_id}/plaintext" \
-H "Authorization: Bearer {tenant_access_token}"
Response example:
{
"code": 0,
"data": {
"content": "Document text content here"
}
}
tenant_access_token is invalid.tenant_access_token.Authorization: Bearer {token}.tenant_access_token is correctly added to request header.document_id is incorrect or document has been deleted.document_id from document URL.Through the above steps, you can achieve editing Feishu documents via API, supporting add/delete/modify/query operations for multiple content types including text, tables, and images.