| title | Create contentActivity |
|---|---|
| toc.title | Create contentActivity |
| description | Create a content activity for the signed-in user. |
| author | kylemar |
| ms.date | 06/19/2025 |
| ms.localizationpriority | medium |
| ms.subservice | security |
| doc_type | apiPageType |
Namespace: microsoft.graph
Create a content activity for the signed-in user.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
POST /me/dataSecurityAndGovernance/activities/contentActivities[!INCLUDE me-apis-sign-in-note]
POST /users/{userId}/dataSecurityAndGovernance/activities/contentActivities| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of the contentActivity object.
If successful, this method returns a 201 Created response code and a contentActivity object in the response body.
The following example shows a request.
POST https://graph.microsoft.com/v1.0/me/dataSecurityAndGovernance/activities/contentActivities
Content-Type: application/json
{
"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"
}
}
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('7c497f10-cba8-4a8d-9449-db4b76d1ef80')/dataSecurityAndGovernance/activities/contentActivities/$entity",
"id": "4c3d1219-b1af-442f-85b5-06b7ef1cf8c8",
"userId": "7c497f10-cba8-4a8d-9449-db4b76d1ef80",
"scopeIdentifier": null,
"contentMetadata": {
"protectedAppMetadata": null,
"contentEntries": [
{
"identifier": "d6ab5054-e111-45c3-9fba-9f2a59c9bbf8",
"content": null,
"name": "CA Purview API Explorer message",
"correlationId": "edfb7f88-b963-4ef2-8b30-5cb90f80e01e",
"sequenceNumber": 0,
"length": null,
"isTruncated": false,
"createdDateTime": "2025-05-28T20:20:37Z",
"modifiedDateTime": "2025-05-28T20:20:37Z"
}
],
"activityMetadata": {
"activity": "downloadText"
},
"deviceMetadata": {
"deviceType": null,
"operatingSystemSpecifications": {
"operatingSystemPlatform": "Windows 11",
"operatingSystemVersion": "10.0.26100.0"
}
},
"integratedAppMetadata": {
"name": "CA Purview API Explorer",
"version": "0.1"
}
}
}