Skip to content

API webservices DELETE does not distinguish existing and non-existing items #46095

@muhme

Description

@muhme

Is your feature request related to a problem? Please describe.

Deleting an item (article, content category, banner, etc.) returns status 204 (NO CONTENT) for both existing and non-existing items. For API users, there is no single API call that can be used to securely delete an item. Two calls are required: first, the item must be retrieved to check whether it exists, and then it can be deleted.

Describe the solution you'd like

  • Use distinct status codes, e.g. 404 (NOT EXIST) if we try to DELETE a non-existing item or
  • Offer conditional deletes with sending additional header "If-Match: *"
    • If the resource exists → delete → 204
    • If it doesn’t exist → 412 Precondition Failed

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions