# Bulk operation API best practice

**URL:** https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124
**Category:** Forum
**Tags:** cumulocity, device-connectivity
**Created:** [November 30, 2022, 11:01am UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124 "2022-11-30T11:01:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Mauro\_Stramazzotti](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mauro\_Stramazzotti](https://community.cumulocity.com/u/Mauro_Stramazzotti)
#### Post date: [November 30, 2022, 11:01am UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/1 "2022-11-30T11:01:00Z")

</div>

Hello,

I have some requests re how to handle bulk operations via API.

once launched a bulk operation is there any API to control and monitor a bulk operation status?  
In particular how would it be possible to look for the list of success and failed operations?  
then to retry the failed operation requests?

thanks  
KR

Mauro

---

<div class="post-metadata">

### Author: ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)
#### Post date: [November 30, 2022, 12:40pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/2 "2022-11-30T12:40:07Z")

</div>

Hi Mauro,

you can get a bulk operation by id:  
[https://cumulocity.com/api/10.15.0/#operation/getBulkOperationResource](https://cumulocity.com/api/10.15.0/#operation/getBulkOperationResource)

That result contains a “progress” fragment that tells you about the number of pending / failed / executing / completed operations.

If you want to retry a failed bulk operation, you have to create a new bulk operation with a “failedParentId” instead of “groupId” with the “failedParentId” being the ID of the previous bulk operation. This will automatically retry all failed operations.

[https://cumulocity.com/api/10.15.0/#tag/Bulk-operations](https://cumulocity.com/api/10.15.0/#tag/Bulk-operations)

---

<div class="post-metadata">

### Author: ![Mauro\_Stramazzotti](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mauro\_Stramazzotti](https://community.cumulocity.com/u/Mauro_Stramazzotti)
#### Post date: [November 30, 2022, 1:52pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/3 "2022-11-30T13:52:17Z")

</div>

thanks Harald,

is there a way also to have the list of failed?  
thanks  
Mauro

---

<div class="post-metadata">

### Author: ![Philipp\_Emmel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/philipp_emmel/32/19455_2.png) [@Philipp\_Emmel](https://community.cumulocity.com/u/Philipp_Emmel)
#### Post date: [November 30, 2022, 2:04pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/4 "2022-11-30T14:04:19Z")

</div>

You can get operations by bulk operation ID and status see here: [https://cumulocity.com/api/10.13.0/#operation/getOperationCollectionResource](https://cumulocity.com/api/10.13.0/#operation/getOperationCollectionResource)

---

<div class="post-metadata">

### Author: ![Mauro\_Stramazzotti](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mauro\_Stramazzotti](https://community.cumulocity.com/u/Mauro_Stramazzotti)
#### Post date: [December 2, 2022, 2:57pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/5 "2022-12-02T14:57:15Z")

</div>

thanks @Philipp_Emmel !

in the case of a device is offline at the time of the bulk campaign, when this will return online (anytime after the scheduled campaign), does the platform automatically relaunch the campaign to the device?

Or should we implement a custom logic to monitor the result of the campaign and retry with the failed?

KR

Mauro

---

<div class="post-metadata">

### Author: ![Philipp\_Emmel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/philipp_emmel/32/19455_2.png) [@Philipp\_Emmel](https://community.cumulocity.com/u/Philipp_Emmel)
#### Post date: [December 2, 2022, 7:24pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/6 "2022-12-02T19:24:33Z")

</div>

Bulk operations are transparent to devices. A Device only sees the individual operation that is created for it. These operations stay in status PENDING until the device picks them up. There is no time limit on this. Whenever the device returns online, it can pick up the operation and execute it.

Of course this will prevent the bulk operation from being completed. The unfinished operation will be shown in its respective status as part of the bulk operation.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)
#### Post date: [May 31, 2023, 7:24pm UTC](https://community.cumulocity.com/t/bulk-operation-api-best-practice/3124/7 "2023-05-31T19:24:41Z")

</div>

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