send_single_message
Send DingTalk messages to up to 20 users via user IDs or names, supporting text, markdown, images, links, action cards, files, audio, and video.
Instructions
Send a message to one or more DingTalk users (max 20). Supports text, markdown, image, link, actionCard (single/multi button), file, audio, video. Recipients can be specified via userIds (numeric) and/or userName (exact name search). Both arrays are merged, deduplicated, and sent as a single batch call. Use upload_media first for image/file/audio/video to get a mediaId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| btns | No | (for msgtype=actionCard_multi) Array of button objects, 1-6 buttons | |
| text | No | (for msgtype=actionCard_*) Card body in Markdown format | |
| title | No | (for msgtype=actionCard_*) Card title | |
| width | No | (for msgtype=video) Display width in px, default 600 | |
| height | No | (for msgtype=video) Display height in px, default 400 | |
| picUrl | No | (for msgtype=link) Optional preview image URL | |
| content | No | (for msgtype=text) Plain text message content | |
| mediaId | No | (for msgtype=audio) mediaId from upload_media | |
| msgtype | No | Message type. Supported: text, markdown, image, link, actionCard_single, actionCard_multi, file, audio, video. | |
| userIds | No | Array of DingTalk numeric user IDs. Max 20 total recipients across userIds + userName. For a single recipient, pass a 1-element array (e.g. ["011950195121139389"]). | |
| duration | No | (for msgtype=video) Duration in seconds | |
| fileName | No | (for msgtype=file) File display name, e.g. "report.pdf" | |
| fileType | No | (for msgtype=file) File extension: xlsx, pdf, zip, rar, doc, docx | |
| photoURL | No | (for msgtype=image) Image URL or mediaId (use upload_media to get mediaId) | |
| userName | No | Array of exact user names to search and resolve to user IDs. If any name matches multiple users, the entire batch will fail with a list of duplicates. Max 20 total recipients across userIds + userName. | |
| singleURL | No | (for msgtype=actionCard_single) Button URL | |
| videoType | No | (for msgtype=video) Video format, default "mp4" | |
| messageUrl | No | (for msgtype=link) URL to open when clicking the link | |
| picMediaId | No | (for msgtype=video) Cover image mediaId from upload_media | |
| singleTitle | No | (for msgtype=actionCard_single) Button title | |
| videoMediaId | No | (for msgtype=video) Video mediaId from upload_media | |
| btnOrientation | No | (for msgtype=actionCard_*) Button layout: 0=vertical, 1=horizontal |