Getting started
LeonAI Secrets is a secure, one-time secret sharing platform. Share passwords, API keys and sensitive files with confidence.
Quick start
- Create a secret
Enter your secret text or upload a file (up to 10 MB). Choose an expiration time from 5 minutes to 30 days. - Optional password
Add a password for extra security. The recipient will need it to view the secret. - Share the link
Copy the generated link and share it with your recipient by email, chat or any secure channel. - One-time view
Once the recipient views the secret, its content is permanently deleted. A record of it (dates, recipients, file name) is kept; see the Privacy Policy.
Features
- Encryption in your browser: with JavaScript on, secrets created on this site are encrypted with AES-256-GCM before they leave your browser. Secrets from the form without JavaScript, and plain text sent to
POST /api/v2/secrets, are encrypted by our server - Burn after reading: secrets delete themselves after one view
- Flexible expiration: from 5 minutes to 30 days
- Password protection: an optional second layer
- File attachments: encrypted files up to 10 MB
- Email notifications: know the moment a secret is opened
- Templates: ready-made shapes for common secret types
- History: track what you shared (signed-in users)
API documentation
LeonAI Secrets provides a RESTful JSON API for programmatic secret sharing. It powers the official browser extension and the LeonAI Secrets app for Make.com.
Base URL
https://secrets.leonai.io/api/v2
Authentication
Authenticated endpoints require an API key sent as a Bearer token:
Authorization: Bearer <api_key>
Generate keys from your API Keys page (sign in first). Keys are shown once. A missing, revoked or malformed key returns 401. Keys are never accepted in the URL. Verify a key with GET /api/v2/key/info.
Response format
Every response is JSON: { "success": true, "data": { ... } } on success and { "success": false, "error": "message" } on failure.
Status codes: 400 validation error, 401 invalid API key, 403 forbidden, 404 secret not found (already revealed, deleted or expired), 429 rate limit exceeded.
Timestamps: in REST responses expiresAt, createdAt, viewedAt, answeredAt, answerExpiresAt, readAt and closedAt are Unix seconds; created and viewed inside secret metadata are Unix milliseconds. Webhook payloads use ISO 8601 UTC strings instead (see Webhooks).
Endpoints
| Endpoint | Description |
|---|---|
GET /api/v2/key/info |
Validate the API key. Returns name, userEmail, createdAt, lastUsed, requestsCount, isActive. |
POST /api/v2/secrets |
Create a secret. Body: secret (text up to 10,000 characters, required), ttl (seconds: 300, 900, 1800, 3600, 21600, 43200, 86400, 259200, 604800 or 2592000; default 3600), password (optional), recipients (optional array of up to 10 emails). Returns id, url, apiUrl, expiresIn, expiresAt, passwordProtected, recipientCount. |
GET /api/v2/secrets/:id |
Get secret metadata without revealing it. Returns exists, passwordProtected, hasFile, fileName, created. |
POST /api/v2/secrets/:id/view |
Reveal the secret. This is the one-time view: the secret is destroyed after a successful call and any later request returns 404. Body: password (required for password-protected secrets; three wrong attempts destroy the secret). Returns secret, metadata (created, viewed, ttl, passwordProtected, clientEncrypted, hasFile, fileName, fileSize, fileType), fileId, fileName. |
DELETE /api/v2/secrets/:id |
Delete (burn) a secret before anyone opens it. Returns success and message. |
GET /api/v2/history |
List the secrets you created. Query: page (default 1), limit (default 20, max 100), status (all, active, viewed, expired). Returns secrets[] (secretId, status, createdAt, expiresAt, viewedAt, viewerIp, viewerCountry, hasPassword, hasFile, fileName, fileSize, fileType, ttl, recipientCount, recipients, burnNotified) and pagination (page, limit, total, totalPages, hasNextPage, hasPrevPage). |
GET /api/v2/history/export |
Export your history. Query: format (json or csv), status. |
GET /api/v2/templates |
List secret templates. Query: language (en or he), category (api_keys, credentials, database, ssh, cloud, wifi, server, custom; omit it, or send it empty, for every category). Returns an array of id, name, description, category, content, icon, language. |
GET /api/v2/templates/:id |
One template by id. |
PUT /api/v2/templates/:id |
Update one of your own templates. |
DELETE /api/v2/templates/:id |
Delete one of your own templates. |
GET /api/v2/stats |
Your own usage counters (secrets created, viewed, active). |
POST /api/v2/secrets/encrypted |
Advanced: store a payload you already encrypted client-side (the format the browser extension produces). Body: secret (encrypted payload, required), ttl, password, recipients, encryptionKey (optional UUID or 64-hex key appended to emailed links as a #fragment; if you send it, it passes through our server and our email provider, and the server never stores it). Returns id, url, expiresAt, passwordProtected. |
GET /api/v2/files/:secretId/:fileId/encrypted |
Download a file attached to a secret or answer that was just revealed — once, within 5 minutes of the reveal; a second call is 404. For a readable request answer the server decrypts it: data carries fileName, fileType, fileSize, decrypted: true and file (the plaintext, base64). Files attached to ordinary secrets created in the browser are encrypted there: the response is the encrypted file, and only the key in the secret link's #fragment opens it. |
GET /api/v2/health |
Health check (no authentication). |
POST /api/v2/requests |
Create a secret request. Body: mode (zk or readable), ttl (seconds — the same fixed set as plain secrets: 300, 900, 1800, 3600, 21600, 43200, 86400, 259200, 604800, 1209600 or 2592000; default 604800), publicKey (base64url raw P-256 key — required for zk; API/Make callers use readable), reference (≤100 chars, yours only), message (≤500 chars, shown to the responder), password (responder gate, 3 attempts), recipients (≤10 emails to invite), allowFile, webhookUrl (https, overrides your default). Returns id, respondUrl, status, expiresAt, … |
GET /api/v2/requests |
List your requests, newest first. Query: status — all (default), open, answered, read, expired, cancelled, locked, or closed (= expired, cancelled or locked); page (default 1), limit (default 20, max 100), answeredAfter (Unix seconds — for polling). Returns requests[] (each shaped like GET /api/v2/requests/:id) and pagination (page, limit, total, totalPages, hasNextPage, hasPrevPage). |
GET /api/v2/requests/:id |
One request: id, reference, message, mode, status, publicKey, respondUrl, passwordProtected, allowFile, recipients, webhookUrl, createdAt, expiresAt, answeredAt, answerExpiresAt, readAt, closedAt, closeReason, closed, hasAnswer, and — once answered in zk mode — the encrypted keyDelivery blob (otherwise null). |
DELETE /api/v2/requests/:id |
Cancel an open or answered request. An answer you have not opened yet is deleted with it and cannot be recovered. Returns id and status (cancelled); a request that is already closed or read is 409 request_closed. |
POST /api/v2/requests/:id/reveal |
Open the answer once. readable: returns secret (plain text), fileId, fileName, fileSize, fileType, metadata (created, viewed, ttl, passwordProtected, clientEncrypted, hasFile, fileName, fileType) and answerId; an attached file is then downloadable once, for 5 minutes, from GET /api/v2/files/:answerId/:fileId/encrypted. zk: returns answerId and keyDelivery for your browser to decrypt. Any later call is 409. |
POST /api/v2/requests/:id/key |
readable only: returns the answer key key and answerId without opening the answer (advanced; the reveal endpoint is simpler). |
POST /api/v2/requests/:id/unlock |
Responder side, public: exchange the responder password for an unlockToken (10 minutes, one use). Three wrong attempts lock the request (403 request_locked). Rate limit 5/min. |
POST /api/v2/requests/:id/answer |
Responder side, public: store the encrypted answer. Body: secret (client-encrypted base64), keyDelivery (zk) or key (readable, 64 hex), unlockToken (if password-protected), fileId/fileName (from POST /api/v2/files/encrypted). Exactly one answer wins; later calls are 409 already_answered. |
GET /api/v2/webhooks |
Your default webhook URL and whether a signing secret exists. |
PUT /api/v2/webhooks |
Set (or clear with null) the default URL. The first time a URL is set, the signing secret is returned once. |
POST /api/v2/webhooks/rotate |
Create a new signing secret (returned once; the old one stops verifying immediately). |
POST /api/v2/webhooks/test |
Queue a request.test delivery to your default URL. |
GET /api/v2/webhooks/deliveries |
Delivery log: event, status (pending, delivered, failed), attempts, last_status, last_error. Query: page, limit, requestId. |
POST /api/v2/webhooks/deliveries/:id/retry |
Re-queue a failed delivery for one more attempt. |
POST /api/v2/webhooks/endpoints |
Register an app's delivery endpoint and the events it wants — the attach step of an integration's instant trigger. Body: url (https), events (any of request.answered, request.read, request.expired, request.locked, request.cancelled; omit for all), label (≤100 chars, audit log only). Each URL is its own registration: re-registering it updates its events, and it never touches your default webhook URL. Returns id (the SHA-256 of the URL), url, events, label. At most 25 per account (400 too_many_endpoints). |
DELETE /api/v2/webhooks/endpoints/:id |
Detach a registered endpoint by that id. Removes only that registration — never another one, and never your default webhook URL. An unknown id is a no-op (removed: false). |
Example: create a secret
curl -X POST https://secrets.leonai.io/api/v2/secrets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"secret": "my-password-123",
"ttl": 3600,
"password": "optional-password"
}'
Example: reveal a secret (one-time)
curl -X POST https://secrets.leonai.io/api/v2/secrets/SECRET_ID/view \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "password": "optional-password" }'
Secret requests
Ask someone for a secret instead of sending one: you create a request, they open the respond link, their browser encrypts the answer, and you open it exactly once. Requests need an account (session or API key); answering does not.
Two trust modes
- Zero-knowledge (
zk) — your browser creates a P-256 key pair; the answer key is wrapped to your public key (ECIES: ECDH + HKDF-SHA256 + AES-256-GCM, bound to the request id). LeonAI never sees the answer. The private key stays in your browser and in your private read link. - Readable via API (
readable) — the answer key is wrapped with LeonAI's master key so your API key or Make.com can open the answer once. Use this for automation.
Lifecycle
open— waiting for an answer; the respond link works untilexpiresAt.answered— an answer is stored and will be deleted 7 days after it was given if nobody opens it (a reminder email goes out 24 hours before).read— you opened the answer; it is gone.expired(unansweredorunread),cancelled,locked(3 wrong responder passwords) — closed states.- Every transition emails you and, if configured, calls your webhook.
Example: request and read a secret with an API key
curl -X POST https://secrets.leonai.io/api/v2/requests \
-H "Authorization: Bearer $LEONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"readable","ttl":604800,"reference":"Acme — DB password","recipients":["ops@acme.example"],"allowFile":true}'
# → { "success": true, "data": { "id": "…", "respondUrl": "https://secrets.leonai.io/r/…", "mode": "readable", "status": "open", "expiresAt": 1767830400 } }
curl -X POST https://secrets.leonai.io/api/v2/requests/<id>/reveal -H "Authorization: Bearer $LEONAI_API_KEY"
# → { "success": true, "data": { "secret": "…", "fileId": "…", "fileName": "db.env", "fileSize": 312, "fileType": "text/plain",
# "metadata": { "created": 1767225600000, "viewed": 1767229200000, "ttl": 604800, "passwordProtected": false,
# "clientEncrypted": true, "hasFile": true, "fileName": "db.env", "fileType": "text/plain" },
# "answerId": "…" } } (one time)
curl https://secrets.leonai.io/api/v2/files/<answerId>/<fileId>/encrypted -H "Authorization: Bearer $LEONAI_API_KEY"
# → { "success": true, "data": { "fileName": "db.env", "fileType": "text/plain", "fileSize": 312, "decrypted": true, "file": "<base64>" } } (once, within 5 minutes)
curl -X DELETE https://secrets.leonai.io/api/v2/requests/<id> -H "Authorization: Bearer $LEONAI_API_KEY"
# → { "success": true, "data": { "id": "…", "status": "cancelled" } } (deletes an unopened answer)
Errors carry a machine-readable code: invalid_mode, invalid_ttl, invalid_public_key, invalid_webhook_url, too_many_recipients, request_not_found, request_closed, already_answered, wrong_password (with attemptsLeft), request_locked, unlock_required, invalid_unlock_token, mode_mismatch, invalid_key_delivery, invalid_key, answer_too_large, file_not_allowed, unknown_upload.
Webhooks
A signed POST to your endpoints whenever a request changes state. Every event goes to your default URL (set on your profile, Webhooks card — or per request with webhookUrl, which replaces the default for that request) and to every app endpoint registered for that event (see *Connecting an app*), each URL once.
Events
request.answered— an answer arrived; forreadablerequests the payload includesrevealUrlto fetch it.request.read— the answer was opened (by you, your API key or Make).request.expired— the deadline passed (reason: unanswered) or an unopened answer was deleted (reason: unread).request.locked— three wrong responder passwords.request.cancelled— you cancelled it.request.test— sent from the profile page orPOST /api/v2/webhooks/test.
Delivery
POST <your url>
Content-Type: application/json
User-Agent: LeonAI-Secrets-Webhook/1.0
X-LeonAI-Event: request.answered
X-LeonAI-Delivery: dlv_…
X-LeonAI-Timestamp: 1767225600
X-LeonAI-Signature: v1=<hex hmac-sha256>
{ "id": "dlv_…", "event": "request.answered", "createdAt": "…", "owner": "you@example.com",
"request": { "id": "…", "reference": "…", "message": "…", "mode": "readable", "status": "answered",
"createdAt": "…", "expiresAt": "…", "answeredAt": "…", "answerExpiresAt": "…",
"hasFile": false, "fileName": null, "inboxUrl": "https://secrets.leonai.io/requests/…",
"revealUrl": "https://secrets.leonai.io/api/v2/requests/…/reveal" } }
Payload timestamps (createdAt, and createdAt, expiresAt, answeredAt, answerExpiresAt inside request) are ISO 8601 UTC strings, unlike the Unix seconds of the REST API. revealUrl is present only for readable requests. Two events add a top-level field: request.expired carries reason (unanswered or unread) and request.locked carries passwordAttempts.
The payload never contains the answer, a key, keyDelivery or a private link — it is a notification. Fetch the answer with POST /api/v2/requests/:id/reveal (readable mode) using your API key.
Connecting an app (Make.com)
An integration registers its own delivery URL instead of asking you to paste one: POST /api/v2/webhooks/endpoints with { url, events, label } returns an id, and DELETE /api/v2/webhooks/endpoints/{id} detaches it. This is what the LeonAI Secrets app for Make.com does when you add its *Watch events* trigger to a scenario — nothing to configure here. Each scenario gets its own registration and receives only the events it selected; several scenarios can watch the same account, and removing one never affects another. Your default URL (Profile → Webhooks) is separate and keeps receiving every event.
Verifying the signature
X-LeonAI-Signature is v1= + hex HMAC-SHA256 of "<X-LeonAI-Timestamp>.<raw body>" with your signing secret. Compare in constant time and reject timestamps older than 5 minutes; X-LeonAI-Delivery is unique per delivery — use it to de-duplicate.
// Node.js
const crypto = require('crypto');
function verify(secret, headers, rawBody) {
const ts = headers['x-leonai-timestamp'];
const sig = (headers['x-leonai-signature'] || '').replace(/^v1=/, '');
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // 5-minute window
const expected = crypto.createHmac('sha256', secret).update(ts + '.' + rawBody).digest('hex');
return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig, 'hex'), Buffer.from(expected, 'hex'));
}
We expect a 2xx within 10 seconds and do not follow redirects. Failures are retried: immediately, +2 s, +10 s, then +1 h, +2 h, +12 h (6 attempts). After the last failure you get an email and the delivery shows as failed on your profile, where you can retry it.
Endpoint rules: https:// only, a public hostname (no IP literals, localhost, .local, .internal or private ranges), no credentials in the URL.
Rate limits
- API: 100 requests per minute per IP address, and 1,000 requests per hour per API key
- Secret creation: 10 per minute per IP
- Secret reveal: 10 per minute per IP
- Web UI: 60 requests per minute per IP
Exceeding a limit returns 429 with a Retry-After header.
Need help?
- Support: care@leonai.io
- FAQ: Frequently asked questions
- Security: Security policy