---
title: "发布智能体"
method: POST
path: "/v3/agent/{agent_id}/publish"
tags: ["发布相关", "发布相关-internal"]
---

# 发布智能体

`POST /v3/agent/{agent_id}/publish`

## Request

- Base URL: `https://localhost:30777/api/agent-factory`
- URL: `https://localhost:30777/api/agent-factory/v3/agent/{agent_id}/publish`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/kweaver-ai/apis/agent-factory-api/docs/v3/agent/:agent_id/publish/post.ts> (a function with typed inputs; its response is checked against the schema)

可以通过提交已有的 agent_id 发布智能体，或者提交 agent_config 创建并发布智能体

## Path parameters

- `agent_id` string, required

## Request body

- ReleasereqUpdatePublishInfoReq
  - `category_ids` string[]: 分类IDs
  - `description` string: 发布描述
  - `pms_control` PmsvoPmsControlObjS
    - `app_account_ids` string[]: 应用账号ID列表
    - `department_ids` string[]: 部门ID列表
    - `role_ids` string[]: 角色ID列表
    - `user_group_ids` string[]: 用户组ID列表
    - `user_ids` string[]: 用户ID列表
  - `publish_to_bes` CdaenumPublishToBe[]: 发布为什么 ["skill_agent", "api_agent", "web_sdk_agent", "agent_tpl"]
  - `publish_to_where` DaenumPublishToWhere[]: 发布到的目标 ["square"]

## Response `201`

发布成功

- object

## Other responses

- `400`: 失败
- `401`: 失败
- `403`: 失败
- `404`: 失败
- `500`: 失败

---

[API](https://skmtc.dev/kweaver-ai/apis/agent-factory-api.md) - [All operations](https://skmtc.dev/kweaver-ai/apis/agent-factory-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kweaver-ai/apis/agent-factory-api/revisions/94c8acc695b9?raw)
