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://www.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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
user_id is the ID of the user, service account, or group to add the role to.
resource_type is the type of resource the role applies to.
Available options:
ORGANIZATION, CLUSTER, FOLDER resource_id is the ID of the resource the role applies to. Pass an empty string for organization-scoped roles.
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 
