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

# Delete trained pages

```http theme={null}
DELETE https://services.leadconnectorhq.com/knowledge-bases/crawler
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Body

<ParamField body="knowledgeBaseId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  knowledge base ID as string
</ParamField>

<ParamField body="locationId" type="string" required default="tDtDnQdgm2LXpyiqYvZ6">
  account ID as string
</ParamField>

<ParamField body="urlIds" type="string[]" required default="[tDtDnQdgm2LXpyiqYvZ6]">
  List of trained urls ids ( fetched from the Get all trained page links by knowledge base endpoint)
</ParamField>

## Respuestas

<Accordion title="200 - Selected pages deleted successfully">
  <ResponseField name="success" type="boolean" required default="True">
    Indicates if the operation was successful
  </ResponseField>

  ```json theme={null}
  {
    "success": true
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  <ResponseField name="statusCode" type="number" default="400" />

  <ResponseField name="message" type="string" default="Bad Request" />

  ```json theme={null}
  {
    "statusCode": 400,
    "message": "Bad Request"
  }
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  <ResponseField name="statusCode" type="number" default="401" />

  <ResponseField name="message" type="string" default="Invalid token: access token is invalid" />

  <ResponseField name="error" type="string" default="Unauthorized" />

  ```json theme={null}
  {
    "statusCode": 401,
    "message": "Invalid token: access token is invalid",
    "error": "Unauthorized"
  }
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  <ResponseField name="statusCode" type="number" default="422" />

  <ResponseField name="message" type="string[]" />

  <ResponseField name="error" type="string" default="Unprocessable Entity" />

  ```json theme={null}
  {
    "statusCode": 422,
    "message": [
      "Unprocessable Entity"
    ],
    "error": "Unprocessable Entity"
  }
  ```
</Accordion>

<Accordion title="500 - Internal Server Error">
  <ResponseField name="statusCode" type="number" default="500" />

  <ResponseField name="message" type="string" default="Internal Server Error" />

  ```json theme={null}
  {
    "statusCode": 500,
    "message": "Internal Server Error"
  }
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE 'https://services.leadconnectorhq.com/knowledge-bases/crawler' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6",
    "locationId": "tDtDnQdgm2LXpyiqYvZ6",
    "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/knowledge-bases/crawler', {
    method: 'DELETE',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6", "locationId": "tDtDnQdgm2LXpyiqYvZ6", "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'DELETE',
      'https://services.leadconnectorhq.com/knowledge-bases/crawler',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"knowledgeBaseId": "tDtDnQdgm2LXpyiqYvZ6", "locationId": "tDtDnQdgm2LXpyiqYvZ6", "urlIds": "[tDtDnQdgm2LXpyiqYvZ6]"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/knowledge-bases/crawler');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'knowledgeBaseId': 'tDtDnQdgm2LXpyiqYvZ6', 'locationId': 'tDtDnQdgm2LXpyiqYvZ6', 'urlIds': '[tDtDnQdgm2LXpyiqYvZ6]'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
