Skip to content

API Errors

When communicating with exchanges, various API errors can occur. This guide explains common error codes and how to resolve them.

HTTP Status Codes

401 — Unauthorized

Meaning: Your API credentials are invalid or expired.

Common causes:

  • API key was deleted on the exchange
  • API key expired (some exchanges have expiration dates)
  • Secret key or passphrase is incorrect
  • System clock is significantly out of sync

Solution:

  1. Verify the API key exists on your exchange
  2. Create a new API key if needed
  3. Update credentials in Settings → API Keys

403 — Forbidden

Meaning: Your API key doesn't have permission for the requested action.

Common causes:

  • Missing trade permission when trying to place orders
  • IP restriction blocking the request
  • Account-level restrictions on the exchange

Solution:

  1. Check API key permissions on your exchange
  2. Verify IP whitelist settings (if any)
  3. Check for any account restrictions

429 — Rate Limited

Meaning: Too many requests sent to the exchange API.

Common causes:

  • Multiple applications using the same API key
  • Rapid manual refreshing
  • Temporary spike in API calls

Solution:

  • Wait 60 seconds before retrying
  • Avoid rapid manual refreshing
  • Use a dedicated API key for Crodl

Read requests and trade submissions have different recovery rules. Chart layout autosave honors Retry-After; a trade's execution status must be checked before submitting it again. Do not treat a rate limit as permission to create a second trade request with a new idempotency key.

500+ — Server Error

Meaning: The exchange is experiencing internal issues.

Common causes:

  • Exchange maintenance
  • High load on the exchange
  • Temporary outage

Solution:

  • Check the request's outcome before retrying a trade; read requests can be refreshed after the service recovers
  • Check the exchange's status page
  • Crodl surfaces errors and checks uncertain trade outcomes rather than blindly creating a replacement order

Webhook Validation and Execution Outcomes

These are Crodl admission/execution results, separate from the exchange error codes below. A webhook 401 can mean an invalid security_token; a 202 only confirms admission to the queue.

ResultWhat to check
Futures 422 Invalid envelopeInclude exchange, trading_action, and security_token; do not send a spot payload to /webhooks/trading
Futures 422 Invalid payloadCheck futures side, quantity fields, non-market price fields, and TP/SL settings
trigger_id_invalid / trigger_metadata_not_foundUse the ID exported from the matching saved futures trigger; ensure account/token/symbol/action match
close_requires_position_quantity_modeFutures close sizing must describe the live position; use quantity_mode: "position"
Spot 422 spot_trade_validation_failedUse /webhooks/spot/trading, correct buy/sell quantity mode, and only spot fields
Spot 422 spot_trigger_scope_invalidRe-copy the exact saved spot trigger configuration and ID; do not change the side or size only in TradingView
interactive_trade_queue_expiredA proven pre-submission request expired without an exchange submission; review the current signal before deliberately sending another trade
Needs attention / reconciliationExisting exchange outcome is uncertain; inspect that request and exchange history instead of resubmitting
409A conflicting money-path reservation or execution is already in progress; inspect its detail
503Admission, queue, or product availability problem; inspect the existing request before retrying an uncertain submission

If you retry delivery of the same signal, keep its original idempotency key. Do not generate a new key to bypass an unresolved request. See Futures Triggers and Spot Triggers.

Crodl Trade Guard Errors

These errors happen inside Crodl before the order is submitted to the exchange.

Error CodeMeaningSolution
max_notional_breachedThe open trigger's final computed position notional exceeded max_notional_usd and guard_action was rejectIncrease max_notional_usd, reduce quantity_amount, or use guard_action: "clamp"
max_notional_clamp_below_min_sizeCrodl tried to clamp the order to max_notional_usd, but the resulting size was below the exchange minimum order sizeIncrease max_notional_usd or send a larger valid order size

Trade guard errors only apply when an open trigger includes max_notional_usd. If the guard fields are omitted, Crodl does not enforce a notional cap.

Exchange-Specific Errors

Blofin

Error CodeMeaningSolution
50001Invalid parameterCheck order parameters
50004API key suspendedReactivate on Blofin
51008Insufficient marginAdd funds or reduce size

Bybit

Error CodeMeaningSolution
10003Invalid API keyRegenerate key
10005Permission deniedCheck key permissions
110007Insufficient balanceAdd funds

Bitget

Error CodeMeaningSolution
40014Invalid API keyRegenerate key
40015Invalid passphraseRe-enter passphrase
43011Insufficient marginAdd funds

OKX

Error CodeMeaningSolution
50011Rate limit exceededWait and retry; reduce rapid refreshes
50113Invalid signature or credentialsRe-check API key, secret, and passphrase
51008Insufficient marginAdd funds or reduce size

Bitunix

Error CodeMeaningSolution
1001Invalid parameterCheck request format
1002Authentication failedVerify credentials

Hyperliquid

Hyperliquid returns plain-text error messages rather than numeric error codes. Common ones relate to an unknown or mistyped wallet address and insufficient collateral for the requested order — check your Master/Agent addresses in Settings → API Keys and your deposited margin on Hyperliquid.

Error Handling in Crodl

Crodl handles API errors automatically:

  • Session recovery — a 401 refreshes your session and retries the request once, so an expired token does not surface as an error
  • In-flight deduplication — prevents duplicate requests
  • Granular error messages — specific messages for each error type
  • Abort on unmount — prevents stale requests from affecting the UI
  • Layout autosave backoff — chart layout saves respect Retry-After on a 429 instead of hot-looping

If you see persistent errors across multiple refreshes, the issue is likely with your API key configuration. Try removing and re-adding your exchange connection.