API documentation

Bots

Bot management — create, configure, start, stop

Base URL https://api.lexx-trade.com/api/v2 · All endpoints require Ed25519 request signatures unless marked "no auth" — see Authentication.

GET /bots

List bots

Returns all configured bots for the authenticated user, optionally filtered by strategy type. This endpoint is not paginated and accepts no exchange, status or limit filters — only type.

Query parameters

type string Filter bots by strategy type

Request samples

# Sign: timestamp + "GET" + "/v2/bots" + ""  → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/bots' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("GET", "/bots");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/bots")
print(res["data"])

Response 200 — Bot list

data array
id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (401, 429, 500)
401 Invalid or missing API key/signature
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

POST /bots

Create bot

Create a new trading bot with specified type and configuration.

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request body required

type string required

Bot strategy type (see PublicBot.type for descriptions)

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

settings all of required

Bot-type-specific configuration. settings.exchange is required; see BotConfig for per-type schemas (the schemas use the type field as discriminator for documentation purposes).

options object

Additional runtime options passed to the bot (e.g., UI preferences, notification overrides). Optional, structure varies by bot type.

metadata string

Arbitrary JSON-encoded metadata string attached to the bot. Used for client-side tracking (e.g., source, campaign, notes).

tag string

User-defined tag for grouping and filtering bots (e.g., "scalping", "long-term", "test"). Max 50 characters.

Request samples

# Sign: timestamp + "POST" + "/v2/bots" + body  → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/bots' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP" \
  -H 'Content-Type: application/json' \
  -d '{"type":"FIBO","settings":{"type":"FIBO","symbol":{"base":"SOL","quote":"USDT"},"exchange":"binance-spot","deposit":{"value":"1000","asset":"USDT","strategy":"fixed","allocate":"auto"},"strategy":"fixed","channels":[{"name":"0","depositePercent":"0","buy":"120.00","sell":"120.00"},{"name":"1","depositePercent":"0","buy":"180.00","sell":"180.00"},{"name":"0.5","depositePercent":"100","buy":"150.00","sell":"165.00"}]}}'
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/bots", {
  body: {
    "type": "FIBO",
    "settings": {
      "type": "FIBO",
      "symbol": {
        "base": "SOL",
        "quote": "USDT"
      },
      "exchange": "binance-spot",
      "deposit": {
        "value": "1000",
        "asset": "USDT",
        "strategy": "fixed",
        "allocate": "auto"
      },
      "strategy": "fixed",
      "channels": [
        {
          "name": "0",
          "depositePercent": "0",
          "buy": "120.00",
          "sell": "120.00"
        },
        {
          "name": "1",
          "depositePercent": "0",
          "buy": "180.00",
          "sell": "180.00"
        },
        {
          "name": "0.5",
          "depositePercent": "100",
          "buy": "150.00",
          "sell": "165.00"
        }
      ]
    }
  }
});
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/bots", body={
    "type": "FIBO",
    "settings": {
      "type": "FIBO",
      "symbol": {
        "base": "SOL",
        "quote": "USDT"
      },
      "exchange": "binance-spot",
      "deposit": {
        "value": "1000",
        "asset": "USDT",
        "strategy": "fixed",
        "allocate": "auto"
      },
      "strategy": "fixed",
      "channels": [
        {
          "name": "0",
          "depositePercent": "0",
          "buy": "120.00",
          "sell": "120.00"
        },
        {
          "name": "1",
          "depositePercent": "0",
          "buy": "180.00",
          "sell": "180.00"
        },
        {
          "name": "0.5",
          "depositePercent": "100",
          "buy": "150.00",
          "sell": "165.00"
        }
      ]
    }
  })
print(res["data"])

Response 200 — Bot created

data object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

GET /bots/{id}

Get bot by ID

Returns a single bot by its identifier.

Path parameters

id required string Bot identifier

Request samples

# Sign: timestamp + "GET" + "/v2/bots/<id>" + ""  → see Authentication
curl -X GET 'https://api.lexx-trade.com/api/v2/bots/<id>' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("GET", "/bots/<id>");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("GET", "/bots/<id>")
print(res["data"])

Response 200 — Bot details

data object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (401, 404, 429, 500)
401 Invalid or missing API key/signature
404 Resource not found
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

PATCH /bots/{id}

Update bot configuration

Update a bot configuration. Bot must be stopped before updating. Note: X-Idempotency-Key is NOT honored on PATCH requests (the idempotency guard only covers POST/PUT/DELETE).

Path parameters

id required string Bot identifier

Request body required

config object

Bot-type-specific configuration object. Structure depends on bot type. See BotConfig schema.

options object

Additional update options (e.g., restart behavior, notification settings). Structure varies by bot type.

metadata string

Arbitrary metadata string to attach to the bot.

restart boolean

If true, automatically restart the bot after applying the configuration update.

Request samples

# Sign: timestamp + "PATCH" + "/v2/bots/<id>" + ""  → see Authentication
curl -X PATCH 'https://api.lexx-trade.com/api/v2/bots/<id>' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("PATCH", "/bots/<id>");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("PATCH", "/bots/<id>")
print(res["data"])

Response 200 — Bot updated. `data` contains the updated bot and, when available, the previous version.

data object
bot object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

old object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 404, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
404 Resource not found
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

DELETE /bots/{id}

Delete bot

Permanently delete a bot and its history. Running bots must be stopped first.

Path parameters

id required string Bot identifier

Query parameters

force boolean Force stop all runs before deletion.

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request samples

# Sign: timestamp + "DELETE" + "/v2/bots/<id>" + ""  → see Authentication
curl -X DELETE 'https://api.lexx-trade.com/api/v2/bots/<id>' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("DELETE", "/bots/<id>");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("DELETE", "/bots/<id>")
print(res["data"])

Response 200 — Bot deleted. `data` is `null`.

data null

Always null on successful deletion.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 404, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
404 Resource not found
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

POST /bots/{id}/runs

Start bot

Start a bot, creating a new run instance.

Path parameters

id required string Bot identifier

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request samples

# Sign: timestamp + "POST" + "/v2/bots/<id>/runs" + ""  → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/bots/<id>/runs' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/bots/<id>/runs");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/bots/<id>/runs")
print(res["data"])

Response 200 — Bot started. `data` is the full updated bot record.

data object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 404, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
404 Resource not found
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

DELETE /bots/{id}/runs/{runId}

Stop bot

Stop a running bot. Active orders may be canceled depending on bot configuration.

Path parameters

id required string Bot identifier
runId required string Run instance identifier

Query parameters

cleanup string Order cleanup strategy on stop. leaveAllOrders — keep all open orders, cancelBuyOrders — cancel only buy-side orders, cancelAllOrders — cancel all open orders.
force boolean Force stop the run even if it is in a transient state.
action string Post-stop action to execute. Valid value: stop_and_sell — stop the bot and market-sell remaining positions.

Request samples

# Sign: timestamp + "DELETE" + "/v2/bots/<id>/runs/<runId>" + ""  → see Authentication
curl -X DELETE 'https://api.lexx-trade.com/api/v2/bots/<id>/runs/<runId>' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("DELETE", "/bots/<id>/runs/<runId>");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("DELETE", "/bots/<id>/runs/<runId>")
print(res["data"])

Response 200 — Bot stopped. `data` is the full updated bot record.

data object

Trading bot record returned by the Public API. This is the internal bot entry (IBotEntry) with internal-only fields stripped by botEntryToPublicData (userId, apiKeyId, keyId, apiKey, secret, credentials, workerId, worker, internalConfig, _id, __v are never present). It is an open object: beyond the guaranteed id, type, and exchange, the exact set of fields varies by bot type and lifecycle state. There is no guaranteed createdAt/updatedAt. The fields below are the ones commonly present.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 404, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
404 Resource not found
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

POST /bots/{id}/runs/{runId}/message

Send message to running bot

Path parameters

id required string Bot identifier
runId required string Run instance identifier

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request body required

message string required

Command to send to the running bot. Supported commands: add_stoploss, update_stoploss, delete_stoploss.

enum: "add_stoploss" · "delete_stoploss" · "update_stoploss"

params object

Command parameters. The expected shape depends on message: add_stoploss / update_stoploss / delete_stoploss — a stop-loss object; required: strategy (string, e.g. breakeven, price_percent_buy), trigger ({type, value?}kline or exchange), order (order parameters, e.g. {type: "STOP_MARKET", stopPrice: "..."}). Optional: disabled, complete, snoozeDuration, maxStops. Same shape for delete — the bot matches the existing stop. A stop whose trigger has already activated is rejected.

Request samples

# Sign: timestamp + "POST" + "/v2/bots/<id>/runs/<runId>/message" + ""  → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/bots/<id>/runs/<runId>/message' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/bots/<id>/runs/<runId>/message");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/bots/<id>/runs/<runId>/message")
print(res["data"])

Response 200 — Message accepted. `data` is `null`.

data null

Always null.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 404, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
404 Resource not found
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

DELETE /bots/batch

Batch delete bots

Delete multiple bots. Max 20 per request.

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request body required

bots array<string> required

Array of bot IDs to delete

Request samples

# Sign: timestamp + "DELETE" + "/v2/bots/batch" + ""  → see Authentication
curl -X DELETE 'https://api.lexx-trade.com/api/v2/bots/batch' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("DELETE", "/bots/batch");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("DELETE", "/bots/batch")
print(res["data"])

Response 200 — Per-bot results. `data` is an array of results, one entry per requested bot.

data array
id string required

Bot ID this result refers to.

success boolean required

True if the operation succeeded for this bot.

runId string

Run identifier, when the operation started/affected a run.

error string

Error message when success is false.

bot all of

The affected bot (sanitized PublicBot), when the service returns it.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

POST /bots/batch/runs

Batch start bots

Start multiple bots (max 20) in a single request. Returns a per-bot result array — each entry reports success or the error for that bot.

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request body required

bots array<string> required

Array of bot IDs to start

Request samples

# Sign: timestamp + "POST" + "/v2/bots/batch/runs" + ""  → see Authentication
curl -X POST 'https://api.lexx-trade.com/api/v2/bots/batch/runs' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("POST", "/bots/batch/runs");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("POST", "/bots/batch/runs")
print(res["data"])

Response 200 — Per-bot results. `data` is an array of results, one entry per requested bot.

data array
id string required

Bot ID this result refers to.

success boolean required

True if the operation succeeded for this bot.

runId string

Run identifier, when the operation started/affected a run.

error string

Error message when success is false.

bot all of

The affected bot (sanitized PublicBot), when the service returns it.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

DELETE /bots/batch/runs

Batch stop bots

Stop multiple running bots in a single request. Returns results per bot.

Headers

X-Idempotency-Key string Client-generated UUID for idempotent request handling (POST/PUT/DELETE only; ignored on other methods). If a request with the same key and the same parameters was already processed within the last 1 hour, the original response (status + body) is replayed without re-executing the operation. The same key with different parameters — or while the original request is still in flight — returns 409 IDEMPOTENCY_CONFLICT. 5xx responses are not cached. Strongly recommended for order creation and cancellation.

Request body required

bots array<array<string>> required

Array of [botId, runId] pairs identifying which runs to stop.

cleanup string

Order cleanup strategy on stop.

enum: "leaveAllOrders" · "cancelBuyOrders" · "cancelAllOrders"

action string

Action name, e.g. stop_and_sell

force boolean

Force stop runs even if they are in a transient state.

Request samples

# Sign: timestamp + "DELETE" + "/v2/bots/batch/runs" + ""  → see Authentication
curl -X DELETE 'https://api.lexx-trade.com/api/v2/bots/batch/runs' \
  -H "X-LEXX-KEY: $LEXX_PUBLIC_KEY" \
  -H "X-LEXX-SIGN: $SIGNATURE" \
  -H "X-LEXX-TIMESTAMP: $TIMESTAMP"
// lexx() — the signing helper from the Quickstart guide
const { data, meta } = await lexx("DELETE", "/bots/batch/runs");
console.log(data);
# lexx() — the signing helper from the Quickstart guide
res = lexx("DELETE", "/bots/batch/runs")
print(res["data"])

Response 200 — Per-bot results. `data` is an array of results, one entry per requested run.

data array
id string required

Bot ID this result refers to.

success boolean required

True if the operation succeeded for this bot.

runId string

Run identifier, when the operation started/affected a run.

error string

Error message when success is false.

bot all of

The affected bot (sanitized PublicBot), when the service returns it.

id string required

Unique bot identifier

type string required

Bot strategy type. FIBO = Fibonacci retracement grid. CHANNEL = channel breakout/bounce. SQUEEZE = Bollinger squeeze scalper. INTRADAY = intraday momentum. ALGO = custom algorithm. ALARM = price alert monitor. NOTIFY = notification-only watcher.

enum: "FIBO" · "CHANNEL" · "SQUEEZE" · "INTRADAY" · "ALGO" · "ALARM" · "NOTIFY"

exchange string required

Exchange account this bot operates on (e.g., binance-spot, bybit-futures)

status string

Current bot state (when present). NEW = created but never started. STARTED = actively trading. STOPPED = stopped. ERROR = stopped due to an error.

enum: "NEW" · "STARTED" · "STOPPED" · "ERROR"

config all of

Bot-type-specific configuration object (present under config, settings, or options depending on the bot). Discriminated on the type field — see BotConfig.

settings object

Bot settings as submitted on creation (may appear instead of/alongside config).

options object

Additional runtime options (e.g., UI display preferences, notification settings). Structure is bot-type-specific.

metadata string

Arbitrary metadata string attached to the bot, if any.

tag string

User-defined tag for grouping bots, if set.

state string

Live runtime state label, if present.

runId string

Current active run identifier, if the bot is running.

meta object

Standard response envelope metadata included in every successful API response. Rate-limit state is NOT in the body — it is delivered via the X-RateLimit-* response headers.

requestId string (uuid) required

Unique identifier for this API request, useful for support tickets and debugging

timestamp integer required

Response timestamp in Unix milliseconds

version string required

API version

idempotencyKey string

Echoed back on a successful mutating request (POST/DELETE) when the caller sent an X-Idempotency-Key header. Absent otherwise.

Error responses (400, 401, 403, 409, 429, 500)
400 Invalid request parameters
401 Invalid or missing API key/signature
403 Insufficient permissions or IP not whitelisted
409 Resource conflict (e.g., idempotency key reuse)
429 Rate limit exceeded
500 Internal server error

All errors share the { error: { code, status, message }, meta } envelope — see Errors for every code.

Cookie Preferences

Manage your cookie preferences below. Necessary cookies are always active as they are essential for the website to function properly.

Strictly Necessary

Essential for the website to function. These cookies cannot be disabled.

Analytics

Help us understand how visitors interact with our website by collecting and reporting information anonymously.

Marketing

Used to track visitors across websites to display relevant advertisements.

Preferences

Allow the website to remember choices you make, such as language or region.