groups

Create a group

Creates a project group. Available only for users who can create groups.

post/api/v4/groups

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Request body

namestring required

The name of the group

pathstring required

The path of the group

parent_idinteger

The parent group id for creating nested group

organization_idinteger

The organization id for the group

descriptionstring

The description of the group

visibility'private' | 'internal' | 'public'

The visibility of the group

avatarstring binary

Avatar image for the group

share_with_group_lockboolean

Prevent sharing a project with another group within this group

require_two_factor_authenticationboolean

Require all users in this group to setup Two-factor authentication

two_factor_grace_periodinteger

Time before Two-factor authentication is enforced

project_creation_level'noone' | 'owner' | 'maintainer' | 'developer' | 'administrator'

Determine if developers can create projects in the group

auto_devops_enabledboolean

Default to Auto DevOps pipeline for all projects within this group

subgroup_creation_level'owner' | 'maintainer'

Allowed to create subgroups

emails_disabledboolean

(Deprecated) Disable email notifications. Use: emails_enabled

emails_enabledboolean

Enable email notifications

show_diff_preview_in_emailboolean

Include the code diff preview in merge request notification emails

mentions_disabledboolean

Disable a group from getting mentioned

lfs_enabledboolean

Enable/disable LFS for the projects in this group

request_access_enabledboolean

Allow users to request member access

default_branchstring

The default branch of group's projects

default_branch_protection0 | 3 | 1 | 2 | 4

Determine if developers can push to default branch

enabled_git_access_protocol'ssh' | 'http' | 'all'

Allow only the selected protocols to be used for Git access.

crm_enabledboolean

Enable Customer Relations Management for this group

resource_access_token_notify_inheritedboolean

Send access token expiry notifications to all inherited members of the group

lock_resource_access_token_notify_inheritedboolean

Prevent subgroups from overriding the access token expiry notification setting

membership_lockboolean

Prevent adding new members to projects within this group

ldap_cnstring

LDAP Common Name

ldap_accessinteger

A valid access level

shared_runners_minutes_limitinteger

(admin-only) compute minutes quota for this group

extra_shared_runners_minutes_limitinteger

(admin-only) Extra compute minutes quota for this group

wiki_access_level'disabled' | 'private' | 'enabled'

Wiki access level. One of disabled, private or enabled

duo_availability'always_on' | 'default_on' | 'default_off' | 'never_on'

Duo availability. One of default_on, default_off, never_on or always_on

duo_remote_flows_availabilityboolean

Enable GitLab Duo remote flows for this group

duo_foundational_flows_availabilityboolean

Enable GitLab foundational Duo flows for this group

duo_custom_agents_availabilityboolean

Enable GitLab Duo custom agents for this group

duo_custom_flows_availabilityboolean

Enable GitLab Duo custom flows for this group

duo_external_agents_availabilityboolean

Enable GitLab Duo external agents for this group

tool_approval_for_session_availability'default_on' | 'default_off' | 'never_on'

Tool approval for session availability. One of default_on, default_off or never_on

amazon_q_auto_review_enabledboolean

Enable Amazon Q auto review for merge request

experiment_features_enabledboolean

Enable experiment features for this group

model_prompt_cache_enabledboolean

Enable model prompt cache for this group

Example request

{
  "default_branch": "main"
}

Response

Create a group

idinteger required
web_urlstring required
namestring required
pathstring required
descriptionstring required
visibilitystring required
share_with_group_lockboolean required
require_two_factor_authenticationboolean required
two_factor_grace_periodinteger required
project_creation_levelstring required
auto_devops_enabledstring required
subgroup_creation_levelstring required
emails_disabledboolean required
emails_enabledboolean required
show_diff_preview_in_emailboolean required
mentions_disabledstring required
lfs_enabledboolean required
archivedboolean required
math_rendering_limits_enabledboolean required
lock_math_rendering_limits_enabledboolean required
crm_enabledboolean required
resource_access_token_notify_inheritedboolean required
lock_resource_access_token_notify_inheritedboolean required
default_branchstring required
default_branch_protectioninteger required
default_branch_protection_defaultsstring required
avatar_urlstring required
request_access_enabledboolean required
full_namestring required
full_pathstring required
created_atstring required
parent_idstring required
organization_idinteger required
shared_runners_settingstring required
max_artifacts_sizeinteger required
marked_for_deletion_onstring required
ldap_cnstring required
ldap_accessstring required
file_template_project_idstring
wiki_access_levelstring required
repository_storagestring
duo_core_features_enabledboolean

[Experimental] Indicates whether GitLab Duo Core features are enabled for the group

duo_features_enabledstring
lock_duo_features_enabledstring
auto_duo_code_review_enabledstring
web_based_commit_signing_enabledstring
allow_personal_snippetsstring
duo_namespace_access_rulesstring
built_in_project_templates_enabledboolean
lock_built_in_project_templates_enabledboolean

Example response

{
  "web_url": "http://gitlab.example.com/groups/diaspora",
  "name": "Diaspora",
  "custom_attributes": {
    "key": "foo",
    "value": "bar"
  },
  "ldap_group_links": {
    "cn": "ldap-group-1",
    "group_access": 10,
    "provider": "ldapmain",
    "filter": "id >= 500",
    "member_role_id": 12
  },
  "saml_group_links": {
    "name": "saml-group-1",
    "access_level": 40,
    "member_role_id": 12,
    "provider": "saml"
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.