---
title: "Recover the API key for a settled bundle"
method: POST
path: "/api/payments/recover"
---

# Recover the API key for a settled bundle

`POST /api/payments/recover`

## Request

- Base URL: `https://api.reletter.com`
- URL: `https://api.reletter.com/api/payments/recover`
- Auth: none required

Re-issue the API key for a bundle you already paid for but whose key you lost. The key is shown only once, in the buy response. Only bundles settled on the `tempo` rail can be recovered here, because recovery proves control of the wallet that funded them: EIP-191 personal_sign the exact UTF-8 message 'Reletter API key recovery for <payment_intent_id>' with that wallet, then POST the PaymentIntent id and signature. The response carries the same api_key the purchase returned. An SPT/card bundle has no wallet to sign with; re-POST /api/payments/buy for the same PaymentIntent to get its key back instead.

## Request body

- object
  - `payment_intent_id` string, required: `payment_intent_id` from the original buy response (the Payment-Receipt header value without the `stripe:` prefix).
  - `signature` string, required: 0x-hex EIP-191 personal_sign of the recovery message by the funding wallet.

## Response `200`

Signature verified. Body carries the API key.

- object
  - `api_key` string: Send as the `x-reletter-api-key` header.
  - `api_key_header` string
  - `base_url` string
  - `quota` integer
  - `used` integer
  - `remaining` integer
  - `bundle_id` integer
  - `payment_intent_id` string
  - `recovered` boolean

## Other responses

- `400`: Missing payment_intent_id or signature (`invalid_request`).
- `401`: Signature does not match the funding wallet.
- `404`: No settled bundle for that payment_intent_id (`unknown_payment`).
- `409`: Bundle was not wallet-funded, so it can't be recovered by signature (`recovery_unavailable`).

---

[API](https://skmtc.dev/reletter/apis/reletter-api.md) · [All operations](https://skmtc.dev/reletter/apis/reletter-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reletter/apis/reletter-api/revisions/51db96682bd0?raw)
