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

FieldTypeDescription
secretstringThe text to share. Encrypted on our server (see "End-to-end" below to encrypt it yourself).
expires_inintegerSeconds: 3600, 86400, 604800 (default), 2592000 or 7776000.
viewsintegerHow many times it can be opened, 1 (default) to 10.
passphrasestringOptional passphrase the recipient must enter.
recipient_emailstringOptional: only this address can open it (they get an email code).
labelstringOptional name, shown in the activity log and the key creator's "My links".
notifybooleanEmail 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:

  1. Make a random 32-byte key and a random 12-byte IV.
  2. Encrypt the UTF-8 text with AES-256-GCM (no additional data). ciphertext = base64url(IV + ciphertext + 16-byte tag), without padding.
  3. key_check = base64url(SHA-256(key)), without padding (43 characters).
  4. Send them, then give the recipient url + "#" + base64url(key). The part after # never reaches our server.