POST/v2/organizations

Create an organization

Creates a new organization. Provide a name; you can also set its description and slug, subject to the slug's length and character constraints. A 200 response returns the created organization's details and base permissions.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

The organization's name and optional description and slug.

descriptionstringoptional
A description of the organization.
namestringrequired
The organization name. Must be between 3 and 50 characters.
slugstringoptional
The organization slug. Must be between 3 and 60 characters and contain lowercase letters, digits, or hyphens, with at least one lowercase letter.

5 status codes
200Returns the created organization, including its ID, name, slug, description, base permissions, and current user's organization role.
avatarobjectoptional
basePermissionsobjectrequired
currentUserRolestringoptional
The role of currently authorized user. Can be null when user has direct access to one of the projects owned by the organization.
Allowed:MEMBEROWNERMAINTAINER
descriptionstringoptional
idintegerrequired
namestringrequired
slugstringrequired
400Returned when a required field is missing or a field value fails validation, such as an invalid name length or slug.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is unauthenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when access is forbidden.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when a requested resource is not found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

name is required and must be 3 to 50 characters long. If provided, slug must be 3 to 60 characters and match the lowercase letter, digit, and hyphen pattern; a 400 is returned for invalid input. A 401 indicates an unauthenticated request, a 403 indicates access is forbidden, and a 404 indicates a requested resource was not found.