Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować się zalogować lub zmienić katalog.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Create a new agentIdentity object from the specified agent identity blueprint.
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.
| Permission type | Least privileged permission | Higher privileged permissions |
|---|---|---|
| Delegated (work or school account) | Not supported. | Not supported. |
| Delegated (personal Microsoft account) | Not supported. | Not supported. |
| Application | AgentIdentity.CreateAsManager, AgentIdentity.Create.All | Directory.ReadWrite.All |
Important
When using delegated permissions, the authenticated user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.
- Agent ID Administrator.
- Agent ID Developer - Create agent identity blueprints. The principal with this role is assigned ownership of the blueprint they create and can perform write operations on that blueprint.
HTTP request
POST /servicePrincipals/microsoft.graph.agentIdentity
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 representation of a agentIdentity object. The request body must contain displayName, agentIdentityBlueprintAppId, and a valid sponsor reference.
Response
If successful, this method returns a 201 Created response code and a agentIdentity object in the response body.
For information about errors returned by agent identity APIs, see Agent identity error codes.
Examples
Request
The following example shows a request.
POST https://graph.microsoft.com/beta/servicePrincipals/microsoft.graph.agentIdentity
Content-type: application/json
{
"displayName": "My Agent Identity",
"agentIdentityBlueprintId": "65415bb1-9267-4313-bbf5-ae259732ee12",
"sponsors@odata.bind": [
"https://graph.microsoft.com/v1.0/users/acc9f0a1-9075-464f-9fe7-049bf1ae6481",
"https://graph.microsoft.com/v1.0/groups/47309f33-e0ff-7be6-defe-28b504c8cd2e"
]
}
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#servicePrincipals/$entity",
"@odata.type": "#microsoft.graph.agentIdentity",
"id": "59e617e5-e447-4adc-8b88-00af644d7c92",
"createdByAppId": "f98c895e-6ce2-4f5b-a31b-da7e48f25daa",
"displayName": "My Agent Identit",
"servicePrincipalType": "ServiceIdentity",
"tags": [],
"agentIdentityBlueprintId": "65415bb1-9267-4313-bbf5-ae259732ee12"
}