> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.alephant.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server.

# Feishu

> Connect a Feishu knowledge space, limit indexing to approved Wiki scopes, and verify document access.

Use the Feishu connector to index approved Wiki content into AIvis. Start with one small knowledge space or subtree, verify the indexed documents, and expand the scope only after the content owner approves it.

## Use cases

| Scenario                            | Recommendation                                                                                               |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Department knowledge Q\&A           | Create connectors by knowledge space or subtree and bind them to the relevant department group.              |
| Project delivery document retrieval | Use a separate connector per project space so it can be disabled, reindexed, and reviewed independently.     |
| Knowledge bases with attachments    | Enable attachment indexing only when attachment content is approved and deployment resources are sufficient. |
| Mixed-sensitivity knowledge bases   | Split connectors by audience; do not put public and restricted documents in the same indexing scope.         |

## What it indexes

The connector discovers Wiki nodes in each configured scope and indexes nodes backed by Feishu Docx documents. It preserves headings, paragraphs, lists, code blocks, quotes, tasks, and callouts as searchable text.

When **Include attachments** is enabled, supported images and files embedded in a document are indexed as child documents. Wiki nodes backed by unsupported resource types are reported as document failures instead of being silently indexed.

## Prerequisites

Before creating the connector, prepare a Feishu custom app and confirm all of the following:

1. The app is enabled for the tenant that owns the target knowledge space.
2. Application-identity permissions cover reading Wiki spaces and nodes, reading Docx documents and blocks, and downloading Drive media when attachments are enabled.
3. The app or bot has resource-level access to every configured knowledge space. Add it as a knowledge-space member or administrator when the space does not otherwise grant the required access.
4. The AIvis API and indexing workers can reach `open.feishu.cn` through the deployment's approved DNS and outbound network path.

API permission approval and knowledge-space membership are separate checks. A successful access-token request does not prove that the app can read a particular space.

## Prepare the app in Feishu

1. Open the Feishu Open Platform and go to the **Developer Console**.
2. Select the target company and create a **Custom App**. The app name can be `AIvis`, the description can be `AIvis connector`, and the icon can follow your company's app policy.

![Feishu Open Platform custom app creation dialog with app name, description, and icon fields](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/alephantai.docs.buildwithfern.com/2c56ebf6a86ebaecb1ec11f4613e27edc903ac072e78a9c5714e2f09c77cb23c/assets/aivis/feishu/feishu-create-app.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260805T120121Z&X-Amz-Expires=604800&X-Amz-Signature=3f0f994cb5760229a327d1c9416b40004b332f319b09b320a7b425909326a695&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

3. In the app sidebar, open **Credentials & Basic Info**. In the **App Credentials** section, copy the `App ID` and `App Secret`. These map directly to the AIvis Feishu credential fields.

![Feishu Open Platform Credentials and Basic Info page showing the App ID and App Secret area](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/alephantai.docs.buildwithfern.com/79e2a2be8cac98583946e2222ecac864cfa36d5ba86d2c19e37dd25a464964bd/assets/aivis/feishu/feishu-app-credentials.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260805T120121Z&X-Amz-Expires=604800&X-Amz-Signature=d45586d166f386cb2aabc9b18d2de8791f8585ddf876411df40ab1f28d0d289f&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

4. In **Permission Management**, add the Wiki, Docx, and optional Drive-media read permissions required by the connector, then submit them for approval if your company requires it.
5. In **Version Management & Release**, create and publish an app version. Feishu only applies the current app configuration after the app version is released.
6. Add the app or bot to the knowledge space you want to index, or ask a space administrator to grant it access to the target root node.

Do not forward the `App Secret` in screenshots, shared documents, or tickets that unrelated people can access. If the secret has been exposed, regenerate it in Feishu and update the AIvis credential.

## Create credentials

In the AIvis Admin Panel, create a Feishu credential with:

| Field             | Value                        |
| ----------------- | ---------------------------- |
| Feishu App ID     | The custom app's App ID.     |
| Feishu App Secret | The custom app's App Secret. |

AIvis exchanges these values for a short-lived `tenant_access_token` and refreshes it automatically. Do not paste a user access token or tenant access token into either credential field, and never store the App Secret in an Agent instruction, chat message, or shared document.

If credential validation fails, return to Feishu's **Credentials & Basic Info** page, copy the `App ID` and `App Secret` again, and confirm that the app has been released to the target company.

## Find the indexing scope

Every connector requires at least one explicit scope. Use one of these formats:

```text
SPACE_ID
SPACE_ID/ROOT_NODE_TOKEN
```

| Format                     | Result                                                       |
| -------------------------- | ------------------------------------------------------------ |
| `SPACE_ID`                 | Index every supported Wiki document in that knowledge space. |
| `SPACE_ID/ROOT_NODE_TOKEN` | Index the specified Wiki node and its descendants only.      |

To find `SPACE_ID`, open the knowledge-space settings and copy the space identifier shown in the URL, or call Feishu's list-spaces API and read `data.items[].space_id`. To find `ROOT_NODE_TOKEN`, open the intended root page and copy the token after `/wiki/` in its URL.

Replace both placeholders with real values. The literal text `root_node_token` is not a valid subtree root. A root node must belong to the space specified before the slash. Identifiers may contain only letters, numbers, underscores, and hyphens.

## Configure the connector

![Feishu connector form with connector name, knowledge-space scope, attachment setting, and document access fields](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/alephantai.docs.buildwithfern.com/4b928071a4b68a23fb6ef9f894d792cbcfb4d573dbe4a7567ffcb019dd75aa6b/assets/aivis/feishu/feishu-connector-form.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260805T120121Z&X-Amz-Expires=604800&X-Amz-Signature=a132300bd037c15760c08b0579e5eee7ac1ec58ccd9ab62cc42bf1b490619102&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

1. Open **Documents & Knowledge**, choose **Feishu**, and select the credential created above.
2. Fill in **Connector name**. This field is required. Use a name that identifies the space and purpose, such as `Feishu - Product Knowledge Base` or `Feishu - Project A Delivery Docs`.
3. Under **Feishu knowledge-space scope**, click **New** and add one approved `SPACE_ID` or `SPACE_ID/ROOT_NODE_TOKEN` per scope. Duplicate scopes are rejected.
4. Keep **Include attachments** enabled only when the deployment is approved to index embedded images and files. When enabled, supported images and file attachments are indexed as child documents.
5. Set **Document access**. Choose **Public** when every user who can use this document set in the workspace may search the content. For restricted knowledge spaces, choose private access or assign specific groups.
6. Click **Create connector**. AIvis validates every configured scope before saving it; fix the credential, scope, or Feishu resource permission before retrying if validation fails.

Start with a small scope for the first creation and indexing check, then expand to the full knowledge space after validation.

## Verify indexing

1. Confirm connector creation succeeds without a validation error.
2. Run an index attempt and wait for it to complete.
3. Review the indexed document count and any per-document failures. Unsupported Wiki resource types may appear as explicit failures.
4. Open a representative indexed document and confirm its title, text, hierarchy, source link, and optional attachment children.
5. Attach the resulting document set to a test Agent and ask a question whose answer exists only in the indexed Feishu documents. Require the Agent to cite the source document.

After changing app permissions, knowledge-space membership, scope values, or attachment settings, run a new index attempt and repeat these checks.

## Troubleshooting

| Symptom                                                          | Likely cause and action                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Feishu credential is invalid`                                   | Verify the App ID and App Secret belong to the same enabled custom app. AIvis obtains the tenant token; do not substitute a copied access token.                                                                                                                                                                   |
| Error code `99991672`                                            | The app lacks an OpenAPI permission required by the requested Wiki, Docx, or Drive API. Add the permission for application identity, publish or approve the change, then retry.                                                                                                                                    |
| Error code `403` or `91403`                                      | The app can obtain a token but has not been granted access to the target knowledge space, node, document, or Drive resource. Add the app or bot to the knowledge space and confirm that the app version has been released.                                                                                         |
| Error code `131006` or `1770032`                                 | The app has no resource-level access to the space, node, document, or media. Add the app or bot to the knowledge space with the required role and verify that the configured root is visible to it.                                                                                                                |
| `Feishu root node does not belong to the configured space`       | The value after the slash comes from another knowledge space. Copy the root token from a page inside the configured space.                                                                                                                                                                                         |
| `Feishu API request failed`                                      | Check outbound DNS, proxy, TLS, and firewall access to `open.feishu.cn`, then inspect the API and indexing-worker logs for the upstream status or business code. If SSRF protection is enabled, fix any DNS or proxy rule that maps the public Feishu host to a private, loopback, link-local, or fake-IP address. |
| Scope validation fails after entering `SPACE_ID/root_node_token` | Replace the placeholder with the actual token from the `/wiki/ROOT_NODE_TOKEN` page URL and remove spaces or unsupported characters.                                                                                                                                                                               |
| Documents index but attachments fail                             | Grant the app permission to download Drive media, confirm resource access, and retry with **Include attachments** enabled.                                                                                                                                                                                         |

## Related pages

* [Connectors & Indexing](/aivis/knowledge/connectors) explains connector runs and document sets.
* [Index Settings](/aivis/knowledge/index-settings) covers deployment-wide indexing behavior.