# Split positions

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

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

Splits each of the given open positions into two positions, one holding the given percentage of the amount and one holding the rest. Positions on hold, already sold or with an open order are skipped.

OAuth scope: `read`, `manage`

percentage must be above 0 and at most 100; it defaults to 50. When some positions were skipped, data also says how many. Returns an error when no position could be split. Not available for copy bots.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | 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_id` | array of integer | no |  |
| `percentage` | number | no | Between 0 and 100. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/split" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_id":[123456,123457],"percentage":25}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Positions have been splitted."
}
```

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.
