---
title: "Get attached public keys"
method: GET
path: "/api/vps/v1/virtual-machines/{virtualMachineId}/public-keys"
tags: ["VPS: Virtual machine"]
---

# Get attached public keys

`GET /api/vps/v1/virtual-machines/{virtualMachineId}/public-keys`

Retrieve public keys attached to a specified virtual machine.

Use this endpoint to view SSH keys configured for specific VPS instances.

## Path parameters

- `virtualMachineId` integer, required

## Query parameters

- `page` integer

## Response `200`

Success response

- object
  - `data` VPSV1PublicKeyPublicKeyResource[] — Array of [`VPS.V1.PublicKey.PublicKeyResource`](#model/vpsv1publickeypublickeyresource)
    - `id` integer — Public key ID
    - `name` string — Public key name
    - `key` string — Public key content
  - `meta` CommonSchemaPaginationMetaSchema
    - `current_page` integer
    - `per_page` integer
    - `total` integer

## Other responses

- `401` — Unauthenticated response
- `500` — Error response

---

[API](https://skmtc.net/hostinger/apis/hostinger-api.md) · [All operations](https://skmtc.net/hostinger/apis/hostinger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hostinger/hostinger-api/versions/796bd5194565/schema)
