---
title: "Cancel Run by ID"
method: DELETE
path: "/v1/rebalancing/runs/{run_id}"
tags: ["Rebalancing"]
---

# Cancel Run by ID

`DELETE /v1/rebalancing/runs/{run_id}`

## Request

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

Cancels a run so it does not start, or is not retried. Only a run in QUEUED or IN_PROGRESS can be canceled. A run in any other status is rejected. Canceling does not stop a run that is already placing orders: those orders are not canceled, and the run's final status can replace CANCELED.

## Response `204`

No Content

## Other responses

- `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 call this endpoint, or rebalancing is not enabled for the correspondent. Use credentials with the required permission and try again.
- `404`: No rebalance run with this ID exists for your correspondent. Check the run ID and try 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. Retry with backoff. 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)
