---
title: "Cancel a Factory Environment Build"
method: POST
path: "/api/v0/environments/{environmentId}/builds/{buildId}/cancel"
tags: ["Environments"]
---

# Cancel a Factory Environment Build

`POST /api/v0/environments/{environmentId}/builds/{buildId}/cancel`

## Request

- Base URL: `https://api.factory.ai`
- URL: `https://api.factory.ai/api/v0/environments/{environmentId}/builds/{buildId}/cancel`
- Auth: HTTP bearer

## Path parameters

- `environmentId` string, required: Factory Environment ID. Must not contain "/" and must not be "." or "..".
- `buildId` string, required

## Headers

- `X-Factory-Org-Id` string

## Response `204`

Response for status 204

## Other responses

- `400`: Response for status 400
- `401`: Response for status 401
- `402`: Response for status 402
- `403`: Response for status 403
- `404`: Response for status 404
- `409`: Response for status 409
- `451`: Response for status 451
- `500`: Response for status 500
- `503`: Response for status 503

## Changes

- **2026-11-12** `b6a46c415079`: 5 breaking, 1 warning, 28 info
  - the response's body type changed from `object` to no type for status `400`
  - removed the media type `application/json` for the response with the status `204`
  - removed the required property `detail` from the response with the `400` status
  - removed the required property `status` from the response with the `400` status
  - …30 more
- **2026-10-13** `dd43fbb08a00`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/factory/apis/factory-public-api/changes/api/v0/environments/:environmentId/builds/:buildId/cancel/post.md)

---

[API](https://skmtc.dev/factory/apis/factory-public-api.md) - [All operations](https://skmtc.dev/factory/apis/factory-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/factory/apis/factory-public-api/revisions/2e37e1b079d2?raw)
