Identity and Access Management API, REST: ApiKey.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",
"lastUsedAt": "string"
},
"secret": "string"
}
Field | Description |
---|---|
apiKey | object ApiKey resource. An ApiKey resource. For more information, see Api-Key. |
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. The range of possible values is from To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits). |
apiKey. description |
string Description of the API key. 0-256 characters long. |
apiKey. lastUsedAt |
string (date-time) Timestamp for the last authentication using this API key. String in RFC3339 text format. The range of possible values is from To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits). |
secret | string Secret part of the API key. This secret key you may use in the requests for authentication. |