# SSH key

## Available Fields

| Field        |
| ------------ |
| `id`         |
| `user`       |
| `title`      |
| `public_key` |
| `created_at` |

***

## Examples

### Get all SSH keys

```bash
GET "https://api.balena-cloud.com/v7/user__has__public_key" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Get SSH key by ID

```bash
GET "https://api.balena-cloud.com/v7/user__has__public_key(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```

### Add new SSH key to account

```bash
POST "https://api.balena-cloud.com/v7/user__has__public_key" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "public_key": "<SSH KEY>",
    "title": "<TITLE>",
    "user": "<USER ID>"
}'
```

### Remove SSH key

```bash
DELETE "https://api.balena-cloud.com/v7/user__has__public_key(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 
```


---

# 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.balena.io/reference/api/resources/user__has__public_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.
