# Change settings of short positions

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

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

Changes one or more settings on the given short positions: take profit, auto close time, auto remove time, stop-loss on or off, stop-loss percentage, trailing stop-loss on or off, trailing arm percentage and trailing percentage.

OAuth scope: `read`, `manage`

position_ids are short position IDs. setting must be an object of setting names and values. Allowed names: take_profit, auto_close_time and auto_remove_time (Unix timestamp in seconds in the future, or 0 to turn off), stop_loss_enabled, stop_loss_percentage, trailing_enabled, trailing_arm_percentage, trailing_percentage. data is a list with one message per setting. Not available for exchange arbitrage, market maker, copy, grid and AI bots.

## Headers

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `position_ids` | array of integer | no |  |
| `setting` | object | no |  |
| &nbsp;&nbsp;`take_profit` | number | no | Minimum 0. |
| &nbsp;&nbsp;`auto_close_time` | number | no | Minimum 0. |
| &nbsp;&nbsp;`auto_remove_time` | number | no | Minimum 0. |
| &nbsp;&nbsp;`stop_loss_percentage` | number | no | Minimum 0. |
| &nbsp;&nbsp;`stop_loss_enabled` | integer | no |  |
| &nbsp;&nbsp;`trailing_enabled` | integer | no |  |
| &nbsp;&nbsp;`trailing_arm_percentage` | number | no | Minimum 0. |
| &nbsp;&nbsp;`trailing_percentage` | number | no | Minimum 0. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/setshortsetting" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_ids":[223344],"setting":{"take_profit":2.5,"auto_close_time":1759000000}}'
```

## Response

Example response (illustrative values):

```json
{
    "data": [
        "Position percentage profit has been set.",
        "Auto close time has been set for 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.
