Updating a link

Branded short links can be updated via a POST method to https://api.rebrandly.com/v1/links/{id}, where {id} is the unique identifier (id) of the branded short link, which accepts a JSON object describing the 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

Path parameterDescription
idUnique identifier of the branded short link you want to update

Link Parameters

The table below shows the parameters you should specify when updating a link.
If you do not want to modify some parameters, you can simply leave them unchanged, i.e. pass their values as you originally received them.

Link propertyTypeConstraintsDescription
Valid URL
Max 2048 chars
New destination URL you want to assign to a branded short link
Min 2 chars
Max 300 chars
New title you want to assign to a branded short link
favouritebooleanrequiredWhether a link should be marked as favourite (loved) or not
descriptionstringoptionalAvailable only if your plan includes link notes

A description/note you associate to the branded short link


Check for compatibility first

Double check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a description field along with your Link object.
For every account, you can check for features and limits with a preliminary API call.

Updating an existing link (changing "What is Rebrandly" into "What is Rebrandly?")
$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af' \
-H 'apikey: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d \
  "id": "fffa4cc5b6ee45d6g7897b06ac2d16af",
  "title": "What is Rebrandly?",
  "destination": "https://www.youtube.com/watch?v=3VmtibKpmXI",
  "shortUrl": "rebrand.ly/video"

HTTP/1.1 200 OK
JSON response (updated link)
  "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-15T10:05:22.000Z",
  "shortUrl": "rebrand.ly/video",
  "domain": {
    "id": "8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "ref": "/domains/8f104cc5b6ee4a4ba7897b06ac2ddcfb",
    "fullName": "rebrand.ly"

Handling errors

HTTP StatusError typeDescription
403403 - Already existsGiven pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag
403403 - Invalid formatInvalid Link object. Double check value for property field. Details about validation failure in message field
404404 - Not found
with property value "id"
Given id does not correspond to any existing link
404404 - Not found
with property value "domain.id"
Given domain.id does not correspond to any existing domain