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

# Delete Record

> Delete a single record from your campaign

<Note>
  **Endpoint Alias**: This endpoint is an alias for `/api/v1/leads`. Both endpoints are functionally identical - use whichever naming convention fits your integration.
</Note>

## Record Lookup

Records are identified by `externalId` or `phoneNumber`, not internal IDs.

<Info>
  **At least one of `phoneNumber` or `externalId` is required.** If both are provided, `externalId` takes priority for the lookup.
</Info>

## Authentication

<ParamField header="x-api-key" type="string" required>
  Your API key with `write` scope
</ParamField>

## Query Parameters

<ParamField query="campaignId" type="string" required>
  The ID of the campaign the record belongs to
</ParamField>

<ParamField query="phoneNumber" type="string">
  Phone number in E.164 format.

  **Required if `externalId` is not provided.**
</ParamField>

<ParamField query="externalId" type="string">
  Your CRM's internal ID for this record.

  **Required if `phoneNumber` is not provided.**
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="deleted" type="boolean">
      Always `true` if the request succeeded
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string | null">
  Error message if request failed
</ResponseField>

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://YOUR_DEPLOYMENT.lupitor.com/api/v1/records?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/records?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345',
    {
      method: 'DELETE',
      headers: {
        'x-api-key': 'YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  ```

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

  response = requests.delete(
      'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/records',
      params={
          'campaignId': 'YOUR_CAMPAIGN_ID',
          'externalId': 'CRM_12345'
      },
      headers={'x-api-key': 'YOUR_API_KEY'}
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "deleted": true
    },
    "error": null
  }
  ```

  ```json Error Response - Not Found theme={null}
  {
    "success": false,
    "data": null,
    "error": "Lead not found"
  }
  ```
</ResponseExample>

## Notes

<Warning>
  **Permanent Deletion**: This action cannot be undone. The record will be permanently deleted.
</Warning>

<Tip>
  **Need the record data?** Fetch the record first, then delete it.
</Tip>

<Info>
  For full documentation, see [Delete Lead](/api-reference/leads/delete).
</Info>
