# 发送后续消息 (/zh/api/agent/v2/send-message)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1161 · updated: 2026-07-30 -->

向现有代理任务发送后续指令。该消息会异步处理——请轮询 [获取代理任务](/zh/api/agent/v2/get-agent-job) 端点以跟踪进度。

<div id="rate-limits">
  ## 速率限制 [#速率限制]
</div>

* 每个 Mintlify 项目每小时最多可使用 100 次

<div id="usage">
  ## 用法 [#用法]
</div>

```bash
curl -X POST https://api.mintlify.com/v2/agent/{projectId}/job/{id}/message \
  -H "Authorization: Bearer mint_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Also add error handling examples to the quickstart guide"}'
```

`POST /v2/agent/{projectId}/job/{id}/message`

向现有代理任务发送后续消息。该消息将异步处理——请轮询 get job 端点以跟踪进度。

使用管理员 API 密钥进行身份验证。

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "projectId",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "你的项目 ID。可从你的控制台中的 [API keys](https://dashboard.mintlify.com/settings/organization/api-keys) 页面复制。"
    },
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "要向其发送消息的代理任务的唯一标识符。"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "prompt"
          ],
          "properties": {
            "prompt": {
              "type": "string",
              "minLength": 1,
              "description": "发送给代理的后续指令。"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "消息发送成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "代理任务的唯一标识符。"
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "completed",
                  "archived",
                  "failed"
                ],
                "description": "作业的当前状态。`active`——代理当前正在处理提示词。`completed`——代理已成功完成，并且可能已创建 PR（请检查 `prLink`）。`archived`——作业已归档。`failed`——代理遇到了不可恢复的错误。请持续轮询，直到状态变为 `completed`、`archived` 或 `failed`。"
              },
              "source": {
                "type": "object",
                "description": "源存储库信息。",
                "properties": {
                  "repository": {
                    "type": "string",
                    "description": "GitHub 存储库的完整 URL。"
                  },
                  "ref": {
                    "type": "string",
                    "description": "代理正在处理的 Git branch。",
                    "nullable": true
                  }
                }
              },
              "model": {
                "type": "string",
                "description": "此作业使用的 AI 模型。"
              },
              "prLink": {
                "type": "string",
                "format": "uri",
                "example": "https://github.com/org/repo/pull/123",
                "description": "由代理创建的 GitHub 拉取请求（PR；亦称“合并请求”/Merge Request）URL。作业仍处于 `active` 状态或没有文件变更时，该值为 `null`。代理成功创建 PR 后，此字段会被填充。",
                "nullable": true
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "description": "作业创建时的时间戳。"
              },
              "archivedAt": {
                "type": "string",
                "format": "date-time",
                "description": "作业归档时的时间戳。",
                "nullable": true
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "无效请求",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "错误消息。"
              }
            }
          }
        }
      }
    },
    "404": {
      "description": "未找到作业",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "错误消息。"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "超出速率限制",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "错误消息。"
              }
            }
          }
        }
      }
    }
  }
}
```
