# Set or move a futures stop or target

`POST https://app.skylit.ai/api/nexus/v1/trading/accounts/{account}/protect`

API: Nexus.

Set or move the position's stop (`"role": "stopLoss"`) or target (`"role": "takeProfit"`) to `price`, the same as dragging them on the Futures Desk. One stop and one target per position: sending a new level moves the one there. A stop must sit below the price on a long and above it on a short, a target the other way, or it answers 422 `order_refused` and nothing moves.

No `clientOrderId`: the same level sent twice lands on the same level, so one is refused with 400 `bad_request`. Only takes risk off, so it isn't held by the main account switch or an agent pause. The same checks as a close: your own named account, no trading on an ended account or a challenge entry, and it counts against your write limit.

```bash
curl -s -X POST "https://app.skylit.ai/api/nexus/v1/trading/accounts/agent/protect" \
  -H "Authorization: Bearer $SKYLIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ticker": "NQ", "role": "stopLoss", "price": 25310}'
```

## Authentication

Send your Skylit API key as a bearer token: `Authorization: Bearer <key>`. No other header is accepted.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `account` | path | string | yes | `practice`, `agent` (your bot's account), `evaluation` or `funded` (when you have exactly one running), or a futures account id from capabilities. |

## Request body

`application/json`

```json
{
  "ticker": "string",
  "role": "stopLoss",
  "price": 0
}
```

## Example request

```bash
curl "https://app.skylit.ai/api/nexus/v1/trading/accounts/practice/protect" \
  -H "Authorization: Bearer $SKYLIT_API_KEY"
```

## Responses

### 200

The order the engine placed or moved.

The stop is a working sell stop (a local run of the route).:

```json
{
  "data": {
    "account": {
      "id": "60e7c0fa-a3d2-40c1-a355-30367aa8299b",
      "kind": "agent",
      "name": "Agent"
    },
    "order": {
      "id": "a074081d-77d8-4cad-851a-c14573ac0a73",
      "assetClass": "futures",
      "source": "api",
      "account": {
        "id": "60e7c0fa-a3d2-40c1-a355-30367aa8299b",
        "kind": "agent",
        "name": "Agent"
      },
      "symbol": "NQZ26",
      "side": "sell",
      "quantity": 1,
      "role": "stop_loss",
      "orderType": "stop",
      "status": "working",
      "stopPrice": 25310,
      "placedAt": "2026-11-18T15:02:00Z"
    }
  },
  "meta": {}
}
```

The target is a working sell limit (a local run of the route).:

```json
{
  "data": {
    "account": {
      "id": "60e7c0fa-a3d2-40c1-a355-30367aa8299b",
      "kind": "agent",
      "name": "Agent"
    },
    "order": {
      "id": "197fc06b-e9c0-4427-9971-d8677ff871f1",
      "assetClass": "futures",
      "source": "api",
      "account": {
        "id": "60e7c0fa-a3d2-40c1-a355-30367aa8299b",
        "kind": "agent",
        "name": "Agent"
      },
      "symbol": "NQZ26",
      "side": "sell",
      "quantity": 1,
      "role": "take_profit",
      "orderType": "limit",
      "status": "working",
      "limitPrice": 25370,
      "placedAt": "2026-11-18T15:02:00Z"
    }
  },
  "meta": {}
}
```

### 400

The request was refused and nothing moved. Codes: `bad_request` (no `ticker`, a `role` that isn't `stopLoss` or `takeProfit`, or a `clientOrderId`), `bad_contract`, `invalid_price` (missing, or outside 0.01 to 999,999.99).

No role sent.:

```json
{
  "error": {
    "code": "bad_request",
    "message": "role must be \"stopLoss\" or \"takeProfit\"."
  }
}
```

### 401

No key, or a key that isn't valid. Codes: `missing_api_key`, `invalid_api_key`.

No key sent.:

```json
{
  "error": {
    "code": "missing_api_key",
    "message": "Send your Skylit API key in the Authorization header: Authorization: Bearer YOUR_SKYLIT_API_KEY."
  }
}
```

### 403

The key works but the account can't do this. Codes: `account_suspended`, `nexus_access_denied`, `futures_access_denied`.

The account doesn't include Nexus.:

```json
{
  "error": {
    "code": "nexus_access_denied",
    "message": "This Skylit account doesn't include Nexus, so it can't place Nexus trades."
  }
}
```

### 404

Not on your account. Codes: `trade_not_found`, `account_not_found`, `order_not_found`.

Not your trade, or no such trade.:

```json
{
  "error": {
    "code": "trade_not_found",
    "message": "No trade with that id on your account."
  }
}
```

### 409

The order clashes with what you hold or sent before. Codes: `duplicate_position` (with `tradeId`: add to it instead), `trade_closed`, `open_position_limit` (open positions plus resting opens through the API are at 50), `working_order_limit` (50 options and stock orders already resting through the API), `position_size_limit` (an add would take the position past 1,000 contracts or 100,000 shares), `client_order_id_used`, `request_in_progress`, `account_locked`, `account_busy`, `account_ended`, `order_not_working` (it already filled, expired, or was cancelled or rejected), `stop_triggered` (a stop that's been set off is filling now, so it can't be cancelled or changed).

You already hold this contract.:

```json
{
  "error": {
    "code": "duplicate_position",
    "message": "You already hold an open position on this contract. Add to it with POST /api/nexus/v1/trades/{id}/adds (the id is tradeId), or close it first.",
    "tradeId": "6f1c2a4e-8b1d-4c39-9a51-2d7e0b3c9f10"
  }
}
```

### 422

`order_refused`: the level is on the wrong side of the price, or there's no position. Also `market_closed`, `account_not_tradable`, `account_locked`.

A stop above the price on a long.:

```json
{
  "error": {
    "code": "order_refused",
    "message": "A stop must be below the current price."
  }
}
```

### 429

Over a rate limit. Wait `Retry-After` seconds, then retry. Codes: `rate_limited`, and `stream_limit_reached` (too many live streams open: 3 per key, 6 per account).

Headers: `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`.

Too many writes from this key.:

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests (limit 30). Slow down and retry in 12 seconds."
  }
}
```

### 500

Something went wrong on our side. If you sent a `clientOrderId`, retry with the same one. Code: `internal_error`.

Retry with the same clientOrderId.:

```json
{
  "error": {
    "code": "internal_error",
    "message": "Something went wrong on our side. If you sent a clientOrderId, retry with the same one (it can't fill twice). Otherwise check your account before retrying."
  }
}
```

### 503

Try again in a moment (honour `Retry-After` when it's sent). Codes: `stale_quote` (the quote, or a stock's last trade, is more than 15 seconds old, so nothing filled), `no_live_price`, `rules_pending`, `unavailable`, `auth_unavailable`, `access_check_unavailable`, `api_keys_unavailable`, `trades_api_disabled`, `stream_unavailable` (the live stream isn't on, or the server is restarting: try again shortly, or poll the reads).

Headers: `Retry-After`.

No live price right now.:

```json
{
  "error": {
    "code": "no_live_price",
    "message": "There's no live price for this contract right now, so nothing was filled. Try again in a moment."
  }
}
```
