---
title: "通过机器人发送消息"
method: POST
path: "/api/v1/platform/bots/{bot_uuid}/send_message"
tags: ["Bots"]
---

# 通过机器人发送消息

`POST /api/v1/platform/bots/{bot_uuid}/send_message`

通过指定的机器人向目标发送消息。仅支持 API Key 认证。

## Path parameters

- `bot_uuid` string, uuid, required

## Request body

- object
  - `target_type` 'person' | 'group', required — 目标类型
  - `target_id` string, required — 目标 ID（用户 ID 或群组 ID）
  - `message_chain` object[], required — 消息链
    - `type` 'Plain' | 'Image' | 'At' | 'Voice' — 消息元素类型
    - `text` string — 文本内容（Plain 类型）
    - `url` string — 图片 URL（Image 类型）
    - `target` string — @ 的目标 ID（At 类型）

## Response `200`

发送成功

- object
  - `code` integer
  - `data` object
    - `sent` boolean

## Other responses

- `400` — 参数错误

---

[API](https://skmtc.dev/langbot/apis/langbot-service-api.md) · [All operations](https://skmtc.dev/langbot/apis/langbot-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/langbot/langbot-service-api/revisions/2384dee8c36a/schema)
