---
title: Cancel Build
protocol: rest
method: DELETE
endpoint: /v1/projects/{projectId}/builds/{buildId}
description: "Cancel a queued or in-progress build"
---

# Cancel Build

Cancel a build that is queued or currently in progress.

<Endpoint method="DELETE" path="/v1/projects/{projectId}/builds/{buildId}" />

## Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID (e.g., `prj_abc123`).
</ParamField>

<ParamField path="buildId" type="string" required>
  The build ID (e.g., `bld_xyz789`).
</ParamField>

## Response

Returns `204 No Content` on success.

## Example

<CodeGroup>
```bash cURL
curl -X DELETE https://api.syntext.dev/v1/projects/prj_abc123/builds/bld_xyz789 \
  -H "Authorization: Bearer stx_abc12345_..."
```

```typescript SDK
import { Syntext } from '@syntext/sdk'

const client = new Syntext('stx_abc12345_...')
await client.builds.cancel('prj_abc123', 'bld_xyz789')
```

```python Python
from syntext import Syntext

client = Syntext("stx_abc12345_...")
client.builds.cancel("prj_abc123", "bld_xyz789")
```
</CodeGroup>

### Response

```
HTTP/1.1 204 No Content
```

<Note>
Only builds with `status: "queued"` or `status: "building"` can be cancelled. Builds that have already completed or failed cannot be cancelled.
</Note>

## Error Responses

### 404 Not Found

Returned when the project or build does not exist.

```json
{
  "error": {
    "code": "not_found",
    "message": "Build or project does not exist"
  }
}
```

### 409 Conflict

Returned when the build cannot be cancelled because it has already completed or failed.

```json
{
  "error": {
    "code": "conflict",
    "message": "Build has already completed or failed"
  }
}
```
