---
title: "Create an SSH key"
method: POST
path: "/ssh_keys"
tags: ["Ssh Keys"]
---

# Create an SSH key

`POST /ssh_keys`

## Request

- Base URL: `https://sg.deployhq.com`
- URL: `https://sg.deployhq.com/ssh_keys`
- Auth: HTTP basic

## Request body

- KeyPairObject
  - `key_pair` object, required
    - `title` string, required
    - `key_type` string
    - `use_custom_key` boolean
    - `custom_private_key` string

## Response `201`

Created

- IdentifierTitlePublicKeyObject
  - `identifier` string
  - `title` string
  - `public_key` string
  - `key_type` string
  - `fingerprint` string
  - `account` string

## Other responses

- `400`: Bad Request
- `401`: You are not authorized to access this resource. You need to authenticate yourself first.
- `403`: You are not allowed to access this resource. You do not have the necessary permissions.
- `422`: Unprocessable Entity
- `500`: An unexpected error occurred on the server. The server was unable to process the request.

---

[API](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation.md) · [All operations](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/revisions/830264ae58be?raw)
