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

NameInTypeDescription
project_idpathstringThe UUID of the project (tenant).
keypair_namepathstringThe name of the key pair to retrieve.
user_id (Optional)querystringFor 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

NameTypeDescription
keypairobjectWrapper object containing the key pair data.
keypair.idintegerInternal numeric identifier of the key pair.
keypair.namestringThe name of the key pair.
keypair.public_keystringPublic key material. May include a descriptive trailing comment (e.g. VSTOR-KEY-DESC:...).
keypair.fingerprintstringMD5 fingerprint of the public key (colon-delimited hex).
keypair.user_idstringUser ID that owns the key pair.
keypair.created_atstringCreation timestamp (ISO 8601).
keypair.updated_atnullAlways null (not currently used).
keypair.deletedbooleanAlways false (soft-delete not applied here).
keypair.deleted_atnullAlways null.
keypair.typestringKey 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

{
"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