# SSH Keys

Creates an SSH key for use in your instances.

## HTTP Request

`POST` `{API_URL}/ssh-keys`

## Body Parameters

| Parameters | Requirements | Type     | Description             |
| ---------- | ------------ | -------- | ----------------------- |
| key\_name  | Required     | `string` | The name of the SSH key |
| key\_data  | Required     | `string` | The SSH key value       |

## Response Attributes

#### data `dict`

Returns the `data` object, containing details of the new SSH Key.

Each SSH key specifies the following properties:

* `id`: The ID of the SSH key.
* `key_name`: The name of the SSH key.
* `key_data`: The SSH key value.
* `create_time`: The UNIX timestamp of when the SSH Key was created.

#### status `string`

Indicates the result of the request to create a SSH key. `success` signifies success, while `failed` indicates an error.

#### message `string`

A description of the status of the request.

## Example

#### Request

```bash
curl -X POST '{API_URL}/ssh-keys' \
-H 'Authorization: Bearer {TOKEN/KEY}' \
-d '{
    "name": "My Personal SSH Key",
    "key_data": "ssh-rsa AAADB3NzaC1yc2EBBACCAQABAAABAQD5",
}'
```

#### Response

```json
{
    "data": {
        "id": 73,
        "key_name": "My Personal SSH Key",
        "key_data": "ssh-rsa AAADB3NzaC1yc2EBBACCAQABAAABAQD5",
        "create_time": "1730847667"
    },
    "message": "SSH key created successfully",
    "status": "success"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nebulablock.com/overview/platform_api/create_ssh_key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
