# Delete Publication

> Permanently delete App Store publications using Applivery's Integrations or Workspace APIs. Covers authentication and endpoints.

Source: https://docs.applivery.com/en/app-distribution/api/publications/delete-publication/  •  Last updated: 2026-04-01

**Key topics:** API, App Store Publication, Deletion, Authentication, Applivery, App Store, Integrations API, Workspace API, App API Token, Service Account token

---

**TL;DR:** Learn how to permanently delete App Store publications using Applivery's Integrations or Workspace API, understanding the authentication methods and implications.

Permanently delete a Publication from the App Store. This removes the Publication configuration and its URL — users who visit the Publication URL after deletion will no longer be able to access or download the App.

:::warning
This operation is **permanent and irreversible**. The Publication's URL (`distributionUrl`) will stop working immediately. If you want to temporarily block access without deleting the Publication, consider setting `visibility` to `"inactive"` via [PUT – Update Published Application](https://docs.applivery.com/en/app-distribution/api/publications/update-publication/) instead.
:::

:::info
Deleting a Publication does **not** delete the Builds associated with it. The underlying Builds remain in Applivery and can still be referenced by other Publications.
:::

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

---

## Choosing the right API

| | Integrations API | Workspace API |
|---|---|---|
| **Designed for** | Per-app integrations and CI/CD 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`, `storeId`, and `publishedApplicationId` required in the path |
| **Typical users** | Scripts that clean up expired or superseded Publications | Platform engineers managing Publication lifecycle across multiple Apps |

---

## Integrations API

Use this endpoint when deleting Publications 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/distributions/{publishedApplicationId}
```

### Authentication

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

### Path Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `publishedApplicationId` | String | Yes | The unique identifier of the Publication to delete. E.g. `552ae3cfcb5abfc58d733b81`. Returned by [POST – Create a Published Application](https://docs.applivery.com/en/app-distribution/api/publications/create-publication/) and [GET – List of Published Applications](https://docs.applivery.com/en/app-distribution/api/publications/list-publications/). |

### Example Request

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

### Responses

**✓ 200 OK**

```json
{
  "status": true,
  "data": {
    "delete": "OK"
  }
}
```

**✗ 400 Bad Request**

Each App must have at least one Publication. If you attempt to delete the only remaining Publication for an App, the request will be rejected with this error. Create a replacement Publication before deleting the last one, or set its `visibility` to `"inactive"` instead.

```json
{
  "status": false,
  "error": {
    "code": 5044,
    "message": "Can Not Delete Last PubApplication"
  }
}
```

**✗ 401 Unauthorized**

```json
{
  "status": false,
  "error": {
    "code": 4002,
    "message": "No auth token"
  }
}
```

**✗ 404 Not Found**

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

---

## Workspace API

Use this endpoint when deleting Publications at the Workspace level — for example, in automation pipelines that manage Publication lifecycle across multiple Apps using a single credential.

Authentication uses a **Service Account** token, which is Workspace-scoped and not tied to any individual app.

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}/stores/{storeId}/pubApps/{publishedApplicationId}
```

### Path parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `organizationId` | String | Yes | The unique identifier of your Applivery organization. |
| `storeId` | String | Yes | The unique identifier of the store (app project) the Publication belongs to. |
| `publishedApplicationId` | String | Yes | The unique identifier of the Publication to delete. |

### Authentication

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

### Example Request

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

A successful deletion returns `{ "status": true, "data": { "delete": "OK" } }`. The same `5044` constraint applies — the last publication of an App cannot be deleted via the Workspace API either.
