Namespace: microsoft.graph
Deletes a personAnnotation object from a user's profile.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
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 permissions |
Higher privileged permissions |
Delegated (work or school account) |
User.Read |
User.Read.All, User.ReadBasic.All, User.ReadWrite, User.ReadWrite.All |
Delegated (personal Microsoft account) |
User.Read |
User.ReadWrite |
Application |
Not supported. |
Not supported. |
HTTP request
DELETE /me/profile/notes/{id}
DELETE /users/{id | userPrincipalName}/profile/notes/{id}
Request body
Don't supply a request body for this method.
Response
If successful, this method returns a 204 No Content
response code.
Examples
Request
DELETE https://graph.microsoft.com/beta/users/{userId}/profile/notes/{id}
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Users["{user-id}"].Profile.Notes["{personAnnotation-id}"].DeleteAsync();
mgc-beta users profile notes delete --user-id {user-id} --person-annotation-id {personAnnotation-id}
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Users().ByUserId("user-id").Profile().Notes().ByPersonAnnotationId("personAnnotation-id").Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.users().byUserId("{user-id}").profile().notes().byPersonAnnotationId("{personAnnotation-id}").delete();
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/users/{userId}/profile/notes/{id}')
.version('beta')
.delete();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$graphServiceClient->users()->byUserId('user-id')->profile()->notes()->byPersonAnnotationId('personAnnotation-id')->delete()->wait();
Import-Module Microsoft.Graph.Beta.People
Remove-MgBetaUserProfileNote -UserId $userId -PersonAnnotationId $personAnnotationId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
await graph_client.users.by_user_id('user-id').profile.notes.by_person_annotation_id('personAnnotation-id').delete()
Response
HTTP/1.1 204 No Content