---
title: "Create user group"
method: POST
path: "/usergroups"
tags: ["usergroup"]
---

# Create user group

`POST /usergroups`

Create user group information

## Headers

- `X-Request-Id` string

## Request body

- UserGroup
  - `id` integer — The ID of the user group
  - `group_name` string — The name of the user group
  - `group_type` integer — The group type, 1 for LDAP group, 2 for HTTP group, 3 for OIDC group.
  - `ldap_group_dn` string — The DN of the LDAP group if group type is 1 (LDAP group).

## Response `201`

User group created successfully.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `409` — Conflict
- `500` — Internal server error

---

[API](https://skmtc.dev/goharbor/apis/harbor-api.md) · [All operations](https://skmtc.dev/goharbor/apis/harbor-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/goharbor/harbor-api/revisions/62d78801f8df/schema)
