# Delete Build

> Permanently delete Builds from Applivery using the Integrations API or Workspace API. Covers authentication and parameters.

Source: https://docs.applivery.com/en/app-distribution/api/builds/delete-build/  •  Last updated: 2026-03-31

**Key topics:** Deleting builds, Integrations API, Workspace API, API authentication, Error handling, Applivery, App API Token, Service Account, API

---

**TL;DR:** Learn how to permanently delete builds from Applivery using either the Integrations API (App API Token) or the Workspace API (Service Account token).

Permanently deletes a Build from Applivery. This action removes the Build record and its associated file from storage.

:::warning
This operation is **permanent and irreversible**. Once a Build is deleted, it cannot be recovered. Any Publication pointing exclusively to this Build will no longer be able to serve the App for download. Verify that the Build is not actively used in any Publication before deleting it.
:::

Applivery provides two separate APIs for deleting Builds, each requiring a different authentication credential.

---

## Choosing the Right API

| | Integrations API | Workspace API |
|---|---|---|
| **Designed for** | Per-app integrations and CI/CD cleanup pipelines | Workspace-level automation across multiple Apps |
| **Authentication** | App API Token (per-app) | Service Account token (Workspace-level) |
| **App context** | Implicit — token is already scoped to an App | Explicit — `organizationId` and `applicationId` required in the path |
| **Typical users** | CI scripts pruning old or failed Builds automatically | Platform engineers managing build retention across multiple Apps |

:::warning
Access to the different APIs might not be available in your current plan. Please check availability on our [pricing page](https://www.applivery.com/app-distribution-pricing/).
:::

---

## Integrations API

Use this endpoint when deleting Builds within the scope of a single app. Authentication uses an **App API Token**, scoped to the specific App.

To create an App API Token, see [Apps API Authentication](https://docs.applivery.com/en/app-distribution/api/app-api-token/).

### Endpoint

```
DELETE https://api.applivery.io/v1/integrations/builds/{buildId}
```

### Authentication

```
Authorization: Bearer <your_app_token>
```

### Path Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `buildId` | String | Yes | The unique identifier of the Build to delete. E.g. `552ae3cfcb5abfc58d733b81`. The `buildId` is returned in the response of [POST – Upload a Build](https://docs.applivery.com/en/app-distribution/api/builds/upload-build/) and [GET – List of Builds](https://docs.applivery.com/en/app-distribution/api/builds/list-builds/). |

### Example Request

```bash
curl 'https://api.applivery.io/v1/integrations/builds/552ae3cfcb5abfc58d733b81' \
  -X DELETE \
  -H 'Authorization: Bearer YOUR_APP_TOKEN'
```

### Responses

**✓ 200 OK**

```json
{
  "status": true,
  "data": {
    "deleted": true
  }
}
```

**✗ 400 Bad Request**

Build not yet processed. Builds that are still in a `pending` or `in_progress` state cannot be deleted. Wait for processing to complete before attempting to delete.

```json
{
  "status": false,
  "error": {
    "code": 5014,
    "message": "Build Not Processed"
  }
}
```

**✗ 401 Unauthorized**

```json
{
  "status": false,
  "error": {
    "code": 3002,
    "message": "Token Expired"
  }
}
```

**✗ 404 Not Found**

```json
{
  "status": false,
  "error": {
    "code": 3001,
    "message": "Entity not found"
  }
}
```

---

## Workspace API

Use this endpoint when deleting Builds at the Workspace level — for example, in automated build retention pipelines that operate across multiple Apps using a single credential.

Authentication uses a **Service Account** token, which is Workspace-scoped and not tied to any individual app. The App and build context are both provided via path parameters.

To create a Service Account, see [Service Accounts](https://docs.applivery.com/en/platform/api/service-accounts/).

### Endpoint

```
DELETE https://api.applivery.io/v1/organizations/{organizationId}/apps/{applicationId}/builds/{buildId}
```

### Path Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `organizationId` | String | Yes | The unique identifier of your Applivery organization. |
| `applicationId` | String | Yes | The unique identifier of the App the Build belongs to. |
| `buildId` | String | Yes | The unique identifier of the Build to delete. |

### Authentication

```
Authorization: Bearer <your_service_account_token>
```

### Example Request

```bash
curl 'https://api.applivery.io/v1/organizations/ORG_ID/apps/APP_ID/builds/552ae3cfcb5abfc58d733b81' \
  -X DELETE \
  -H 'Authorization: Bearer YOUR_SERVICE_ACCOUNT_TOKEN'
```

The response schema is identical to the Integrations API. A successful deletion returns `{ "status": true, "data": { "deleted": true } }`.
