In this guide, we’ll create an endpoint that lets you delete a unit based on a specified unit ID using the DELETE method. The below is an example of the request used to call the API.
curl --location --request DELETE 'https://example.in.bosbec.io/units?id=00000000-0000-0000-0000-000000000000' \
--header 'Authorization: 00000000-0000-0000-0000-000000000000'
Start off by:
- Adding an Incoming HTTP trigger
- Selecting the channel you created.
- Adding the path “units” to the end of the URL.
- Selecting the DELETE method.

Now, we want to make sure that there is a query containing the unit ID to delete. To do this, we’ll start by adding a Route from meta data job and a Unit pipeline.
Set the metadata route to the following settings:
- Meta data source
- {{defaultvalue( “{{incoming_http_request.query.id}}” || “” )}}
- Allow empty values in source
- Checked
- Compare operator
- !empty

This will retrieve the value of the query, or set the source to empty if the query is missing entirely, and proceed to the next job only if it is not empty.
Next, we’ll set up the Unit Pipeline the same way we did in the GET request.
- Find unit step
- Matches unit id
- Unit ID
- {{incoming_http_request.query.id}}
- Page size
- 1
- Unit ID
- From account
- Matches unit id
- Save as resource step
- found_unit

Now we’ll add the same chain of jobs again, a Route from meta data and a Unit pipeline. But this time, we’ll configure them to check how many units were found, and if one was found, delete it.
- Meta data source
- {{found_unit.count()}}
- Compare operator
- =
- Compare value
- 1

In the Unit pipeline we’ll simply load the resource and delete it from the account.

The main feature of the workflow is now ready, and you can delete units using the DELETE request. However, we should still add API responses to the workflow.

In the screenshot above, we’ve added a 400 Error for the on-no-match route when checking for a unit ID in the query. After that, a 404 Error when no unit matching the unit id was found. Lastly, a 200 OK response is returned when a unit is successfully deleted.

This is what the entire workflow looks like when finished! This can, of course, be modified further as needed. This version of the workflow can also be found in the Workflow Library!