Webhooks API Reference
AlgoTest Webhooks API 1.0.0
Webhook endpoints for AlgoTest API. Handles trade execution signals and position management via webhooks.
Servers
| Description | URL |
|---|---|
| Order execution and webhooks | https://orders.algotest.in |
| Main webhook endpoint | https://algotest.in |
Webhooks
POST /webhook/tv/tk-trade
Send Trade Signal via Webhook
Description
Execute a trade signal through webhook from TradingView or other platforms.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
brokers |
query | string | No | Comma-separated list of brokers to execute on | |
tag |
query | string | No | Tag identifier for the signal | |
token |
query | string | No | Authentication token for the webhook |
Request body
"BTCUSD.P buy 10"
Schema of the request body
{
"type": "string",
"description": "Trade signal in text format",
"example": "BTCUSD.P buy 10"
}
Response 200 OK
{
"success": true,
"order_id": "order_12345",
"message": "Trade executed successfully"
}
Schema of the response body
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
},
"order_id": {
"type": "string",
"description": "Unique identifier for the executed order",
"example": "order_12345"
},
"message": {
"type": "string",
"example": "Trade executed successfully"
}
}
}
Response 401 Unauthorized
{
"success": true,
"error": {
"code": "string",
"message": "string",
"details": {}
}
}
Schema of the response body
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"default": false
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "object"
}
}
}
}
}
Response 400 Bad Request
{
"success": true,
"error": {
"code": "string",
"message": "string",
"details": {}
}
}
Schema of the response body
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"default": false
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "object"
}
}
}
}
}
POST /api/webhook/custom-position/execution/start/live
Live Trading Start
Description
Start a live trading position with custom strategy configuration.
Request body
{
"access_token": "string",
"alert_name": "custom_strategy",
"exit_time": "2025-11-29T15:15:00",
"strategy": {
"Ticker": "NIFTY",
"Legs": [
{}
]
}
}
Schema of the request body
{
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "User access token"
},
"alert_name": {
"type": "string",
"description": "Name identifier for the alert",
"example": "custom_strategy"
},
"exit_time": {
"type": "string",
"format": "date-time",
"description": "Strategy exit time",
"example": "2025-11-29T15:15:00"
},
"strategy": {
"type": "object",
"description": "Trading strategy configuration",
"properties": {
"Ticker": {
"type": "string",
"example": "NIFTY"
},
"Legs": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"required": [
"access_token",
"alert_name",
"strategy"
]
}
Response 200 OK
{
"id": "6788c4fb6be04cb2210e9c10"
}
Schema of the response body
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Position identifier",
"example": "6788c4fb6be04cb2210e9c10"
}
}
}
Response 503 Service Unavailable
{
"msg": "You can only activate strategies during 08:15 IST to 15:29 IST on trading days"
}
Schema of the response body
{
"type": "object",
"properties": {
"msg": {
"type": "string",
"example": "You can only activate strategies during 08:15 IST to 15:29 IST on trading days"
}
}
}
POST /api/webhook/custom-position/execution/start/paper
Forward Test Start
Description
Start a paper trading position for testing strategies.
Request body
{
"access_token": "string",
"alert_name": "custom_strategy",
"exit_time": "2025-11-29T15:25:00",
"strategy": {
"Ticker": "NIFTY",
"Legs": [
{}
]
}
}
Schema of the request body
{
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "User access token"
},
"alert_name": {
"type": "string",
"description": "Name identifier for the alert",
"example": "custom_strategy"
},
"exit_time": {
"type": "string",
"format": "date-time",
"description": "Strategy exit time",
"example": "2025-11-29T15:25:00"
},
"strategy": {
"type": "object",
"description": "Trading strategy configuration",
"properties": {
"Ticker": {
"type": "string",
"example": "NIFTY"
},
"Legs": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"required": [
"access_token",
"alert_name",
"strategy"
]
}
Response 200 OK
{
"id": "6788c4fb6be04cb2210e9c10"
}
Schema of the response body
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Position identifier",
"example": "6788c4fb6be04cb2210e9c10"
}
}
}
Response 503 Service Unavailable
{
"msg": "You can only activate strategies during 08:15 IST to 15:29 IST on trading days"
}
Schema of the response body
{
"type": "object",
"properties": {
"msg": {
"type": "string",
"example": "You can only activate strategies during 08:15 IST to 15:29 IST on trading days"
}
}
}
POST /api/webhook/custom-position/execution/square-off/{position_id}
Live Trading Square Off
Description
Square off a live trading position. Use Position ID from the Start API response.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
position_id |
path | string | No | Position identifier from start API response |
Request body
{
"access_token": "string"
}
Schema of the request body
{
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "User access token"
}
},
"required": [
"access_token"
]
}
Response 200 OK
{
"success": true,
"message": "Position squared off successfully"
}
Schema of the response body
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "Position squared off successfully"
}
}
}
Response 404 Not Found
{
"success": true,
"error": {
"code": "string",
"message": "string",
"details": {}
}
}
Schema of the response body
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"default": false
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "object"
}
}
}
}
}
Tags
| Name | Description |
|---|---|
| Webhooks | Receiving trade execution signals and position management |