🔌 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

MethodEndpointDescription
POST/auth/registerCreate new account
POST/auth/loginLogin and get token
POST/auth/refreshRefresh access token
GET/auth/meGet current user

MT5 Accounts

MethodEndpointDescription
GET/mt5/accountsList all accounts
POST/mt5/accountsAdd new account
GET/mt5/accounts/{id}Get account details
DELETE/mt5/accounts/{id}Remove account

Trades

MethodEndpointDescription
GET/tradesList all trades
POST/tradesPlace new trade
PUT/trades/{id}Modify trade
DELETE/trades/{id}Close trade

Webhook

MethodEndpointDescription
POST/webhook/tradingviewTradingView webhook

❌ Error Responses

CodeDescription
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error

📊 Interactive Documentation

Access Swagger UI for interactive API testing:

Open Swagger UI

📚 Related Guides