Identity and Access Management API, gRPC: ApiKeyService.Create
Creates an API key for the specified service account.
gRPC request
rpc Create (CreateApiKeyRequest) returns (CreateApiKeyResponse)
CreateApiKeyRequest
{
"serviceAccountId": "string",
"description": "string",
"scope": "string",
"expiresAt": "google.protobuf.Timestamp"
}
Field |
Description |
serviceAccountId |
string ID of the service account to create an API key for. |
description |
string Description of the API key. |
scope |
string Scope of the API key. |
expiresAt |
API key expiration timestamp, if not specified, then the API key doesn't expire |
CreateApiKeyResponse
{
"apiKey": {
"id": "string",
"serviceAccountId": "string",
"createdAt": "google.protobuf.Timestamp",
"description": "string",
"lastUsedAt": "google.protobuf.Timestamp",
"scope": "string",
"expiresAt": "google.protobuf.Timestamp"
},
"secret": "string"
}
Field |
Description |
apiKey |
ApiKey resource. |
secret |
string Secret part of the API key. This secret key you may use in the requests for authentication. |
ApiKey
An ApiKey resource. For more information, see Api-Key.
Field |
Description |
id |
string ID of the API Key. |
serviceAccountId |
string ID of the service account that the API key belongs to. |
createdAt |
Creation timestamp. |
description |
string Description of the API key. 0-256 characters long. |
lastUsedAt |
Timestamp for the last authentication using this API key. |
scope |
string Scope of the API key. 0-256 characters long. |
expiresAt |
API key expiration timestamp. |