Delete attachment
Delete an attachment from a calendar event, mail message, or group post.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
- If accessing attachments in messages: Mail.ReadWrite.
- If accessing attachments in events: Calendars.ReadWrite.
- If accessing attachments in group posts: Group.ReadWrite.All.
HTTP request
Attachments for an event in the user's or group's default calendar.
DELETE /me/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/events/{id}/attachments/{id}
DELETE /me/calendar/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendar/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}
DELETE /me/calendargroup/calendars/{id}/events/{id}/attachments/{id}
DELETE /users/{id | userPrincipalName}/calendargroup/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
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.
Loading feedback...