00001101001101100010100001011111111100001111100111
01011011101101011110011001010111001011110111110110
10010011111111111001101110110000001110110010011110
10101110000101000000010110011100100000111111001101
10110101010101001000010001000000000100000000001101
00110110000010010000001111010010100000100111111000
11001010000110110101110010100110101100100010001110
11111011111010100000101001011001101010110000000000
11010110010001000011111100001001011010101011010011
10001101000000011000111000000011111001110100101111
10010100010110000001110000111000100101001100110011
01101010000011001111011111000001110001101010000010
00011001100010000000101110101110010000101010101000
10101101110000001100111111000011111100011101010100
10011100111111001001010101011101001010100110010111
01111110001101011100110100010100111001001111000100
00011001101000011101011001110100010011001010100110
00110010100101000010010001000011110111101001010011
10011110011110111101000011011010011001000100011101
11001101101111110100100011001111010100011010000001
PrivNote

API Documentation

Technical documentation for developers who want to integrate PrivNote into their applications.

API Reference
Endpoints for creating and retrieving notes

POST /api/notes

Create a new private note

Request Body

{
  "content": "Your encrypted note content",
  "expirationTime": "7d",       // Optional: "1h", "24h", "7d", or "30d"
  "allowedIps": [],             // Optional: Array of allowed IP addresses
  "restrictIp": false,          // Optional: Restrict to current IP
  "hasPassword": false,         // Optional: Whether the note is password protected
  "autoDecryptKey": "..."       // Optional: Auto-generated for notes without password protection
}

Response

{
  "noteId": "uniqueNoteIdentifier",
  "publicUrl": "https://example.com/note/uniqueNoteIdentifier",
  "rawUrl": "https://example.com/api/notes?id=uniqueNoteIdentifier"
}

Response Fields

  • noteId - The unique identifier for the note
  • publicUrl - The URL to view the note in the web interface
  • rawUrl - The URL to retrieve the raw note content via API

Example

// Client-side encryption example
import { encryptData } from './crypto';

// Generate a random key for password-less encryption
const autoDecryptKey = generateRandomKey();

// Encrypt the content
const encryptedContent = await encryptData('This is a secret message', autoDecryptKey);

// Send to server
fetch('/api/notes', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    content: encryptedContent,
    hasPassword: false,
    autoDecryptKey: autoDecryptKey
  }),
})
.then(response => response.json())
.then(data => {
  console.log('Public URL:', data.publicUrl);
  console.log('Raw API URL:', data.rawUrl);
})

Built with Next.js, Tailwind CSS, and Vercel KV. Secured with client-side encryption.