cURL
curl --request PUT \
--url https://cockroachlabs.cloud/api/v1/roles/{user_id} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"roles":[{"name":"CLUSTER_ADMIN","resource":{"id":"example_cluster_id","type":"CLUSTER"}}],"user_id":"12345678-1234-1234-1234-123456789012"}'{
"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>"
}Replace the roles for a user, service account, or group with exactly those provided
Replace the entire role set for a user, service account, or group by providing its ID in the user_id path parameter.
Roles that will be removed or 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
PUT
/
api
/
v1
/
roles
/
{user_id}
cURL
curl --request PUT \
--url https://cockroachlabs.cloud/api/v1/roles/{user_id} \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"roles":[{"name":"CLUSTER_ADMIN","resource":{"id":"example_cluster_id","type":"CLUSTER"}}],"user_id":"12345678-1234-1234-1234-123456789012"}'{
"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.
Body
application/json
roles is the complete set of roles for the user, service account, or group.
Show child attributes
Show child attributes

