API documentation
Create one-time secret links from scripts, CI pipelines and internal tools. The API is part of OneTimePass Business; team admins create keys under Team → API & Slack. New to sharing keys this way? See how teams share API keys securely.
Authentication
Send your key in the Authorization header. Keys belong to your team; keep them secret and revoke any key that may have leaked.
Authorization: Bearer otp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Limit: 120 requests per minute per key. Errors are JSON: {"error": "…"} with status 400, 401 (bad key), 402 (plan not active), 404, 422 (invalid field) or 429.
Create a secret
POST https://onetimepass.org/api/v1/secrets
| Field | Type | Description |
|---|---|---|
secret | string | The text to share. Encrypted on our server (see "End-to-end" below to encrypt it yourself). |
expires_in | integer | Seconds: 3600, 86400, 604800 (default), 2592000 or 7776000. |
views | integer | How many times it can be opened, 1 (default) to 10. |
passphrase | string | Optional passphrase the recipient must enter. |
recipient_email | string | Optional: only this address can open it (they get an email code). |
label | string | Optional name, shown in the activity log and the key creator's "My links". |
notify | boolean | Email the key's creator when it's opened. |
Your team's security policies apply: a link with a longer expiry, more opens or no passphrase than the policy allows is refused with status 422 and {"error": "…", "code": "policy_violation"}. When expires_in is left out, the longest allowed up to 7 days is used.
curl -X POST https://onetimepass.org/api/v1/secrets \
-H "Authorization: Bearer $OTP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"secret": "db-password-123", "expires_in": 86400, "views": 1}'
Response 201:
{
"id": "3f9c2a7b1d4e6f80",
"url": "https://onetimepass.org/view/3f9c2a7b1d4e6f80",
"expires_at": "2026-11-02T10:00:00+00:00",
"views": 1,
"encrypted_in_browser": false
}
Check a secret's status
GET https://onetimepass.org/api/v1/secrets/{id} returns status (active, opened, burned, expired, destroyed or gone), views_left and timestamps. Never the content.
Delete a secret
DELETE https://onetimepass.org/api/v1/secrets/{id} deletes it before it's opened.
Check your key
GET https://onetimepass.org/api/v1/ping returns your team name.
End-to-end encryption (optional)
To keep even OneTimePass from seeing the secret, encrypt it yourself and send ciphertext and key_check instead of secret:
- Make a random 32-byte key and a random 12-byte IV.
- Encrypt the UTF-8 text with AES-256-GCM (no additional data).
ciphertext= base64url(IV + ciphertext + 16-byte tag), without padding. key_check= base64url(SHA-256(key)), without padding (43 characters).- Send them, then give the recipient
url + "#" + base64url(key). The part after#never reaches our server.