postAccountOrgsWithHttpInfo method
Onboard creates the caller's organization.
Onboard creates the caller's organization. Two flows, keyed on whether the caller already has a home org (mirrors app/onboard/route.ts): - FIRST-RUN (no home org): create + MOVE the user in as admin, so their next JWT carries the new owner and the cloud scopes everything to it. This is the path a fresh OAuth sign-up takes, from the sign-up application's org. - ADDITIONAL (owner set): create the org but do NOT move the user — a move changes their IAM owner (stripping a SuperAdmin's status + orphaning their current org). They reach the new org via the OrgSwitcher, which re-scopes X-Org-Id without touching IAM membership. A personal-org request from someone who already has an org is meaningless → 409.
Note: This method returns the HTTP Response.
Parameters:
- OnboardReq onboardReq (required):
Implementation
Future<Response> postAccountOrgsWithHttpInfo(OnboardReq onboardReq,) async {
// ignore: prefer_const_declarations
final path = r'/v1/account/orgs';
// ignore: prefer_final_locals
Object? postBody = onboardReq;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}