Skip to content

Assign Unit Role

POST
/units/{unitId}/roles

Assigns a role (operator or viewer) to a user on a Unit. If the user already has a different role on this Unit, it is replaced. The user is identified by their IdP user ID. The Space must be active.

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

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

object
userId
required

User ID from the IdP

string
Example
usr_abc123
role
required

Role to assign

string
Allowed values: operator viewer
Example
operator
object
id
required

Assignment ID

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

Unauthorized — missing or invalid JWT

Forbidden — insufficient permissions

Resource not found

Conflict — resource already exists or constraint violated

Validation failed — invalid input