Public API v1
Create secrets from your code
A simple REST API to create self-destructing links from your scripts, CI/CD pipelines or applications, with the same end-to-end encryption as the website.
Zero knowledge
You encrypt, we store. The server never sees the secret or the key.
No API key
No account, no token. Requests are rate limited per IP address.
OpenAPI 3.1
Full specification and reference clients in Node.js, Python, C# and Java.
How it works
The API never receives the secret in clear. Your code encrypts it locally with a random key, sends only the encrypted result, then builds the link to share itself.
The key travels in the link fragment, after the #. Browsers never send the fragment to the server: only the recipient, opening the link, can decrypt.
https://ephemer.pw/s/{id}#{urlKey}The recipient opens the link in a browser, exactly as for a secret created on the website. Nothing else to integrate on that side.
Quick start
The fastest way: download the reference client and hand it the secret. It encrypts, calls the API and prints the link.
# 1. Download the reference client (Node.js 20+, no dependency)
curl -fsSLO https://ephemer.pw/cli/ephemer.mjs
# 2. Create a link. The secret is read from stdin: never from your shell history
node ephemer.mjs --views 1 --expires 24h < secret.txt
# → https://ephemer.pw/s/K_xEr7XyYQ22dxO_#39dh_OBrXnZ1ovM-1TUrIikpu19lFxSR8O-LzQ35c0s# 1. Download the reference client (Node.js 20+, no dependency)
Invoke-WebRequest https://ephemer.pw/cli/ephemer.mjs -OutFile ephemer.mjs
# 2. Create a link. The secret is read from stdin: never from your shell history
Get-Content secret.txt -Raw | node ephemer.mjs --views 1 --expires 24h
# → https://ephemer.pw/s/K_xEr7XyYQ22dxO_#39dh_OBrXnZ1ovM-1TUrIikpu19lFxSR8O-LzQ35c0spip install cryptography argon2-cffi
curl -fsSLO https://ephemer.pw/cli/ephemer.py
python ephemer.py --views 1 --expires 24h < secret.txt
# → https://ephemer.pw/s/K_xEr7XyYQ22dxO_#39dh_OBrXnZ1ovM-1TUrIikpu19lFxSR8O-LzQ35c0s# .NET 10+: the single file runs as is (dependencies restored automatically)
curl -fsSLO https://ephemer.pw/cli/Ephemer.cs
dotnet run Ephemer.cs -- --views 1 --expires 24h < secret.txt
# → https://ephemer.pw/s/K_xEr7XyYQ22dxO_#39dh_OBrXnZ1ovM-1TUrIikpu19lFxSR8O-LzQ35c0s# Java 17+: no build step, no dependency
curl -fsSLO https://ephemer.pw/cli/Ephemer.java
java Ephemer.java --views 1 --expires 24h < secret.txt
# → https://ephemer.pw/s/K_xEr7XyYQ22dxO_#39dh_OBrXnZ1ovM-1TUrIikpu19lFxSR8O-LzQ35c0sOptions: --views (1 to 10, default 1), --expires (5m, 30m, 1h, 12h, 24h, 3d or 7d, default 24h), --passphrase and --api (another instance).
With a passphrase
The passphrase is read from the EPHEMER_PASSPHRASE environment variable, never from the arguments. It needs an Argon2id library, which depends on the language (see the table below). Send it to the recipient through another channel than the link.
npm install hash-wasm # Argon2id for Node.js (see the table for other languages)
read -rs EPHEMER_PASSPHRASE && export EPHEMER_PASSPHRASE
node ephemer.mjs --passphrase --views 1 < secret.txt| Language · library | Installation |
|---|---|
| Node.jshash-wasm | npm install hash-wasm |
| Pythonargon2-cffi | pip install argon2-cffi |
| C# / .NETKonscious.Security.Cryptography.Argon2 | dotnet add package Konscious.Security.Cryptography.Argon2As a file-based app (dotnet run Ephemer.cs), the package is restored automatically. |
| Javaorg.bouncycastle:bcprov-jdk18on | java -cp bcprov-jdk18on.jar Ephemer.java --passphraseAdd the BouncyCastle jar to the classpath, or the Maven/Gradle dependency. |
In your code
The reference clients can also be used as libraries: createSecret (JavaScript), create_secret (Python), EphemerClient.CreateSecretAsync (C#) and Ephemer.createSecret (Java). They return the full link, ready to send.
import { createSecret } from "./ephemer.mjs"
const { url, expiresAt, viewsLeft } = await createSecret(
process.env.DB_PASSWORD,
{ views: 1, expiresIn: "1h" } // optional: passphrase, api
)
console.log(url) // send it to the recipientimport os
from ephemer import create_secret
url, info = create_secret(
os.environ["DB_PASSWORD"],
views=1,
expires_in="1h", # optional: passphrase=..., api=...
)
print(url) # send it to the recipient// Ephemer.cs copied into your project (see the header of the file)
var secret = await EphemerClient.CreateSecretAsync(
Environment.GetEnvironmentVariable("DB_PASSWORD")!,
views: 1,
expiresIn: "1h"); // optional: passphrase, api, cancellationToken
Console.WriteLine(secret.Url); // send it to the recipient// Ephemer.java copied into your project
Ephemer.SharedSecret secret = Ephemer.createSecret(
System.getenv("DB_PASSWORD"),
1, // views
"1h", // expiresIn
null, // passphrase (needs BouncyCastle)
"https://ephemer.pw"); // api
System.out.println(secret.url()); // send it to the recipientCreate a secret
POST/api/v1/secrets
Stores an already encrypted secret. JSON body, 201 Created response. Every binary value is encoded as base64url, without padding.
Encrypt before sending
Never put the secret itself in ciphertext: the API rejects any value too short to be real ciphertext, but cannot detect a long plaintext. Use a reference client or follow the protocol below.
| Field · Type | Description |
|---|---|
| idstring | 16 random characters from A–Z a–z 0–9 _ -, generated by you. It appears in the link. |
| ciphertextstring | AES-256-GCM output: ciphertext followed by the 16-byte tag. At least 17 bytes (23 characters), and at most 64 KB of plaintext. |
| ivstring | 12 random bytes (16 encoded characters). |
| saltstring | 16 random bytes (22 encoded characters), used by HKDF and Argon2id. |
| authTokenstring | null | Only with a passphrase: 32 bytes derived with HKDF (43 characters). Otherwise null. The server keeps only its SHA-256 hash. |
| viewsinteger | Number of views allowed, from 1 to 10. |
| expiresInstring | Lifetime: 5m, 30m, 1h, 12h, 24h, 3d or 7d. |
POST /api/v1/secrets HTTP/1.1
Host: ephemer.pw
Content-Type: application/json
{
"id": "K_xEr7XyYQ22dxO_",
"ciphertext": "1VaiERcaM481rjaxfO1yISQbNJPTZrSFFs7H19ohAX6aPBAc…",
"iv": "EIM77F2o8nqkYAN3",
"salt": "d95yiUjpxpeGS-1suuqERQ",
"authToken": null,
"views": 1,
"expiresIn": "24h"
}HTTP/1.1 201 Created
Content-Type: application/json
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1764003600
{
"id": "K_xEr7XyYQ22dxO_",
"expiresAt": "2026-11-25T12:00:00.000Z",
"viewsLeft": 1
}The server cannot build the link: your code assembles it from id and the key, as /s/id#key.
Encryption protocol
To write your own client, in any language. The protocol only uses standard primitives: AES-256-GCM, HKDF-SHA-256 and Argon2id.
id = 16 random characters from A–Z a–z 0–9 _ -
salt = 16 random bytes
urlKey = 32 random bytes → goes in the link fragment, never sent
iv = 12 random bytes
ikm = urlKey (no passphrase)
ikm = Argon2id(passphrase, salt) ‖ urlKey (with passphrase)
Argon2id: t = 2, m = 19456 KiB, p = 1, 32-byte output
contentKey = HKDF-SHA-256(ikm, salt, info = "ephemer:v1:content", 32 bytes)
authToken = HKDF-SHA-256(ikm, salt, info = "ephemer:v1:auth", 32 bytes)
(only with a passphrase; otherwise authToken = null)
ciphertext = AES-256-GCM(key = contentKey, iv, UTF-8(secret),
additionalData = UTF-8(id)) ‖ 16-byte tag
link = https://ephemer.pw/s/{id}#{base64url(urlKey)}
All binary values are encoded as base64url without padding (RFC 4648 §5).- The
idis bound to the ciphertext as authenticated data: moved to another id, it does not decrypt. On409 id_taken, generate a new id and encrypt again. authTokenand the content key come from the same source through separate HKDF branches: the token proves the passphrase to the server without revealing anything about the key.- When in doubt, the reference clients are authoritative: on every change, a conformance test checks that the website decrypts their secrets.
Secret status
GET/api/v1/secrets/{id}
Tells whether a secret still exists, how many views it has left and when it expires. This call spends no view. Expired, exhausted or unknown: the answer is always 404, indistinguishably.
curl https://ephemer.pw/api/v1/secrets/K_xEr7XyYQ22dxO_{
"salt": "d95yiUjpxpeGS-1suuqERQ",
"viewsLeft": 1,
"expiresAt": "2026-11-25T12:00:00.000Z",
"hasPassphrase": false
}Errors
An error returns a JSON object with a stable error field: base your code on that field, not on the HTTP status alone.
| Code · HTTP | Meaning |
|---|---|
| invalid_jsonHTTP 400 | The request body is not valid JSON. |
| invalid_payloadHTTP 400 | A field is missing or invalid, for instance a ciphertext too short to be encrypted (secret sent in clear). Details per field are in issues. |
| id_takenHTTP 409 | This id already exists (very unlikely). Generate a new id and encrypt again. |
| not_foundHTTP 404 | The secret expired, was opened the maximum number of times, or never existed. |
| rate_limitedHTTP 429 | Too many requests. Wait the number of seconds given by the Retry-After header. |
HTTP/1.1 400 Bad Request
{
"error": "invalid_payload",
"issues": { "views": ["Too big: expected number to be <=10"] }
}Limits
- Creation: 10 requests per minute per IP address.
- Status: 60 requests per minute per IP address.
- Size: 64 KB of plaintext (UTF-8) per secret.
- Views: 1 to 10 per link. The last one destroys the secret.
- Lifetime: from 5 minutes to 7 days, cannot be extended.
- Every response shows your quota with
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset.
Best practices
- Never send the key (the part after the
#) to the API or any other server, and never write it to a log. - Pass secrets through standard input or an environment variable, not as an argument: they would end up in your shell history.
- For the most sensitive secrets, add a passphrase and send it through another channel than the link.
- In a CI/CD pipeline, mask the generated link in the logs: anyone who reads it can spend a view.
- Do not retry a failed creation in a loop: read the
errorfield and honourRetry-Afteron a429.
Resources
- Node.js clientephemer.mjs: Node 20+, no dependency./cli/ephemer.mjs
- Python clientephemer.py: Python 3.10+, cryptography./cli/ephemer.py
- C# / .NET clientEphemer.cs: .NET 8+, or dotnet run on .NET 10./cli/Ephemer.cs
- Java clientEphemer.java: Java 17+, no dependency./cli/Ephemer.java
- OpenAPI specificationFor Postman, Insomnia or a client generator./openapi.json
- Report a vulnerabilitySecurity contact (RFC 9116)./.well-known/security.txt