Skip to main content

Show SSH Key Pair Details

GET/v2.1/{project_id}/os-keypairs/{keypair_name}

Retrieve the detailed information for a specific key pair identified by keypair_name within the authenticated project.

Request​

Parameters​

project_idstringrequiredpath

The UUID of the project (tenant).

keypair_namestringrequiredpath

The name of the key pair to retrieve.

user_idstringquery

For administrators: retrieve a key pair owned by the specified user ID. New in version 2.10

Although some references show user_id in the request body, standard usage is as a query parameter for GET requests.

Sample Request​

Using curl​

curl -ks \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' \
-H 'X-OpenStack-Nova-API-Version: 2.72' \
https://api.vietnix.cloud:8774/v2.1/{project_id}/os-keypairs/key1

http request​

GET https://api.vietnix.cloud:8774/v2.1//os-keypairs/apikey1

Response​

Response Body Fields​

keypairobjectrequired

Wrapper object containing the key pair data.

10 fields
idintegerrequired

Internal numeric identifier of the key pair.

namestringrequired

The name of the key pair.

public_keystringrequired

Public key material. May include a descriptive trailing comment (e.g. VSTOR-KEY-DESC:...).

fingerprintstringrequired

MD5 fingerprint of the public key (colon-delimited hex).

user_idstringrequired

User ID that owns the key pair.

created_atstringrequired

Creation timestamp (ISO 8601).

updated_atnullrequired

Always null (not currently used).

deletedbooleanrequired

Always false (soft-delete not applied here).

deleted_atnullrequired

Always null.

typestringrequired

Key type: ssh or x509. New in version 2.2

Status Codes​

Success​

CodeReason
200 - OKRequest succeeded.

Error​

CodeReason
401 - UnauthorizedAuthentication is required or failed.
403 - ForbiddenPolicy does not allow the current user to perform this action.
404 - Not FoundThe specified key pair does not exist.

Sample Response​

Response body
{
"keypair": {
"name": "apikey1",
"public_key": "ssh-rsa AAAA<...> VSTOR-KEY-DESC:Key description",
"fingerprint": "67:c0:a2:8a:b4:c8:50:de:80:91:ed:79:14:17:37:90",
"created_at": "2025-10-08T08:49:39.071378",
"user_id": "64166c7effeb4a89b59c073588099640",
"deleted": false,
"deleted_at": null,
"id": 183,
"updated_at": null
}
}

Notes & Tips​

  • Use the fingerprint to verify integrity after importing or distributing a key.
  • Descriptive suffixes (comments) after the base key material aid auditing but must not modify the key itself.
  • Administrative retrieval with user_id requires appropriate policy permissions and a compatible microversion (≥ 2.10).
  • Key type x509 support (microversion ≥ 2.2) may require additional configuration; if unsupported, the API may reject such keys at creation time.

See Also​