plane icon indicating copy to clipboard operation
plane copied to clipboard

API DELETE /states/ returns 204 but does not delete custom states

Open flowq-C opened this issue 8 months ago โ€ข 3 comments

Bug Description

Custom states created via the API cannot be deleted โ€” neither through the API nor through the UI. The DELETE endpoint returns HTTP 204 (success) but the state remains. Attempting to delete the same custom state through the Plane UI (Project Settings โ†’ States) also fails silently โ€” there is no delete option or it has no effect.

This rules out "API limitation" as an explanation. If custom states cannot be deleted through any interface, this is a data integrity issue.

Steps to Reproduce

Via API

  1. Create a custom state via API:
curl -X POST "https://<plane-instance>/api/v1/workspaces/<ws>/projects/<pid>/states/" \
  -H "X-API-Key: <key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "TEST-STATE", "group": "backlog", "color": "#888888"}'
# Returns 200 with state ID
  1. Delete the state via API:
curl -X DELETE "https://<plane-instance>/api/v1/workspaces/<ws>/projects/<pid>/states/<state-id>/" \
  -H "X-API-Key: <key>"
# Returns 204 No Content โ€” but state is NOT deleted
  1. List states again โ€” state is still present.

Via UI

  1. Go to Project Settings โ†’ States
  2. Attempt to delete the custom state (no issues assigned to it)
  3. State cannot be removed โ€” no delete action available or action has no effect

Workaround

The only way to remove the orphaned state is a direct database DELETE:

DELETE FROM states WHERE id = '<state-id>';

This works without foreign key violations (when no issues reference the state), confirming the state is safe to delete โ€” the application just refuses to do it.

Expected Behavior

  • Custom states with 0 assigned issues should be deletable via UI and API
  • API DELETE should actually remove the state, OR return an error (409/422) explaining why deletion is not possible
  • Returning 204 without deleting violates HTTP semantics (RFC 9110 ยง9.3.5)

Actual Behavior

  • API returns 204 (implying success) but does not delete
  • UI provides no working delete mechanism for custom states
  • Custom states become permanent, polluting the project
  • Only workaround is direct database manipulation

Impact

  • Custom states created during testing, automation, or by mistake cannot be cleaned up
  • Projects accumulate orphaned states with no way to remove them
  • Self-hosted users can work around this via DB access, but cloud users are stuck permanently

Environment

  • Plane: Self-hosted (Docker Compose)
  • API: v1
  • Version: Latest stable (as of 2026-03-22)

flowq-C avatar Mar 22 '26 09:03 flowq-C

Can confirm this is also happening to us. Version: v1.2.3

lamongabriel avatar Mar 24 '26 14:03 lamongabriel

It looks like this was fixed with v1.3.0 - it is working for me now at least while I had the same problem with v1.2.3.

poettig avatar Apr 12 '26 21:04 poettig

Flagging a downstream consequence in case it helps prioritization. This API behavior is what blocks plane schema sync from deleting states. The CLI's own --help text acknowledges it: "Delete operations are not yet supported by the Plane API. This command will show what WOULD be deleted but won't actually delete." In practice this means any state pushed via Compose can't be rolled back via Compose -- you have to drop into the UI or, per this thread, the database.

Hit this during a Compose 0.2.0 evaluation: added a test state via plane schema push, then couldn't remove it via plane schema push (additive-only) or plane schema sync (no-op for deletes). Full context: https://github.com/orgs/makeplane/discussions/8999

john-derose avatar May 03 '26 20:05 john-derose