---
title: "Create Run"
method: POST
path: "/v1/rebalancing/runs"
tags: ["Rebalancing"]
---

# Create Run

`POST /v1/rebalancing/runs`

## Request

- Base URL: `https://broker-api.giftcity.sandbox.in.alpaca.markets`
- URL: `https://broker-api.giftcity.sandbox.in.alpaca.markets/v1/rebalancing/runs`
- Auth: HTTP basic

Creates a rebalance run.

Omit `weights` or provide an empty array to create a subscription-driven run using the account's active subscription. Provide a non-empty `weights` array to create a manual one-off run. A manual run is rejected if the account already has an active subscription.

The determination of a run's orders and the execution of a run take place during normal market hours. Runs can be initiated outside normal market hours but remain `QUEUED` until normal market hours.

Only one run in a non-terminal status is allowed at any time.

## Request body

- object
  - `account_id` string, uuid, required: The account to create the run for.
  - `amount` union: Optional decimal amount used by the run. JSON strings and numbers are accepted.
    - string
    - number
  - `type` 'full_rebalance' | 'invest_cash', required: The kind of rebalance run to create.
  - `weights` PortfolioWeightRequest[]: Asset allocation weights. Omit this field or provide an empty array to use the account's active subscription. Provide a non-empty array to create a manual one-off run. A manual run is rejected if the account already has an active subscription.
    - union: Weight entry in a portfolio create or update request, selected by `type`.
      - PortfolioWeightCashEntry: A cash weight. `symbol` is optional and may be null.
        - `percent` string, decimal, required: Percentage allocated to this weight. Values must be greater than zero, and all supplied weights must total exactly 100.
        - `symbol` string, nullable: Asset symbol. Required and non-null when `type` is `asset`.
        - `type` 'cash', required: Type of weight entry in a portfolio.
      - PortfolioWeightAssetEntry: An asset weight. `symbol` is required.
        - `percent` string, decimal, required: Percentage allocated to this weight. Values must be greater than zero, and all supplied weights must total exactly 100.
        - `symbol` string, nullable, required: Asset symbol. Required and non-null when `type` is `asset`.
        - `type` 'asset', required: Type of weight entry in a portfolio.

## Response `200`

OK

## Other responses

- `400`: The request body is missing, is not valid JSON, or has a value of the wrong type. Send a JSON body that matches the endpoint and try again.
- `401`: The request is not authenticated. Send a valid API key ID and secret, or a Broker Dashboard session, and try again.
- `403`: These credentials are not allowed to perform this action, or rebalancing is not permitted for this correspondent or account.
- `404`: The resource does not exist or is not visible to this correspondent.
- `415`: The Content-Type header is not application/json. Set Content-Type to application/json and send the body again.
- `422`: The request failed validation or cannot be completed in its current state. The message describes the reason.
- `500`: Something went wrong on our side while handling the request. Check whether the run was created before retrying, because this request is not idempotent. If it keeps happening, contact support.

---

[API](https://skmtc.dev/alpacahq/apis/broker-api.md) - [All operations](https://skmtc.dev/alpacahq/apis/broker-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alpacahq/apis/broker-api/revisions/381b1ecb3ccc?raw)
