Function create_user

Source
pub async fn create_user(
    __arg0: State<AppState>,
    __arg1: Json<CreateUserRequest>,
) -> impl IntoResponse
Expand description

POST /api/users

Creates a single non-admin user. Admin-only access.

§Request Body

{
  "username": "u12345678",
  "email": "[email protected]",
  "password": "securepassword"
}

§Response: 201 Created

  • JSON body with full user object (excluding password)

§Errors:

  • 400 Bad Request — Validation failure
  • 409 Conflict — Duplicate username/email