Method create

Creates an API key for the specified service account.

HTTP request

POST https://iam.api.cloud.yandex.net/iam/v1/apiKeys

Body parameters

{
  "serviceAccountId": "string",
  "description": "string"
}
Field Description
serviceAccountId string

ID of the service account to create an API key for. To get the service account ID, use a list request. If not specified, it defaults to the subject that made the request.

The maximum string length in characters is 50.

description string

Description of the API key.

The maximum string length in characters is 256.

Response

HTTP Code: 200 - OK

{
  "apiKey": {
    "id": "string",
    "serviceAccountId": "string",
    "createdAt": "string",
    "description": "string"
  },
  "secret": "string"
}
Field Description
apiKey object

ApiKey resource.

An ApiKey resource.

apiKey.
id
string

ID of the API Key.

apiKey.
serviceAccountId
string

ID of the service account that the API key belongs to.

apiKey.
createdAt
string (date-time)

Creation timestamp.

String in RFC3339 text format.

apiKey.
description
string

Description of the API key. 0-256 characters long.

secret string

Secret part of the API key. This secret key you may use in the requests for authentication.