---
title: "POST /v1beta/{tenantId}/host/hosts"
method: POST
path: "/v1beta/{tenantId}/host/hosts"
tags: ["Host"]
---

# POST /v1beta/{tenantId}/host/hosts

`POST /v1beta/{tenantId}/host/hosts`

Creates host.

## Request body

- HostCreateSpec — Host is a consumer of volume from storage.
  - `osType` 'linux' | 'windows' | 'esxi', required
  - `hostName` string, required — Only numbers, letters, '-', '.' in ASCII characters are allowed.
  - `ip` string, required — IP address of the host, mandatory
  - `port` integer — Host access port
  - `accessMode` 'agent' | 'agentless', required — The way to access host, system will access host to get more information and install agent if accessMode is 'agent'. 'port', 'username'and 'password' are requried in 'agent' mode.
  - `username` string — username to access Host
  - `password` string — password to access Host
  - `availabilityZones` string[], nullable
  - `initiators` object[], nullable — Initiator of host
    - `portName` string — Host initiator. Set the wwn, iSCSI type of the host whose FC type is set to iqn of the host
    - `protocol` 'iscsi' | 'fibre_channel' | 'nvmeof' — Initiator type FC or iSCSI

## Response `200`

OK

- HostRespSpec — Host is a consumer of volume from storage.
  - `id` string
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `tenantId` string
  - `hostName` string
  - `osType` string
  - `accessMode` string
  - `ip` string
  - `port` string
  - `username` string
  - `availabilityZones` string[]
  - `initiators` object[]
    - `portName` string
    - `protocol` 'iscsi' | 'fibre_channel' | 'nvmeof'

## Other responses

- `400` — BadRequest
- `401` — NotAuthorized
- `403` — Forbidden
- `500` — An unexpected error occured.

## Changes

- **2020-02-07** `fe6600fe7546` — 1 warning
  - changed the pattern of the request property `hostName` from `^(([a-zA-Z0-9_-]|[a-zA-Z0-9_-][a-zA-Z0-9_-]*[a-zA-Z0-9_-]))*([A-Za-z0-9_-]|[A-Za-z0-9_-][A-Za-z0-9_-]*[A-Za-z0-9_-])$` to `^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`
- **2020-02-07** `3ee778b81b92` — 1 warning, 1 info
  - changed the pattern of the request property `hostName` from `^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$` to `^(([a-zA-Z0-9_-]|[a-zA-Z0-9_-][a-zA-Z0-9_-]*[a-zA-Z0-9_-]))*([A-Za-z0-9_-]|[A-Za-z0-9_-][A-Za-z0-9_-]*[A-Za-z0-9_-])$`
  - the request property `availabilityZones` became nullable
- **2019-12-18** `5fa53bf5acd6` — 1 info
  - the request property `initiators` became nullable
- **2019-12-05** `8450d2e17372` — 2 breaking
  - added the pattern `^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$` to the request property `ip`
  - added the pattern `^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$` to the request property `hostName`
- **2019-12-04** `e4c0a6954a29` — 1 info
  - added the new `esxi` enum value to the request property `osType`

[Full history](https://skmtc.dev/sodafoundation/apis/soda-api/changes/v1beta/:tenantId/host/hosts/post.md)

---

[API](https://skmtc.dev/sodafoundation/apis/soda-api.md) · [All operations](https://skmtc.dev/sodafoundation/apis/soda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sodafoundation/apis/soda-api/revisions/62ce0f6c94b4?raw)
