Skip to content

MT-23420: document the delete organization sub account endpoint - #56

Draft
oshchyhol wants to merge 1 commit into
mainfrom
MT-23420-delete-sub-account
Draft

MT-23420: document the delete organization sub account endpoint#56
oshchyhol wants to merge 1 commit into
mainfrom
MT-23420-delete-sub-account

Conversation

@oshchyhol

Copy link
Copy Markdown
Contributor

Motivation

MT-23420

Sub-accounts can now be deleted from the organization panel, and the same action is exposed over
the public API. DELETE /api/organizations/{organization_id}/sub_accounts/{sub_account_id} is not
described in the spec yet, so it is missing from the rendered reference.

Changes

  • deleteOrganizationSubAccount: new delete operation on
    /api/organizations/{organization_id}/sub_accounts/{sub_account_id}, tagged Organizations,
    reusing the existing organization_id and sub_account_id parameters
    • 204 with no body on success, 401, 403 on insufficient organization permissions or a
      sub-account outside the organization, 404 on an unknown or already deleted sub-account,
      429 over the rate limit of 10 requests per minute per organization
    • the description states that the sub-account and its data are removed permanently, that
      deleting the organization's last sub-account also deletes the organization, and that a
      repeated call returns 404
    • cURL sample only – no SDK exposes sub-account deletion yet
  • new RateLimitExceededResponse schema and LIMIT_EXCEEDED response for the 429, which the
    spec had no shared definition for

How to test

  • the spec lints clean in CI
  • in the rendered reference, Organizations shows "Delete organization sub account" with the
    organization_id and sub_account_id path params, a cURL sample, and 204/401/403/404/429
    responses
  • the 429 example reads {"errors": "Rate limit exceeded"}
  • against the deployed API: DELETE /api/organizations/:organization_id/sub_accounts/:id with
    a token holding Sub-accounts Creation & Listing Admin returns 204 and the sub-account is gone
    from GET /api/organizations/:organization_id/sub_accounts
  • the same call repeated returns 404; with a viewer-level token 403; with no token 401
  • more than 10 calls within a minute for one organization return 429

Companion PRs

  • falcon – railsware/falcon#10943

Caveat: merge after the falcon change ships – the endpoint does not exist in production yet. The
documented last-sub-account behaviour is inherited from the existing deletion flow; if that gets a
guard before release, the description needs updating.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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