---
title: "Regenerate project SSH key"
method: PATCH
path: "/projects/{id}/regenerate_key"
tags: ["Projects"]
---

# Regenerate project SSH key

`PATCH /projects/{id}/regenerate_key`

## Request

- Base URL: `https://sg.deployhq.com`
- URL: `https://sg.deployhq.com/projects/{id}/regenerate_key`
- Auth: HTTP basic

Regenerates the project SSH key and returns the new public key. key_type is optional and defaults to the existing project's algorithm; must be one of ED25519 or RSA when provided.

## Path parameters

- `id` string, required

## Request body

- ProjectObject3
  - `project` object
    - `key_type` string

## Response `200`

Success

- PublicKeyObject
  - `public_key` string, required

## Other responses

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