API Documentation
Developer API reference for integrating with OgaPay.
API Documentation
Base URL: https://ogapay-production.up.railway.app/api/v1
Authentication
Most endpoints require a Bearer token in the Authorization header.
Authorization: Bearer <your-access-token>Register
POST /auth/register
{
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"password": "SecurePass123",
"username": "johndoe",
"role": "WORKER"
}Login
POST /auth/login
{
"email": "john@example.com",
"password": "SecurePass123"
}Refresh Token
POST /auth/refresh
Tasks
List Tasks (Public)
GET /tasks
Query parameters: category, status, page, limit, search, currency, minReward, maxReward, sortBy, sortOrder
Get Task
GET /tasks/:id
Create Task (Poster)
POST /tasks
{
"title": "Rate 10 logo designs",
"description": "Rate 10 logo designs on a scale of 1-5",
"category": "SURVEY",
"reward": 100,
"currency": "NGN",
"maxWorkers": 5,
"instructions": "Open each link, rate it, paste your ratings"
}Apply to Task (Worker)
POST /tasks/:id/apply
Submit Proof (Worker)
POST /tasks/:id/submit
{
"workerNotes": "I completed the task",
"proof": "https://example.com/proof",
"attachments": ["https://imgkit.com/file1.jpg"]
}Review Submission (Poster)
PATCH /tasks/submissions/:submissionId/review
{
"status": "APPROVED",
"posterNotes": "Great work!",
"rating": 5
}Wallet
Get Balance
GET /wallet/balance
Withdraw
POST /wallet/withdraw
{
"amount": 5000,
"currency": "NGN",
"bankAccountId": "uuid"
}Transaction History
GET /wallet/transactions
Users
Get Profile
GET /users/:id
Update Profile
PATCH /users/me
Save Wallet
POST /users/wallet
Save Bank Account
POST /users/bank
Leaderboard
GET /leaderboard?period=all&type=earners
Notifications
List
GET /notifications
Mark Read
PATCH /notifications/:id/read
Error Responses
All endpoints return errors in this format:
{
"success": false,
"message": "Error description",
"errors": [
{ "field": "email", "message": "Invalid email format" }
]
}HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad request / Validation failed |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not found |
| 429 | Too many requests |
| 500 | Internal server error |
Rate Limits
| Endpoint Type | Limit | Window |
|---|---|---|
| Auth endpoints | 20 requests | 15 minutes |
| General API | 200 requests | 15 minutes |