SSH Keys
List SSH keys
GET
/api/v1/ssh-keysRequired scope: servers:read
Parameters
| Name | In | Required | Description |
|---|---|---|---|
account_id | query | yes | Account to scope the list to. Must be one the token owner belongs to. |
page[size] | query | no | Items per page (1-100, default 30). |
page[cursor] | query | no | Opaque cursor from a previous response. |
Example request
curl https://hangar.nagara.cloud/api/v1/ssh-keys?account_id=acct_123 \
-H "Authorization: Bearer hgp_your_token"Example response
{
"data": [ { /* ... */ } ],
"meta": { "per_page": 30, "next_cursor": "eyJ...", "prev_cursor": null },
"links": { "next": "/api/v1/...?page[cursor]=eyJ...", "prev": null }
}Register an SSH key
POST
/api/v1/ssh-keysRequired scope: servers:write
Example request
curl https://hangar.nagara.cloud/api/v1/ssh-keys \
-X POST \
-H "Authorization: Bearer hgp_your_token" \
-H "Content-Type: application/json" \
-d '{"account_id": "account_123", "name": "...", "public_key": "..."}'Example response
{ "data": {
"account_id": "account_123",
"created_at": "2026-01-01T00:00:00Z",
"fingerprint": "...",
"id": "id_123",
"name": "...",
"public_key": "..."
} }Get an SSH key
GET
/api/v1/ssh-keys/{key}Required scope: servers:read
Parameters
| Name | In | Required | Description |
|---|---|---|---|
key | path | yes | The key id. |
Example request
curl https://hangar.nagara.cloud/api/v1/ssh-keys/key_123 \
-H "Authorization: Bearer hgp_your_token"Example response
{ "data": {
"account_id": "account_123",
"created_at": "2026-01-01T00:00:00Z",
"fingerprint": "...",
"id": "id_123",
"name": "...",
"public_key": "..."
} }Delete an SSH key
DELETE
/api/v1/ssh-keys/{key}Required scope: servers:write
Parameters
| Name | In | Required | Description |
|---|---|---|---|
key | path | yes | The key id. |
Example request
curl https://hangar.nagara.cloud/api/v1/ssh-keys/key_123 \
-X DELETE \
-H "Authorization: Bearer hgp_your_token"Example response
HTTP/1.1 204 No Content