v1

latestOpenAPI 3.0.22026-08-062794201004.1 KB
Api Keys

Create API Key

Creates a new API key under an organization.

Organization Owners can create Organization and Project scoped API keys.

Project Owner and Project Creator can create project scoped keys.

To learn more, see Organization, Project, and Database Access Overview.

post/v4/organizations/{organizationId}/apikeys

Request body

namestring required

Name of the API key.

descriptionstring

Description for the API key.

expirynumber float

Expiry of the API key in number of days. Must be at least 0.01 days. If set to -1, the token will not expire.

allowedCIDRsstring[]

List of inbound CIDRs for the API key. The system making a request must come from one of the allowed CIDRs.

organizationRolesAPIKeyOrganizationRoles[] required

Example request

{
  "name": "Production",
  "description": "API key to manage production Capella Cluster.",
  "allowedCIDRs": [
    "0.0.0.0/0"
  ],
  "organizationRoles": [
    "organizationMember"
  ],
  "resources": [
    {
      "id": "ffffffff-aaaa-1414-eeee-000000000000",
      "roles": [
        "projectDataReaderWriter",
        "projectManager"
      ]
    }
  ]
}

Response

Successfully created an API key under an organization.

idstring required

The id is a unique identifier for an apiKey.

tokenstring required

The Token is a confidential piece of information that is used to authorize requests made to v4 endpoints.

Example response

{
  "id": "IS9DrRsw4KWFS72Zhbj4xmhllHvPcdCL",
  "token": "QktxVUtFU1dKV1FlMmxwbzJBYXdnTVlRemFZdlRDZTg6eFh4dzU4JUYjekJVYWZPY3lqdUwwYkJoTjZSTmlzRWFIRHF0b1h4a08yazBpQjJ1bms1OW4yTUhAenRib3IhVQ=="
}