Bulk Delete Recordings for specific users

Hello, I by no means am a developer, trying to wrap my head around some of this stuff. I've been tasked with trying to delete recordings of certain users within Genesys. I think from the API explorer, I created the below. I just don't know what it will do when i execute? or what my testing should be, if this is even correct?

I'm trying to delete all recordings from a particular user, i technically have 6 users to delete recordings from, but want to get one done at a time i guess.

{
"action": "DELETE",
"actionDate": "2024-02-21T12:00:00.000Z",
"includeRecordingsWithSensitiveData": true,
"includeScreenRecordings": true,
"conversationQuery": {
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "userId",
"propertyType": "string",
"value": "6ffaab96-3250-484f-a98b-4d869ef8194e",
"operator": "matches"
}
]
}
],
"order": "asc",
"orderBy": "conversationStart",
"interval": "2023-10-01T11:00:00.000Z/2024-02-20T12:00:00.000Z",
"startOfDayIntervalMatching": true
}
}

I assume you're using POST /api/v2/recording/jobs?

It will invoke a recording job. There's a tutorial of this process here: https://developer.genesys.cloud/analyticsdatamanagement/recording/recordings-bulk-action

Use the conversation query from your request in an analytics conversation detail query, adding the same interval and a segment filter for recording exists. That will identify the recorded conversations that the recording job will target. You can then fetch the recordings for them to establish that they exist and you can access them. Then run the recording job. Once it's done, try to retrieve those recordings again to validate that the operation worked as expected.

Thank you Tim, I was able to use
/api/v2/analytics/conversations/details/query to get hits on a user for a 31 day period.

I put in same time frame to the recording job query and it's telling me my log in credentials are bad? I'm logged into the dev center.

Your access token may be expired. If you add the account in that region again, it should work. If you continue to get an error, please share the exact response code and body you're getting.

ok thanks, I now am getting 202 code response. Looks to be pending state. - but looks to be 0 recordings..
{
"id": "7051a836-e36a-495a-bcab-8ec042891101",
"state": "PENDING",
"recordingJobsQuery": {
"action": "DELETE",
"actionDate": "2024-02-21T12:00:00Z",
"includeRecordingsWithSensitiveData": false,
"includeScreenRecordings": true
},
"dateCreated": "2024-02-21T15:53:12.826Z",
"totalConversations": 0,
"totalRecordings": 0,
"totalSkippedRecordings": 0,
"totalFailedRecordings": 0,
"totalProcessedRecordings": 0,
"percentProgress": 0,
"selfUri": "/api/v2/recording/jobs/7051a836-e36a-495a-bcab-8ec042891101",
"user": {
"id": "c8629446-9df4-4ef2-b250-0b55f72ba631",
"selfUri": "/api/v2/users/c8629446-9df4-4ef2-b250-0b55f72ba631"
}
}

I found 73 with this interval string - 2024-01-01T13:00:00.000Z/2024-02-01T01:00:00.000Z with the other API.

Check to make sure your query and interval are correct on the job. If the data returned by the API doesn't seem correct, please open a case with Genesys Cloud Care to investigate. We do not have access to your org's data via the forum to validate/investigate API results.

Also, wait until the job is completed. I'm not certain if those counts are conversations it will act on or conversations it has acted on.

ok Thank you so much for your help!

Not sure if you sorted now, and how you intend to do it but I had to do exactly same thing.

I used powershell7 and the GC.exe tool.
Created a CSV file of the userIds I needed to remove for.

  1. Script reads a csv of agents Ids that needed recordings deleted.
  2. Created the JSON payload (Query above) for each dynamically and saved to a file in a folder
  3. Loop over those files in folder to process with GC.EXE tool for the recordings part.

Loop makes calls to GC, you need to check the response JSON for processing state, examples below:

gc.exe recording jobs create -f $file.FullName -p $ProfileName 2>&1 | Set-Variable -Name response

Loop to get job state ready for next stage (with a short sleep of say 5 seconds between requests)
gc.exe recording jobs get $thisJobId -p $ProfileName 2>&1 | Set-Variable -Name jobResponse

You need to check the $jobResponse.state for "READY"

When READY you need to Update job with:

gc.exe recording jobs update $thisJobId -p $ProfileName -f "..\state.json" 2>&1 | Set-Variable -Name jobResponse

The state.json file has a simple request payload of:

{
	"state": "PROCESSING"
}

Another loop to check if job fullfilled as well:
gc.exe recording jobs get $thisJobId -p $ProfileName 2>&1 | Set-Variable -Name jobResponse

You need to check the $jobResponse.state for "FULLFILLED" to know done.

One Note: Pretty sure you CANNOT DELETE recordings with

"includeRecordingsWithSensitiveData": true

only EXPORT

Thank you Simon, I shouldn't have too many to go through. I was able to make my way through the API's getting information Job's created for user and am going through deleting and verifying

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.