Skip to content

Assign Unit Role by Email

POST
/units/{unitId}/roles/invite

Assigns a unit role by email. Single entry point for the UI. If the email belongs to a registered user, the role is assigned directly (outcome: “assigned”). If the email is not registered, an invitation is created (outcome: “invited”). The caller does not need to know whether the user exists.

unitId
required
string
X-Space-Id
required
string format: uuid

UUID of the target Space (tenant boundary). Validated against user access.

object
email
required

Email of the user to invite or assign

string format: email
Example
john.smith@example.com
role
required

Role to assign

string
Allowed values: operator viewer
Example
operator
object
outcome
required

Whether the user was directly assigned or invited

string
Allowed values: assigned invited
Example
assigned
id
required

Assignment or invitation ID

string format: uuid
Example
770e8400-e29b-41d4-a716-446655440000

Unauthorized — missing or invalid JWT

Forbidden — insufficient permissions

Resource not found

Validation failed — invalid input