Moonbase API
Authenticate users, fetch profile data, and download files.
Moonbase API is the backend surface for Moonbase apps and plugins. Use it to authenticate users, retrieve profile data, and fetch user files.
Authentication model
All requests include your public API key. After login, include the JWT in the Token header for user scoped endpoints.
Quick start
Copy your public API key from the console output on first startup.
Authenticate with
POST /api/auth/user to receive a JWT.Use the JWT and API key for profile and file requests.
Environment setup
.env.local
# Replace with your Moonbase API host.
NEXT_PUBLIC_API_URL=https://your-moonbase-host
# Printed once in the server console on first startup.
NEXT_PUBLIC_API_KEY=your_public_key_hereJump in
Authentication
Log in, get a JWT, and learn required headers.
User profile
Fetch account data with your API key + JWT.
User files
Download user files and handle binary responses.
Examples
Ready-to-run requests in multiple languages.
API reference
Endpoints with request and response examples.
Errors and status codes
Understand common error shapes and limits.