Developer Guide

BitStore Tutorial

Create an account, create a bucket, copy your write token, then use GET/POST/PUT/DELETE.

Visibility and security
  • Swagger UI requires login.
  • Read endpoints are public by slug. If someone knows your slug, they can fetch bucket data.
  • Write endpoints require X-BitStore-Key (or an owner session).
  • Treat the write key as secret. Do not put it in public repos or frontend code shipped to browsers.
  • Always check HTTP status and surface API error messages from the response body.
  • Validate value length client-side before sending (max 8 characters).
  • /demo runs in logged-out mode and sends requests with credentials: "omit".

1. Create an account

Open Login, choose Create account, then sign in with your email/password.

First created account becomes SuperUser.

2. Create a bucket and copy credentials

Open Buckets, create a bucket, then open it.

From the bucket page copy:

  • Slug (used in the URL, not a secret)
  • Write key (your write token, sent as X-BitStore-Key)

3. Read bucket data (GET)

# Bucket + latest record
curl "https://bitstore.mrcheng.se/api/buckets/your-slug"

# Latest record only
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/latest"

# List recent records (optional take=1..200)
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?take=50"

# Page through older records with the nextCursor from the previous response
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?take=50&cursor=NEXT_CURSOR"

# Created date range. fromUtc is inclusive; toUtc is exclusive.
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?fromUtc=2026-05-11&toUtc=2026-05-18"

# Calendar filters. Defaults to UTC; add timeZone for local calendar days/weeks/months.
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?date=2026-05-11&timeZone=Europe/Stockholm"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?fromDate=2026-05-11&toDate=2026-05-18&timeZone=Europe/Stockholm"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?week=2026-W21&timeZone=Europe/Stockholm"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?month=2026-05&timeZone=Europe/Stockholm"

# Value filters for app-encoded keys like g4c:1200
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?valuePrefix=g4c:"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?valuePrefixes=g4c:,g4d:,g4e:,g4f:,g4g:,g4h:,g4i:"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?valuePrefixFrom=g4c:&valuePrefixTo=g4i:"
curl "https://bitstore.mrcheng.se/api/buckets/your-slug/records?valuePattern=^(g|b)\d+$"

Record list responses include hasMore and nextCursor. Extra filters include beforeUtc, updatedFromUtc, updatedToUtc, date, fromDate, toDate, week, month, timeZone, value, valueContains, and valuePattern. Calendar toDate includes that whole local day.

4. Add a record (POST)

curl -X POST "https://bitstore.mrcheng.se/api/buckets/your-slug/records" \
  -H "Content-Type: application/json" \
  -H "X-BitStore-Key: your-write-key" \
  -d "{\"value\":\"hello123\"}"

Value max length is 8 characters. You can also send the key as query string: ?apiKey=your-write-key.

5. Update a record (PUT)

curl -X PUT "https://bitstore.mrcheng.se/api/buckets/your-slug/records/123" \
  -H "Content-Type: application/json" \
  -H "X-BitStore-Key: your-write-key" \
  -d "{\"value\":\"upd12345\"}"

6. Delete/clear records (DELETE/POST)

# Clear one record value (keeps row)
curl -X POST "https://bitstore.mrcheng.se/api/buckets/your-slug/records/123/clear" \
  -H "X-BitStore-Key: your-write-key"

# Delete one record
curl -X DELETE "https://bitstore.mrcheng.se/api/buckets/your-slug/records/123" \
  -H "X-BitStore-Key: your-write-key"

# Delete all records
curl -X DELETE "https://bitstore.mrcheng.se/api/buckets/your-slug/records" \
  -H "X-BitStore-Key: your-write-key"
Local base URL: https://bitstore.mrcheng.se
Docs: Swagger