# Sell position

`POST https://api.cryptohopper.com/v1/hopper/{id}/position/sell/{position_id}`

Part of [Positions](https://www.cryptohopper.com/api-documentation/api-reference/positions.md) in the Cryptohopper API reference.

Places a sell order for one open position at the current bid, or at the price you send.

OAuth scope: `trade`

Uses the order rate limit bucket: 1 request per 8 seconds. The body is optional: price (limit price) and market_order (1 for a market order). If the position already has an open order, data is "Order already placed". Requires an active subscription for the hopper.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `position_id` | string | yes | Open position ID. |
| `id` | string | yes | Hopper ID. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sell/POSITION_ID" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"market_order":1}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Sell order for position placed."
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
