cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/service-accounts/{service_account_id}/credentials \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"algorithm":"RS256","expires_at":"2023-03-22T20:23:11.285067Z","name":"ci signer","public_key":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkq...\n-----END PUBLIC KEY-----\n"}'{
"algorithm": "RS256",
"client_id": "crl-sa_abc123",
"created_at": "2022-03-22T20:23:11.285067Z",
"credential_type": "JWT_BEARER",
"expires_at": "2023-03-22T20:23:11.285067Z",
"id": "1234abcd-1234-1234-abcd-12345678abcd",
"name": "ci signer",
"service_account_id": "abcd1234-abcd-abcd-1234-abcdef123456"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Create an OAuth credential for a service account
Can be used by the following roles assigned at the organization scope:
- ORG_ADMIN
POST
/
api
/
v1
/
service-accounts
/
{service_account_id}
/
credentials
cURL
curl --request POST \
--url https://cockroachlabs.cloud/api/v1/service-accounts/{service_account_id}/credentials \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--json '{"algorithm":"RS256","expires_at":"2023-03-22T20:23:11.285067Z","name":"ci signer","public_key":"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkq...\n-----END PUBLIC KEY-----\n"}'{
"algorithm": "RS256",
"client_id": "crl-sa_abc123",
"created_at": "2022-03-22T20:23:11.285067Z",
"credential_type": "JWT_BEARER",
"expires_at": "2023-03-22T20:23:11.285067Z",
"id": "1234abcd-1234-1234-abcd-12345678abcd",
"name": "ci signer",
"service_account_id": "abcd1234-abcd-abcd-1234-abcdef123456"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Authorizations
Path Parameters
Body
application/json
Response
A successful response.
ServiceAccountCredential is an OAuth 2.0 jwt-bearer credential a service account uses to obtain short-lived access tokens. CockroachDB Cloud stores only the public key and signature algorithm; it never holds a secret on the customer's behalf.

