Skip to content
NyriaDocs

REST API

Send alerts to a strategy and read its open positions, recent orders and fills over REST, with the same token as the webhook.

Every route lives under https://api.nyria.io/v1 and answers in JSON. POST /v1/alerts returns an order_id for each order it creates.

Authentication

Send the strategy token in the Authorization header:

Authorization: Bearer YOUR_STRATEGY_TOKEN

The token is the 64-character string at the end of the strategy's webhook URL. Copy it from the strategy's Integration tab. The API takes the token only in this header, never in the URL.

Each token allows 30 requests a minute. The token sends to the strategy it belongs to. It reads that strategy and your own accounts with a bot on it. Accounts that copy the strategy are not shown. Account numbers show the last 4 digits only.

Positions

curl https://api.nyria.io/v1/positions \
  -H "Authorization: Bearer YOUR_STRATEGY_TOKEN"
{
  "accounts": [
    {
      "account": "****1234",
      "broker": "Nyria Paper",
      "account_type": "paper",
      "positions": [
        {
          "instrument": "BTCUSDT",
          "direction": "long",
          "quantity": 0.5,
          "average_price": 65000,
          "working_quantity": null,
          "strategy": "this"
        }
      ]
    }
  ]
}

You get one entry for each of your accounts with a bot on the strategy. Positions cover trades Nyria placed. Trades placed outside Nyria are not listed.

  • quantity is the filled quantity.
  • average_price is the average fill price, weighted by quantity. It is null when nothing has filled.
  • working_quantity is the quantity still open at the broker, or null.
  • strategy is this for a position from this strategy and other for one from another strategy on the same account.

An account with nothing open has "positions": []. With no bot on the strategy, accounts is empty.

Orders

curl "https://api.nyria.io/v1/orders?limit=20" \
  -H "Authorization: Bearer YOUR_STRATEGY_TOKEN"
{
  "orders": [
    {
      "order_id": "6f1c2a9e-0000-4000-8000-000000000001",
      "broker": "nyria-paper",
      "account_type": "paper",
      "account": "****1234",
      "instrument": "BTCUSDT",
      "action": "buy_to_open",
      "side": "entry",
      "status": "filled",
      "quantity": 0.5,
      "filled_quantity": 0.5,
      "fill_price": 65000,
      "created_at": "2026-10-29T14:30:01.000Z",
      "updated_at": "2026-10-29T14:30:02.000Z"
    }
  ]
}

Orders come newest first. limit takes 1 to 100 and defaults to 20.

The webhook reply carries no order id. Send through POST /v1/alerts to get one back.

Order status

curl https://api.nyria.io/v1/orders/ORDER_ID \
  -H "Authorization: Bearer YOUR_STRATEGY_TOKEN"
{
  "alert": null,
  "orders": [
    {
      "order_id": "6f1c2a9e-0000-4000-8000-000000000001",
      "broker": "nyria-paper",
      "account_type": "paper",
      "account": "****1234",
      "instrument": "BTCUSDT",
      "action": "buy_to_open",
      "side": "entry",
      "status": "partially filled",
      "quantity": 0.5,
      "filled_quantity": 0.2,
      "fill_price": 65000,
      "created_at": "2026-10-29T14:30:01.000Z",
      "updated_at": "2026-10-29T14:30:02.000Z"
    }
  ]
}

ORDER_ID is an order_id from GET /v1/orders, POST /v1/alerts or the MCP nyria_send_alert reply. An order_id from a send names the alert, so alert holds the alert and orders lists each of your bots' orders for it. orders is empty until the bots place them.

status is the order's state, such as pending, open, partially filled, filled, closed, cancelled or rejected. Times are UTC.

Send an alert

Alerts can place real orders. Every active bot on the strategy acts on the alert, including bots on accounts that copy it. Test with a paper bot first.

curl -X POST https://api.nyria.io/v1/alerts \
  -H "Authorization: Bearer YOUR_STRATEGY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "BUY BTCUSDT"}'
{
  "status": "processed",
  "message": null,
  "live_bots": false,
  "orders": [
    {
      "order_id": "6f1c2a9e-0000-4000-8000-000000000002",
      "instrument": "BTCUSDT",
      "action": "buy",
      "side": "entry",
      "status": "open"
    }
  ]
}

message is the alert in the same words a webhook takes, up to 2000 characters. A text/plain body works too, with the alert as the whole body.

  • status is how Nyria handled the alert. processed means it reached the strategy's bots. rejected means the strategy turned it down, for example a ticker not on its list or a strategy that isn't Active. duplicate means Nyria already had that alert.
  • message is the reason when status is rejected, otherwise null.
  • live_bots is true when a live bot on the strategy may have placed a real order.
  • orders holds one entry per order the alert created. Pass its order_id to GET /v1/orders/{order_id} to see each bot's fill.

orders can be empty when the alert is still being recorded. List recent orders a few seconds later.

The same alert sent twice within two minutes goes out once. The repeat answers 409. To scale into a position, make the message differ.

Errors

StatusBodyMeaning
400{"error": "limit must be a whole number from 1 to 100."}limit is out of range.
400{"error": "Send the alert as JSON ... or as plain text."}The alert body is empty or has no message.
401{"error": "Unauthorized"}The token is missing, mistyped or rotated.
404{"error": "Order not found."}No order with that id on this strategy.
405{"error": "Method not allowed"}The route takes the method in the Allow header.
409{"error": "This alert was already sent in the last two minutes. ..."}The same alert went out in the last two minutes.
413{"error": "Request too large"}The body is over 16 KB.
422{"error": "..."}Nyria couldn't use the alert, for example unreadable text or an unknown symbol. The error says why.
429{"error": "Too many requests. Wait a moment and try again."}Over 30 requests a minute, or too many alerts in a burst. Wait for the Retry-After seconds.
500{"error": "..."}The alert may not have gone through. The error says what happened. Check recent orders before you send again.

Next steps

Your edge, on autopilot.

Trading carries risk. Read the risk disclosure.

© 2026 Nyria LLC. All rights reserved.