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 or service account
Add a single role to a user or service account by providing its user_id or service_account_id.
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
Available options:
ORGANIZATION, CLUSTER, FOLDER Available options:
BILLING_COORDINATOR, ORG_ADMIN, ORG_MEMBER, CLUSTER_ADMIN, CLUSTER_OPERATOR_WRITER, CLUSTER_DEVELOPER, CLUSTER_CREATOR, FOLDER_ADMIN, FOLDER_MOVER 
