cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/api-keys \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"name":"example name","service_account_id":"1234abcd-1234-1234-abcd-12345678abcd"}'{
"api_key": {
"created_at": "2022-03-22T20:23:11.285067Z",
"id": "CCDB1_12345abcdefGHIJKLMnopq",
"name": "example name",
"service_account_id": "1234abcd-1234-1234-abcd-12345678abcd"
},
"secret": "CCDB1_12345abcdefGHIJKLMnopq_NkdXLI9d81Mnx3djs45iwPfgtnaRv0XCh0Z9047K"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Create a new API Key
Can be used by the following roles assigned at the organization scope:
- ORG_ADMIN
POST
/
api
/
v1
/
api-keys
cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/api-keys \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"name":"example name","service_account_id":"1234abcd-1234-1234-abcd-12345678abcd"}'{
"api_key": {
"created_at": "2022-03-22T20:23:11.285067Z",
"id": "CCDB1_12345abcdefGHIJKLMnopq",
"name": "example name",
"service_account_id": "1234abcd-1234-1234-abcd-12345678abcd"
},
"secret": "CCDB1_12345abcdefGHIJKLMnopq_NkdXLI9d81Mnx3djs45iwPfgtnaRv0XCh0Z9047K"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
Body
application/json
Response
A successful response.

