---
title: "POST /api/v1/ssh/host-groups"
method: POST
path: "/api/v1/ssh/host-groups"
tags: ["SSH Host Groups"]
---

# POST /api/v1/ssh/host-groups

`POST /api/v1/ssh/host-groups`

Create SSH Host Group

## Request body

- object
  - `projectId` string, required — The ID of the project to create the SSH host group in.
  - `name` string, required — The name of the SSH host group.
  - `loginMappings` object[] — A list of default login mappings to include on each host in the SSH host group. Each login mapping contains a login user and a list of corresponding allowed principals being usernames of users in the Infisical SSH project.
    - `loginUser` string, required
    - `allowedPrincipals` object, required
      - `usernames` string[]
      - `groups` string[]

## Response `200`

Default Response

- object
  - `id` string, uuid, required
  - `projectId` string, required
  - `name` string, required
  - `loginMappings` object[], required
    - `loginUser` string, required
    - `allowedPrincipals` object, required
      - `usernames` string[]
      - `groups` string[]

## 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)
