ESC
Type to search...

ContentActivity.Write

Export JSON
Export CSV
Copy URL
Print
ApplicationDelegated Write User Scope

Allows the application to upload bulk contents activity audit logs to the audit store.

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

Permission Details

Application Permission

Upload content activity audit logs to the audit store.

Allows the application to upload bulk contents activity audit logs to the audit store.

Delegated Permission Admin consent required

Upload contents activity audit logs to the audit store.

Allows the application to upload bulk contents activity audit logs to the audit store.

Properties

Microsoft Graph v1.0 exact-category-docs

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

Property Type Description
contentMetadata processContentRequest Defines the input payload. It includes the relevant metadata about the activity, device, and integrated application.
id String Unique identifier.
scopeIdentifier StringNullable The scope identified from computed protection scopes.
userId StringNullable ID of the user.

JSON Representation

Microsoft Graph v1.0 exact-category-docs

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

JSON representation
{
  "@odata.type": "#microsoft.graph.contentActivity",
  "id": "String (identifier)",
  "userId": "String",
  "scopeIdentifier": "String",
  "contentMetadata": {
    "@odata.type": "microsoft.graph.processContentRequest"
  }
}

Relationships

Microsoft Graph v1.0 schema-derived

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

Relationship Type Description
contentMetadata processContentRequest Related contentMetadata 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
POST /me/dataSecurityAndGovernance/activities/contentActivities
POST /users/{userId}/dataSecurityAndGovernance/activities/contentActivities
Exact Microsoft Learn match

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

Methods
POST /me/dataSecurityAndGovernance/activities/contentActivities
POST /users/{userId}/dataSecurityAndGovernance/activities/contentActivities
No Microsoft Learn PowerShell mapping available

Microsoft Graph PowerShell v1.0 commands are not available from refreshed Microsoft Learn PowerShell snippets for this permission.

No deterministic PowerShell command map is available for this permission.

Browse PowerShell docs
No Microsoft Learn PowerShell mapping available

Microsoft Graph PowerShell beta commands are not available from refreshed Microsoft Learn PowerShell snippets for this permission.

No deterministic PowerShell command map is available for this permission.

Browse PowerShell docs

Code Examples

C# / .NET SDK
Create contentActivity
// Code snippets are only available for the latest version. Current version is 5.x

// Dependencies
using Microsoft.Graph.Models;
using Microsoft.Kiota.Abstractions.Serialization;

var requestBody = new ContentActivity
{
	AdditionalData = new Dictionary<string, object>
	{
		{
			"contentToProcess" , new UntypedObject(new Dictionary<string, UntypedNode>
			{
				{
					"contentEntries", new UntypedArray(new List<UntypedNode>
					{
						new UntypedObject(new Dictionary<string, UntypedNode>
						{
							{
								"@odata.type", new UntypedString("microsoft.graph.processConversationMetadata")
							},
							{
								"identifier", new UntypedString("07785517-9081-4fe7-a9dc-85bcdf5e9075")
							},
							{
								"name", new UntypedString("PC Purview API Explorer message")
							},
							{
								"correlationId", new UntypedString("d63eafd2-e3a9-4c1a-b726-a2e9b9d9580d")
							},
							{
								"sequenceNumber", new UntypedString("0")
							},
							{
								"isTruncated", new UntypedBoolean(false)
							},
							{
								"createdDateTime", new UntypedString("2025-05-27T17:23:20")
							},
							{
								"modifiedDateTime", new UntypedString("2025-05-27T17:23:20")
							},
						}),
					})
				},
				{
					"activityMetadata", new UntypedObject(new Dictionary<string, UntypedNode>
					{
						{
							"activity", new UntypedString("uploadText")
						},
					})
				},
				{
					"deviceMetadata", new UntypedObject(new Dictionary<string, UntypedNode>
					{
						{
							"operatingSystemSpecifications", new UntypedObject(new Dictionary<string, UntypedNode>
							{
								{
									"operatingSystemPlatform", new UntypedString("Windows 11")
								},
								{
									"operatingSystemVersion", new UntypedString("10.0.26100.0")
								},
							})
						},
						{
							"ipAddress", new UntypedString("127.0.0.1")
						},
					})
				},
				{
					"protectedAppMetadata", new UntypedObject(new Dictionary<string, UntypedNode>
					{
						{
							"name", new UntypedString("PC Purview API Explorer")
						},
						{
							"version", new UntypedString("0.2")
						},
						{
							"applicationLocation", new UntypedObject(new Dictionary<string, UntypedNode>
							{
								{
									"@odata.type", new UntypedString("microsoft.graph.policyLocationApplication")
								},
								{
									"value", new UntypedString("83ef208a-0396-4893-9d4f-d36efbffc8bd")
								},
							})
						},
					})
				},
				{
					"integratedAppMetadata", new UntypedObject(new Dictionary<string, UntypedNode>
					{
						{
							"name", new UntypedString("PC Purview API Explorer")
						},
						{
							"version", new UntypedString("0.2")
						},
					})
				},
			})
		},
	},
};

// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.DataSecurityAndGovernance.Activities.ContentActivities.PostAsync(requestBody);
JavaScript
Create contentActivity
const options = {
	authProvider,
};

const client = Client.init(options);

const contentActivity = {
    contentToProcess: {
       contentEntries: [
          {
             '@odata.type': 'microsoft.graph.processConversationMetadata',
             identifier: '07785517-9081-4fe7-a9dc-85bcdf5e9075',
             name: 'PC Purview API Explorer message',
             correlationId: 'd63eafd2-e3a9-4c1a-b726-a2e9b9d9580d',
             sequenceNumber: 0, 
             isTruncated: false,
             createdDateTime: '2025-05-27T17:23:20',
             modifiedDateTime: '2025-05-27T17:23:20'
          }
       ],
       activityMetadata: { 
          activity: 'uploadText'
       },
       deviceMetadata: {
          operatingSystemSpecifications: {
             operatingSystemPlatform: 'Windows 11',
             operatingSystemVersion: '10.0.26100.0' 
          },
          ipAddress: '127.0.0.1'
       },
       protectedAppMetadata: {
          name: 'PC Purview API Explorer',
          version: '0.2',
          applicationLocation: {
             '@odata.type': 'microsoft.graph.policyLocationApplication',
             value: '83ef208a-0396-4893-9d4f-d36efbffc8bd'
          }
       },
       integratedAppMetadata: {
          name: 'PC Purview API Explorer',
          version: '0.2' 
       }
    }
};

await client.api('/me/dataSecurityAndGovernance/activities/contentActivities')
	.post(contentActivity);
PowerShell
Connect-MgGraph -Scopes "ContentActivity.Write"
Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/me/dataSecurityAndGovernance/activities/contentActivities"
Python
Create contentActivity
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.content_activity import ContentActivity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ContentActivity(
	additional_data = {
			"content_to_process" : {
					"content_entries" : [
						{
								"@odata_type" : "microsoft.graph.processConversationMetadata",
								"identifier" : "07785517-9081-4fe7-a9dc-85bcdf5e9075",
								"name" : "PC Purview API Explorer message",
								"correlation_id" : "d63eafd2-e3a9-4c1a-b726-a2e9b9d9580d",
								"sequence_number" : 0,
								"is_truncated" : False,
								"created_date_time" : "2025-05-27T17:23:20",
								"modified_date_time" : "2025-05-27T17:23:20",
						},
					],
					"activity_metadata" : {
							"activity" : "uploadText",
					},
					"device_metadata" : {
							"operating_system_specifications" : {
									"operating_system_platform" : "Windows 11",
									"operating_system_version" : "10.0.26100.0",
							},
							"ip_address" : "127.0.0.1",
					},
					"protected_app_metadata" : {
							"name" : "PC Purview API Explorer",
							"version" : "0.2",
							"application_location" : {
									"@odata_type" : "microsoft.graph.policyLocationApplication",
									"value" : "83ef208a-0396-4893-9d4f-d36efbffc8bd",
							},
					},
					"integrated_app_metadata" : {
							"name" : "PC Purview API Explorer",
							"version" : "0.2",
					},
			},
	}
)

result = await graph_client.me.data_security_and_governance.activities.content_activities.post(request_body)

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 Application permissions or delegated permissions and search for ContentActivity.Write

4

Grant Admin Consent

Application permissions always require admin consent.