Skip to main content
Data Operations · NGSI-LD and Stellio

Stellio Delete Subscription

The node sends a DELETE request for a single subscription to the Stellio context broker. The subscription id comes from the configuration or from msg.subscriptionId. The status below the node shows whether the subscription was deleted or could not be found.

  • Subscriptions
  • Delete
  • NGSI-LD
Node type
stellio-delete-subscription
Package
@htag/node-red-contrib-hypertegrity-ngsi-ld
Inputs / outputs
1 / 1
Target
Stellio context broker (NGSI-LD)

When to use this node​

Subscriptions that are no longer needed keep producing notifications and put load on broker and receiver. With this node you remove a subscription deliberately, for example when dismantling a data flow or after changing the notification receiver.

Typical use cases are:

  • Teardown: delete the subscription created by Stellio Create Subscription when removing a flow.
  • Clean-up: filter ids from Stellio Get Subscriptions and delete them one after another via msg.subscriptionId.
  • Re-creation: delete a misconfigured subscription before creating it again with different parameters.

How the node works​

1

Determine id

msg.subscriptionId or the configured Subscription ID decides which subscription is deleted.

2

Send DELETE

The node calls /ngsi-ld/v1/subscriptions/<id> with the NGSILD-Tenant header.

3

Emit response

Status code, headers and any response body are written into the message; the status shows deleted, not found or error.

Result: The subscription is removed; the message carries the status code for further evaluation.

The node is message-driven and deletes exactly one subscription per incoming message.

Configuration​

FieldTypeDefaultMeaning
NameTextemptyDisplay name of the node in the flow.
NGSILD-TenantText (required)emptyValue of the NGSILD-Tenant header, for example ds_public_parking.
API URLTextemptyBase URL of the broker. If the field is empty, the node uses the environment variable STELLIO_API_URL. A placeholder ${STELLIO_API_URL} is replaced by Node-RED.
Subscription IDTextemptyFull URN of the subscription to delete, for example urn:ngsi-ld:Subscription:7f3a2c1e-0000-4000-8000-000000000001. May stay empty if the id arrives via message.

Input​

PropertyTypeMeaning
msg.subscriptionIdstringOverrides the configured Subscription ID. If both are missing, the node aborts with an error.
msg.tenantstringOverrides the configured tenant.
msg.apiUrlstringOverrides the configured API URL.
msg.payloadanyNot evaluated; the message only acts as trigger.

Output​

After successful deletion Stellio answers without content:

{
"statusCode": 204,
"headers": {
"date": "Thu, 01 Oct 2026 06:00:02 GMT"
},
"payload": null
}
FieldMeaning
msg.statusCodeHTTP status code of the response: 204 deleted, 404 not found, other codes on errors.
msg.headersResponse headers of the broker.
msg.payloadResponse body as JSON if present (for example an error object on 404); null for an empty response; the raw text if the content cannot be parsed.

Example flow​

The package ships with a shared example flow for several Stellio nodes. You can import it in Node-RED via Menu → Import → Examples → @htag/node-red-contrib-hypertegrity-ngsi-ld → stellio-helper-nodes. The Stellio Delete Subscription node is included in this shared example, but its output is not wired to a Debug node; the following excerpt therefore shows a minimal wiring of this node. Alternatively, download stellio-helper-nodes.json and import it via Menu → Import.

Step 1

Inject

An Inject node triggers the deletion manually.

Step 2

Delete Subscription

The node deletes the configured subscription in the tenant ds_public_parking. Enter the id from Create Subscription.

Step 3

Debug

A Debug node shows status code and response.

Show minimal wiring as JSON
[
{"id": "tab1", "type": "tab", "label": "Stellio Helper Nodes", "disabled": false, "info": ""},
{"id": "inject1", "type": "inject", "z": "tab1", "name": "", "props": [{"p": "payload"}], "repeat": "", "once": false, "payload": "", "payloadType": "date", "x": 100, "y": 340, "wires": [["delete1"]]},
{"id": "delete1", "type": "stellio-delete-subscription", "z": "tab1", "name": "", "tenant": "ds_public_parking", "apiUrl": "", "subscriptionId": "urn:ngsi-ld:Subscription:7f3a2c1e-0000-4000-8000-000000000001", "x": 280, "y": 340, "wires": [["debug1"]]},
{"id": "debug1", "type": "debug", "z": "tab1", "name": "Result", "active": true, "tosidebar": true, "complete": "true", "targetType": "full", "x": 520, "y": 340, "wires": []}
]

Status and errors​

IndicatorMeaning
Blue dot "deleting..."The request is running.
Green dot "deleted (204)"Subscription deleted successfully.
Yellow ring "not found (404)"No subscription with this id in the tenant. The message is still sent.
Red ring "error (400)" (or another status code)The broker answered with a different error status. The message is still sent.
Red ring "missing subscription ID" with error "Subscription ID is required"Neither the configuration nor msg.subscriptionId contains an id. No message is sent.
Red ring "error" with error messageNetwork error, for example broker unreachable or invalid URL. No message is sent.

Errors are reported via node.error and can be handled with a Catch node.

Notes​

  • Irreversible: Deletion cannot be undone. If needed, save the subscription definition beforehand via Stellio Subscriptions.
  • Subscription ID: Use the URN exactly as the broker delivers it.
  • Authentication: The node sends no authentication headers; access to the broker is protected by the network or an upstream gateway.
  • Personal data: The node only processes the subscription id and no entity content.

References​