cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/service-accounts \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"description":"","name":"new name","roles":[{"name":"CLUSTER_ADMIN","resource":{"type":"ORGANIZATION"}}]}'{
"created_at": "2022-03-22T20:23:11.285067Z",
"creator_name": "creator",
"description": "",
"group_roles": [],
"id": "12345678-1234-1234-1234-123456789012",
"name": "SA Name",
"roles": [
{
"name": "CLUSTER_ADMIN",
"resource": {
"type": "ORGANIZATION"
}
}
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Create a service account
Can be used by the following roles assigned at the organization scope:
- ORG_ADMIN
- CLUSTER_ADMIN
POST
/
api
/
v1
/
service-accounts
cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/service-accounts \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"description":"","name":"new name","roles":[{"name":"CLUSTER_ADMIN","resource":{"type":"ORGANIZATION"}}]}'{
"created_at": "2022-03-22T20:23:11.285067Z",
"creator_name": "creator",
"description": "",
"group_roles": [],
"id": "12345678-1234-1234-1234-123456789012",
"name": "SA Name",
"roles": [
{
"name": "CLUSTER_ADMIN",
"resource": {
"type": "ORGANIZATION"
}
}
]
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}This endpoint is in Preview and subject to change. Refer to the API support policy for more details.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
A successful response.
A service account is an identity scoped to an organization that represents a non-human user.
created_at represents the creation time of the service account.
creator_name is the name of user that created the service account.
description of the service account.
roles that the service account has inherited via a group.
Show child attributes
Show child attributes
The ID of the service account.
name of the service account.
roles that are assigned to the service account.
Show child attributes
Show child attributes

