Delete an activity

Delete an existing user activity for your app.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) UserActivity.ReadWrite.CreatedByApp
Delegated (personal Microsoft account) UserActivity.ReadWrite.CreatedByApp
Application Not supported.

HTTP request

DELETE /me/activities/{id}

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Request body

No request body.

Response

If successful, this method returns the 204 No Content response code if the activity was deleted.

Example

Request

Here is an example of the request.

DELETE https://graph.microsoft.com/v1.0/me/activities/{activity-id}/
Response

Here is an example of the response.

HTTP/1.1 204 No Content

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

await graphClient.Me.Activities["{activity-id}"]
	.Request()
	.DeleteAsync();

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.