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.
This API is available in the following national cloud deployments.
Global service | US Government L4 | US Government L5 (DOD) | China operated by 21Vianet |
---|---|---|---|
✅ | ✅ | ✅ | ✅ |
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 the 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) | User.ReadWrite | User.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | User.ReadWrite.All | Not supported. |
To delete the profile photo of a group
Permission type | Least privileged permissions | Higher privileged permissions |
---|---|---|
Delegated (work or school account) | Group.ReadWrite.All | Not supported. |
Delegated (personal Microsoft account) | Not supported. | Not supported. |
Application | Not supported. | Not supported. |
Note
- An app with only application permissions cannot delete a group's photo.
- Global and user 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 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.
Response
The following example shows the response.
HTTP/1.1 200 OK
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for