API Reference
API reference
LearnCoin REST API — base URL, versioning, conventions, and where each endpoint lives.
The LearnCoin API is a single versioned REST surface. All endpoints live under:
https://api.learncoin.me/v1/Conventions
- Authentication — Bearer token in
Authorizationheader. See Authentication. - Content type —
application/jsonfor all requests and responses. - Timestamps — ISO 8601 UTC (
2026-04-23T12:00:00Z). - IDs — ULID-shaped prefixed strings:
bat_01HX…(batch),cred_01HX…(credential),tnt_01HX…(tenant). - Idempotency —
Idempotency-Keyheader accepted on all POSTs; retries within 24h deduplicate. - Pagination — cursor-based via
cursorandlimitquery params; maxlimitis 100. - Errors — standard HTTP status codes; body shape
{ "error": { "code": "...", "message": "...", "request_id": "..." } }.
Environments
| Environment | Base URL | Chain | Key prefix |
|---|---|---|---|
| Testnet | https://api.learncoin.me/v1/ | Base Sepolia | lrn_test_... |
| Production | https://api.learncoin.me/v1/ | Base mainnet | lrn_live_... |
Your API key's prefix determines which chain your credentials are anchored on — no separate base URL.
Where to go next
- Authentication — how keys work, rotation, scoping
- Endpoints — full endpoint list with request / response shapes
OpenAPI spec
Live at learncoin.me/openapi.yaml — OpenAPI 3.1, covers every endpoint with full request / response schemas.
Generate a typed client:
# TypeScript
npx openapi-typescript https://learncoin.me/openapi.yaml -o learncoin.d.ts
# Python
pip install openapi-python-client
openapi-python-client generate --url https://learncoin.me/openapi.yaml
# Go
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
oapi-codegen -package learncoin https://learncoin.me/openapi.yaml > learncoin.goOr drop the hand-maintained TypeScript mirror from /docs/api/types directly into your codebase — no install, no codegen step.