---
title: "Create a new Host in the vault"
method: POST
path: "/v1/host/{external_id}/"
tags: ["host"]
---

# Create a new Host in the vault

`POST /v1/host/{external_id}/`

## Request

- Base URL: `https://termius.com` (the document declares no server; this is the origin it was published from)
- URL: `https://termius.com/v1/host/{external_id}/`
- Auth: none declared

Pass the host ID in your infrastructure as `external_id` in the API
path, the vault name in the `vault`, `address`, and optional `label`
fields. Additionally, pass the ssh port in `port` field inside the
`ssh` object or telnet port in `port` inside the `telnet` object.

To see the full schema of the request, click on the **Schema** in
**Request body** below.

Example of the request that creates a new host with `external_id` as
`vm-1234` in `Team` vault with address `example.com`, label `Database`,
ssh port `22`, and ssh credentials in `username` and `password`
properties, and SSH key in the `key` property:

- path: `/v1/host/vm-1234/`
- body:
  ```
  {
    "vault": "Team",
    "address": "example.com",
    "label": "Database",
    "ssh": {
      "port": 22,
      "credentials": {
        "username": "username",
        "password": "password",
        "key": {
          "label": "shared with the team",
          "private": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3Blbn..."
        }
      }
    }
  }
  ```

Optionally, pass the `group` field with the group `external_id` instead
of the vault. Create such a group with the
<a rel="noopener noreferrer" href="#operations-group-createGroup">
<code>/group/{external_id}/</code> API</a>.

## Path parameters

- `external_id` string, required

## Request body

- Host
  - `group` string, required
  - `vault` string, required
  - `address` string, required
  - `label` string
  - `tags` string[]
  - `ssh` object
    - `port` integer
    - `credentials` Credentials
      - `username` string
      - `password` string
  - `telnet` object
    - `port` integer
    - `credentials` Credentials
      - `username` string
      - `password` string

## Response `200`

successful operation

- CreateHostResponse

## Other responses

- `400`: Failed request. Check the request body.

---

[API](https://skmtc.dev/termius/apis/termius-api-bridge.md) - [All operations](https://skmtc.dev/termius/apis/termius-api-bridge/llms.txt) - [OpenAPI document](https://skmtc.dev/termius/apis/termius-api-bridge/revisions/668e002cb168?raw)
