Skip to content

Latest commit

 

History

History
131 lines (95 loc) · 5.16 KB

File metadata and controls

131 lines (95 loc) · 5.16 KB
title Delete profilePhoto
description Delete the photo for the signed-in user or the specified group.
ms.localizationpriority medium
author kristinmcleod
ms.subservice people
doc_type apiPageType
ms.date 08/08/2024

Delete profilePhoto

Namespace: microsoft.graph

Delete the photo for the signed-in user or the specified group.

Note

The delete operation supports only user or group photos, but not Outlook contact nor Teams photos.

[!INCLUDE national-cloud-support]

Permissions

The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

To delete the profile photo of the signed-in user

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ProfilePhoto.ReadWrite.All User.ReadWrite, User.ReadWrite.All
Delegated (personal Microsoft account) User.ReadWrite Not supported.
Application ProfilePhoto.ReadWrite.All User.ReadWrite.All

To delete the profile photo of a group

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ProfilePhoto.ReadWrite.All Group.ReadWrite.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application ProfilePhoto.ReadWrite.All Group.ReadWrite.All

Note

  • Global admins, User admins, and People admins can delete the photo of any user in the organization using delegated permissions. This operation also supports application permissions. Deleting the photo of any user in the organization requires ProfilePhoto.ReadWrite.All or User.ReadWrite.All permissions. Deleting the photo of the signed-in user only requires User.ReadWrite permissions.

HTTP request

To delete a user's profile photo:

DELETE /me/photo/$value
DELETE /users/{id | userPrincipalName}/photo/$value

To delete a group photo:

DELETE /groups/{id}/photo/$value

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code.

Examples

Request

The following example shows a request.

DELETE https://graph.microsoft.com/v1.0/me/photo/$value

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

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

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

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

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

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

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


Response

The following example shows the response.

HTTP/1.1 200 OK