BaaS API Overview
Programmatic trading beyond TradingView.
The dotQuant BaaS API (baas.dotquant.io) is an HTTP API that lets you execute trades and manage your account programmatically — without TradingView webhooks.
Any application, script, or service can send orders directly to your connected broker using your API Key and Tenant ID. There are no restrictions on language or platform.
The API uses a command-based design: all write operations are CloudEvents sent to a single POST /tenants/{tenantId}/api/trading endpoint. Read operations use conventional GET endpoints. This is intentional — the system is built on event sourcing, so commands are dispatched to an internal message queue rather than modifying resources in-place.
Key capabilities:
- Submit buy/sell orders to your connected IBKR account
- Configure and manage indicator and strategy alerts
- Retrieve broker configuration and signal history
- Manage broker connections
Base URL: https://baas.dotquant.io
All endpoints are tenant-scoped: https://baas.dotquant.io/tenants/{tenantId}/...
API Key Authentication
How to authenticate with the BaaS API.
All BaaS API endpoints require your dotQuant API Key.Header format:
X-Api-Key: <your-api-key>
Where to find your credentials — go to your Account page in the dashboard:
- Tenant ID: shown at the top right of the Account card, labelled Tenant ID. Use the copy button to copy it. This goes into the {tenantId} path segment of every request.
- API Key: shown in the API Keys section below. Click Generate New API Key if you haven't created one yet.
Keep your API Key secret — it grants full access to your tenant. Rate Limiting
Request limits enforced on all BaaS API endpoints.
Three independent limits are enforced on every request. All limits are per-instance and apply regardless of which endpoint is called.
1. Global limit — per IP address
120 requests per 60-second sliding window across all endpoints. Exceeding it returns 429 Too Many Requests with a Retry-After header (seconds to wait).
2. Write limit — per Tenant ID
Applies to POST and PUT on /tenants/{tenantId}/api/trading only (CloudEvent ingestion).
120 requests per 60-second sliding window. Same 429 + Retry-After response.
3. Auth failure limit — per IP address
If an IP sends 10 requests that result in 401 Unauthorized within a 60-second window, that IP is blocked for the remainder of the window.
Blocked requests receive 429 Too Many Requests with a Retry-After header.
The counter resets on a successful authenticated request — legitimate clients are never penalised.
Handling 429 responses
A 429 from any of the three limiters looks identical. Clients should treat them all the same way:
1. Read the Retry-After header value (integer, seconds)
2. Wait that duration before retrying
3. Do not retry immediately — the window will not have reset
# Example: check for 429 and honour Retry-After in bash
RESPONSE=$(curl -s -o /dev/null -w "%{http_code} %{header_json}" ...)
if [[ $RESPONSE == 429* ]]; then
WAIT=$(echo $RESPONSE | jq -r '."retry-after"[0]')
sleep $WAIT
fi
Note: The values above are the platform defaults. The operator-configured values in production may differ. Submitting a Trade
Sending an order directly via the API.
Endpoint: POST https://baas.dotquant.io/tenants/{tenantId}/api/trading
Content-Type: application/json
All commands are sent as CloudEvents. To submit a trade signal:
{
"id": "signal-msft-buy-001",
"type": "SubmitSignal",
"source": "trading",
"dataSchema": "submit-signal/1.0",
"dataContentType": "application/json",
"time": "2026-04-27T11:20:00Z",
"data": {
"CorrelationId": "<your-alert-id>",
"TenantId": "<your-tenant-id>",
"Id": "<unique-signal-id>",
"BrokerId": "<your-broker-id>",
"BrokerName": "IBKR",
"Symbol": "MSFT",
"Date": "2026-04-27T11:20:00Z",
"Data": "buy",
"Quantity": 1,
"Price": 424.60,
"OrderType": "MKT",
"InstrumentType": "STK",
"AccountRiskPercentage": 0,
"AccountQuantityMultiplier": 0
}
}
Field notes:
- CorrelationId — the alert ID from your signal settings page (ties this signal to the right alert configuration)
- Id — a unique ID for this individual signal instance (sequential number or UUID)
- Data — the action: buy, sell, or close
- OrderType — MKT or LMT
- InstrumentType — STK, Forex, Crypto, or Options
- AccountRiskPercentage / AccountQuantityMultiplier — set to 0 unless using account-level risk management
Response (202 Accepted):
{ "id": "<your-alert-id>" }
For a full list of supported command types and their schemas, call GET /tenants/{tenantId}/api/trading/schemas. Command Schemas
Discovering supported command types.
List all schemas:
GET https://baas.dotquant.io/tenants/{tenantId}/api/trading/schemas
Returns:
[
{ "name": "submit-signal", "versions": ["1.0"] },
{ "name": "configure-indicator-alert", "versions": ["1.0"] },
{ "name": "configure-strategy-alert", "versions": ["1.0"] }
]
Fetch a specific schema:
GET https://baas.dotquant.io/tenants/{tenantId}/api/trading/schemas/{schema}/{version}
Returns the full JSON Schema document (application/schema+json) for that command version. Use this to validate your payloads before sending. curl Examples
Ready-to-run curl commands for the BaaS API.
Replace $TENANT_ID, $API_KEY, $ALERT_ID, and $BROKER_ID with your values from the signal settings and Account pages.
List available command schemas:
curl https://baas.dotquant.io/tenants/$TENANT_ID/api/trading/schemas \
-H "X-Api-Key: $API_KEY"
Fetch a specific schema (e.g. submit-signal v1.0):
curl https://baas.dotquant.io/tenants/$TENANT_ID/api/trading/schemas/submit-signal/1.0 \
-H "X-Api-Key: $API_KEY"
Submit a buy order:
curl -X POST https://baas.dotquant.io/tenants/$TENANT_ID/api/trading \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "'$(uuidgen)'",
"type": "SubmitSignal",
"source": "trading",
"dataSchema": "submit-signal/1.0",
"dataContentType": "application/json",
"time": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
"data": {
"CorrelationId": "'$ALERT_ID'",
"TenantId": "'$TENANT_ID'",
"Id": "'$(uuidgen)'",
"BrokerId": "'$BROKER_ID'",
"BrokerName": "IBKR",
"Symbol": "AAPL",
"Date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
"Data": "buy",
"Quantity": 10,
"Price": 200.00,
"OrderType": "MKT",
"InstrumentType": "STK",
"AccountRiskPercentage": 0,
"AccountQuantityMultiplier": 0
}
}'
Submit a sell order — same structure, change "Data": "sell":
curl -X POST https://baas.dotquant.io/tenants/$TENANT_ID/api/trading \
-H "X-Api-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "'$(uuidgen)'",
"type": "SubmitSignal",
"source": "trading",
"dataSchema": "submit-signal/1.0",
"dataContentType": "application/json",
"time": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
"data": {
"CorrelationId": "'$ALERT_ID'",
"TenantId": "'$TENANT_ID'",
"Id": "'$(uuidgen)'",
"BrokerId": "'$BROKER_ID'",
"BrokerName": "IBKR",
"Symbol": "AAPL",
"Date": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
"Data": "sell",
"Quantity": 10,
"Price": 200.00,
"OrderType": "MKT",
"InstrumentType": "STK",
"AccountRiskPercentage": 0,
"AccountQuantityMultiplier": 0
}
}'
Windows (PowerShell):
$body = @{
id = [guid]::NewGuid().ToString()
type = "SubmitSignal"
source = "trading"
dataSchema = "submit-signal/1.0"
dataContentType = "application/json"
time = (Get-Date).ToUniversalTime().ToString("o")
data = @{
CorrelationId = $ALERT_ID
TenantId = $TENANT_ID
Id = [guid]::NewGuid().ToString()
BrokerId = $BROKER_ID
BrokerName = "IBKR"
Symbol = "AAPL"
Date = (Get-Date).ToUniversalTime().ToString("o")
Data = "buy"
Quantity = 10
Price = 200.00
OrderType = "MKT"
InstrumentType = "STK"
AccountRiskPercentage = 0
AccountQuantityMultiplier = 0
}
} | ConvertTo-Json -Depth 5
Invoke-RestMethod `
-Uri "https://baas.dotquant.io/tenants/$TENANT_ID/api/trading" `
-Method POST `
-Headers @{ "X-Api-Key" = $API_KEY; "Content-Type" = "application/json" } `
-Body $body
Use Cases
What you can build with the BaaS API.
Automated trading bot: A Python or Node.js script monitors market data and submits orders directly without needing TradingView.
Risk management layer: An external system monitors your positions and sends close orders if drawdown exceeds a threshold.
Multi-source signals: Combine signals from multiple sources (custom indicators, news feeds, ML models) and route them all to IBKR via the BaaS API.
Backtesting integration: Replay historical signals through the API in a paper-trading environment to validate execution logic.
Example — Python:
import requests, uuid
from datetime import datetime, timezone
requests.post(
f"https://baas.dotquant.io/tenants/{tenant_id}/api/trading",
headers={"X-Api-Key": api_key, "Content-Type": "application/json"},
json={
"id": str(uuid.uuid4()),
"type": "SubmitSignal",
"source": "trading",
"dataSchema": "submit-signal/1.0",
"dataContentType": "application/json",
"time": datetime.now(timezone.utc).isoformat(),
"data": {
"CorrelationId": alert_id,
"TenantId": tenant_id,
"Id": str(uuid.uuid4()),
"BrokerId": broker_id,
"BrokerName": "IBKR",
"Symbol": "AAPL",
"Date": datetime.now(timezone.utc).isoformat(),
"Data": "buy",
"Quantity": 5,
"Price": 200.00,
"OrderType": "MKT",
"InstrumentType": "STK",
"AccountRiskPercentage": 0,
"AccountQuantityMultiplier": 0
}
}
)