命名空间:microsoft.graph
重要
Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
重要
即将推出的对代理注册表 API 的更改
从 2026 年 5 月开始,Microsoft Graph 中的代理注册表 API 将替换为由 Microsoft Agent 365 支持的代理注册表 API。 此更改整合了代理管理体验,以便更轻松地观察、管理和保护租户中的所有代理。 我们建议你计划在发布基于 Agent 365 的新 API 时迁移到它们。 详细了解代理注册表与 Microsoft Agent 365 的融合。
将 agentInstance 添加到 agentCollection。若要批量添加多个 agentInstance,请考虑使用 JSON 批处理。
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 | 最小特权权限 | 更高特权权限 |
|---|---|---|
| 委派(工作或学校帐户) | AgentCollection.ReadWrite.All 和 AgentInstance.Read.All | AgentCollection.ReadWrite.All 和 AgentInstance.ReadWrite.All |
| 委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
| 应用程序 | AgentCollection.ReadWrite.ManagedBy 和 AgentInstance.Read.All | AgentCollection.ReadWrite.All、AgentCollection.ReadWrite.ManagedBy 和 AgentInstance.Read.All、AgentCollection.ReadWrite.ManagedBy 和 AgentInstance.ReadWrite.All、AgentCollection.ReadWrite.ManagedBy 和 AgentInstance.ReadWrite.ManagedBy |
重要
除了上表中列出的权限外,此 API 还支持以下作用域为特殊集合的较低特权权限:
- 对于 全局 集合: AgentCollection.ReadWrite.Global 和 AgentInstance.Read.All; AgentCollection.ReadWrite.Global 和 AgentInstance.ReadWrite.All
- 对于 隔离的 集合: AgentCollection.ReadWrite.Quarantined 和 AgentInstance.Read.All; AgentCollection.ReadWrite.Quarantined 和 AgentInstance.ReadWrite.All
HTTP 请求
POST /agentRegistry/agentInstances/{agentInstanceId}/collections/{agentCollectionId}/members/$ref
请求标头
| 名称 | 说明 |
|---|---|
| Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| Content-Type | application/json. 必需。 |
请求正文
在请求正文中,提供一个 JSON 对象,该对象包含 @odata.id 属性,并通过 ID 引用 agentInstance。
响应
如果成功,此方法返回 204 No Content 响应代码。
示例
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/agentRegistry/agentInstances/{agentInstanceId}/collections/{agentCollectionId}/members/$ref
Content-Type: application/json
{
"@odata.id": "https://graph.microsoft.com/beta/agentRegistry/agentInstances('agent-instance-id')"
}
响应
以下示例显示了相应的响应。
HTTP/1.1 204 No Content