Skip to content

fix(api): allow passing data with delete calls#1471

Merged
ramya18101 merged 3 commits intoauth0:mainfrom
ewanharris:fix/api-allow-delete-with-body
Mar 27, 2026
Merged

fix(api): allow passing data with delete calls#1471
ramya18101 merged 3 commits intoauth0:mainfrom
ewanharris:fix/api-allow-delete-with-body

Conversation

@ewanharris
Copy link
Copy Markdown
Contributor

🔧 Changes

Changes the validateAndSetData func in auth0 api to allow setting data on a DELETE call. This is so that calls like delete org members can work.

📚 References

https://auth0.com/docs/api/management/v2/organizations/delete-members

🔬 Testing

Tested calling the delete org members with the change and it works

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

DELETE calls do accept a body, for example the delete memebrs from org endpoint. So we should allow it
Copilot AI review requested due to automatic review settings March 24, 2026 16:05
@ewanharris ewanharris requested a review from a team as a code owner March 24, 2026 16:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the api CLI command input validation to permit JSON request bodies on DELETE requests (needed for Auth0 Management API endpoints like “delete organization members”).

Changes:

  • Allow validateAndSetData to parse/set JSON payloads for DELETE (still skipping GET).
  • Add a test case covering parsing of a DELETE call that includes the --data flag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/cli/api.go Removes the DELETE early-return so JSON payloads can be parsed and sent with DELETE requests.
internal/cli/api_test.go Adds a new test case for DELETE + --data argument parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergiught
Copy link
Copy Markdown
Contributor

Hey @ramya18101 👋🏻 when can we expect to have this merged and released? 🙏🏻

@ramya18101 ramya18101 enabled auto-merge (squash) March 27, 2026 14:46
@ramya18101 ramya18101 merged commit fc7d843 into auth0:main Mar 27, 2026
6 checks passed
@ramya18101
Copy link
Copy Markdown
Contributor

Hey @ramya18101 👋🏻 when can we expect to have this merged and released? 🙏🏻

@sergiught , It will be included in the release planned for mid next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants