Creates a user inside the caller's own tenant and sends them a Cognito
invitation email. The path tenant must equal the caller's tenant_id
claim; a mismatch is 403 Invalid tenant id.
The permission required depends on the role being granted:
roleName | permission |
|---|---|
SUPER_ADMIN | super_admin:create |
ADMIN | admin:create |
USER, or omitted | user:create |
| a custom role of this tenant | user:create, plus every permission the role grants |
Platform role names match case-insensitively; any other name is looked
up as a custom role of the path tenant (404 Role {name} not found
when it matches nothing), and a custom role may not grant a permission
the caller does not hold. A blank or absent roleName means USER.
The new user starts INVITED and cannot sign in until they set their
own password through POST /api/auth/activate or
POST /api/auth/new-password. The Cognito account is created first
and its sub becomes the platform user id. tenantId in the body is
ignored. Returns 200, not 201.

