---
title: "Create a local user."
method: POST
path: "/users"
tags: ["user"]
---

# Create a local user.

`POST /users`

This API can be used only when the authentication mode is for local DB.  When self registration is disabled.

## Headers

- `X-Request-Id` string

## Request body

- UserCreationReq
  - `email` string
  - `realname` string
  - `comment` string
  - `password` string
  - `username` string

## Response `201`

Created

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — When the self registration is disabled, non-admin does not have permission to create user. When self registration is enabled, this API can only be called from UI portal, calling it via script will get a 403 error.
- `409` — Conflict
- `500` — Internal server error

---

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