> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dalyenergy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create User

> Create a new user in the authenticated workspace

# POST /users

Create a new user record and automatically generate an API key for them. The new user is added to the currently authenticated workspace with the `viewer` role.

## Notes

* Requires **admin** role in the current workspace.
* The response includes a plaintext `api_key` field. This is the only time the key is visible -- store it securely.
* The API key is stored as an HMAC-SHA256+PBKDF2 hash and cannot be retrieved later.
* Request body requires `email`, `first_name`, and `last_name`.
* The newly created user is assigned the `viewer` role in the workspace. Promote them via workspace user management if a higher role is needed.
* See `GET /users/workspaces` to list workspaces the current user belongs to.

<Warning>Copy the returned `api_key` immediately. It cannot be recovered after this response.</Warning>
