Rebrandly for Developers

Use our API to create, track and share custom short links that incorporate your brand domain name.

Get Started

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 parameter
Description

lid

Unique identifier of the branded short link you want the script to be attached to

sid

Unique 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 status
Error type
Description

404

404 - Not found
with property value "link.id"

Given path parameter lid does not correspond to any existing link

404

404 - Not found
with property value "script.id"

Given path parameter sid does not correspond to any existing script

Detaching a script


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.