Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Bulk Delete API

    Posted 7 hours ago
    Edited by Kieran McCormick 7 hours ago

    Hi all

    Trying to delete some recordings which slipped through our deletions policies. I have used the bulk delete API in the past successfully, but didn't keep the Data Actions I created at the time. Now when I try it, I am not quite getting there.

    My API payload (for /api/v2/recording/jobs - POST) - to delete recordings of calls to a particular DNIS: 

    {
      "action": "DELETE",
      "actionDate": "2026-04-16T12:45:00.000Z",
      "includeRecordingsWithSensitiveData": false,
      "includeScreenRecordings": true,
      "clearExport": false,
      "conversationQuery": {
        "segmentFilters": [
          {
            "type": "or",
            "predicates": [
              {
                "type": "dimension",
                "dimension": "dnis",
                "operator": "matches",
                "value": "+441234567890"
              }
            ]
          }
        ],
        "interval": "2026-03-31T23:00:00.000Z/2026-04-29T23:00:00.000Z"
      }
    }

    ...giving me job ID 3f91e391-38bd-4ae0-9bdf-6cc5a736f215. If I GET the status (/api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215 - GET), i see: 

      "recordingJobsQuery.conversationQuery.interval": "2026-03-31T23:00:00.000Z/2026-04-29T23:00:00.000Z",
      "recordingJobsQuery.includeSnippetRecordings": true,
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.type": [
        [
          "dimension"
        ]
      ],
      "recordingJobsQuery.clearExport": false,
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.value": [
        [
          "+441234567890"
        ]
      ],
      "recordingJobsQuery.conversationQuery.segmentFilters.type": [
        "or"
      ],
      "dateCreated": "2026-04-16T12:21:04.917Z",
      "percentProgress": 0,
      "totalSkippedRecordings": 0,
      "totalFailedRecordings": 0,
      "id": "3f91e391-38bd-4ae0-9bdf-6cc5a736f215",
      "state": "READY",
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.operator": [
        [
          "matches"
        ]
      ],
      "recordingJobsQuery.includePolicyBasedRecordings": true,
      "totalProcessedRecordings": 0,
      "user.selfUri": "/api/v2/users/9dd7cad4-6ec5-42bb-80a6-0b0882c797df",
      "recordingJobsQuery.action": "DELETE",
      "user.id": "9dd7cad4-6ec5-42bb-80a6-0b0882c797df",
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.dimension": [
        [
          "dnis"
        ]
      ],
      "totalConversations": 3,
      "selfUri": "/api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215",
      "recordingJobsQuery.actionDate": "2026-04-16T12:45:00Z",
      "totalRecordings": 3,
      "recordingJobsQuery.includeRecordingsWithSensitiveData": false,
      "recordingJobsQuery.includeScreenRecordings": true,
      "recordingJobsQuery.conversationQuery.startOfDayIntervalMatching": false
    Then when I execute the job the delete the recordings in that job ID (/api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215 - PUT), I see:
    "recordingJobsQuery.conversationQuery.interval": "2026-03-31T23:00:00.000Z/2026-04-29T23:00:00.000Z",
      "recordingJobsQuery.includeSnippetRecordings": true,
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.type": [
        [
          "dimension"
        ]
      ],
      "recordingJobsQuery.clearExport": false,
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.value": [
        [
          "+441234567890"
        ]
      ],
      "recordingJobsQuery.conversationQuery.segmentFilters.type": [
        "or"
      ],
      "dateCreated": "2026-04-16T12:21:04.917Z",
      "percentProgress": 100,
      "totalSkippedRecordings": 0,
      "totalFailedRecordings": 3,
      "id": "3f91e391-38bd-4ae0-9bdf-6cc5a736f215",
      "state": "FAILED",
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.operator": [
        [
          "matches"
        ]
      ],
      "recordingJobsQuery.includePolicyBasedRecordings": true,
      "totalProcessedRecordings": 3,
      "user.selfUri": "/api/v2/users/9dd7cad4-6ec5-42bb-80a6-0b0882c797df",
      "recordingJobsQuery.action": "DELETE",
      "user.id": "9dd7cad4-6ec5-42bb-80a6-0b0882c797df",
      "recordingJobsQuery.conversationQuery.segmentFilters.predicates.dimension": [
        [
          "dnis"
        ]
      ],
      "totalConversations": 3,
      "selfUri": "/api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215",
      "recordingJobsQuery.actionDate": "2026-04-16T12:45:00Z",
      "failedRecordings": "/api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215/failedrecordings",
      "totalRecordings": 3,
      "recordingJobsQuery.includeRecordingsWithSensitiveData": false,
      "recordingJobsQuery.includeScreenRecordings": true,
      "recordingJobsQuery.conversationQuery.startOfDayIntervalMatching": false
    Where am I going wrong this time?


    #API/Integrations

    ------------------------------
    Kieran McCormick
    Telecoms Engineer
    ------------------------------



  • 2.  RE: Bulk Delete API

    Posted 7 hours ago

    Hi Kieran

    I'm sure you already checked this but just to confirm, are these recordings not perhaps protected from being deleted?

    Regards



    ------------------------------
    Stephan Taljaard
    EMBEDIT s.r.o
    ------------------------------



  • 3.  RE: Bulk Delete API
    Best Answer

    Posted 6 hours ago

    HI Kieran

    It looks like your query is actually working correctly because the job is finding the recordings (totalRecordings: 3). The issue seems to happen during the execution of the delete, since the job ends with:
     
    totalProcessedRecordings: 3
    totalFailedRecordings: 3
    state: FAILED
     
    This usually means the recordings were identified but Genesys Cloud was not allowed to delete them.
     
    A few things I would recommend checking:
     
    1. Recording retention policies
    If the recordings are still within the retention period defined in a Recording Policy, they cannot be deleted manually. Even though the job shows includePolicyBasedRecordings: true, the platform will still prevent deletion if the retention period has not expired.
     
    2. Permissions
    Make sure the user or OAuth client executing the request has the required permissions, such as:
     
    recording:recording:delete
    recording:recordingSegment:delete
    recording:job:add
    recording:job:edit
    recording:job:view
     
    Missing permissions can cause the job to process but fail when attempting the delete.
     
    3. Sensitive recordings
    Your payload includes:
     
    "includeRecordingsWithSensitiveData": false
     
    If any of those recordings are marked as containing sensitive data (for example due to PCI redaction), they will be skipped or fail to delete. You could try setting this to true if appropriate.
     
    4. Check the failed recordings endpoint
    The response already provides a useful endpoint:
     
    /api/v2/recording/jobs/{jobId}/failedrecordings
     
    In your case:
     
    /api/v2/recording/jobs/3f91e391-38bd-4ae0-9bdf-6cc5a736f215/failedrecordings
     
    This endpoint should return the specific reason each recording failed to delete, which usually points directly to the root cause.



    ------------------------------
    Kaio Oliveira
    GCP - GCQM - GCS - GCA - GCD - GCO - GPE & GPR - GCWM

    PS.: I apologize if there are any mistakes in my English; my primary language is Portuguese-Br.
    ------------------------------



  • 4.  RE: Bulk Delete API

    Posted 4 hours ago

    Thank you @Kaio Oliveira



    ------------------------------
    Mohan Singh
    Subject matter expert
    ------------------------------



  • 5.  RE: Bulk Delete API

    Posted 2 hours ago

    Thank you @Kaio Oliveira



    ------------------------------
    Uma Siva Shankar Kumar Babu Karanam
    ------------------------------



  • 6.  RE: Bulk Delete API

    Posted 6 hours ago

    Hello Kieran, 

    Just to add to @Kaio Oliveira reply, which is the most likely what's happening. 

    The first thing I'd recommend is calling the failedRecordings endpoint from your job response. That will give you the exact error for each recording and usually points pretty clearly to what's going on behind the scenes.

    Based on what you've shared, a few likely causes come to mind. Like Kaio said,  recordings may be protected from deletion due to compliance settings, which will block both manual and API-based deletes.

    Permissions can also play a role-you'll want to make sure the user or client running the API has the Recording > Recording > Edit Retention permission. Another thing to check is your payload setting for sensitive data; since you've got includeRecordingsWithSensitiveData set to false, anything flagged as sensitive won't be deleted and could show up as a failure.

    Lastly, keep in mind the bulk API only deletes full recordings, not segments, so if your query is filtering at the segment level, that can also lead to unexpected results.

    Cheers, 



    ------------------------------
    Cameron
    Online Community Manager/Moderator
    ------------------------------



  • 7.  RE: Bulk Delete API

    Posted 4 hours ago

    Thanks for all the replies Guys

    It was a combination of OAuth Permission and retention policy. 

    We had dialled back OAuth permissions, and early attempts with the Data Actions failed because of that so I thought I had them all up to where they needed to be once the Data Action started to run successfully (but without actually deleting anything). 

    And the recordings in our test Org that I was picking for testing on were covered by the retention policy, so that was causing failure too. So I've gone back and tested on recordings from a few years ago that aren't in the policy, and the jobs are now being Fulfilled :)

    Thanks for all your help



    ------------------------------
    Kieran McCormick
    Telecoms Engineer
    ------------------------------