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.

PATH Parameters

Parameter name

Description

id

Unique 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 Status

Error type

Description

404

404 - Not found

Given id does not correspond to any existing link


Did this page help you?