POST
/
v3
/
orgs
/
{orgId}
/
iam
/
service-accounts
/
{accountId}
/
keys
curl --request POST \
  --url https://api.ctrl-hub.com/v3/orgs/{orgId}/iam/service-accounts/{accountId}/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "data": {
    "type": "service-account-keys"
  }
}'
{
  "data": {
    "type": "service-accounts",
    "id": "14b28316-9c20-8a7d-e85a-b62f29a29ac5",
    "attributes": {
      "client_secret": "5-wyyBa465q6FikrEqtm07LbSc",
      "enabled": true
    }
  }
}

The response contains the ID and the Secret in data.attributes.secret. The secret is only returned once, so make sure to store it securely.

Authorizations

Authorization
string
header
required

To understand how to authenticate, see the auth docs

Body

application/json
data
object

Response

200
application/json
data
object