Automation · APIs
DELETE
Cheat sheet · https://pcornel.dk/topic.php?topic=5299
Answer
Requesting removal or deactivation of a resource while distinguishing accepted deletion from durable absence.
Remember
- DELETE 2xx ≠ resource physically gone; soft delete, tombstones or asynchronous cleanup may remain.
- DELETE idempotent ≠ every retry returns the same status; later calls may return 404 while final state remains absent.
- 404 after DELETE ≠ deletion proven; the resource may have been absent before the request.
- Resource absent ≠ dependencies cleaned up; references, sessions or external side effects can persist.
First checks
curl -sS -X DELETE -o /dev/null -w '%{http_code}' https://<api>/v1/items/<id>— delete- 404 on repeat delete is acceptable — idempotency
- Soft delete/recovery options — safety
Verify in this order
DELETE → 204/200
Where it usually breaks
A DELETE response proves request handling, not durable absence or cleanup of related state.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
DELETE API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5299