Context
Change Type: Feature
Product area: Platform services
Component: REST API
Deployed at: eu.latest.cumulocity.com, apj.cumulocity.com, jp.cumulocity.com, cumulocity.com, us.cumulocity.com
Technical details
Build artifact: cumulocity (2026.165.0)
Internal ID: MTM-66518
Description
Cumulocity now provides a dedicated alarm upsert endpoint (POST /alarm/alarms/upsert).
The operation creates a new alarm if no uncleared alarm with the same source and type exists,
or updates the existing one otherwise. The response status reflects the outcome 201 Created
for a newly created alarm, or 200 OK when an existing alarm was updated.
For details refer to the alarm upsert operation
in the Cumulocity OpenAPI Specification.
1 Like
What is not 100% clear to me is how de-duplication is handled here.
For the original POST / CREATE Alarm operation de-duplication logic applies if alarm to same source and type already exists . De-duplication means count is increased but no other data will be changed.
What happens with this new endpoint? It is stated that the alarm is updated in that case, so very simlar to de-duplication but I guess updates of data is acutally reflected, which wasn’t the case in de-duplication, correct?
So I would argue it’s a replacement for the orignal POST endpoint?
Hi Stefan,
The new UPSERT endpoint is not a replacement for the existing POST endpoint, but rather addresses a different use case. Here is how they differ:
-
POST (De-duplication): If an alarm of the same type already exists, POST increments the counter but does not update the alarm data with the new payload. Use this if you want strict de-duplication.
-
UPSERT: This endpoint ensures that data updates are actually reflected on the alarm. It creates the alarm if it doesn’t exist, or fully updates its fields if it does. It does not handle traditional de-duplication (i.e., it won’t just increment a counter while ignoring your new data).
We are currently working on an optimization for the UPSERT endpoint to return both the old and new values in the response. This will save you from having to execute a separate GET request if you need to compare states.
Cheers,
Martin
1 Like