One-time secrets

Create a one-time secret

Changed on

Stores client-side encrypted text or one file for 1 to 10 views (default 1) and 1h, 1d, 7d or 30d (default 7d), with a title the recipient sees. Owned like a publication: send X-Owner-Token (none: a new one is returned). Share https://brewpage.app/secret/{id}#{key} with the key only in the fragment; manageUrl is for the creator only.

post/api/secrets

Request

  • Base URL
    https://brewpage.app
  • Auth
    • none
    • or API key in header X-Owner-Token

Headers

X-Owner-Token, unknown

Reuse your owner token so the secret joins your other publications. If omitted, a new token is generated

Request body

SecretCreateRequest required
ciphertext, string required

AES-GCM-256 output (encrypted text plus its 16-byte tag) as base64url without padding, at most 54000 characters. Encrypt in the client; the key never reaches the server.

iv, string required

The 12-byte AES-GCM nonce as 16 base64url characters.

ttl, '1h' | '1d' | '7d' | '30d' nullable

How long the secret stays readable: 1h, 1d, 7d or 30d. Omitted: 7d.

maxViews, integer nullable

How many times it can be opened, 1 to 10. Omitted: 1.

title, string required

Shown to the recipient before opening: never put the secret here. 1-200 characters, one line.

note, string nullable

Your own note, at most 500 characters; only you see it.

tags, string[]

Your tags, at most 10 of 1-32 characters; only you see them.

kind, 'text' | 'file' nullable

text: UTF-8 text; file: one file in envelope v1. Omitted: text.

keyCheck, string nullable

base64url of the first 16 bytes of SHA-256("brewpage-secret-key-check-v1" + the 32 key bytes): the page checks a key against it before spending a view.

Response

Created

SecretCreateResponse required
id, string required

22-character secret id. Share https://brewpage.app/secret/{id}#{key}, the key in the fragment only.

ref, string required

10-character owner handle of the owner routes; it can't open the secret

kind, 'text' | 'file' required

text or file

title, string required

Title the recipient sees

expiresAt, string date-time required

When the secret stops being readable

maxViews, integer required

How many times it can be opened

ownerToken, string required

Owner token: keep it; send it as X-Owner-Token on later creates and owner routes

manageUrl, string required

Private manage link (status, opens, delete): give it to the creator only, never to the recipient

tags, string[]

Your tags; absent when none

notices, PublishNotice[]

How the request was adjusted; absent when not

Changes

    • breaking

      added the new required request property title

    • info

      the endpoint scheme security OwnerToken was added to the API

    • info

      added the new optional header request parameter X-Owner-Token

    13 more changes in this revision