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

# Delete Extractor

> Delete an extractor from your account.

Delete an extractor from your account. This is a soft delete — the extractor is deactivated but historical extraction results remain accessible.

<Note>
  Some extractors installed from the catalog cannot be deleted.
</Note>

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token authentication. Example: `Bearer YOUR_API_KEY`
</ParamField>

### Path Parameters

<ParamField path="extractor_id" type="string" required>
  The unique identifier (UUID) of the extractor to delete
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE https://api.doctly.ai/api/v1/e/987fcdeb-a654-3210-9876-543210987654 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  extractor_id = "987fcdeb-a654-3210-9876-543210987654"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  response = requests.delete(
      f"https://api.doctly.ai/api/v1/e/{extractor_id}",
      headers=headers
  )

  if response.status_code == 200:
      print(response.json()["message"])
  else:
      print(f"Error: {response.json()}")
  ```

  ```javascript JavaScript theme={null}
  const extractorId = '987fcdeb-a654-3210-9876-543210987654';

  const response = await fetch(
    `https://api.doctly.ai/api/v1/e/${extractorId}`,
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  if (response.ok) {
    const data = await response.json();
    console.log(data.message);
  } else {
    const error = await response.json();
    console.error('Error:', error);
  }
  ```
</CodeGroup>

## Response

<ResponseField name="message" type="string">
  Success confirmation message including the extractor name
</ResponseField>

## Example Responses

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "Extractor 'Invoice Extractor' has been deleted successfully."
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "detail": "This extractor cannot be deleted."
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "detail": "Extractor not found or you do not have access to it."
  }
  ```

  ```json 422 Unprocessable Entity theme={null}
  {
    "detail": [
      {
        "loc": ["path", "extractor_id"],
        "msg": "value is not a valid uuid",
        "type": "type_error.uuid"
      }
    ]
  }
  ```
</ResponseExample>

## What Happens When You Delete

* The extractor is deactivated and no longer appears in your extractor list
* You can no longer run the extractor on new documents
* Historical documents processed by this extractor remain accessible
* The extractor's slug becomes available for reuse

<Warning>
  **This action cannot be undone.** If you need to restore an extractor, you'll need to recreate it or reinstall it from the catalog.
</Warning>

## Check Before Deleting

Before deleting, you may want to verify there are no active integrations using this extractor:

<CodeGroup>
  ```python Python theme={null}
  import requests

  extractor_id = "987fcdeb-a654-3210-9876-543210987654"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  # Check for recent documents using this extractor
  response = requests.get(
      "https://api.doctly.ai/api/v1/documents",
      headers=headers,
      params={"extractor_id": extractor_id, "limit": 10}
  )

  data = response.json()
  if data["count"] > 0:
      print(f"Warning: {data['count']} documents were processed with this extractor")
      for doc in data["data"][:5]:
          print(f"  - {doc['file_name']} ({doc['created_at']})")
  else:
      print("No documents found. Safe to delete.")
  ```

  ```javascript JavaScript theme={null}
  const extractorId = '987fcdeb-a654-3210-9876-543210987654';
  const headers = { 'Authorization': 'Bearer YOUR_API_KEY' };

  // Check for recent documents using this extractor
  const response = await fetch(
    `https://api.doctly.ai/api/v1/documents?extractor_id=${extractorId}&limit=10`,
    { headers }
  );

  const data = await response.json();
  if (data.count > 0) {
    console.log(`Warning: ${data.count} documents were processed with this extractor`);
  } else {
    console.log('No documents found. Safe to delete.');
  }
  ```
</CodeGroup>


## OpenAPI

````yaml DELETE /e/{extractor_id}
openapi: 3.1.0
info:
  title: Doctly API
  description: >-
    The Doctly API enables you to programmatically convert PDF documents to
    Markdown and extract structured data using custom extractors.
  version: 1.0.0
  contact:
    email: support@doctly.ai
servers:
  - url: https://api.doctly.ai/api/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /e/{extractor_id}:
    delete:
      tags:
        - Extractors
      summary: Delete Extractor
      description: Delete an extractor (soft delete)
      operationId: deleteExtractor
      parameters:
        - name: extractor_id
          in: path
          required: true
          description: Extractor ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Extractor deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '404':
          description: Extractor not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    Error:
      type: object
      properties:
        detail:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
                properties:
                  loc:
                    type: array
                    items:
                      type: string
                  msg:
                    type: string
                  type:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer token

````