---
title: "POST /api/v1/ssh/hosts"
method: POST
path: "/api/v1/ssh/hosts"
tags: ["SSH Hosts"]
---

# POST /api/v1/ssh/hosts

`POST /api/v1/ssh/hosts`

Register SSH Host

## Request body

- object
  - `projectId` string, required — The ID of the project to create the SSH host in.
  - `hostname` string, required — The hostname of the SSH host.
  - `alias` string — The alias for the SSH host.
  - `userCertTtl` string — The time to live for user certificates issued under this host.
  - `hostCertTtl` string — The time to live for host certificates issued under this host.
  - `loginMappings` object[] — A list of login mappings for the SSH host. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users or groups slugs in the Infisical SSH project.
    - `loginUser` string, required
    - `allowedPrincipals` object, required
      - `usernames` string[]
      - `groups` string[]
  - `userSshCaId` string — The ID of the SSH CA to use for user certificates. If not specified, the default user SSH CA will be used if it exists.
  - `hostSshCaId` string — The ID of the SSH CA to use for host certificates. If not specified, the default host SSH CA will be used if it exists.

## Response `200`

Default Response

- object
  - `id` string, uuid, required
  - `projectId` string, required
  - `hostname` string, required
  - `alias` string, nullable
  - `userCertTtl` string, required
  - `hostCertTtl` string, required
  - `userSshCaId` string, uuid, required
  - `hostSshCaId` string, uuid, required
  - `loginMappings` object[], required
    - `loginUser` string, required
    - `allowedPrincipals` object, required
      - `usernames` string[]
      - `groups` string[]
    - `source` 'host' | 'hostGroup', required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.dev/infisical/apis/infisical-api.md) · [All operations](https://skmtc.dev/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infisical/infisical-api/revisions/53fe4d80973f/schema)
