---
title: "Set the active RSA key for the Repository."
method: POST
path: "/repos/{owner}/{identifier}/rsa/"
tags: ["repos"]
---

# Set the active RSA key for the Repository.

`POST /repos/{owner}/{identifier}/rsa/`

Set the active RSA key for the Repository.

## Request body

- RepositoryRsaKeyCreate
  - `rsa_passphrase` string — The RSA passphrase used for signing.
  - `rsa_private_key` string, required — The RSA private key.

## Response `200`

The provided RSA key is the same as the current RSA key.

- RepositoryRsaKey
  - `active` boolean — If selected this is the active key for this repository.
  - `created_at` string, date-time
  - `default` boolean — If selected this is the default key for this repository.
  - `fingerprint` string — The long identifier used by RSA for this key.
  - `fingerprint_short` string
  - `public_key` string — The public key given to repository users.
  - `ssh_fingerprint` string, nullable — The SSH fingerprint used by RSA for this key.

## Other responses

- `201` — The provided RSA key was assigned to the Repository.
- `400` — The provided RSA key is not valid
- `402` — Custom RSA keys are not active; upgrade your account!
- `404` — Organization/Repository does not exist, or you do not have permissions.
- `422` — Missing or invalid parameters (see detail).

---

[API](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1.md) · [All operations](https://skmtc.dev/cloudsmith/apis/cloudsmith-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudsmith/cloudsmith-api-v1/revisions/4d7879df9b2f/schema)
