---
title: "Restore private key"
method: POST
path: "/api/chat/backup/restore"
tags: ["chat"]
---

# Restore private key

`POST /api/chat/backup/restore`

Get encrypted private key backup. Backup password is verified server-side. The backup is encrypted with the backup password (using PBKDF2/Argon2). Decrypt it client-side with the same backup password. Works for all users including OAuth users.

## Request body

- RestorePrivateKeyRequest — Request to restore private key. Backup password is verified server-side.
  - `backup_password` string, required — Backup password - verified server-side before returning backup. This is the password you set when creating the backup (separate from Keycloak password).

## Response `200`

Successful Response

- RestorePrivateKeyResponse — Response with encrypted private key backup.
  - `encrypted_private_key` string, required — Private key encrypted with user password
  - `encryption_salt` string, required — Salt used for key derivation
  - `encryption_iv` string, nullable — IV/nonce for AES-GCM (base64, optional if included in ciphertext)
  - `key_type` string, required — Key type
  - `backup_enabled` boolean, required — Whether backup is enabled

## Other responses

- `422` — Validation Error

---

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