v1

latestOpenAPI 3.0.02026-07-26166415635.8 KB
Rebalancing

Get Run by ID

Get a run by its ID.

get/v1/rebalancing/runs/{run_id}

Response

The run object

account_idstring

Account ID for given run

canceled_atstring

RFC3339 format

completed_atstring

RFC3339 format

idstring

Run ID

initiated_from'system' | 'api'

system or api

portfolio_idstring

Portfolio ID for given run

reasonstring

Explainer text in case of failed runs

status'QUEUED' | 'IN_PROGRESS' | 'CANCELED' | 'CANCELED_MID_RUN' | 'ERROR' | 'TIMEOUT' | 'COMPLETED_ADJUSTED' | 'COMPLETED_SUCCESS'
StatusFinalRepresented StateNotes
QUEUEDNoThe run has been queued, waiting for our system to process it.Runs only executed when the US market is open and there's at least 15 minutes before the market closes.
IN_PROGRESSNoPortfolio adjustment is in progress.
CANCELEDYesPortfolio run canceled, before being picked up by Alpaca's background processing
CANCELED_MID_RUNYesPortfolio run canceled while executing.The portfolio's state is in between the pre-run and post-run state, manual remediation or job re-run is recommended.
ERRORYesThere was an error while rebalancing the portfolio.The portfolio's state is in between the pre-run and post-run state, manual remediation or job re-run is recommended.
TIMEOUTYesA timeout occurred while rebalancing the portfolio.The portfolio's state is in between the pre-run and post-run state, manual remediation or job re-run is recommended.
COMPLETED_ADJUSTEDYesThe portfolio has been adjustedThe adjustments have been prepared, but the run details haven't yet updated with the list of resulting orders
COMPLETED_SUCCESSYesThe portfolio has been adjusted, run status updated
type'full_rebalance' | 'invest_cash'

full_rebalance or invest_cash

updated_atstring

RFC3339 format

Example response

{
  "failed_orders": [
    {
      "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "cancel_requested_at": "2021-03-16T18:38:01.942282Z",
      "canceled_at": "2021-03-16T18:38:01.942282Z",
      "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "commission": "3.14",
      "commission_bps": "10",
      "commission_type": "qty",
      "created_at": "2021-03-16T18:38:01.942282Z",
      "expired_at": "2021-03-16T18:38:01.942282Z",
      "extended_hours": true,
      "failed_at": "2021-03-16T18:38:01.942282Z",
      "filled_at": "2021-03-16T18:38:01.942282Z",
      "filled_avg_price": "4.2",
      "filled_qty": "4.2",
      "hwm": "3.14",
      "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "legs": [
        {
          "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "canceled_at": "2021-03-16T18:38:01.942282Z",
          "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "commission": "3.14",
          "commission_bps": "10",
          "commission_type": "qty",
          "created_at": "2021-03-16T18:38:01.942282Z",
          "expired_at": "2021-03-16T18:38:01.942282Z",
          "extended_hours": true,
          "failed_at": "2021-03-16T18:38:01.942282Z",
          "filled_at": "2021-03-16T18:38:01.942282Z",
          "filled_avg_price": "4.2",
          "filled_qty": "4.2",
          "hwm": "3.14",
          "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "limit_price": "3.14",
          "notional": "4.2",
          "order_type": "market",
          "position_intent": "buy_to_open",
          "qty": "4.2",
          "replaced_at": "2021-03-16T18:38:01.942282Z",
          "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "side": "buy",
          "status": "filled",
          "stop_price": "3.14",
          "submitted_at": "2021-03-16T18:38:01.942282Z",
          "symbol": "AALP",
          "time_in_force": "gtc",
          "trail_percent": "5.0",
          "trail_price": "3.14",
          "type": "market",
          "updated_at": "2021-03-16T18:38:01.942282Z"
        }
      ],
      "limit_price": "3.14",
      "notional": "4.2",
      "order_type": "market",
      "position_intent": "buy_to_open",
      "qty": "4.2",
      "replaced_at": "2021-03-16T18:38:01.942282Z",
      "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "side": "buy",
      "status": "filled",
      "stop_price": "3.14",
      "submitted_at": "2021-03-16T18:38:01.942282Z",
      "symbol": "AALP",
      "time_in_force": "gtc",
      "trail_percent": "5.0",
      "trail_price": "3.14",
      "type": "market",
      "updated_at": "2021-03-16T18:38:01.942282Z"
    }
  ],
  "orders": [
    {
      "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "cancel_requested_at": "2021-03-16T18:38:01.942282Z",
      "canceled_at": "2021-03-16T18:38:01.942282Z",
      "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "commission": "3.14",
      "commission_bps": "10",
      "commission_type": "qty",
      "created_at": "2021-03-16T18:38:01.942282Z",
      "expired_at": "2021-03-16T18:38:01.942282Z",
      "extended_hours": true,
      "failed_at": "2021-03-16T18:38:01.942282Z",
      "filled_at": "2021-03-16T18:38:01.942282Z",
      "filled_avg_price": "4.2",
      "filled_qty": "4.2",
      "hwm": "3.14",
      "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "legs": [
        {
          "asset_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "canceled_at": "2021-03-16T18:38:01.942282Z",
          "client_order_id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "commission": "3.14",
          "commission_bps": "10",
          "commission_type": "qty",
          "created_at": "2021-03-16T18:38:01.942282Z",
          "expired_at": "2021-03-16T18:38:01.942282Z",
          "extended_hours": true,
          "failed_at": "2021-03-16T18:38:01.942282Z",
          "filled_at": "2021-03-16T18:38:01.942282Z",
          "filled_avg_price": "4.2",
          "filled_qty": "4.2",
          "hwm": "3.14",
          "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "limit_price": "3.14",
          "notional": "4.2",
          "order_type": "market",
          "position_intent": "buy_to_open",
          "qty": "4.2",
          "replaced_at": "2021-03-16T18:38:01.942282Z",
          "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
          "side": "buy",
          "status": "filled",
          "stop_price": "3.14",
          "submitted_at": "2021-03-16T18:38:01.942282Z",
          "symbol": "AALP",
          "time_in_force": "gtc",
          "trail_percent": "5.0",
          "trail_price": "3.14",
          "type": "market",
          "updated_at": "2021-03-16T18:38:01.942282Z"
        }
      ],
      "limit_price": "3.14",
      "notional": "4.2",
      "order_type": "market",
      "position_intent": "buy_to_open",
      "qty": "4.2",
      "replaced_at": "2021-03-16T18:38:01.942282Z",
      "replaced_by": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "replaces": "61e69015-8549-4bfd-b9c3-01e75843f47d",
      "side": "buy",
      "status": "filled",
      "stop_price": "3.14",
      "submitted_at": "2021-03-16T18:38:01.942282Z",
      "symbol": "AALP",
      "time_in_force": "gtc",
      "trail_percent": "5.0",
      "trail_price": "3.14",
      "type": "market",
      "updated_at": "2021-03-16T18:38:01.942282Z"
    }
  ]
}