---
title: "Create a new user"
method: POST
path: "/api/users"
tags: ["Users"]
---

# Create a new user

`POST /api/users`

## Request body

- CreateUserInput
  - `username` string, required — Desired username (must be unique)
  - `password` string, required — Plain text password (will be bcrypt-hashed)

## Response `201`

User created successfully

- UserCreatedResponse
  - `success` boolean — Indicates whether the request was successful
  - `code` integer — HTTP status code
  - `message` string — Human-readable status message
  - `request_id` string, nullable — Unique request identifier for tracing
  - `timestamp` string, date-time — ISO 8601 response timestamp
  - `data` object, nullable
    - `id` string, uuid, required — Auto-generated UUID v4
    - `username` string, required — Unique username
    - `password` string, required — bcrypt-hashed password
  - `error` object, nullable
  - `errors` object[], nullable

## Other responses

- `409` — Resource conflict (e.g. duplicate username)
- `500` — Internal server error

## Changes

- **2026-07-17** `bff336605cec` — 1 info
  - endpoint added
- **2026-05-27** `f1f9de326bee` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/sword-web/apis/sword-users-api/changes/api/users/post.md)

---

[API](https://skmtc.dev/sword-web/apis/sword-users-api.md) · [All operations](https://skmtc.dev/sword-web/apis/sword-users-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sword-web/sword-users-api/revisions/bff336605cec/schema)
