A hosted JSON key-value store for side
projects, prototypes, and quick hacks.
No accounts. No schemas. No servers to spin up.
Pick a namespace, POST your data, and start building.
curl -X POST https://mantledb.sh/v2/my-app/config \
-H "Content-Type: application/json" \
-d '{"theme": "dark", "lang": "en"}'
curl https://mantledb.sh/v2/my-app/config
# → {"theme": "dark", "lang": "en"}
curl https://mantledb.sh/v2/claim/my-app
# → {"key": "a3f9...", "namespace": "my-app"}
No auth tokens to configure. No SDK to install. Works from any HTTP client — curl, fetch, whatever.
/ns/a/b/c/d — store data at any depth, no hierarchy to declareYour top-level bucket. The first segment after /v2/. Unclaimed by default — anyone can use it. Claim it to add write protection and extend data retention.
Everything after the namespace. Arbitrarily deep. Each unique path stores exactly one JSON object. No nesting, no relations — just flat paths to flat JSON.
Your namespace is the first segment of any path —
/v2/my-app/....
Out of the box it's unclaimed: anyone can read and write. Good for public data and rapid prototyping.
Unclaimed namespaces are purged after 30 days of inactivity.
A path like /v2/my-app/users/alice stores one
JSON object. POST to overwrite, PATCH to merge, GET to read.
Use ?key=field on a GET to pluck a single field.
No schema to declare. Store whatever shape you need.
GET /v2/claim/:ns locks your namespace and returns a
secret key. After that, writes require X-Mantle-Key.
Reads are private by default — toggle individual entries to public as needed.
Claimed namespaces are purged after 90 days of inactivity.
X-Mantle-Keypublic_readWorking examples built entirely on the MantleDB API — no separate backend, no database config.
A global click counter shared across all visitors. Open it in two windows to see it sync.
POST /v2/increment/:ns/*path
Sync UI preferences across devices without an auth system or backend boilerplate.
PATCH /v2/:ns/*path
A public message wall built on a JSON array entry. Append-only, no backend needed.
POST /v2/:ns/*path
https://mantledb.sh
application/json
X-Mantle-Key: <your-key>
| Method | Path | What it does | Auth |
|---|---|---|---|
| Namespace | |||
| GET | /v2/claim/:ns |
Claim namespace, receive secret key | None |
| GET | /v2/list/:ns |
List all paths in a namespace | Optional |
| Data | |||
| POST | /v2/:ns/*path |
Write (overwrite) an entry | Required* |
| GET | /v2/:ns/*path |
Read entry. ?key=field to pluck one value |
Required* |
| PATCH | /v2/:ns/*path |
Merge-update an entry (RFC 7396) | Required* |
| POST | /v2/increment/:ns/*path |
Atomically increment a numeric field | Required* |
| DELETE | /v2/:ns/*path |
Delete an entry permanently | Required* |
| Access Control | |||
| PUT | /v2/visibility/:ns/*path |
Toggle per-entry public read access | Required |
| Key Recovery | |||
| POST | /v2/email/:ns |
Set or update recovery email | Required |
| POST | /v2/recover/:ns |
Send recovery link to email on file | None |
| GET | /v2/recover/:ns?token= |
Validate token, issue new key | None |
* Required only if the namespace has been claimed. Unclaimed namespaces are open to all.
/v2/claim/:namespace
— no key required
Locks a namespace and returns a one-time secret key. The key is hashed before storage —
save it immediately, it cannot be reconstructed.
Once claimed, all writes to this namespace require X-Mantle-Key.
Claiming also extends your data retention from 30 to 90 days of inactivity.
Pass ?email= to register a recovery address at claim time.
If you lose the key, you can request a reset link via Key Recovery.
# Basic claim
curl https://mantledb.sh/v2/claim/my-app
# With a recovery email (recommended)
curl "https://mantledb.sh/v2/claim/[email protected]"
# Response
{
"success": true,
"namespace": "my-app",
"key": "a3f9...",
"warning": "SAVE THIS KEY. It cannot be recovered."
}
/v2/list/:namespace
— key optional
Returns all paths stored in a namespace along with each entry's public_read flag
and last-updated timestamp. Without a key, only public_read: true entries are returned.
curl https://mantledb.sh/v2/list/my-app \
-H "X-Mantle-Key: YOUR_KEY"
# Response
{
"namespace": "my-app",
"entries": [
{ "path": "config", "public_read": 1, "updated_at": 1748000000000 },
{ "path": "users/alice", "public_read": 0, "updated_at": 1748000001000 }
]
}
/v2/:namespace/*path
— key required on claimed namespaces
Creates or fully overwrites a JSON entry at the given path.
Paths can be as deep as you need — /v2/my-app/users/alice/settings works
without any upfront setup. If you only want to update certain fields, use
PATCH instead.
curl -X POST https://mantledb.sh/v2/my-app/users/alice \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"name": "Alice", "status": "online", "role": "admin"}'
/v2/:namespace/*path
— key required unless entry is public_read
Returns the stored JSON for the given path. On a claimed namespace, a key is required
unless that entry has public_read enabled. Use the ?key=
query param to read a single top-level field — useful for lightweight polling without
transferring the full object.
# Full entry
curl https://mantledb.sh/v2/my-app/users/alice \
-H "X-Mantle-Key: YOUR_KEY"
# → {"name": "Alice", "status": "online", "role": "admin"}
# Single field — no need to fetch the whole object
curl "https://mantledb.sh/v2/my-app/users/alice?key=status"
# → {"status": "online"}
/v2/:namespace/*path
— key required on claimed namespaces
Merges the request body into the existing entry using
JSON Merge Patch (RFC 7396).
Only the fields you send are changed — all other fields are untouched.
Set a field to null to remove it entirely.
# alice is currently: {"name": "Alice", "status": "online", "role": "admin"}
curl -X PATCH https://mantledb.sh/v2/my-app/users/alice \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"status": "away", "lastSeen": 1748000000}'
# alice is now: {"name": "Alice", "status": "away", "role": "admin", "lastSeen": 1748000000}
# Remove a field by setting it to null
# -d '{"role": null}' → removes the role field entirely
/v2/increment/:namespace/*path
— key required on claimed namespaces
Atomically increments (or decrements) a numeric field in an existing entry.
The operation runs inside a transaction — safe for concurrent updates from multiple clients.
If the entry doesn't exist yet, it is created with the field set to 0 before incrementing.
curl -X POST https://mantledb.sh/v2/increment/my-app/stats \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"key": "views", "by": 1}'
# Response
{"success": true, "views": 42}
# Use a negative value to decrement
# -d '{"key": "views", "by": -1}'
1 — amount to add. Negative to decrement. Decimals are fine.
/v2/:namespace/*path
— key required on claimed namespaces
Permanently removes a single entry. Returns 404 if the path does not exist.
curl -X DELETE https://mantledb.sh/v2/my-app/users/alice \
-H "X-Mantle-Key: YOUR_KEY"
# Response
{"success": true, "message": "Entry deleted"}
/v2/visibility/:namespace/*path
— key required
Toggles the public_read flag on a specific entry. When enabled, anyone can
read that entry without a key — even if the rest of the namespace is private.
This lets you expose individual endpoints (a public config, a leaderboard, an API status)
while keeping everything else locked down. Writes always require the key regardless of this setting.
# Make a single entry publicly readable
curl -X PUT https://mantledb.sh/v2/visibility/my-app/config \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"public_read": true}'
# Now anyone can read it — no key required
curl https://mantledb.sh/v2/my-app/config
# Revert to private
curl -X PUT https://mantledb.sh/v2/visibility/my-app/config \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"public_read": false}'
Lost your namespace key? If you registered an email address, you can request a one-time reset link. Tokens expire after 1 hour and requests are rate-limited to 3 per hour per IP. The old key is invalidated the moment the token is redeemed.
/v2/email/:namespace
— key required
Associates (or updates) a recovery email with a claimed namespace.
You can also set one at claim time via GET /v2/claim/:ns?email=.
curl -X POST https://mantledb.sh/v2/email/my-app \
-H "Content-Type: application/json" \
-H "X-Mantle-Key: YOUR_KEY" \
-d '{"email": "[email protected]"}'
# Response
{"success": true}
/v2/recover/:namespace
— no key required · rate limited (3/hour)
Sends a one-time recovery link to the address on file. Always responds with the same message — even if no email is registered — to prevent namespace or address enumeration.
curl -X POST https://mantledb.sh/v2/recover/my-app
# Response (same regardless of whether an email exists)
{
"success": true,
"message": "If a recovery email is on file, you'll receive it shortly."
}
/v2/recover/:namespace?token=
— no key required
Validates the recovery token from your email link and issues a new secret key. The previous key is immediately invalidated. Save the new one right away.
curl "https://mantledb.sh/v2/recover/my-app?token=TOKEN_FROM_EMAIL"
# Response
{
"success": true,
"namespace": "my-app",
"key": "b7c2...",
"warning": "SAVE THIS KEY. It cannot be recovered."
}