Delete Link
Added in v1.0
DEL
https://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-keystringrequiredYour API authentication key.
Path parameters
idintegerrequiredThe 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."
}
Discussion 0
Reading is open to everyone. Posting, replying, reacting and reporting require a Discord account — we only receive your public username and avatar.
No comments yet. Sign in with Discord to start the conversation.
Sign in required
Reading is open to everyone. Posting, replying, reacting and reporting require a Discord account — we only receive your public username and avatar.