# Cancel a deployment

Source: https://www.jawsdeploy.net/rest-api/deployments-cancel | Section: Deployments

Cancel a queued or running deployment.

`POST /api/deployment/cancel`

Cancels a deployment that is either queued or actively running. Once cancellation is accepted the deployment transitions to a cancelling/cancelled state asynchronously.

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `deploymentId` | body | string | yes | ID of the deployment to cancel. |

## Errors

| Status | Meaning |
|---|---|
| 400 | Invalid `deploymentId`, or the deployment is not in a `Running` or `Queued` state. |
| 401 | Missing or invalid Basic auth credentials, or the service account lacks the required role. |

Example request:

```
POST /api/deployment/cancel HTTP/1.1
Authorization: Basic <base64(...)>
Content-Type: application/json

{ "deploymentId": "dep_a1b2c3" }
```

Example response:

```
{}
```

