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

# Delete Dynamic Link

> Permanently remove dynamic links from your project

## Overview

Permanently delete a dynamic link from your project. This action is irreversible and will remove all associated data, including analytics and click history. Consider using the [Update Link Status](/guides/update-link-status) endpoint to archive links instead if you want to preserve data.

## Endpoint

<CodeGroup>
  ```bash Public API theme={null}
  DELETE https://api.bit2connect.com/1.0/links/{code}
  ```

  ```bash Headers Required theme={null}
  X-API-KEY: b2co_your_api_key_here
  ```
</CodeGroup>

## Path Parameters

For detailed information about path parameters, see the [Delete Link API Reference](/api-reference/links/delete).

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.bit2connect.com/1.0/links/old-campaign" \
    -H "X-API-KEY: b2co_your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const code = "old-campaign";
  const response = await fetch(
    `https://api.bit2connect.com/1.0/links/${code}`,
    {
      method: "DELETE",
      headers: {
        "X-API-KEY": "b2co_your_api_key_here",
      },
    }
  );

  const data = await response.json();
  console.log("Link deleted:", data.success);
  ```

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

  code = "old-campaign"
  url = f"https://api.bit2connect.com/1.0/links/{code}"
  headers = {
      "X-API-KEY": "b2co_your_api_key_here"
  }

  response = requests.delete(url, headers=headers)
  data = response.json()

  if data['success']:
      print(f"Link '{code}' has been permanently deleted")
  else:
      print(f"Error: {data['error']['message']}")
  ```
</CodeGroup>

## Response

### Success Response

```json theme={null}
{
  "success": true,
  "message": "Link deleted successfully",
  "timestamp": "2024-01-15T11:45:00Z"
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "LINK_NOT_FOUND",
    "message": "Link with the specified code was not found"
  }
}
```

For detailed response fields, error codes, and deletion considerations, see the [Delete Link API Reference](/api-reference/links/delete).

## Next Steps

<CardGroup cols={2}>
  <Card title="Create Link" icon="plus" href="/guides/create-link">
    Create new dynamic links for your campaigns
  </Card>

  <Card title="List Links" icon="list" href="/guides/list-links">
    View your remaining active links
  </Card>

  <Card title="Update Link Status" icon="toggle-on" href="/guides/update-link-status">
    Archive links instead of deleting them
  </Card>

  <Card title="Check Code Availability" icon="search" href="/guides/check-code-availability">
    Verify if deleted codes are available for reuse
  </Card>
</CardGroup>
