| title | Update agentIdentity |
|---|---|
| description | Update an agent identity . |
| author | zallison22 |
| ms.date | 02/26/2026 |
| ms.localizationpriority | medium |
| ms.subservice | entra-agent-id |
| doc_type | apiPageType |
Namespace: microsoft.graph
[!INCLUDE national-cloud-support]
Update the properties of an agentIdentity object.
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]
[!INCLUDE rbac-agentid-apis-write]
- To update the customSecurityAttributes property:
- In delegated scenarios, the admin must be assigned the Attribute Assignment Administrator role and the app granted the CustomSecAttributeAssignment.ReadWrite.All and AgentIdentity.ReadWrite.All delegated permissions.
- In app-only scenarios using Microsoft Graph permissions, the app must be granted the CustomSecAttributeAssignment.ReadWrite.All application permission.
PATCH /servicePrincipals/{id}/microsoft.graph.agentIdentity| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply the values for relevant fields that should be updated. Existing properties that aren't included in the request body maintains their previous values or be recalculated based on changes to other property values. For best performance you shouldn't include existing values that haven't changed.
If successful, this method returns a 204 No Content response code.
For information about errors returned by agent identity APIs, see Agent identity error codes.
The following example shows a request.
PATCH https://graph.microsoft.com/v1.0/servicePrincipals/{id}/microsoft.graph.agentIdentity
Content-type: application/json
{
"displayName": "My New Name"
}The following example shows the response.
HTTP/1.1 204 No Content