Function bulk_create_users

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

POST /api/users/bulk

Creates multiple non-admin users. Admin-only access.

§Request Body

{
  "users": [
    { "username": "u001", "email": "[email protected]", "password": "pw1" },
    { "username": "u002", "email": "[email protected]", "password": "pw2" }
  ]
}

§Response: 201 Created

  • JSON array of created user objects

§Errors:

  • 400 Bad Request — If validation fails
  • 409 Conflict — If one user fails to insert (first error returned)