---
updatedAt: 2025-11-14T20:51:24.000Z
agentTools:
  projectIndex: https://developers.rebrandly.com/llms.txt
---

# Retargeting scripts

Retargeting scripts are used to execute custom javascript snippets during the redirection process

> 🚧 Check for compatibility first
>
> Double check whether your API key or OAuth token is enabled to use the Scripts feature.\
> For every account, you can check for features and limits with [a preliminary API call](https://developers.rebrandly.com/docs/account-model).

## Script Object

Main properties of a Script object are:

<table>
<thead>
<tr>
  <th>Property</th>
  <th>Type</th>
  <th>Description</th>
</tr>
</thead>
<tbody>
<tr>
  <td><p>id</p></td>
  <td><p>string</p></td>
  <td><p>Unique identifier of the script</p></td>
</tr>
<tr>
  <td><p>name</p></td>
  <td><p>string</p></td>
  <td><p>Unique name of the script</p></td>
</tr>
<tr>
  <td><p>value</p></td>
  <td><p>string</p></td>
  <td><p>Javascript snippet (enclosed into \<script> and \</script> HTML tags)</p></td>
</tr>
<tr>
  <td><p>uri</p></td>
  <td><p>string</p></td>
  <td><p>Publicly accessible URL to the script content</p></td>
</tr>
</tbody>
</table>

## Scripts management

Here are some basic operations you can perform regarding Script resource:

| Operation                      | Details                                                  |
| :----------------------------- | :------------------------------------------------------- |
| Create a new script            | See [Creating a new script](https://developers.rebrandly.com/docs/creating-a-new-script)   |
| Get script details             | See [Getting script details](https://developers.rebrandly.com/docs/getting-script-details) |
| Access your scripts collection | See [Listing your scripts](https://developers.rebrandly.com/docs/listing-your-scripts)     |
| Delete a script                | See [Deleting a script](https://developers.rebrandly.com/docs/deleting-a-script)           |
| Count your scripts             | See [Counting your scripts](https://developers.rebrandly.com/docs/counting-your-scripts)   |
| Attach a script to a link      | See [Attaching a script](https://developers.rebrandly.com/docs/attaching-a-script)         |
| Detach a script from a link    | See [Detaching a script](https://developers.rebrandly.com/docs/detaching-a-script)         |

## Example of a Script object

```json
{
  "id": "3aehje9d536s46d59ba5bcf49b582ear",
  "name": "Test alert",
  "value": "<script>alert('test');</script>",
  "uri": "https://s3.amazonaws.com/rb-scripts/user/3aehje9d536s46d59ba5bcf49b582ear"
}
```