API /accounts/ endpoint removed - delete membership for user

We previously were using a DELETE call to the API:

https://api.cloudflare.com/client/v4/accounts/{Org identifier}/members/{member identifier}

Which is now returning a 404 error. Cloudflare API Documentation no longer shows a Delete User command where we can supply a member id. Or at least I can’t find it?

This endpoint still works for me, just tested it, and it’s what the dashboard uses as well.

It does 404 if the member cannot be found, or if the org can’t be found, perhaps that is what is confusing you?

There is also DELETE → https://api.cloudflare.com/client/v4/memberships/{identifier} - Cloudflare API Documentation which deletes the user from your current account.

@Chaika - thanks for the testing. Odd that it isn’t working for us. Its also odd that it no longer appears in the documentation?

Regarding the /memberships/ endpoint - the issue there is that we need the ability to delete a specific user from a specific account as we have multiple accounts for multiple clients.

It’s under Account Members → Delete Member:

That’s weird if it doesn’t work for you, the API should return an error body that should explain a bit more. Either “member not found” or “Could not route to …” meaning the account could not be found.

It may be worth mentioning, there is a deprecated one for Organizations:
Organization Members → Delete Member

If you have an Org Identifier, that’s probably the one you want to use. I’m not familiar with Orgs personally or have one to test with though, I kinda thought all accounts became orgs.

Thanks for the research - the API ‘search’ tool isn’t working so well for me. The details allowed me to find my code error so I’m all good now.

As far as the ‘Organization’ API - i’m hesitant to start working on an already-Deprecated API endpoint.

1 Like