🔌 API Reference
Complete REST API documentation for Secure Algo.
🌐 Base URL
https://api.securealgo.in/api🔐 Authentication
Most endpoints require JWT authentication.
Get Token
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "your_password"
}Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "bearer"
}Using Token
GET /api/trades Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
📚 API Endpoints
Authentication
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register | Create new account |
| POST | /auth/login | Login and get token |
| POST | /auth/refresh | Refresh access token |
| GET | /auth/me | Get current user |
MT5 Accounts
| Method | Endpoint | Description |
|---|---|---|
| GET | /mt5/accounts | List all accounts |
| POST | /mt5/accounts | Add new account |
| GET | /mt5/accounts/{id} | Get account details |
| DELETE | /mt5/accounts/{id} | Remove account |
Trades
| Method | Endpoint | Description |
|---|---|---|
| GET | /trades | List all trades |
| POST | /trades | Place new trade |
| PUT | /trades/{id} | Modify trade |
| DELETE | /trades/{id} | Close trade |
Webhook
| Method | Endpoint | Description |
|---|---|---|
| POST | /webhook/tradingview | TradingView webhook |
❌ Error Responses
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
📊 Interactive Documentation
Access Swagger UI for interactive API testing:
Open Swagger UI