Spot Triggers
Spot triggers buy or sell assets held in your exchange account. They use a separate payload and execution path from futures triggers.
For manual buys and sells, account balances, holdings, and open-order management, start with Spot Trading. This page is the automation/webhook reference.
On Automations (/trading-terminal), select the exchange, Spot, and an eligible API key. Create a buy or sell trigger, then use Copy JSON and the matching webhook URL. Spot availability is checked for the selected exchange, key, and feature; a futures connection does not by itself guarantee spot access. Use the product options the app actually enables.
Endpoint
POST https://api.crodl.com/webhooks/spot/trading
Content-Type: application/jsonThe futures endpoint /webhooks/trading does not accept spot payloads. The spot endpoint requires trading_type: "spot" and infers the action from side; do not add trading_action.
Buy Example
This market buy requests 10 USDT worth of SOL, subject to balance, fees, and exchange minimum/lot rules:
{
"name": "buy spot",
"exchange": "blofin",
"trading_type": "spot",
"symbol": "SOL-USDT",
"side": "buy",
"order_type": "market",
"time_in_force": "gtc",
"quantity_type": "amount",
"quantity_mode": "margin",
"quantity_amount": "10",
"quantity_quote": "USDT",
"cancel_unfilled": "disabled",
"pyramiding_allowed": "none",
"opposite_side_close": false,
"security_token": "YOUR_SECURITY_TOKEN",
"trigger_id": 5
}In spot payloads, margin is the buy-side sizing label. It does not enable leverage or borrowing.
Sell Example
This market sell requests 10 USDT worth of SOL from your available SOL holdings, not 10 SOL and not the full holding:
{
"name": "sell spot",
"exchange": "blofin",
"trading_type": "spot",
"symbol": "SOL-USDT",
"side": "sell",
"order_type": "market",
"time_in_force": "gtc",
"quantity_type": "amount",
"quantity_mode": "position",
"quantity_amount": "10",
"quantity_quote": "USDT",
"cancel_unfilled": "disabled",
"pyramiding_allowed": "none",
"opposite_side_close": false,
"security_token": "YOUR_SECURITY_TOKEN",
"trigger_id": 6
}A spot sell requires quantity_mode: "position". Changing only side in a buy payload leaves the wrong mode and saved trigger ID. Create the sell trigger in Crodl and copy its own JSON. IDs 5 and 6 here are illustrative, not IDs to reuse on your account.
Quantity Units
All quantities must be positive; percentages must be at most 100. quantity_quote must match the symbol's quote asset (USDT for SOL-USDT).
quantity_type | Buy (quantity_mode: "margin") | Sell (quantity_mode: "position") |
|---|---|---|
amount | Quote currency to spend; "10" means 10 USDT for SOL-USDT | Quote value of base asset to sell; "10" means approximately 10 USDT worth of SOL |
percentage | Percentage of available quote balance | Percentage of available base-asset holdings |
asset | Base-asset units to buy; "10" means 10 SOL | Base-asset units to sell; "10" means 10 SOL |
To sell the available holding, create a sell trigger with quantity_type: "percentage", quantity_mode: "position", and quantity_amount: "100", then copy its new payload. Locked balance, fee reserves, exchange precision, and minimum size can leave a remainder. A sell cannot open a short or sell an asset you do not have.
Saved Trigger Binding
Unlike a direct futures payload, a spot webhook requires a saved trigger_id. Crodl verifies that it belongs to the authenticated user, API key, and exchange, and that the execution configuration matches the saved trigger.
The checked configuration includes symbol, buy/sell side, order type, time-in-force, quantity type/mode/amount/quote, limit pricing, fixed policy values, and any strategy_dashboard_id. A valid token alone does not authorize arbitrary changes to these fields. A mismatch returns 422 with spot_trigger_scope_invalid.
After editing a spot trigger, re-copy its payload into TradingView or your sender. The old saved alert message does not update automatically. Do not substitute {{ticker}}, {{close}}, or other dynamic values into bound execution fields unless they still match the saved configuration.
Fields
| Field | Contract |
|---|---|
exchange | The exchange on the saved trigger; supported schema values are blofin, bitunix, bitget, bybit, okx, and hyperliquid, subject to live capability checks |
trading_type | Required: spot |
security_token | Required: token from your own saved trigger export; keep it private |
trigger_id | Required: positive integer identifying that saved spot trigger |
name | Human-readable label included by the exporter |
symbol | Required: canonical base-quote pair, for example SOL-USDT; use the pair copied from the trigger |
side | Required: buy or sell, not futures long/short/close_long |
order_type | market or limit; time-in-force is a separate field |
time_in_force | gtc by default; use the values offered for the selected venue and order type |
quantity_type | Required: amount, percentage, or asset |
quantity_mode | Required: margin for buys, position for sells |
quantity_amount | Required: positive numeric string, with the units explained above |
quantity_quote | Required: pair's quote currency |
limit_price_mode / limit_order_price | Required together for limit orders; omit both for market orders |
cancel_unfilled | Only disabled |
pyramiding_allowed | Only none; do not apply futures stacking-policy meanings to spot holdings |
opposite_side_close | Only JSON boolean false |
strategy_dashboard_id | Optional reporting ID, saved with the trigger; up to 128 characters using letters, numbers, ., _, :, or -, starting with a letter or number |
The spot schema rejects unknown fields. Do not include futures leverage, margin_mode, position_mode, TP/SL, allocation_id, qty, or trading_action. Keep numeric quantities as strings, trigger_id as an integer, and opposite_side_close as a boolean in copied JSON.
Limit Orders and Time-in-Force
For a spot limit trigger, set order_type: "limit" and include limit_price_mode (price or percentage) plus a positive limit_order_price. Percentage mode uses a distance below the current reference for buys and above it for sells: "2" means 2%, not 98% of the reference. A buy percentage must be less than 100.
| Venue | Limit time-in-force values |
|---|---|
| Blofin, Bybit, Bitget, OKX | gtc, ioc, fok, post_only |
| Bitunix | gtc |
| Hyperliquid | gtc, ioc, post_only |
Market payloads use gtc; Hyperliquid also accepts ioc. These values do not make a market order rest on the book. Copy the configuration offered by the selected venue; never carry limit fields into a market payload.
TradingView Setup
- Create and save the intended Spot buy or sell trigger in Crodl.
- Copy that trigger's JSON and spot webhook URL.
- In TradingView's alert notifications, enable the webhook and paste
https://api.crodl.com/webhooks/spot/trading. - Paste the complete JSON object into the alert message, with your own token and saved trigger ID.
- Save the alert. After any trigger configuration change, re-copy and save the alert message.
Acceptance and Errors
202 Accepted means Crodl queued the request, not that the exchange filled it. The response includes accepted, request_id, accepted_ms, and trading_type: "spot". Track the request in the spot execution history and check the exchange order/fill record when necessary.
| Result | Meaning |
|---|---|
401 | Invalid security token |
422 spot_trade_validation_failed | Invalid or forbidden field, wrong quantity mode, or inconsistent sizing/pricing |
422 spot_trigger_scope_invalid | Saved trigger is missing, belongs to another scope, or its execution configuration differs |
409 | A conflicting request/reservation already exists; inspect before sending another order |
429 | Spot admission rate limit; default 10 requests/second, configurable by the operator |
503 | Spot is not released/eligible, an ingress gate is closed, or admission/queue services are unavailable |
Use an Idempotency-Key HTTP header when your sender supports it: a unique value for each intended signal, reused only for retries of that signal. Spot's strict schema does not accept the futures body-level idempotency fields. Reusing trigger_id alone does not deduplicate repeated fires. If an outcome is uncertain, inspect the existing request rather than sending a new one with a different key.