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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” unitId
required
string
Header Parameters
Section titled “Header Parameters ” X-Space-Id
required
string format: uuid
UUID of the target Space (tenant boundary). Validated against user access.
Request Body required
Section titled “Request Body required ”object
userId
required
User ID from the IdP
string
Example
usr_abc123 role
required
Role to assign
string
Example
operatorResponses
Section titled “ Responses ”object
id
required
Assignment ID
string format: uuid
Example
770e8400-e29b-41d4-a716-446655440000Unauthorized — missing or invalid JWT
Forbidden — insufficient permissions
Resource not found
Conflict — resource already exists or constraint violated
Validation failed — invalid input