Project Phil Documentation
Sign in

Delete Link

Added in v1.0

DELhttps://api.example.com/api/link/{id}

Requires authentication: x-api-key: YOUR_API_KEY

Permanently deletes an existing shortened link using its database ID. Returns the link object as it existed immediately before deletion.

Headers

  • x-api-keystringrequired
    Your API authentication key.

Path parameters

  • idintegerrequired
    The database ID of the shortened link to delete.

Responses

  • 200OK
  • 404Not Found

Request

curl -X DELETE 'https://api.example.com/api/link/1' \
  -H 'x-api-key: YOUR_API_KEY'
const res = await fetch('https://api.example.com/api/link/1', {
  method: 'DELETE',
  headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const link = await res.json();
import requests

res = requests.delete('https://api.example.com/api/link/1', headers={'x-api-key': 'YOUR_API_KEY'})
link = res.json()
$ch = curl_init('https://api.example.com/api/link/1');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$link = json_decode(curl_exec($ch), true);

200 OK

{
  "id": 1,
  "name": "google",
  "url": "https://google.com",
  "count": 0,
  "creator": "API",
  "creatorID": "0",
  "createdAt": 1795400000000
}

404 Not Found

{
  "msg": "That link no longer exists."
}
Written by !RAB Last updated 1 Dec 2026

Discussion 0

No comments yet. Sign in with Discord to start the conversation.