Keypair

Import key pair

Imports a new key pair for secure shell (SSH) access to your resources. To import a new key pair, include the key name, environment name, and public key in the request body. For additional information on importing SSH key pairs, see Quickstart. If you haven't created a key pair yet, you can generate one by clicking Quickstart.

post/core/keypairs

Request

  • Base URL: https://infrahub-api.nexgencloud.com/v1
  • URL: https://infrahub-api.nexgencloud.com/v1/core/keypairs
  • Auth: API key in header api_key

Request body

environment_namestring required

The name of the environment where the key pair is being created.

namestring required

The name of the key pair that is being created.

public_keystring required

The public key that is being used to import an SSH key pair. See the supported key types.

Response

Keypair is imported successfully

statusboolean

Whether the request succeeded.

messagestring

Human-readable description of the result.

Example response

{
  "status": true,
  "message": "Keypair is imported successfully",
  "keypair": {
    "id": 4501,
    "name": "example-keypair",
    "environment": {
      "id": 6190,
      "name": "example-environment",
      "features": {
        "green_status": "GREEN"
      }
    },
    "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOu6TJudyoheKvyDdnr8HYCBNjJVT79bq9EGuDHdR3e3 user@example.com",
    "fingerprint": "ff:00:4b:02:8e:43:b6:75:03:7c:52:52:df:82:9d:58",
    "created_at": "2026-05-07T11:47:30Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.