---
title: "Open a one-time secret"
method: POST
path: "/api/secrets/{id}/reveal"
tags: ["One-time secrets"]
---

# Open a one-time secret

`POST /api/secrets/{id}/reveal`

## Request

- Base URL: `https://brewpage.app`
- URL: `https://brewpage.app/api/secrets/{id}/reveal`
- Auth: one of:
  - none
  - API key in header `X-Owner-Token`

Spends one view and returns the ciphertext and iv to decrypt with the fragment key. The last view deletes the ciphertext on the server. With the creator's X-Owner-Token no view is spent (sender: true). No request body.

## Path parameters

- `id` string, required

## Headers

- `X-Owner-Token` unknown

## Response `200`

Ciphertext of this view

- SecretRevealResponse
  - `ciphertext` string, required: base64url AES-GCM output as created
  - `iv` string, required: base64url 12-byte nonce as created
  - `viewsLeft` integer, required: Views left after this one; 0 = this was the last, the server no longer holds the secret
  - `sender` boolean: true when X-Owner-Token proves you created it: no view was spent; absent otherwise

## Other responses

- `404`: SECRET_NOT_FOUND: unknown id
- `410`: SECRET_GONE: opened the allowed number of times, expired or deleted
- `429`: Rate limited: wait Retry-After (= retryAfterSeconds)
- `503`: SECRETS_UNAVAILABLE: temporarily off

## Changes

- **2026-11-22** `83483c70abbd`: 3 info
  - the endpoint scheme security `OwnerToken` was added to the API
  - added the new optional `header` request parameter `X-Owner-Token`
  - added the optional property `sender` to the response with the `200` status
- **2026-11-22** `21d3daa71f92`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/brewpage/apis/brewpage-api/changes/api/secrets/:id/reveal/post.md)

---

[API](https://skmtc.dev/brewpage/apis/brewpage-api.md) - [All operations](https://skmtc.dev/brewpage/apis/brewpage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/brewpage/apis/brewpage-api/revisions/78d2720a18a9?raw)
