Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
6.8 KB
Raw Blame
---
title: DingTalk Bot
description: Connect an agent to DingTalk and give it work directly in DMs or group chats.
---

import { Callout } from "fumadocs-ui/components/callout";
import { Step, Steps } from "fumadocs-ui/components/steps";

After connecting an [agent](/agents) to DingTalk, members of the agent's workspace can DM the Bot, @-mention it in a group, or use the `/issue` command to create a Multica [issue](/issues) directly. Conversations and run records are saved to the Multica workspace.

<Callout type="info">
The DingTalk integration is [community-maintained](/community-maintained) and has no official support SLA. Report problems in [GitHub issues](https://github.com/multica-ai/multica/issues).
</Callout>

## Connect the Bot

The agent's owner or a workspace owner/admin can connect the agent to DingTalk. Each agent maps to one DingTalk Bot.

<Steps>
<Step>

### Create a Stream-mode robot [#1-create-a-stream-mode-robot]

1. Create an **enterprise internal app** in the [DingTalk Open Platform](https://open-dev.dingtalk.com).
2. Enable the robot capability and set **Message Receiving Mode** to **Stream Mode**.

</Step>
<Step>

### Grant permissions to the robot [#2-grant-permissions-to-the-robot]

The **Robot Message Sending** permission (`qyapi_robot_sendmsg`) is added by default. To show the Bot's name in Multica, manually add the **DingTalk Group Basic Information Management** permission (`qyapi_chat_manage`).

</Step>
<Step>

### Get the application credentials [#3-get-the-application-credentials]

Open the **Credentials & Basic Information** page and copy the **Client ID (AppKey)** and **Client Secret (AppSecret)**.

</Step>
<Step>

### Connect the agent to DingTalk [#4-connect-the-agent-to-dingtalk]

1. Return to Multica and open **Agents → _your agent_ → Messaging**.
2. Click **Add messaging channel**, then choose **DingTalk**.
3. Enter the **AppKey** and **AppSecret**, then submit.

</Step>
<Step>

### Link your DingTalk and Multica accounts [#5-link-your-dingtalk-and-multica-accounts]

DM the Bot in DingTalk or @-mention it in a group to trigger a linking request. The Bot sends you a link in a DM (valid for about 15 minutes); open it, and linking is complete once the success message appears.

</Step>
</Steps>

## Give the agent work in DingTalk

### Direct messages

Send the Bot a message. When the agent finishes, it replies with the result in the DM.

### Group chats

Add the Bot to a DingTalk group, then send `@your-bot <message>`. Every follow-up needs a fresh @-mention; the Bot processes only messages that @-mention it.

### Send images

Direct messages and group chats both support messages containing text and images. Supported image formats are PNG, JPEG, GIF, WebP, and BMP. Each message can contain up to 4 images, with a maximum size of 10 MB per image. Files and voice messages are not currently supported.

In group messages that mix text and images, the text produced by the @-mention is also sent to the agent as part of the message. To strip the Bot's name from it, add the **DingTalk Group Basic Information Management** permission (`qyapi_chat_manage`).

### Follow up with a quoted message

Use DingTalk's quote action to select a message, then enter your current input. In groups, you must still @-mention the Bot. Multica prepends supported quoted content supplied by the DingTalk callback to your current message as agent context. An `/issue`, `/new`, or `/clear` inside the quote is quoted content, not a command for the current turn.

### Message processing feedback

After receiving a DingTalk message, Multica tries to add DingTalk's `RogerThat` reaction to the original message to show it has been handed to the agent. Once the agent finishes and the reply reaches DingTalk, `RogerThat` is replaced with `Done`. If the run is cancelled, `RogerThat` is removed.

Reactions depend on DingTalk's API and may not update immediately. Check the Bot's reply and the run record in Multica when assessing the outcome.

### Create an issue with `/issue`

Send `/issue <title>` or `/issue <title>{newline}<detailed description>` to create a new Multica issue and automatically assign it to the agent the Bot is bound to. Images in the same message are also added to the issue as attachments. Unlike regular chat messages, the `/issue` command leaves no record in Multica [Chat](/chat).

### Start a new Chat with `/new`

Send `/new` to create a new empty Multica Chat and route later DingTalk messages to it. Send `/new <message>` to create the Chat and use that message as its first turn. The previous Chat remains stored and usable in Multica.

### Clear the current context with `/clear`

Send `/clear` to keep the current Multica Chat while applying a fresh agent-visible context to the next message. Send `/clear <message>` to use that message as the first turn after the boundary. The complete Chat history remains visible in Multica.

## Manage connections

- On **Agents → _your agent_ → Messaging**, the agent's owner and workspace owners/admins can connect the agent to DingTalk or disconnect it. Once connected, this page shows the Bot's name, DingTalk groups where it has successfully processed messages, and its activity status data in those groups. Any workspace member with read access to the agent can see this information. Groups with no successfully processed messages in the last 90 days are placed under **Long inactive** and loaded when expanded.
- **Settings → Messaging** lists the connected agents you can read, grouped by platform. Select an agent to open its **Messaging** section, view the Bot's group activity, or manage the connection. After disconnection, the Bot stops receiving messages, while the installation record is retained for audit. Workspace owners/admins can also forget a group. This removes the group from the list without deleting conversations or messages. The group reappears if a workspace member with a linked DingTalk account later @mentions the Bot there and Multica accepts the message.

## Self-hosting setup

Multica Cloud users can skip this section. A self-hosted deployment must first set a key for encrypting the DingTalk `AppSecret`:

```dotenv
MULTICA_DINGTALK_SECRET_KEY=<base64-encoded 32-byte key>
```

Generate one with:

```bash
openssl rand -base64 32
```

Restart the API service, then connect DingTalk. Keep this key permanently: if it is changed or lost, existing tokens cannot be decrypted and the connection must be set up again.

Account-linking URLs use `MULTICA_APP_URL`, falling back to `FRONTEND_ORIGIN` when it is unset. The URL must point to a Multica address that members can access.

## Next

- [Chat integrations](/channels) — how the Channel engine, sessions, and authorization work
- [Agents](/agents) · [Chat](/chat) · [Issues](/issues)
- [Environment variables](/environment-variables) — complete self-hosting configuration reference