API Documentation

Professional, secure, and easy-to-use API for SecureNote.link

Overview

Welcome to the SecureNote.link API documentation. This API allows you to create, retrieve, and manage secure, one-time notes with optional password protection and expiration. All endpoints are HTTPS only and require Content-Type: application/json for requests with a body. If using the API, you must encrypt your note first. See the examples below for encryption patterns.

🌐 Base URL: https://securenote.link 🛡️ Version: v1

Authentication & Rate Limiting

  • No authentication required for standard endpoints.
  • General API: 100 requests / 15 min
  • Password verification: 10 requests / 15 min
  • All requests must use HTTPS

Description

Create a new encrypted secret with optional password protection and expiration.

Request Body
{
  "encryptedData": "string (required)",
  "iv": "string (required)",
  "password": "string (optional)",
  "expiresIn": "number (optional, hours: 1, 24, 72, 168)"
}
Response
{
  "id": "string",
  "passwordProtected": true,
  "expiresIn": 24
}
Rate Limit 100 requests per 15 minutes

Code Examples

// JavaScript fetch example
fetch('/api/v1/secrets', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    encryptedData: '...',
    iv: '...',
    password: 'optional',
    expiresIn: 24
  })
})
# Curl example
curl -X POST https://your-domain.com/api/v1/secrets \
  -H "Content-Type: application/json" \
  -d '{"encryptedData":"...","iv":"..."}'

Description

Retrieve a secret (marks it as accessed). Secret is deleted after retrieval if no password.

ParametersID (32-character hex string)
Response
{
  "content": {
    "encryptedData": "string",
    "iv": "string"
  },
  "passwordProtected": false
}
NotesSecret is deleted after retrieval if no password

Code Examples

// JavaScript fetch example
fetch('/api/v1/secrets/your-secret-id')
  .then(res => res.json())
  .then(data => console.log(data));
# Curl example
curl https://your-domain.com/api/v1/secrets/your-secret-id

Description

Verify the password for a secret without revealing it.

Request Body
{
  "password": "string (required)"
}
Response
{
  "valid": true
}
Rate Limit 10 requests per 15 minutes

Code Examples

// JavaScript fetch example
fetch('/api/v1/secrets/your-secret-id/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ password: 'yourpassword' })
}).then(res => res.json()).then(data => console.log(data));
# Curl example
curl -X POST https://your-domain.com/api/v1/secrets/your-secret-id/verify \
  -H "Content-Type: application/json" \
  -d '{"password":"yourpassword"}'

Description

Check the API service health status.

Response{"status":"ok"}

Code Examples

// JavaScript fetch example
fetch('/api/v1/health')
  .then(res => res.json())
  .then(data => console.log(data));
# Curl example
curl https://your-domain.com/api/v1/health

Overview

These examples show AES-GCM encrypt/decrypt patterns used by the SecureNote client and server. They are intentionally simple and focused on interoperability: generate a 256-bit key, use a 96-bit (12 byte) IV, and store/send the ciphertext, IV, and key using base64 when needed. AES-GCM also produces an authentication tag (usually appended to or transmitted with the ciphertext).

Note: examples show how to encrypt/decrypt locally and how to represent binary fields (ciphertext, iv, key) as base64 strings for transmission/storage. In production, never transmit the raw key; the key should remain in the client URL fragment (like SecureNote) or a secure KMS. Use HTTPS and enforce proper key handling policies.

Error Codes

  • 400: Bad Request - Invalid parameters
  • 401: Unauthorized - Authentication failed
  • 403: Forbidden - Access denied
  • 404: Not Found - Secret not found
  • 410: Gone - Secret expired
  • 429: Too Many Requests - Rate limit exceeded
  • 500: Internal Server Error - Server error

Security Features

  • Encrypted data stored securely.
  • One-time access for secrets without passwords.
  • Optional password protection with verification.
  • Automatic expiration of secrets.
  • HTTPS enforced for all API calls.