Skip to content

Create API Key

POST
/enum.api.v1.ServiceAccountService/CreateApiKey
object
projectId
string
serviceAccountId
string
name

Unique within the service account. Cannot be changed after creation.

string
expiresAt

Required, and must be in the future. There is no way to create a key that never expires.

string format: date-time

OK

object
apiKey

An ApiKey is a long-lived credential belonging to a service account. The key token is returned once, when the key is created, and is not retrievable afterwards. Deleting a key revokes it immediately.

The key is scoped to its service account’s project; it carries no project_id of its own.

object
id
string
serviceAccountId
string
name
string
expiresAt

The point in time after which the key stops authenticating.

string format: date-time
createdAt
string format: date-time
status
integer format: enum
token

The key token. Returned only on creation and never retrievable afterwards.

string