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 parameter | Description |
|---|---|
| id | Unique 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 property | Type | Constraints | Description |
|---|---|---|---|
destination | string | required | New destination URL you want to assign to a branded short link |
title | string | required | New title you want to assign to a branded short link |
favourite | boolean | required | Whether a link should be marked as favourite (loved) or not |
description | string | optional | Available only if your plan includes link notes A description/note you associate to the branded short link |
Check for compatibility firstDouble check whether your API key or OAuth token is enabled to use the Link Notes feature before sending a
descriptionfield 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' \
-X POST \
-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 OKNote: If you're updating a link from a non-default workspace, include the workspace HTTP header in your request:
workspace: YOUR_WORKSPACE_ID
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 Status | Error type | Description |
|---|---|---|
403 | Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag | |
403 | Invalid Link object. Double check value for | |
404 | 404 - Not found | Given |
404 | 404 - Not found | Given |
Updated 10 days ago
