POST
/
api
/
v1
/
ssh
/
hosts
cURL
curl --request POST \
  --url https://us.infisical.com/api/v1/ssh/hosts \
  --header 'Content-Type: application/json' \
  --data '{
  "projectId": "<string>",
  "hostname": "<string>",
  "alias": "",
  "userCertTtl": "8h",
  "hostCertTtl": "1y",
  "loginMappings": [],
  "userSshCaId": "<string>",
  "hostSshCaId": "<string>"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "projectId": "<string>",
  "hostname": "<string>",
  "alias": "<string>",
  "userCertTtl": "<string>",
  "hostCertTtl": "<string>",
  "userSshCaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "hostSshCaId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "loginMappings": [
    {
      "loginUser": "<string>",
      "allowedPrincipals": {
        "usernames": [
          "<string>"
        ],
        "groups": [
          "<string>"
        ]
      },
      "source": "host"
    }
  ]
}

Body

application/json
projectId
string
required

The ID of the project to create the SSH host in.

hostname
string
required

The hostname of the SSH host.

Minimum length: 1
alias
string
default:""

The alias for the SSH host.

Maximum length: 64
userCertTtl
string
default:8h

The time to live for user certificates issued under this host.

hostCertTtl
string
default:1y

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.

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

Default Response

id
string<uuid>
required
projectId
string
required
hostname
string
required
userCertTtl
string
required
hostCertTtl
string
required
userSshCaId
string<uuid>
required
hostSshCaId
string<uuid>
required
loginMappings
object[]
required
alias
string | null