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

# Delete a Search

> Deletes a specific search by its ID. This operation will permanently remove the search and all associated tasks from the system. Only the owner of the search can delete it.

## Description

Deletes a specific search by its ID. This operation will permanently remove the search and all associated tasks from the system. Only the owner of the search can delete it.

## Parameters

### Path Parameters

* **`id`** (required, string, UUID): The unique identifier of the search to delete

## Responses

### 200 OK

The search was successfully deleted.

```json theme={null}
{
  "message": "Search deleted successfully"
}
```

### 401 Unauthorized

You are not authorized to delete this search. This may be because you do not own the search, or the search owner is not part of your workspace.

```json theme={null}
{
  "error": "Unauthorized"
}
```

### 404 Not Found

The search with the specified ID does not exist.

```json theme={null}
{
  "error": "Search not found"
}
```

### 422 Unprocessable Entity

The search deletion failed for an unknown reason.

```json theme={null}
{
  "error": "Failed to delete search"
}
```

## Notes

* When a search is deleted, all related tasks are also deleted automatically
* This operation cannot be undone
* Only searches owned by the authenticated user or within the user's workspace can be deleted


## OpenAPI

````yaml DELETE /searches/{id}
openapi: 3.0.1
info:
  title: Pipecorn List API
  description: Pipecorn List API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /searches/{id}:
    delete:
      summary: Delete a search
      description: >-
        Deletes a specific search by its ID. This operation will permanently
        remove the search and all associated tasks from the system. Only the
        owner of the search can delete it.
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the search to delete
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Search deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Search deleted successfully
        '401':
          description: Unauthorized - The authenticated user does not own the search
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
        '404':
          description: Search not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Search not found
        '422':
          description: Failed to delete search
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Failed to delete search
components:
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````