Skip to content

MT-22692: Organization sub-accounts - #18

Merged
Lorenc326 merged 1 commit into
mainfrom
MT-22692-sub-accounts
Jul 10, 2026
Merged

MT-22692: Organization sub-accounts#18
Lorenc326 merged 1 commit into
mainfrom
MT-22692-sub-accounts

Conversation

@Lorenc326

Copy link
Copy Markdown
Contributor

Motivation

Adds organization sub-account management to the Go SDK: list and create the sub-accounts of an organization.

Changes

  • SubAccounts (client.SubAccounts): List and Create against /api/organizations/{organization_id}/sub_accounts, with the {account: {name}} request wrapper.
  • New WithOrganizationID client option. The organization endpoints require the id in the path and have no account-less twin (unlike the account resources), and a token maps to exactly one organization — so it is a fixed per-token scope configured once at construction rather than passed to every call. Calls without it fail fast with a clear error.
  • httptest tests + examples/sub-accounts + README entry.

Field shapes and paths verified against the OpenAPI spec (account-management). Surface mirrors the Node.js client.organizations grouping.

How to test

  • go test -race ./...
  • go vet ./...
  • golangci-lint run ./...

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Lorenc326, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 584bd145-713f-4df3-9e5a-3cf037438c87

📥 Commits

Reviewing files that changed from the base of the PR and between a8e1073 and cc0973c.

📒 Files selected for processing (6)
  • README.md
  • client.go
  • client_test.go
  • examples/sub-accounts/main.go
  • sub_accounts.go
  • sub_accounts_test.go

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.

@Lorenc326
Lorenc326 force-pushed the MT-22692-sub-accounts branch from bc0168d to 12682e0 Compare July 7, 2026 14:21
@Lorenc326
Lorenc326 force-pushed the MT-22692-sub-accounts branch from 12682e0 to 237404d Compare July 7, 2026 14:49
@Lorenc326
Lorenc326 changed the base branch from MT-22692-general to MT-22692-tokens-billing July 7, 2026 14:49
@Lorenc326
Lorenc326 force-pushed the MT-22692-tokens-billing branch from 51957f4 to d86d430 Compare July 8, 2026 12:13
@Lorenc326
Lorenc326 force-pushed the MT-22692-sub-accounts branch from 237404d to d08c72a Compare July 8, 2026 13:21
@Lorenc326
Lorenc326 requested review from Rabsztok and piobeny July 8, 2026 14:01
@Lorenc326
Lorenc326 force-pushed the MT-22692-tokens-billing branch from d86d430 to 60ad753 Compare July 10, 2026 13:16
Base automatically changed from MT-22692-tokens-billing to main July 10, 2026 13:24
Add sub-accounts management (client.SubAccounts): List and Create under
an organization. The organization is a fixed per-token scope, configured
once via the new WithOrganizationID option rather than passed per call.

Includes httptest coverage, examples/sub-accounts, and a README entry.
@Lorenc326
Lorenc326 force-pushed the MT-22692-sub-accounts branch from d08c72a to cc0973c Compare July 10, 2026 13:29
@Lorenc326
Lorenc326 merged commit 0d072ce into main Jul 10, 2026
4 checks passed
@Lorenc326
Lorenc326 deleted the MT-22692-sub-accounts branch July 10, 2026 13:31
@github-actions github-actions Bot mentioned this pull request Jul 10, 2026
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.

3 participants