cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/roles/{user_id}/{resource_type}/{resource_id}/{role_name} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'{
"group_roles": [
{
"group_names": [
"<string>"
],
"role": {
"name": "BILLING_COORDINATOR",
"resource": {
"type": "ORGANIZATION",
"id": "<string>"
}
}
}
],
"roles": [
{
"name": "BILLING_COORDINATOR",
"resource": {
"type": "ORGANIZATION",
"id": "<string>"
}
}
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Add a role to a user, service account, or group
Add a single role to a user, service account, or group by providing its ID in the user_id path parameter.
Roles that will be added as a result of this call must follow the CC rules for role assignment: https://docs.cockroachlabs.com/docs/cockroachcloud/authorization#organization-user-roles
POST
/
api
/
v1
/
roles
/
{user_id}
/
{resource_type}
/
{resource_id}
/
{role_name}
cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/roles/{user_id}/{resource_type}/{resource_id}/{role_name} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'{
"group_roles": [
{
"group_names": [
"<string>"
],
"role": {
"name": "BILLING_COORDINATOR",
"resource": {
"type": "ORGANIZATION",
"id": "<string>"
}
}
}
],
"roles": [
{
"name": "BILLING_COORDINATOR",
"resource": {
"type": "ORGANIZATION",
"id": "<string>"
}
}
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
Path Parameters
role_name is the role to grant.
Available options:
BILLING_COORDINATOR, ORG_ADMIN, ORG_MEMBER, CLUSTER_ADMIN, CLUSTER_OPERATOR_WRITER, CLUSTER_DEVELOPER, CLUSTER_CREATOR, FOLDER_ADMIN, FOLDER_MOVER, METRICS_VIEWER, CLUSTER_MONITOR, BILLING_VIEWER, AUDITOR, CLUSTER_DATA_ACCESSOR 
