Skip to content

add sub account deletion - #75

Open
oshchyhol wants to merge 2 commits into
mainfrom
MT-23420-java-delete-sub-account
Open

add sub account deletion#75
oshchyhol wants to merge 2 commits into
mainfrom
MT-23420-java-delete-sub-account

Conversation

@oshchyhol

@oshchyhol oshchyhol commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

The API gains DELETE /api/organizations/{organization_id}/sub_accounts/{sub_account_id}. The SDK covers listing and creating sub accounts but not deleting them.

Changes

  • SubAccounts.deleteSubAccount(organizationId, subAccountId) – sends the DELETE request, returns nothing on success
  • javadoc notes the permission requirement, that the deletion is permanent, that deleting the last sub account deletes the organization, the 404 on a repeated call and the 10 requests per minute per organization rate limit
  • SubAccountsExample deletes the sub account it creates

How to test

  • client.organizationsApi().subAccounts().deleteSubAccount(orgId, subAccountId) with an existing sub account – returns without an exception, the sub account is gone from getSubAccounts(orgId)
  • call it again with the same id – HttpClientException with status 404
  • call it with a sub account id from another organization, or with a token without sub account management permissions – HttpClientException with status 403
  • call it with an invalid token – HttpClientException with status 401
  • run SubAccountsExample with MAILTRAP_API_KEY and MAILTRAP_ORGANIZATION_ID set – it lists sub accounts, creates "Acme Marketing", deletes it and prints Sub account <id> deleted
  • mvn javadoc:javadoc – the deleteSubAccount entry renders in SubAccounts

Companion PRs

Caveat: merge and release only after the backend change ships; the endpoint is not in production yet.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: cdcb2196-82a8-4bdd-803b-25218050dfbf


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant