curl --request POST \
--url http://localhost:3333/v1/roles \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Compliance Lead",
"permissions": {
"control": [
"read",
"update"
],
"policy": [
"read",
"update",
"publish"
],
"risk": [
"read"
]
}
}
'{
"id": "rol_abc123",
"name": "compliance-lead",
"permissions": {},
"isBuiltIn": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Create a new custom role with specified permissions. Only admins and owners can create roles.
curl --request POST \
--url http://localhost:3333/v1/roles \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Compliance Lead",
"permissions": {
"control": [
"read",
"update"
],
"policy": [
"read",
"update",
"publish"
],
"risk": [
"read"
]
}
}
'{
"id": "rol_abc123",
"name": "compliance-lead",
"permissions": {},
"isBuiltIn": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}API key for authentication
Name of the custom role
2 - 50"Compliance Lead"
Permissions for the role. Keys are resource names, values are arrays of allowed actions.
{
"control": ["read", "update"],
"policy": ["read", "update", "publish"],
"risk": ["read"]
}Was this page helpful?