Detaching a script

You can detach a Script object from a Link object.
When you delete a Script, it is detached from all the branded links it was attached to.

In order to detach a Script from a Link, you must first get both unique identifiers for the Link and the Script. Once you have them, you can perform a DELETE API call (without body) to the association endpoint, which is composed as follow:

https://api.rebrandly.com/v1/links/:lid/scripts/:sid, where lid is the Link resource's id property and sid is the Script resource's id property.

Path parameters

Path parameterDescription
lidUnique identifier of the branded short link you want the script to be attached to
sidUnique identifier of the script you want to attach to this link
Detaching a Script from a Link
$ curl 'https://api.rebrandly.com/v1/links/FFfa4cc5b6ee45d6g7897b06ac2d16af/scripts/3aehje9d536s46d59ba5bcf49b582ear' \
-X DELETE \
-H 'apikey: YOUR_API_KEY' \
-H 'Content-Type: application/json'

HTTP/1.1 200 OK

Handling errors

HTTP statusError typeDescription
404404 - Not found
with property value "link.id"
Given path parameter lid does not correspond to any existing link
404404 - Not found
with property value "script.id"
Given path parameter sid does not correspond to any existing script