Deleting a link

A branded short link can be deleted from your collection and it will suddenly stop redirecting.

In order to delete it, you are supposed to send a DELETE request to its API URL: https://api.rebrandly.com/v1/links/{id}, where {id} is the unique identifier of the branded short link.
If you don't know the link's id in advance, you can fetch it first with another API call, see Getting link details.

If you need to delete multiple links (up to 25) with a single API call, kindly refer to our other endpoint DELETE /v1/links in the API explorer section.

Also review the following Python scripts to delete your links in bulk:

PATH Parameters

Parameter nameDescription
idUnique identifier of the branded short link you want to delete

Permanently deleting a single link

$ curl 'https://api.rebrandly.com/v1/links/fffa4cc5b6ee45d6g7897b06ac2d16af' \
-X DELETE \
-H 'apikey: YOUR_API_KEY'
When a link has just been deleted, its last object representation is returned (prior to deletion).
{
  "id": "fffa4cc5b6ee45d6g7897b06ac2d16af",
  "title": "What is Rebrandly",
  "slashtag": "video",
  "destination": "https://www.youtube.com/watch?v=3VmtibKpmXI",
  "createdAt": "2016-07-13T10:54:12.000Z",
  "updatedAt": "2016-07-13T10:54:12.000Z",
  "shortUrl": "rebrand.ly/video",
  "domain": {
    "id": "8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "ref": "/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb"
  },
  "favourite": false
}

Handling errors

HTTP StatusError typeDescription
404404 - Not foundGiven id does not correspond to any existing link