Skip to content

DELETE /authorization/organizations/:org/resources/:type/:external_id is not served #207

Open

Description

@etiennecoutaud

DELETE /authorization/organizations/:organization_id/resources/:resource_type_slug/:external_id has no route, so deleting a resource by external id gets 404 {"message":"Not Found","code":"not_found"}, with or without cascade_delete. The SDKs call it (e.g. DeleteResourceByExternalID in workos-go), and the emulator already serves GET and PATCH on that path and DELETE /authorization/resources/:resource_id.

Repro (@workos/emulate 0.20.0)

H=(-H "Authorization: Bearer sk_test_default" -H "Content-Type: application/json")
B=http://localhost:4100
oid=$(curl -s "${H[@]}" -X POST $B/organizations -d '{"name":"Repro"}' | jq -r .id)
curl -s "${H[@]}" -X POST $B/authorization/resources \
  -d "{\"resource_type_slug\":\"project\",\"external_id\":\"prj_1\",\"name\":\"P\",\"organization_id\":\"$oid\"}" > /dev/null
curl -s "${H[@]}" -X DELETE "$B/authorization/organizations/$oid/resources/project/prj_1?cascade_delete=true"
# {"message":"Not Found","code":"not_found"}

Expected: as in production, and as the emulator's delete by id already does: 204, or 409 resource_has_dependents without cascade_delete=true when the resource has descendants or role assignments.

Activity

  1. changed the title [-]Authorization: delete resource by external id is missing, and a repeated role assignment is stored twice[/-] [+]DELETE /authorization/organizations/:org/resources/:type/:external_id is not served[/+] on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions