CryptNote

API for integrating secure messages

Language: PT EN

The API lets you create secure message links and retrieve them programmatically.

Quick Start

curl
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"Olá API","max_views":1}'
JavaScript (fetch)
const res = await fetch('/api/v1/create.php', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({content: 'Olá API', max_views: 1})
});
const json = await res.json();

API Base

/api/v1

Create encrypted content

POST /api/v1/create

JSON body:

  • content (string, required, max 50000)
  • is_markdown (bool, optional, default: false)
  • max_views (int, 1-20, optional, default: 1)
  • password (string, optional, 4-100)
  • expire_minutes (int, 1-10080, optional)

Response (200):

{
    "success": true,
    "share_url": "https://.../view.php?token=...",
    "token": "..."
}
With password and multiple views
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"segredo","password":"Secreta@123","max_views":5}'
Markdown + time expiration
curl -sS /api/v1/create.php \
  -H 'Content-Type: application/json' \
  -d '{"content":"# Título","is_markdown":true,"expire_minutes":60}'

Read/Decrypt

POST /api/v1/view

JSON body:

  • token (string, required)
  • password (string, required if protected)

Response (200):

{
  "success": true,
  "content": "... plaintext ...",
  "is_markdown": false,
  "remaining_views": 0,
  "expires_at": null
}
With password (example)
curl -sS /api/v1/view.php \
  -H 'Content-Type: application/json' \
  -d '{"token":"TOKEN","password":"Secreta@123"}'
Wrong password
{
  "success": false,
  "error": "password_required|invalid_token|not_found_or_expired"
}

※ This endpoint consumes one view when successful.

Token status (does not consume view)

POST /api/v1/status

JSON body:

  • token (string, required)

Response (200):

{
  "success": true,
  "status": "active|expired|not_found",
  "requires_password": false,
  "is_markdown": false,
  "max_views": 1,
  "remaining_views": 1,
  "expires_at": null
}
Example
curl -sS /api/v1/status.php \
  -H 'Content-Type: application/json' \
  -d '{"token":"TOKEN"}'

Common errors

  • content_required — empty content
  • invalid_max_views — out of 1-20 range
  • invalid_expire_minutes — out of 1-10080 range
  • password_required — missing password
  • not_found_or_expired — token not found/expired
Back to Home