# Close short position

`POST https://api.cryptohopper.com/v1/hopper/{id}/short/close/{position_id}`

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

Closes one short position by placing a buy order at the current ask, or at market.

OAuth scope: `read`, `manage`, `trade`

The body is optional: market_order 1 places a market order. Not available for exchange arbitrage, market maker, copy, grid and AI bots.

## 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 | Short position ID. |
| `id` | string | yes | Hopper ID. |

## Example request

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

## Response

Example response (illustrative values):

```json
{
    "data": "Buy orders (1) have been placed for the selected short position(s)."
}
```

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.
