---
title: "Cancel deployment"
method: POST
path: "/v1/projects/{project_id}/deployments/{deployment_id}/cancel"
tags: ["deployments"]
---

# Cancel deployment

`POST /v1/projects/{project_id}/deployments/{deployment_id}/cancel`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/deployments/{deployment_id}/cancel`
- Auth: HTTP bearer

Requests cancellation of a deployment that is currently building.

For a deployment that is not building, nothing changes and the response has `ok: false`.

Required permission: `deployments.cancel`.

## Path parameters

- `project_id` string, uuid, required
- `deployment_id` string, uuid, required

## Response `200`

Successful Response

- PublicDeploymentCancelResponse
  - `ok` boolean, required: Whether the operation succeeded.
  - `message` 'Cancellation requested' | 'Deployment is not building' | 'Deployment is no longer building', required: `Cancellation requested` when the build is being stopped. `Deployment is not building` or `Deployment is no longer building` when there was no build to cancel; `ok` is false.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `404`: The resource does not exist in this project.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/connic/apis/connic-api.md) · [All operations](https://skmtc.dev/connic/apis/connic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/connic/apis/connic-api/revisions/482932da5fbe?raw)
