Skip to content

Revert "Revert "Remove accounts/{account_id} from all endpoints""#34

Merged
i7an merged 5 commits into
mainfrom
remove-account-id
May 15, 2026
Merged

Revert "Revert "Remove accounts/{account_id} from all endpoints""#34
i7an merged 5 commits into
mainfrom
remove-account-id

Conversation

@i7an

@i7an i7an commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This reverts commit 4dab462.

Motivation

Changes

  • Remove accounts/{account_id} from URLs

How to test

  • Check all bare endpoints

Summary by CodeRabbit

  • Refactor
    • Simplified API endpoints by removing account ID requirement from paths across account management, contacts, email sending, sandbox, and email template services.
    • Updated resource permission models to recognize "sandbox" and "domain" resource types.
    • Removed shared account ID path parameter from API specifications across all affected services.

Review Change Stack

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR removes the {account_id} path segment from API endpoints across five OpenAPI specification files (account-management, contacts, email-sending, sandbox, and templates), updating path definitions, curl examples, operation parameters, and permission resource type enums from inbox/sending_domain to sandbox/domain.

Changes

API Account Scoping Removal

Layer / File(s) Summary
Account management API re-scoping
specs/account-management.openapi.yml
Account accesses, API tokens, permissions resources, and billing endpoints move from account-scoped paths to top-level /api/... routes. Permission resource type enums are updated to use sandbox and domain instead of inbox and sending_domain. Parameter definition components.parameters.account_id is removed.
Contacts API re-scoping
specs/contacts.openapi.yml
Contact CRUD, events, imports, exports, lists, and field endpoints are moved from /api/accounts/{account_id}/... to /api/.... All curl examples and path parameter references are updated to remove account_id scoping. Component parameter definition is removed.
Email sending API re-scoping
specs/email-sending.openapi.yml
Domain management, suppressions, stats, email logs, and webhook endpoints are remapped from account-scoped to unscoped paths. Curl examples and operation parameter lists are updated accordingly. Shared account_id parameter definition is removed.
Sandbox API re-scoping
specs/sandbox.openapi.yml
Project, sandbox, and message operations (including body retrieval, headers, attachments) are moved to unscoped paths. Large set of endpoint path templates, curl samples, and operation parameter lists updated to drop {account_id}. Component parameter definition is removed.
Templates API re-scoping
specs/templates.openapi.yml
Email template list, create, get, update, and delete operations move from account-scoped to unscoped paths. Curl examples and parameter references updated. Shared account_id parameter definition is removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • mailtrap/mailtrap-openapi#29: Performs the same systematic removal of {account_id} path scoping across the same OpenAPI specification files.
  • mailtrap/mailtrap-openapi#33: Reverts this change by reintroducing account-scoped paths and the components.parameters.account_id definition across the same operations.
  • mailtrap/mailtrap-openapi#35: Updates the permissions resource response in account-management spec alongside changes to resource type modeling.

Suggested reviewers

  • piobeny
  • VladimirTaytor
  • IgorDobryn

Poem

🐰 A Rabbit's Code Review Hop

Account scopes are gone, the paths run free,
Flat and account-less, as paths should be,
From sandbox to domain, the schema now sings,
API simplicity—what happiness brings! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides motivation (empty), lists the main change, and includes a test checklist, but lacks detail on scope and impact of the multi-file endpoint restructuring. Expand the description with details about which API specs are affected and why account_id removal is necessary; fill in the motivation section to clarify the architectural reasoning.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the primary change—reverting a previous revert to restore the removal of account-scoped URL patterns from OpenAPI specs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-account-id

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 and usage tips.

@i7an i7an marked this pull request as ready for review May 14, 2026 16:16
@i7an i7an requested a review from VladimirTaytor May 14, 2026 16:19
@i7an i7an requested a review from piobeny May 14, 2026 16:19
@i7an i7an merged commit 8cefad0 into main May 15, 2026
1 of 2 checks passed
@i7an i7an deleted the remove-account-id branch May 15, 2026 07:37
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