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

# Set position limit

> PATCH /v1/firm-control/accounts/{account_id}/position-limit — change one account's position limit.

A position limit is a **policy**: a weighted ceiling (`global_limit`) plus optional per-group weights and caps. Generating an account copies the plan's policy id onto that account. Editing that shared catalog policy changes every account still pointing at it.

Use this operation when one account needs a different limit.

```http theme={null}
PATCH /v1/firm-control/accounts/{account_id}/position-limit
```

`operationId: setFirmAccountPositionLimit`

Requires `accounts:write`. A firm API key is automatically scoped to its firm. Send exactly one of `position_limit_policy_id` or `global_limit`.

## Assign a catalog policy

Point the account at a reusable policy you already created under `position-limit-policies`. Later edits to that catalog policy apply to this account and to every other account on it.

```bash theme={null}
curl -X PATCH "$TRADARA_BASE_URL/v1/firm-control/accounts/$ACCOUNT_ID/position-limit" \
  -H "X-Tradara-Api-Key: $TRADARA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "position_limit_policy_id": "9d4e8c1a-0b2f-4a91-8e3d-1c2b3a4d5e6f",
    "reason_code": "REDUCED_SIZE"
  }'
```

The policy must belong to your firm, match the account's product type, and be a catalog policy. An account-specific copy cannot be assigned.

## Change the ceiling for this account

`global_limit` copies the account's current policy, including its group weights and per-group caps, and sets the new ceiling on that copy. Other accounts keep the original policy.

```bash theme={null}
curl -X PATCH "$TRADARA_BASE_URL/v1/firm-control/accounts/$ACCOUNT_ID/position-limit" \
  -H "X-Tradara-Api-Key: $TRADARA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "global_limit": 2,
    "reason_code": "PAYOUT",
    "note": "Two minis after payout"
  }'
```

A later call with `global_limit` updates that private copy in place. To change weights or per-group caps, create those on a catalog policy and assign it.

## Response — `200 OK`

```json theme={null}
{
  "item": {
    "account_id": "5b1c8a2e-9f2d-4d3c-b6f0-2b6c5b6e1f9a",
    "active_policy_id": "c1d2e3f4-a5b6-4789-8abc-def012345678",
    "previous_active_policy_id": "9d4e8c1a-0b2f-4a91-8e3d-1c2b3a4d5e6f",
    "global_limit": 2,
    "calc_method": "WEIGHTED_SUM",
    "position_limit_cloned": true,
    "position_limit_reason_code": "PAYOUT"
  }
}
```

`position_limit_cloned` is true when Tradara created a private copy. Tradara emits `account.updated` so live risk enforcement uses the new policy.

> [!WARNING]
>
> Tightening the ceiling does not flatten an open position. New orders that would increase exposure past the ceiling are rejected. Orders that reduce exposure are still accepted.

## Errors

| HTTP | Meaning |
| - | - |
| `400` | Missing reason, both fields or neither field, a non-positive ceiling, a product-type mismatch, or an account-specific policy id. `global_limit` also fails when the account has no current policy to copy. |
| `403` | Caller lacks `accounts:write`. |
| `404` | Account or catalog policy is unknown or outside your firm. |
| `502` / `503` | Accounts service unavailable. |


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