> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kalshi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Groups

> Manage order groups for automatic position management

For an overview of order groups and how they work, see [Order Groups](/getting_started/order_groups.md).

## Order Group Request (35=UOG)

Manage order groups with Create, Reset, Delete, Trigger, and Update operations.

### Required Fields

| Tag | Name | Description | Type/Values |
| - | - | - | - |
| 20131 | OrderGroupAction | Operation to perform | Create\<1>, Reset\<2>, Delete\<3>, Trigger\<4>, Update\<5> |

### Optional Fields

| Tag | Name | Description | Type/Values |
| - | - | - | - |
| 79 | AllocAccount | Subaccount number (0-63). When provided on any action, the request targets the order group belonging to that subaccount. Omit (or set to 0) to operate on the primary account. | Integer |
| 100 | ExDestination | Exchange index. Omit for exchange index `0`. | Integer |

> [!NOTE]
>
> Order groups are scoped per subaccount. An `OrderGroupID` created under `AllocAccount=2` cannot be reset, updated, deleted, or triggered without also passing `AllocAccount=2` on the follow-up request. If the AllocAccount value does not match the group's owning subaccount, the exchange returns an `ORDER_GROUP_NOT_FOUND` business reject.

### Fields by Action

#### Create (Action=1)

| Tag | Name | Description | Required |
| - | - | - | - |
| 20132 | OrderGroupContractsLimit | Maximum contracts allowed (1-1,000,000) | Yes |
| 79 | AllocAccount | Subaccount number (0-63) to own the new group. | No |

> [!NOTE]
>
> The OrderGroupID is generated by the server and returned in the response. Do not include tag 20130 in Create requests.

#### Reset (Action=2)

| Tag | Name | Description | Required |
| - | - | - | - |
| 20130 | OrderGroupID | ID of group to reset | Yes |
| 79 | AllocAccount | Subaccount number (0-63) that owns the group. | No |

#### Delete (Action=3)

| Tag | Name | Description | Required |
| - | - | - | - |
| 20130 | OrderGroupID | ID of group to delete | Yes |
| 79 | AllocAccount | Subaccount number (0-63) that owns the group. | No |

> [!WARNING]
>
> Deleting an order group cancels all resting orders in that group.

#### Trigger (Action=4)

| Tag | Name | Description | Required |
| - | - | - | - |
| 20130 | OrderGroupID | ID of group to trigger | Yes |
| 79 | AllocAccount | Subaccount number (0-63) that owns the group. | No |

> [!WARNING]
>
> The Trigger action immediately cancels all orders in the specified order group, regardless of whether the contracts limit has been reached. This is useful for manual risk management or emergency order cancellation.

#### Update (Action=5)

| Tag | Name | Description | Required |
| - | - | - | - |
| 20130 | OrderGroupID | ID of group to update | Yes |
| 20132 | OrderGroupContractsLimit | New maximum contracts allowed (1-1,000,000) | Yes |
| 79 | AllocAccount | Subaccount number (0-63) that owns the group. | No |

> [!NOTE]
>
> If the updated limit would immediately trigger the group (based on the rolling 15-second window), the server cancels all
> orders in the group and marks it as triggered. No new orders can be placed until the group is reset.

**Examples:**

```fix Create Order Group theme={null}
8=FIXT.1.1|9=150|35=UOG|34=5|52=20230809-12:34:56.789|49=your-api-key|56=KalshiNR|
20131=1|20132=5000|10=123|
```

```fix Reset Order Group theme={null}
8=FIXT.1.1|9=150|35=UOG|34=6|52=20230809-12:34:57.789|49=your-api-key|56=KalshiNR|
20131=2|20130=770e8400-e29b-41d4-a716-446655440002|10=124|
```

```fix Delete Order Group theme={null}
8=FIXT.1.1|9=150|35=UOG|34=7|52=20230809-12:34:58.789|49=your-api-key|56=KalshiNR|
20131=3|20130=770e8400-e29b-41d4-a716-446655440002|10=125|
```

```fix Trigger Order Group theme={null}
8=FIXT.1.1|9=150|35=UOG|34=8|52=20230809-12:34:59.789|49=your-api-key|56=KalshiNR|
20131=4|20130=770e8400-e29b-41d4-a716-446655440002|10=126|
```

```fix Update Order Group Limit theme={null}
8=FIXT.1.1|9=150|35=UOG|34=9|52=20230809-12:35:00.789|49=your-api-key|56=KalshiNR|
20131=5|20130=770e8400-e29b-41d4-a716-446655440002|20132=2500|10=127|
```

```fix Create Order Group for subaccount 2 theme={null}
8=FIXT.1.1|9=150|35=UOG|34=10|52=20230809-12:35:01.789|49=your-api-key|56=KalshiNR|
20131=1|20132=5000|79=2|10=128|
```

## Order Group Response (35=UOH)

Response to order group management requests.

### Response Fields

| Tag | Name | Description |
| - | - | - |
| 20130 | OrderGroupID | ID of the order group |
| 20132 | OrderGroupContractsLimit | Current contracts limit (only echoed on Create and Update responses) |
| 79 | AllocAccount | Subaccount number (0-63) that owns the group |

> [!NOTE]
>
> Business-logic errors (e.g. order group not found, exchange-returned errors) are returned as BusinessMessageReject (35=j) messages. Malformed fields (e.g. invalid UUID format for OrderGroupID) produce a session-level Reject (35=3).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.