API Usage
API access requires either an active $5/month subscription or a lifetime beta entitlement. Manage billing with JWT auth, then use API keys for todo CRUD.
Setup
`JWT` comes from login/signup. `API_KEY` comes from API key creation.
API_URL="https://braindump.imnotbot.com"
JWT="your_jwt_from_login"
API_KEY="bdk_..."
ADMIN_KEY="your_beta_admin_key"Billing & Subscription
Check API subscription status and create a checkout session for paid access.
View subscription status
curl -sS "$API_URL/api/v1/billing/subscription" \
-H "Authorization: Bearer $JWT"Start checkout session
curl -sS -X POST "$API_URL/api/v1/billing/checkout-session" \
-H "Authorization: Bearer $JWT"Beta Lifetime Access (Admin)
Grant or revoke free lifetime beta access for selected users. Requires `X-Admin-API-Key`.
Grant beta access
curl -sS -X POST "$API_URL/api/v1/billing/beta/grant" \
-H "Content-Type: application/json" \
-H "X-Admin-API-Key: $ADMIN_KEY" \
-d '{"email":"[email protected]"}'Revoke beta access
curl -sS -X POST "$API_URL/api/v1/billing/beta/revoke" \
-H "Content-Type: application/json" \
-H "X-Admin-API-Key: $ADMIN_KEY" \
-d '{"userId":"<user_id>"}'API Key Management
Use JWT in Authorization header. Endpoints return `402 SUBSCRIPTION_REQUIRED` if API subscription is inactive.
Create key
curl -sS -X POST "$API_URL/api/v1/auth/api-keys" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $JWT" \
-d '{"name":"My automation key"}'List keys
curl -sS "$API_URL/api/v1/auth/api-keys" \
-H "Authorization: Bearer $JWT"Revoke key
curl -sS -X DELETE "$API_URL/api/v1/auth/api-keys/<key_id>" \
-H "Authorization: Bearer $JWT"Todo CRUD (API Key)
Use your API key as `Authorization: Bearer <API_KEY>`.
List todos
curl -sS "$API_URL/api/v1/todos" \
-H "Authorization: Bearer $API_KEY"Create todo
curl -sS -X POST "$API_URL/api/v1/todos" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"text":"Ship integration","priority":2,"category":"work","estimatedDurationMinutes":30}'Update todo
curl -sS -X PUT "$API_URL/api/v1/todos/123" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"text":"Ship integration v2","priority":1}'Delete todo
curl -sS -X DELETE "$API_URL/api/v1/todos/123" \
-H "Authorization: Bearer $API_KEY"