# Create host

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

Endpoint: GET /KnownHosts/create
Version: 11.136.0.14
Security: BasicAuth

## Query parameters:

  - `host_name` (any, required)
    The hostname or IP address to add.
    Example: "hostname.example.com"

  - `port` (integer)
    The SSH port to use, if the system uses a non-standard SSH port.
    Example: 1234

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "create"

  - `module` (string)
    The name of the module called.
    Example: "KnownHosts"

  - `result` (object)

  - `result.data` (object)

  - `result.data.host` (array)
    An array of objects containing information for the host.

  - `result.data.host.host` (any)
    The hostname or IP address.
    Example: "hostname.example.com"

  - `result.data.host.key` (string)
    The host's key.
    Example: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="

  - `result.data.host.line` (string)
    The host's entry in the /home/user/.ssh/known_hosts file, where user is the cPanel account username.
    Example: "host.example.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="

  - `result.data.host.meta` (object)
    An object containing metadata about the host's public key.

  - `result.data.host.meta.algorithm` (string)
    The key's algorithm.
    Example: "ssh-rsa"

  - `result.data.host.meta.body` (string)
    The host's public key.
    Example: "AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="

  - `result.data.host.meta.md5` (string)
    The key's [MD5](https://en.wikipedia.org/wiki/MD5) fingerprint.
    Example: "b6030e39979ed0e724cea3773e014209"

  - `result.data.host.meta.md5-printable` (string)
    A human-readable version of the key's MD5 fingerprint.
    Example: "MD5:b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:09"

  - `result.data.host.meta.sha256` (string)
    The key's [SHA-256](https://en.wikipedia.org/wiki/SHA-2)
fingerprint.
    Example: "44e405bcf4e11ab5b846e58ba0bf6dabd23dcc9e367cae17cb0c91b5b 3b3fc44"

  - `result.data.host.meta.sha256-printable` (string)
    A human-readable version of the key's SHA-256 fingerprint.
    Example: "SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 — Success.
* 0 — Failed. Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


