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

# Delete Contact

> Delete a contact from your address book

Permanently delete a contact from your address book.

<Warning>
  This action is irreversible. Contact notes and tags will be deleted. Call and message history will remain but will no longer be linked to this contact.
</Warning>

## Request Body

<ParamField body="contact_id" type="string" required>
  The unique identifier of the contact to delete.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the contact was deleted successfully.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.magpipe.ai/functions/v1/delete-contact \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"contact_id": "c1d2e3f4-5678-9abc-def0-123456789abc"}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.magpipe.ai/functions/v1/delete-contact',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        contact_id: 'c1d2e3f4-5678-9abc-def0-123456789abc'
      }),
    }
  );

  const result = await response.json();
  console.log('Deleted:', result.success);
  ```

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

  response = requests.post(
      'https://api.magpipe.ai/functions/v1/delete-contact',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json',
      },
      json={'contact_id': 'c1d2e3f4-5678-9abc-def0-123456789abc'}
  )

  result = response.json()
  print(f"Deleted: {result['success']}")
  ```
</RequestExample>

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

  ```json Error Response theme={null}
  {
    "error": {
      "code": "contact_not_found",
      "message": "Contact not found"
    }
  }
  ```
</ResponseExample>
