Complete reference for the FreelanceOS backend API
FreelanceOS API is a RESTful backend built for African freelancers to manage clients, projects, invoices, and receive international payments via Raenest. Every endpoint follows a consistent response format and requires JWT authentication for protected routes.
https://freelanceos-api.onrender.com/api/v1
For local development: http://localhost:5000/api/v1
Most endpoints require a JWT token. Include it in the Authorization header:
Authorization: Bearer your_jwt_token_here
Tokens expire after 7 days. Obtain a token via POST /auth/login or POST /auth/register.
All responses follow this structure:
{
"success": true,
"data": { ... }
}Error responses:
{
"success": false,
"error": "Human-readable error message"
}/auth/registerCreate a new user account
Request:
{
"email": "user@example.com",
"password": "SecurePass123",
"firstName": "John",
"lastName": "Doe"
}Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": { ... }
}
}/auth/loginAuthenticate and receive JWT token
Request:
{
"email": "user@example.com",
"password": "SecurePass123"
}Response:
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": { ... }
}
}/auth/me🔒 Auth requiredGet current user profile
Response:
{
"success": true,
"data": {
"id": "user_123",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"currency": "USD",
"timezone": "Africa/Lagos"
}
}/clients🔒 Auth requiredList all clients for authenticated user
Response:
{
"success": true,
"data": [...],
"total": 5,
"page": 1,
"pageSize": 10
}/clients🔒 Auth requiredCreate a new client
Request:
{
"name": "TechStart Nigeria",
"email": "hello@techstart.ng",
"company": "TechStart Nigeria Ltd",
"phone": "+234 802 345 6789",
"country": "NG"
}/clients/:id🔒 Auth requiredUpdate an existing client
/clients/:id🔒 Auth requiredDelete a client (only if no active projects)
/projects🔒 Auth required??status=active&clientId=client_123List all projects with optional filters
/projects🔒 Auth requiredCreate a new project
Request:
{
"clientId": "client_123",
"name": "E-commerce Redesign",
"description": "Complete website overhaul",
"budget": 4500,
"currency": "USD",
"status": "planning",
"deadline": "2026-04-15T00:00:00Z"
}/invoices🔒 Auth requiredList invoices with status filtering
/invoices🔒 Auth requiredCreate a new invoice (auto-generates invoice number)
Request:
{
"clientId": "client_123",
"amount": 2250,
"currency": "USD",
"dueDate": "2026-04-15T00:00:00Z",
"items": [
{ "description": "UI Design", "quantity": 1, "rate": 1500 },
{ "description": "Development", "quantity": 1, "rate": 750 }
],
"notes": "Payment due within 15 days"
}/invoices/:id/send🔒 Auth requiredMark invoice as sent (changes status from draft to sent)
/invoices/:id/mark-paid🔒 Auth requiredMark invoice as paid (updates client total billed)
/invoices/:id/payment-link🔒 Auth requiredGenerate Raenest payment link (placeholder)
Response:
{
"success": true,
"data": {
"link": "https://pay.raenest.com/fos-inv_123-abc123"
}
}/dashboard/stats🔒 Auth requiredGet key business metrics
Response:
{
"success": true,
"data": {
"totalEarnings": 45250.75,
"monthlyEarnings": 8750.5,
"earningsGrowth": 23.5,
"activeProjects": 4,
"pendingInvoices": 3,
"pendingInvoicesAmount": 12500,
"overdueInvoices": 1,
"overdueInvoicesAmount": 6500,
"upcomingDeadlines": [...]
}
}/dashboard/earnings🔒 Auth required??period=monthlyGet earnings over time (monthly/weekly)
/dashboard/activity🔒 Auth required??limit=20Get recent activity feed
All endpoints are rate-limited to 100 requests per 15 minutes per IP address. The response headers include:
X-RateLimit-Limit — Maximum requests allowedX-RateLimit-Remaining — Requests remaining in windowX-RateLimit-Reset — Time when window resets| Variable | Required | Default | Description |
|---|---|---|---|
| DATABASE_URL | ✅ Yes | - | PostgreSQL connection string |
| JWT_SECRET | ✅ Yes | - | Secret for signing JWTs (min 32 chars) |
| PORT | ❌ No | 5000 | Server port |
| FRONTEND_URL | ❌ No | http://localhost:3000 | CORS allowed origin |
Run one of these commands to generate a secure JWT secret:
# Linux/macOS/Git Bash node -e "console.log(require('crypto').randomBytes(48).toString('hex'))" # Using OpenSSL openssl rand -hex 48 # Windows PowerShell [Convert]::ToBase64String([System.Security.Cryptography.RandomNumberGenerator]::GetBytes(48))Built for the DevCareer × Raenest Hackathon 2026. Need help? Open an issue onGitHub.