PocketJSON Storage Service

Welcome to PocketJSON, a lightweight, single-binary JSON storage service with built-in expiry and multi-tenant support. Perfect for developers who need a quick, reliable way to store and retrieve JSON data without the overhead of a full database setup.

Quick Start Examples

1. Store JSON Data (Guest)

POST your JSON data to create a new storage entry:

curl -X POST http://localhost:9819 \ -H "Content-Type: application/json" \ -d '{"name":"John","age":30}'

Response:

{"id":"f7a8b9c0d1e2","expires_at":"2024-01-21T15:30:45Z"}

2. Retrieve JSON Data

GET your stored JSON using the ID:

curl http://localhost:9819/f7a8b9c0d1e2

Response:

{"name":"John","age":30}

3. Store with Custom ID (Authenticated)

Use an API key to set custom IDs and expiration:

curl -X POST "http://localhost:9819/my-custom-id?expiry=72" \ -H "Content-Type: application/json" \ -H "X-API-Key: your-api-key" \ -d '{"status":"active"}'

Note: Authenticated users get prefixed IDs and longer expiration options.

API Endpoints