Skip to content

Grant a system role to a user

POST
/api/v1/system-roles/grant
curl --request POST \
--url http://localhost:3000/api/v1/system-roles/grant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "userId": "example", "role": "SUPERUSER", "reason": "example" }'
Media type application/json
object
userId
required

User ID to grant the role to

string
role
required

Role type to grant

string
Allowed values: SUPERUSER SUPPORT
reason

Reason for granting the role

string
Media type application/json
object
id
required

System role record ID

string
userId
required

User ID who has this role

string
userEmail
required

User email

string
userName

User name

string
role
required

Role type

string
Allowed values: SUPERUSER SUPPORT
grantedAt
required

When the role was granted

string format: date-time
grantedById

User ID who granted the role (null if granter was deleted)

string
grantedByEmail

Email of user who granted the role (null if granter was deleted)

string
reason

Reason for granting

string
revokedAt

When the role was revoked (null if active)

string format: date-time
revokedById

User ID who revoked the role

string
revokedByEmail

Email of user who revoked the role

string
isActive
required

Whether the role is currently active

boolean
Example
{
"role": "SUPERUSER"
}

Invalid request

Only superusers can grant roles

User not found

User already has this role