Grant superuser role to a user
const url = 'http://localhost:3000/api/v1/system-roles/superuser/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/system-roles/superuser/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”User UUID
Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Responses
Section titled “Responses”object
System role record ID
User ID who has this role
User email
User name
Role type
When the role was granted
User ID who granted the role (null if granter was deleted)
Email of user who granted the role (null if granter was deleted)
Reason for granting
When the role was revoked (null if active)
User ID who revoked the role
Email of user who revoked the role
Whether the role is currently active
Example
{ "role": "SUPERUSER"}Only superusers can grant roles
User not found
User already has superuser role