---
title: "Add SSH Public Key"
method: POST
path: "/v0/users/{user_id}/keys"
tags: ["users"]
---

# Add SSH Public Key

`POST /v0/users/{user_id}/keys`

## Request

- Base URL: `https://api.pantheon.io`
- URL: `https://api.pantheon.io/v0/users/{user_id}/keys`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/pantheon/apis/pantheon-public-api-service/docs/v0/users/:user_id/keys/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds an SSH public key to the authenticated user's account.
The key can be used for Git operations and SFTP access.

## Path parameters

- `user_id` string, required

## Request body

- AddSSHKeyRequest
  - `key` string, required: SSH public key content

## Response `201`

- AddSSHKeyResponse
  - `id` string, required: SSH key ID

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/pantheon/apis/pantheon-public-api-service.md) - [All operations](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/pantheon/apis/pantheon-public-api-service/revisions/5d158d59f4c3?raw)
