Skip to content

HTTP DELETE

Type: http-delete  ·  Package: HTTP Activities v1.0.5  ·  Output: ZoanHttpResponse

Sends a DELETE request to remove a resource from an API. The URL identifies the resource to delete (usually by its id). It sends no body.

Sends the DELETE request to url (with optional headers and authentication) and returns a ZoanHttpResponse.

  • Status codes: 2xx succeeds; any other code makes the activity fail — see what makes the activity fail. Note that many APIs answer 404 when the resource was already deleted, so a second DELETE of the same id usually fails.
  • Timeouts: 30 s to connect and, by default, 5 min for the whole request (timeout parameter). When they run out, the activity fails with a normal error that Try / Catch and Retry catch — see timeouts.
  • No body: if the API requires a body on DELETE, this activity does not send one.
ParameterTypeDefaultDescription
urlstring—Absolute URL of the resource to delete.
ParameterTypeDefaultDescription
headersDictionary—Extra headers (name → value), in the JSON editor. See headers.
authorizationDictionary—Authentication in the JSON editor: bearer, basic or apikey. See authentication.
timeoutint300Seconds to wait for the whole request (connection, sending and answer); maximum 3600, decimals allowed (0.5). Since version 1.0.5. See timeouts.

Returns a ZoanHttpResponse with .StatusCode (2xx), .Ok (always true in an output you receive), .Body and .Headers. Many APIs return 204 (no content) on a successful delete; in that case .Body is "".

MessageCause and fix
The server answered HTTP 404 (Not Found) to the DELETE request.The resource does not exist (or was already deleted), or the server answered with another non-2xx code (401/403, 409, 5xx). If “no longer exists” counts as success for you, catch it with Try / Catch and check error.Message.Contains("HTTP 404").
No such host is known. (or another system network error)There was no response. error.Type is "HttpRequestException".
The DELETE request to api.example.com did not finish within 300 s (timeout). Raise 'timeout' if the service takes longer.The server did not answer within timeout. error.Type is \"TimeoutException\": catch it with Try / Catch or retry with Retry; if the API is slow by nature, raise timeout. If connecting fails, the message says Could not connect to … within 30 s.
An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set.url is not absolute. Include https://.
'url' is required.The url expression evaluated to null.
HTTP DELETE
url = "https://api.erp.com/customers/" + customerId
authorization = { "type": "bearer", "token": credential("erp-api")["value"] }
→ output: resp
Log message = "Customer deleted (status " + resp.StatusCode + ")"