Home/Documentation

API Keys

Manage your API keys — create, scope, rotate, and revoke.

Key Format

API keys follow the format: jdb_sk_<env>_{secret}

jdb_sk_live_A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8S9t0

Key Components

NameTypeDescription
jdb_skprefixIdentifies this as a jsondb.cloud secret key
live / testenv'live' for production, 'test' for development
{secret}string40-character random secret

Key Scoping

Each key has a scope that controls what operations it can perform:

Available Scopes

NameTypeDescription
read-writescopeFull access: create, read, update, delete documents
read-onlyscopeCan only GET documents. POST/PUT/PATCH/DELETE return 403 Forbidden.
lightbulb

Best practice

Use read-only keys for frontend applications and read-write keys for server-side code.

Key Rotation

Rotate a key to get a new secret while keeping the same name and configuration. The old key is immediately revoked.

POST /api/keys/{keyId}/rotate
Authorization: Bearer <session cookie>

Response (201):
{
  "apiKey": { ... },
  "rawKey": "jdb_sk_live_NEW_SECRET_HERE"
}

Rate Limiting

API requests are rate-limited per key:

Rate Limits

NameTypeDescription
Free tier10 req/s10 requests per second per API key
Pro tier100 req/s100 requests per second per API key

Rate limit info is included in response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1708814400

Key Limits

Plan Limits

NameTypeDescription
Free2 keysMaximum 2 active API keys
Pro20 keysMaximum 20 active API keys