API Documentation
Integrate your project with Microcosm using our REST API. All endpoints require authentication.
Base URL
https://api.microcosm.money/v1Authentication
All API requests require a Firebase ID Token in the Authorization header:
Authorization: Bearer <firebase_id_token>Endpoints
GET
/users/profileGet the current user's profile information including roles and organization.
Response
{
"uid": "abc123...",
"email": "user@example.com",
"role": "miner",
"station_id": 1,
"unit_id": 5,
"created_at": "2024-01-15T10:30:00Z"
}GET
/mcc/balanceGet the user's MCC token balance.
Response
{
"total_balance": 1250.5,
"locked_balance": 100.0,
"available_balance": 1150.5,
"pending_rewards": 25.0
}GET
/mcc/mining/historyGet the user's mining history with pagination.
Query Parameters
limit: number (default: 20, max: 100) offset: number (default: 0)
Response
{
"records": [
{
"date": "2024-12-20",
"project": "double-helix",
"amount": 15.5,
"status": "confirmed"
}
],
"total": 150
}GET
/organization/my-teamGet information about the user's station and team.
Response
{
"station": {
"id": 1,
"name": "Station Alpha",
"member_count": 50
},
"unit": {
"id": 5,
"name": "Team A",
"member_count": 10
},
"manager": {
"uid": "manager123...",
"name": "Manager Name"
}
}Rate Limits
API requests are limited to 100 requests per minute per user. Exceeded requests will receive a 429 Too Many Requests response.
Error Responses
{
"error": "unauthorized",
"message": "Invalid or expired token",
"code": 401
}