{{< details >}}
- Tier: 基础版, 专业版, 旗舰版
- Offering: JihuLab.com, 私有化部署
- Status: 实验
{{< /details >}}
使用此 API 与极狐GitLab组织交互。有关更多信息,请参阅组织。
创建组织
{{< history >}}
{{< /history >}}
{{< alert type=”flag” >}}
此功能的可用性由功能标志控制。有关更多信息,请参阅历史记录。
{{< /alert >}}
创建一个新的组织。
此端点是一个实验,可能会在没有通知的情况下更改或删除。
POST /organizations
参数:
属性 | 类型 | 必需 | 描述 |
---|---|---|---|
name |
string | 是 | 组织的名称 |
path |
string | 是 | 组织的路径 |
description |
string | 否 | 组织的描述 |
avatar |
file | 否 | 组织的头像图像 |
示例请求:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
--form "name=New Organization" \
--form "path=new-org" \
--form "description=A new organization" \
--form "avatar=@/path/to/avatar.png" \
"https://gitlab.example.com/api/v4/organizations"
示例响应:
{
"id": 42,
"name": "New Organization",
"path": "new-org",
"description": "A new organization",
"created_at": "2024-09-18T02:35:15.371Z",
"updated_at": "2024-09-18T02:35:15.371Z",
"web_url": "https://gitlab.example.com/-/organizations/new-org",
"avatar_url": "https://gitlab.example.com/uploads/-/system/organizations/organization_detail/avatar/42/avatar.png"
}