> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectdiscovery.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete labels of an asset

<Warning>
  This endpoint removes **ALL labels** from an asset. If you want to remove specific labels while keeping others, use `PATCH /v1/asset/{asset_id}/labels` with `update_type=delete` instead.
</Warning>

## Overview

Remove all labels from a specific asset. This endpoint provides a quick way to completely clear an asset's labels, useful when:

* Resetting asset categorization
* Cleaning up before re-labeling
* Removing assets from all label-based groups
* Decommissioning or archiving assets

## Quick Example

```bash theme={null}
curl -X DELETE "https://api.projectdiscovery.io/v1/asset/123456/labels" \
  -H "X-Api-Key: YOUR_API_KEY"
```

## Response

### Success Response

```json theme={null}
{
  "message": "All labels removed successfully"
}
```

### Error Responses

**Asset Not Found:**

```json theme={null}
{
  "message": "Asset not found",
  "code": "NOT_FOUND"
}
```

**Invalid Asset ID:**

```json theme={null}
{
  "message": "Invalid asset ID format",
  "code": "INVALID_ID"
}
```

## Behavior

### Complete Label Removal

This endpoint removes **all** labels from the asset:

**Before:**

```json theme={null}
{
  "id": 123456,
  "name": "https://example.com",
  "labels": ["production", "api", "critical", "monitored"]
}
```

**Request:**

```bash theme={null}
curl -X DELETE "https://api.projectdiscovery.io/v1/asset/123456/labels" \
  -H "X-Api-Key: YOUR_API_KEY"
```

**After:**

```json theme={null}
{
  "id": 123456,
  "name": "https://example.com",
  "labels": []
}
```


## OpenAPI

````yaml delete /v1/asset/{asset_id}/labels
openapi: 3.1.0
info:
  title: PDCP API
  version: '1.0'
  summary: ProjectDiscovery Cloud Platform
  description: >-
    For more details, checkout
    https://docs.projectdiscovery.io/api-reference/editor/scan
servers:
  - url: https://api.projectdiscovery.io
    description: Production
  - url: https://api.dev.projectdiscovery.io
    description: Development
  - url: http://localhost:8085
    description: Localhost
security:
  - X-API-Key: []
paths:
  /v1/asset/{asset_id}/labels:
    parameters:
      - schema:
          type: integer
          format: int64
        name: asset_id
        in: path
        required: true
    delete:
      tags:
        - assets
      summary: Delete labels of an asset
      operationId: delete-v1-asset-id-labels
      parameters:
        - schema:
            type: string
          in: header
          description: >-
            Retrieve the Team ID from:
            https://cloud.projectdiscovery.io/settings/team
          name: X-Team-Id
      responses:
        '200':
          $ref: '#/components/responses/MessageResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '500':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  responses:
    MessageResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            required:
              - message
    ErrorResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
              kind:
                type: string
              code:
                type: string
              error:
                type: string
              error_id:
                type: string
              param:
                type: string
              status:
                type: integer
  securitySchemes:
    X-API-Key:
      name: X-API-Key
      type: apiKey
      in: header

````