ESC
Type to search...

UserActivity.ReadWrite.CreatedByApp

Export JSON
Export CSV
Copy URL
Print
Delegated Read/Write User Scope

Allows the app to read and report the signed-in user's activity in the app.

Permission data: April 6, 2026 at 4:06 AM UTC
Delegated Access App-Only Access

Permission Details

Delegated Permission User consent allowed

Read and write app activity to users' activity feed

Allows the app to read and report the signed-in user's activity in the app.

Properties

Microsoft Graph v1.0 exact-category

Properties is shown from stable Microsoft Graph v1.0 metadata.

Property Type Description
activationUrl string Required. URL used to launch the activity in the best native experience represented by the appId. Might launch a web-based app if no native app exists.
activitySourceHost string Required. URL for the domain representing the cross-platform identity mapping for the app. Mapping is stored either as a JSON file hosted on the domain or configurable via Windows Dev Center. The JSON file is named cross-platform-app-identifiers and is hosted at root of your HTTPS domain, either at the top level domain or include a sub domain. For example: https://contoso.com or https://myapp.contoso.com but NOT https://myapp.contoso.com/somepath. You must have a unique file and domain (or sub domain) per cross-platform app identity. For example, a separate file and domain is needed for Word vs. PowerPoint.
appActivityId string Required. The unique activity ID in the context of the app - supplied by caller and immutable thereafter.
appDisplayName stringNullable Optional. Short text description of the app used to generate the activity for use in cases when the app is not installed on the user’s local device.
contentInfo object Optional. A custom piece of data - JSON-LD extensible description of content according to schema.org syntax.
contentUrl stringNullable Optional. Used in the event the content can be rendered outside of a native or web-based app experience (for example, a pointer to an item in an RSS feed).
createdDateTime date-timeNullable Set by the server. DateTime in UTC when the object was created on the server.
expirationDateTime date-timeNullable Set by the server. DateTime in UTC when the object expired on the server.
fallbackUrl stringNullable Optional. URL used to launch the activity in a web-based app, if available.
historyItems activityHistoryItem collection Optional. NavigationProperty/Containment; navigation property to the activity's historyItems.
id string The unique identifier for an entity. Read-only.
lastModifiedDateTime date-timeNullable Set by the server. DateTime in UTC when the object was modified on the server.
status object Set by the server. A status code used to identify valid objects. Values: active, updated, deleted, ignored.
userTimezone stringNullable Optional. The timezone in which the user's device used to generate the activity was located at activity creation time; values supplied as Olson IDs in order to support cross-platform representation.
visualElements visualInfo

JSON Representation

Microsoft Graph v1.0 exact-category

JSON representation is shown from stable Microsoft Graph v1.0 metadata.

JSON representation
{
  "activationUrl": "String",
  "activitySourceHost": "String",
  "appActivityId": "String",
  "appDisplayName": "String",
  "contentInfo": {
    "sample": "value"
  },
  "contentUrl": "String",
  "createdDateTime": "2026-01-01T00:00:00Z",
  "expirationDateTime": "2026-01-01T00:00:00Z",
  "fallbackUrl": "String",
  "historyItems": [
    {
      "@type": "activityHistoryItem",
      "id": "00000000-0000-0000-0000-000000000000"
    }
  ],
  "id": "String",
  "lastModifiedDateTime": "2026-01-01T00:00:00Z",
  "status": {
    "sample": "value"
  },
  "userTimezone": "String",
  "visualElements": {
    "@type": "visualInfo",
    "id": "00000000-0000-0000-0000-000000000000"
  }
}

Relationships

Microsoft Graph v1.0 schema-derived

Relationships is shown from stable Microsoft Graph v1.0 metadata.

Relationship Type Description
historyItems activityHistoryItem collection Optional. NavigationProperty/Containment; navigation property to the activity's historyItems.
visualElements visualInfo Related visualElements data exposed by this resource.

Graph Methods

Delegated access App-only access
Exact Microsoft Learn match

Microsoft Graph v1.0 endpoints are mapped directly from refreshed Microsoft Learn permissions tables.

Methods
GET /me/activities
GET /me/activities/recent
PUT /me/activities/{appActivityId}
PUT /me/activities/{id}/historyItems/{id}
DELETE /me/activities/{id}
DELETE /me/activities/{id}/historyItems/{id}
Exact Microsoft Learn match

Microsoft Graph beta endpoints are mapped directly from refreshed Microsoft Learn permissions tables.

Methods
GET /me/activities
GET /me/activities/recent
PUT /me/activities/{appActivityId}
PUT /me/activities/{id}/historyItems/{id}
DELETE /me/activities/{id}
DELETE /me/activities/{id}/historyItems/{id}
Exact Microsoft Learn PowerShell match

Microsoft Graph PowerShell v1.0 commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.

Commands
Get-MgUserActivity /me/activities
Get user activities
Invoke-MgRecentUserActivity /me/activities/recent
Get recent user activities
Remove-MgUserActivity /me/activities/{id}
Delete an activity
Remove-MgUserActivityHistoryItem /me/activities/{id}/historyItems/{id}
Delete an activityHistoryItem
Exact Microsoft Learn PowerShell match

Microsoft Graph PowerShell beta commands are mapped directly from refreshed Microsoft Learn PowerShell snippets.

Commands
Remove-MgBetaUserActivity /me/activities/{id}
Delete an activity

Code Examples

C# / .NET SDK
Delete an activity
// Code snippets are only available for the latest version. Current version is 5.x

// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.Activities["{userActivity-id}"].DeleteAsync();
JavaScript
Create or replace an activity
const options = {
	authProvider,
};

const client = Client.init(options);

const userActivity = {
  activitySourceHost: 'https://contoso.com',
  createdDateTime: '2017-06-09T20:54:43.969Z',
  lastModifiedDateTime: '2017-06-09T20:54:43.969Z',
  id: '14332800362997268276',
  appActivityId: '/article?12345',
  status: 'updated',
  expirationDateTime: '2017-02-26T20:20:48.114Z',
  visualElements: {
    displayText: 'Contoso How-To: How to Tie a Reef Knot',
    description: 'How to Tie a Reef Knot. A step-by-step visual guide to the art of nautical knot-tying.',
    attribution: {
      iconUrl: 'https://www.contoso.com/icon',
      alternateText: 'Contoso Ltd',
      addImageQuery: false
    },
    backgroundColor: '#ff0000',
    content: {
      '$schema': 'https://adaptivecards.io/schemas/adaptive-card.json',
      type: 'AdaptiveCard',
      body: [
        {
          type: 'TextBlock',
          text: 'Contoso MainPage'
        }
      ]
    }
  },
  activationUrl: 'https://www.contoso.com/article?id=12345'
};

await client.api('/me/activities/3F12345')
	.put(userActivity);
PowerShell
Delete an activity
Import-Module Microsoft.Graph.CrossDeviceExperiences
# A UPN can also be used as -UserId.
Remove-MgUserActivity -UserId $userId -UserActivityId $userActivityId
Python
Delete an activity
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python

await graph_client.me.activities.by_user_activity_id('userActivity-id').delete()

App Registration

1

Navigate to Azure Portal

Go to App registrations in Microsoft Entra admin center

2

Add API Permission

Select your app → API permissions → Add a permission → Microsoft Graph

3

Select Permission Type

Choose Delegated permissions and search for UserActivity.ReadWrite.CreatedByApp

4

Grant Admin Consent

Users can consent to this permission during sign-in.