Delete attachment
Namespace: microsoft.graph
Delete an attachment from a user calendar event, mail message, or group post.
Permissions
Depending on the resource (event, message, outlookTask, or post) that the attachment is attached to and the permission type (delegated or application) requested, the permission specified in the following table is the least privileged required to call this API. To learn more, including taking caution before choosing more privileged permissions, search for the following permissions in Permissions.
| Supported resource | Delegated (work or school account) | Delegated (personal Microsoft account) | Application |
|---|---|---|---|
| event | Calendars.ReadWrite | Calendars.ReadWrite | Calendars.ReadWrite |
| message | Mail.ReadWrite | Mail.ReadWrite | Mail.ReadWrite |
| post | Group.ReadWrite.All | Not supported | Not supported |
HTTP request
Attachments for an event in the user's default calendar.
DELETE /me/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/events/{id}/attachments/{id}
DELETE /me/calendar/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendar/events/{id}/attachments/{id}
Attachments for an event in the specified calendar belonging to the user.
DELETE /me/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendars/{id}/events/{id}/attachments/{id}
Attachments for an event in a calendar belonging to the user's default calendarGroup.
DELETE /me/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendars/{id}/events/{id}/attachments/{id}
Attachments for an event in a calendar belonging to a user's calendarGroup.
DELETE /me/calendargroups/{id}/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendargroups/{id}/calendars/{id}/events/{id}/attachments/{id}
Attachments for a message in a user's mailbox.
DELETE /me/messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/messages/{id}/attachments/{id}
Attachments for a message contained in a top level mailFolder in a user's mailbox.
DELETE /me/mailFolders/{id}/messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/attachments/{id}
Attachments for a message contained in a child folder of a mailFolder in a user's mailbox. The example below shows one level of nesting, but a message can be located in a child of a child and so on.
DELETE /me/mailFolders/{id}/childFolders/{id}/.../messages/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/mailFolders/{id}/childFolders/{id}/messages/{id}/attachments/{id}
Attachments for a post in a thread belonging to a conversation of a group.
DELETE /groups/{id}/threads/{id}/posts/{id}/attachments/{id}
DELETE /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/attachments/{id}
Request headers
| Name | Type | Description |
|---|---|---|
| Authorization | string | Bearer {token}. Required. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns 204 No Content response code. It does not return anything in the response body.
Example
Request
Here is an example of the request to delete an attachment on an event.
DELETE https://graph.microsoft.com/v1.0/me/events/{id}/attachments/{id}
Response
Here is an example of the response.
HTTP/1.1 204 No Content
Feedback
Submit and view feedback for