# SSH Key

This endpoint is used to create, update, search or delete ssh keys.

{% hint style="warning" %}
To use this endpoint you should have "manageVcs" access at team level and a Terrakube Organization
{% endhint %}

### Entity fields:

| Path                        | Type   | Description                                       |
| --------------------------- | ------ | ------------------------------------------------- |
| data.type                   | string | Should be "ssh"                                   |
| data.attributes.name        | string | Unique ssh key name for an Terrakube organization |
| data.attributes.description | string | Free text for description                         |
| data.attributes.privateKey  | string | SSH Key content                                   |
| data.attributes.sshType     | string | rsa or ed25519                                    |

### Example:

```
{
  "data": {
    "type": "ssh",
    "attributes": {
      "name": "Sample SSH Key",
      "description": "SSH Key Description",
      "privateKey": "{{sshPrivateKey}}",
      "sshType": "{{sshKeyType}}"
    }
  }
}
```

### Supported Operations

{% openapi src="/files/wOxBGhpTJZD4a5Hp3Og6" path="/organization/{organizationId}/ssh" method="get" %}
[v2\_6.yaml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-cbcb0b1bcdefad8f4d123fc3cda02bf617d62c95%2Fv2_6.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/wOxBGhpTJZD4a5Hp3Og6" path="/organization/{organizationId}/ssh" method="post" %}
[v2\_6.yaml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-cbcb0b1bcdefad8f4d123fc3cda02bf617d62c95%2Fv2_6.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/wOxBGhpTJZD4a5Hp3Og6" path="/organization/{organizationId}/ssh/{sshId}" method="delete" %}
[v2\_6.yaml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-cbcb0b1bcdefad8f4d123fc3cda02bf617d62c95%2Fv2_6.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/wOxBGhpTJZD4a5Hp3Og6" path="/organization/{organizationId}/ssh/{sshId}" method="patch" %}
[v2\_6.yaml](https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-cbcb0b1bcdefad8f4d123fc3cda02bf617d62c95%2Fv2_6.yaml?alt=media)
{% endopenapi %}


---

# 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.terrakube.io/2.18.0/api/methods/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.
