# /users - Create user **POST /users** Create a new user with hierarchical authorization ## Servers - Backend API server (port 8080): https://api.your-domain.com/api (Backend API server (port 8080)) - Collect API server (port 8081): https://collect.your-domain.com/api (Collect API server (port 8081)) ## Authentication methods - Bearer auth ## Parameters ### Body: application/json (object) - **email** (string(email)) Email address (username will be generated automatically) - **name** (string) Full name - **user_role_ids** (array[string]) User role IDs to assign - **organization_id** (string) Organization Logto ID to assign user to (use the logto_id from organization responses) - **phone** (string) Phone number - **custom_data** (object) Custom user data ## Responses ### 201 User created successfully #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object) ### 400 Bad request - validation error #### Body: application/json (object) - **code** (integer) HTTP error code - **message** (string) Error message - **data** (object) ### 401 Unauthorized - invalid or missing token #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) ### 403 Forbidden - insufficient permissions #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** (object | null) ### 422 Unprocessable entity - business logic error #### Body: application/json (object) - **code** (integer) HTTP error code - **message** (string) Error message - **data** (object) [Powered by Bump.sh](https://bump.sh)