Integrate secure note sharing into your applications
Base URL: https://securenotes.net/api/
Format: JSON requests and responses
Security: HTTPS required, rate limiting enabled
The Secure Notes API allows you to programmatically create and manage encrypted, self-destructing notes. Our REST API is designed with security and simplicity in mind, following industry best practices.
https://securenotes.net/api/
Currently, the Secure Notes API uses CSRF token-based authentication for creating notes and IP-based rate limiting for security.
Our API is designed to be accessible without complex authentication schemes. CSRF tokens are automatically handled by our web interface.
When creating notes through the web interface, a CSRF token is required:
{
"csrf_token": "abc123def456...",
"content": "Your encrypted content here"
}
To ensure fair usage and prevent abuse, we implement rate limiting based on IP address:
Action | Limit | Window | Status Code |
---|---|---|---|
Create Notes | 10 requests | 1 hour | 429 |
View Notes | 50 requests | 1 hour | 429 |
Statistics | 20 requests | 1 hour | 429 |
When you hit a rate limit, you'll receive a 429 Too Many Requests
response. Wait for the time window to reset before making additional requests.
/api/create.php
Creates a new encrypted note with specified expiration and security settings.
Parameter | Type | Required | Description |
---|---|---|---|
content |
string | Required | The note content to encrypt (max 10,000 characters) |
expiry_type |
string | Optional | Expiry type: view , time , or both (default: view ) |
expiry_time |
integer | Optional | Hours until expiry (1-8760, default: 24) |
max_views |
integer | Optional | Maximum view count (1-100, default: 1) |
passcode |
string | Optional | Optional passcode for additional security |
notification_email |
string | Optional | Email address for access notifications |
csrf_token |
string | Required | CSRF protection token |
curl -X POST https://securenotes.net/api/create.php \
-H "Content-Type: application/json" \
-d '{
"content": "This is a secret message",
"expiry_type": "both",
"expiry_time": 24,
"max_views": 1,
"passcode": "secret123",
"notification_email": "user@example.com",
"csrf_token": "your-csrf-token"
}'
{
"success": true,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"url": "https://securenotes.net/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expires_at": "2024-01-15 14:30:00",
"max_views": 1,
"has_passcode": true
}
/api/view/{uuid}.php
Retrieves metadata about a note without decrypting it. Actual note viewing happens through the web interface for security.
Parameter | Type | Required | Description |
---|---|---|---|
uuid |
string | Required | The unique identifier of the note |
curl -X GET https://securenotes.net/api/view/a1b2c3d4-e5f6-7890-abcd-ef1234567890.php
{
"success": true,
"note": {
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"has_passcode": true,
"expiry_type": "both",
"expires_at": "2024-01-15 14:30:00",
"max_views": 1,
"current_views": 0,
"is_destroyed": false,
"created_at": "2024-01-14 14:30:00"
}
}
/api/stats.php
Retrieves anonymized usage statistics and system health information.
curl -X GET https://securenotes.net/api/stats.php
{
"success": true,
"stats": {
"total_notes_created": 1542,
"active_notes": 234,
"destroyed_notes": 1308,
"success_rate": 98.5,
"notes_24h": 45,
"notes_7d": 312,
"notes_30d": 1205,
"health_status": {
"database": "healthy",
"encryption": "available",
"email": "configured"
},
"generated_at": "2024-01-14 14:30:00"
}
}
The API uses conventional HTTP response codes to indicate success or failure. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate client errors, and codes in the 5xx range indicate server errors.
Status Code | Meaning | Description |
---|---|---|
200 |
OK | Request succeeded |
400 |
Bad Request | Invalid request parameters |
404 |
Not Found | Note not found or destroyed |
405 |
Method Not Allowed | HTTP method not supported |
429 |
Too Many Requests | Rate limit exceeded |
500 |
Internal Server Error | Server error occurred |
{
"error": "Content is required",
"code": "INVALID_CONTENT",
"details": {
"parameter": "content",
"message": "Content cannot be empty"
}
}
// Create a secure note
const createNote = async (content, options = {}) => {
const response = await fetch('https://securenotes.net/api/create.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: content,
expiry_type: options.expiryType || 'view',
max_views: options.maxViews || 1,
passcode: options.passcode,
csrf_token: await getCSRFToken()
})
});
return await response.json();
};
// Usage
const note = await createNote('My secret message', {
expiryType: 'both',
maxViews: 1,
passcode: 'secret123'
});
console.log('Note URL:', note.url);
import requests
import json
def create_secure_note(content, expiry_type='view', max_views=1, passcode=None):
"""Create a secure note using the SecureNotes API"""
url = 'https://securenotes.net/api/create.php'
payload = {
'content': content,
'expiry_type': expiry_type,
'max_views': max_views,
'csrf_token': get_csrf_token() # You need to implement this
}
if passcode:
payload['passcode'] = passcode
response = requests.post(url, json=payload)
if response.status_code == 200:
return response.json()
else:
raise Exception(f"API Error: {response.status_code} - {response.text}")
# Usage
try:
note = create_secure_note(
content="My secret message",
expiry_type="both",
max_views=1,
passcode="secret123"
)
print(f"Note URL: {note['url']}")
except Exception as e:
print(f"Error: {e}")
Error: API Error: 0 -
# Create a note
curl -X POST https://securenotes.net/api/create.php \
-H "Content-Type: application/json" \
-d '{
"content": "This is my secret message",
"expiry_type": "view",
"max_views": 1,
"csrf_token": "your-csrf-token-here"
}'
# Get statistics
curl -X GET https://securenotes.net/api/stats.php
# Check note metadata
curl -X GET https://securenotes.net/api/view/your-note-uuid.php
We're working on official SDKs for popular programming languages. Currently, you can use the HTTP API directly or create wrapper functions as shown in the examples above.
Language | Library | Status | Maintainer |
---|---|---|---|
JavaScript | securenotes-js |
Coming Soon | Community |
Python | pysecurenotes |
Coming Soon | Community |
Go | go-securenotes |
Coming Soon | Community |
Want to create an SDK for your favorite language? We'd love to feature it here! Contact us at api@securenotes.net
Webhooks allow your application to receive real-time notifications when certain events occur with your notes.
Webhook functionality is currently in development. You'll be able to receive notifications for note access, expiration, and other events.
note.accessed
- When a note is successfully viewednote.failed_access
- When someone tries to access a note with wrong passcodenote.expired
- When a note expires by timenote.destroyed
- When a note is destroyed after max views{
"event": "note.accessed",
"timestamp": "2024-01-14T14:30:00Z",
"data": {
"note_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"access_details": {
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0...",
"access_time": "2024-01-14T14:30:00Z"
}
}
}
Follow our changelog to stay informed about new features, improvements, and breaking changes. We follow semantic versioning for all API updates.
This API documentation is designed to help you integrate Secure Notes into your applications securely and efficiently. If you have questions or suggestions, please don't hesitate to contact us.