| 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 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Add an agentInstance to an agentCollection.To add multiple agentInstance in batch, consider using JSON batching.
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]
POST /agentRegistry/agentInstances/{agentInstanceId}/collections/{agentCollectionId}/members/$ref| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON object that contains a @odata.id property with a reference by ID to an agentInstance.
If successful, this method returns a 204 No Content response code.
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]
The following example shows the response.
HTTP/1.1 204 No Content