Outllok Calendar - delete multiple recurring instances at once

Maciej 26 Reputation points
2022-09-22T10:36:04.82+00:00

Is there any way to delete multiple recurring instances at once? I want to delete, for example, 20 from 100 occurrences, but I don't see this option in the API.

Do I have to go through all the ids and delete them one by one?

I'm using the endpoint below, but it lets you delete only one occurrence, so in case you want to delete 20, I need to send 20 requests. Also, if I listen to changes, I receive 20 events from Microsoft.

DELETE https://graph.microsoft.com/v1.0/me/events/{id}
https://learn.microsoft.com/en-us/graph/api/event-delete?view=graph-rest-1.0&tabs=http

Thanks for help

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2022-09-23T03:13:07.55+00:00

    Hi @Maciej

    You can use JSON batching to delete multiple recurring instances at once, and you only need to send one API call.

    POST https://graph.microsoft.com/v1.0/$batch  
    Accept: application/json  
    Content-Type: application/json  
      
    {  
        "requests": [  
            {  
                "id": "1",  
                "method": "DELETE",  
                "url": "/me/events/{id}"  
            },  
            {  
                "id": "2",  
                "method": "DELETE",  
                "url": "/me/events/{id}"  
            },  
           ......  
        {  
          "id": "20",  
          "method": "DELETE",  
          "url": "/me/events/{id}"  
        }  
        ]  
    }  
    

    244093-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2022-09-22T20:03:57.08+00:00

    Hi @Maciej ,

    Hope you're doing well.

    Currently, there is no Graph API to delete multiple recurring instances at once. You need to delete each event by using the event Instance ID in below endpoint.

     DELETE https://graph.microsoft.com/v1.0/me/events/{id}  
    

    Refer List Instances to get all instances of a recurring event.

    Since this feature is not yet supported, I would request you to raise a feature request using this feedback portal.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.