> ## 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 Record

> Delete Record By Id . Supported Objects are business and custom objects.

Delete Record By Id . Supported Objects are business and custom objects.

```http theme={null}
DELETE https://services.leadconnectorhq.com/objects/{schemaKey}/records/{id}
```

## 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>

## Path parameters

<ParamField path="schemaKey" type="string" required default="custom_objects.pet or business.email (for company's email)">
  The key of the Custom Object / Standard Object Schema. For custom objects, the key must include the “custom\_objects.” prefix, while standard objects use their respective object keys. This information is available on the Custom Objects Details page under Settings.
</ParamField>

<ParamField path="id" type="string" required default="632c34b4c9b7da3358ac9891">
  id of the record to be updated. Available on the Record details page under the 3 dots or in the url
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="id" type="string" default="661c06b4ffde146bdb469442">
    id of the deleted object
  </ResponseField>

  <ResponseField name="success" type="boolean" default="True">
    boolean that defines if the operation was a success or not
  </ResponseField>

  ```json theme={null}
  {
    "id": "661c06b4ffde146bdb469442",
    "success": true
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE 'https://services.leadconnectorhq.com/objects/YOUR_schemaKey/records/YOUR_id' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/objects/YOUR_schemaKey/records/YOUR_id', {
    method: 'DELETE',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
    },
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'DELETE',
      'https://services.leadconnectorhq.com/objects/YOUR_schemaKey/records/YOUR_id',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
      },
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/objects/YOUR_schemaKey/records/YOUR_id');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
      ],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
