ContentActivity.Write
Allows the application to upload bulk contents activity audit logs to the audit store.
Permission Details
Upload content activity audit logs to the audit store.
Allows the application to upload bulk contents activity audit logs to the audit store.
2932e07a-3c29-44e4-bb36-6d0fc176387f
Upload contents activity audit logs to the audit store.
Allows the application to upload bulk contents activity audit logs to the audit store.
948caae6-152a-48cd-a746-4844af30e8e9
Properties
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
JSON representation is shown from stable Microsoft Graph v1.0 metadata.
{
"@odata.type": "#microsoft.graph.contentActivity",
"id": "String (identifier)",
"userId": "String",
"scopeIdentifier": "String",
"contentMetadata": {
"@odata.type": "microsoft.graph.processContentRequest"
}
}
Relationships
Relationships is shown from stable Microsoft Graph v1.0 metadata.
| Relationship | Type | Description |
|---|---|---|
contentMetadata |
processContentRequest |
Related contentMetadata data exposed by this resource. |
Graph Methods
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
|
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
|
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 docsMicrosoft 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 docsCode Examples
// 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);
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);
Connect-MgGraph -Scopes "ContentActivity.Write"
Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/me/dataSecurityAndGovernance/activities/contentActivities"
# 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
Navigate to Azure Portal
Go to App registrations in Microsoft Entra admin center
Add API Permission
Select your app → API permissions → Add a permission → Microsoft Graph
Select Permission Type
Choose Application permissions or delegated permissions and search for ContentActivity.Write
Grant Admin Consent
Application permissions always require admin consent.