更新Agent
更新时间:2026-07-14
更新Agent
- 更新 Agent 描述或 OAuth2 回调白名单。名称不可修改;allowedResourceOauth2ReturnUrls 为全量替换模式,传入即覆盖原有白名单。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1POST /v{version}/agent-identity/agent/update HTTP/1.1
2Host: identity.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其他特殊头域
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号 |
| agentId | String | 是 | RequestBody参数 | Agent ID |
| description | String | 否 | RequestBody参数 | 新的描述,1-128 字符 |
| allowedResourceOauth2ReturnUrls | List |
否 | RequestBody参数 | OAuth2 回调 URL 白名单列表,最多 10 个(全量替换) |
返回状态码
成功返回200,失败返回见错误码
返回头域
除公共头域外,无其他特殊头域
返回参数
AgentDTO 对象
| 参数名称 | 类型 | 描述 |
|---|---|---|
| id | String | Agent ID |
| bceDomainId | String | BCE 账户 ID |
| bceUserId | String | BCE 用户 ID |
| name | String | Agent 名称 |
| description | String | Agent 描述 |
| extra | String | 扩展信息 |
| allowedResourceOauth2ReturnUrls | List |
OAuth2 回调 URL 白名单列表 |
| createdAt | DateTime | 创建时间 |
| updatedAt | DateTime | 更新时间 |
请求示例
Plain Text
1{
2 "agentId": "ag-xxxxxxxxxx",
3 "description": "更新后的描述",
4 "allowedResourceOauth2ReturnUrls": [
5 "https://my-app.example.com/oauth2/callback"
6 ]
7}
返回示例
Plain Text
1{
2 "id": "string",
3 "bceDomainId": "string",
4 "bceUserId": "string",
5 "name": "string",
6 "description": "string",
7 "extra": "string",
8 "allowedResourceOauth2ReturnUrls": ["string"],
9 "createdAt": "string",
10 "updatedAt": "string"
11}
评价此篇文章
