Updating a tag

Tags can be updated via a POST method to https://api.rebrandly.com/v1/tags/{id}, where {id} is the unique identifier (id) of the tag, which accepts a JSON object describing the Tag.

🚧

Check compatibility first

Double check whether your API key or OAuth token is enabled to use the Tags feature.
For every account, you can check for features and limits with a preliminary API call.

PATH Parameters

Path parameterDescription
idUnique identifier of the tag you want to update

Link Parameters

The table below shows the parameters you should specify when updating a tag.
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.

Tag propertyTypeConstraintsDescription
namestringrequired
UTF8
Min 3 chars
Max 255 chars
New name you want to assign to the tag
colorstringrequired
6-digits Hexadecimal
Hexadecimal code of the color you want to assign to the tag (without the opening "#" char)
Updating an existing tag (changing "marketing" into "promo")
$ curl 'https://api.rebrandly.com/v1/tags/gewa4cc5b6ee45d6gkj65b06ac2d1hww' \
-X POST \
-H 'apikey: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d \
'{
  "id": "gewa4cc5b6ee45d6gkj65b06ac2d1hww",
  "name": "promo",
  "color": "FFAA99"
}'

HTTP/1.1 200 OK
JSON response (updated tag)
{
  "id": "gewa4cc5b6ee45d6gkj65b06ac2d1hww",
  "name": "promo",
  "color": "FFAA99"
}

Handling errors

HTTP statusError typeDescription
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 tag