Get Job Session Metadata
Returns the metadata that defines a job session.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer editions with the Salesforce Shield or Data Detect Licenses. |
Example
curl https://MyDomainName.my.salesforce.com/services/data/v68.0/datadetect/policies/jobsession/{jobSessionId}/metadata -H "Authorization: Bearer token" -X GETExample REQUEST BODY
None required
Example 200 RESPONSE BODY
{
"jobSessionId": "0DJRM0000004Cff0AE",
"jobSessionName": "JS-0000000001",
"policyId": "0DDRM0000004Cff0AE",
"policyName": "Customer PII policy",
"scanType": "PatternMatch",
"jobStatus": "InProgress",
"sessionStartTime": "2026-08-31T10:15:00.000Z",
"sessionEndTime": null,
"runByUser": "005RM0000012ABCQAZ",
"stoppedBy": null,
"scheduleId": null,
"isResumable": false,
"createdDate": "2026-08-31T10:14:55.000Z",
"objectProgress": [
{
"jobObjectSessionId": "0DKRM0000004Cff0AE",
"objectSessionName": "OS-0000000001",
"objectApiName": "Contact",
"jobStatus": "Completed",
"sessionStartTime": "2026-08-31T10:15:05.000Z",
"sessionEndTime": "2026-08-31T10:17:30.000Z",
"scannedRecordsCount": 1500,
"numberOfAttempts": 1,
"lastScannedRecord": "003RM000000ABCDQAZ"
},
{
"jobObjectSessionId": "0DKRM0000004Cfg0AE",
"objectSessionName": "OS-0000000002",
"objectApiName": "Lead",
"jobStatus": "InProgress",
"sessionStartTime": "2026-08-31T10:17:31.000Z",
"sessionEndTime": null,
"scannedRecordsCount": 420,
"numberOfAttempts": 1,
"lastScannedRecord": "00QRM000000WXYZQAZ"
}
],
"facetErrors": []
}
Example 403 RESPONSE BODY
{
"errorCode": "FUNCTIONALITY_NOT_ENABLED", "message": "The DataDetect job session API is not enabled for your org."
}
Example 404 RESPONSE BODY
{
"errorCode": "RESOURCE_NOT_FOUND", "message": "No job session exists for the supplied ID."
}
Did this article solve your issue?
Let us know so we can improve!
