Pcornel
Automation · APIs

DELETE

Cheat sheet · https://pcornel.dk/topic.php?topic=5299

Back to the Topic

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

BoundaryHealthy evidenceSuspicious evidence
Caller / requestEnvironment/version, identity and exact request contract are attributableHidden defaults, wrong endpoint/version, leaked or mismatched credentials
Server / responseStatus, headers, structured body and request ID are interpreted togetherStatus-only handling, ignored error body, ambiguous async result or unsafe retry
State / proofWrite result is reconciled with resource read-back or acceptance testResponse success treated as final target success without verification
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind 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

Confirmation

Confirm action

Continue?