Use this API to interact with GitLab organizations. For more information, see organizations.

Cancel maintenance on an organization (maintenance_initialization -> active)

POST /api/v4/internal/org_mover/cancel_maintenance

Aborts maintenance initialization before the organization reaches the maintenance state, returning it to active.

Request body (application/json)

PropertyTypeDescription
organization_id
Required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
404Not found—
422Unprocessable entity—

Confirm maintenance on an organization (maintenance_initialization -> maintenance)

POST /api/v4/internal/org_mover/confirm_maintenance

Completes the maintenance transition once the organization is drained.

Request body (application/json)

PropertyTypeDescription
organization_id
Required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
404Not found—
409Conflict—
422Unprocessable entity—

Exit maintenance on an organization (maintenance -> active)

POST /api/v4/internal/org_mover/exit_maintenance

Returns an organization from maintenance to active.

Request body (application/json)

PropertyTypeDescription
organization_id
Required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
204No Content—
400Bad Request—
401Unauthorized—
404Not found—
422Unprocessable entity—

Report cutover readiness for an organization

GET /api/v4/internal/org_mover/maintenance_readiness

Reports whether an organization is drained and safe to enter maintenance.

Parameters

NameTypeDescription
organization_id
Query, required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Report an organization’s current lifecycle state

GET /api/v4/internal/org_mover/maintenance_state

Returns the organization’s current maintenance lifecycle state.

Parameters

NameTypeDescription
organization_id
Query, required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
404Not found—

Start maintenance on an organization (active -> maintenance_initialization)

POST /api/v4/internal/org_mover/start_maintenance

Begins the maintenance transition for an organization.

Request body (application/json)

PropertyTypeDescription
maintenance_reason
Required
StringThe reason for entering maintenance
Allowed values: migration, isolation, incident, billing, legal
Minimum length: 1
organization_id
Required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
204No Content—
400Bad request—
401Unauthorized—
404Not found—
422Unprocessable entity—

Create an organization

POST /api/v4/organizations

Creates an organization. This feature was introduced in GitLab 17.5. This feature is behind the allow_organization_creation feature flag. In GitLab 18.3, the feature flag changed to organization_switching. In GitLab 19.4, the feature flag changed to org_stage_experimental.

Request body (multipart/form-data)

PropertyTypeDescription
avatarString (binary)The avatar image for the organization
descriptionStringThe description of the organization
name
Required
StringThe name of the organization
path
Required
StringThe path of the organization
visibilityStringThe visibility level of the organization
Allowed values: private, public

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesOrganizationsOrganization
400Bad Request—

Soft-delete an organization

DELETE /api/v4/organizations/{id}

This feature was introduced in GitLab 19.2.

Parameters

NameTypeDescription
id
Path, required
IntegerThe ID of the organization

Responses

CodeDescriptionSchema
202Accepted—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesOrganizationsOrganization

PropertyTypeDescription
avatar_urlStringExample: https://example.com/uploads/-/system/organizations/organization_detail/avatar/1/avatar.png
created_atString (date-time)Example: 2022-02-24T20:22:30.097Z
descriptionStringExample: My description
idInteger (int64)Example: 1
nameStringExample: GitLab
pathStringExample: gitlab
updated_atString (date-time)Example: 2022-02-24T20:22:30.097Z
uuidStringExample: 0192f8c2-1a2b-7cde-89ab-0123456789ab
visibilityStringExample: public
web_urlStringExample: https://example.com/o/gitlab/-/overview