---
title: "Create host"
method: GET
path: "/KnownHosts/create"
tags: ["KnownHosts", "Known SSH Hosts Management"]
---

# Create host

`GET /KnownHosts/create`

This function registers a host in the cPanel account's `/home/user/.ssh/known_hosts` file.

## Query parameters

- `host_name` union, required
  - string, hostname — A valid hostname.
  - string, ipv4 — A valid IP address.
- `port` integer

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `host` object[] — An array of objects containing information for the host.
        - `host` union — The hostname or IP address.
          - string, hostname — A valid hostname.
          - string, ipv4 — A valid IP address.
        - `key` string — The host's key.
        - `line` string — The host's entry in the `/home/user/.ssh/known_hosts` file, where `user` is the cPanel account username.
        - `meta` object — An object containing metadata about the host's public key.
          - `algorithm` string — The key's algorithm.
          - `body` string — The host's public key.
          - `md5` string — The key's [MD5](https://en.wikipedia.org/wiki/MD5) fingerprint.
          - `md5-printable` string — A human-readable version of the key's MD5 fingerprint.
          - `sha256` string — The key's [SHA-256](https://en.wikipedia.org/wiki/SHA-2) fingerprint.
          - `sha256-printable` string — A human-readable version of the key's SHA-256 fingerprint.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 1 | 0 — * `1` — Success. * `0` — Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
