Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 3.3 KB

File metadata and controls

99 lines (73 loc) · 3.3 KB
title Add agentInstance to agentCollection
description Add an agentInstance to an agentCollection.
author jasondou
ms.date 11/14/2025
ms.localizationpriority medium
ms.subservice entra-id
doc_type apiPageType

Add agentInstance to agentCollection

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Add an agentInstance to an agentCollection.To add multiple agentInstance in batch, consider using JSON batching.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

Important

In addition to the permissions listed in the preceding table, the following lesser-privileged permissions scoped to the special collections are supported for this API:

  • For the Global collection: AgentCollection.ReadWrite.Global and AgentInstance.Read.All; AgentCollection.ReadWrite.Global and AgentInstance.ReadWrite.All
  • For the Quarantined collection: AgentCollection.ReadWrite.Quarantined and AgentInstance.Read.All; AgentCollection.ReadWrite.Quarantined and AgentInstance.ReadWrite.All

[!INCLUDE rbac-agentregistry-apis]

HTTP request

POST /agentRegistry/agentInstances/{agentInstanceId}/collections/{agentCollectionId}/members/$ref

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON object that contains a @odata.id property with a reference by ID to an agentInstance.

Response

If successful, this method returns a 204 No Content response code.

Examples

Request

The following example shows a request.

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')"
}

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 204 No Content