Create multiple links with the same destination URL
Speed
This endpoint allows you to create up to 100,000 links per second.
Extended workspace
This endpoint can be used only in extended workspaces. See here how to define the workspace in your API request.
Dedicated endpoint
You will be provided with a dedicated endpoint for using this method.
In this guide, we will use a generic <DEDICATED_ENDPOINT_URL>that you will need to replace in order to use this API
Links can be created via:
- a
PUTHTTP request to<DEDICATED_ENDPOINT_URL>/v1/links/bulk, with body parameters defined in the next paragraph
Body Parameters
Table below shows the parameters you should specify when creating a Link:
| Link property | Type | Constraints | Description |
|---|---|---|---|
| destination | string | required UTF8 Valid URL Max 2048 chars | The destination URL you want your branded short link to point to |
| count | integer | required Positive integer Min value 1 Max value 50,000 | Number of links to be created |
| domainId | string | required Domain Id | Domain to use to create the short links |
| ttl | integer | optional Min value 3600 | Time-to-live for the link, in seconds. If not provided, the value defaults to your plan's maximum TTL (90 days on most plans). The value is capped at your plan's |
Auto-generation strategy for slashtags
The logic for auto-generation slashtag can be found here, using this endpoint the length of the slashtag will start from 5 characters
Examples of valid Link object to PUT:
{
"destination": "https://rebrandly.com/api-solutions",
"domainId": "abc123xyz",
"count": 12000,
"ttl": 86400
}{
"destination": "https://rebrandly.com/api-solutions",
"domainId": "abc123xyz",
"count": 12000
}$ curl '\<DEDICATED_ENDPOINT_URL>/v1/links/bulk' \
-X POST \
-H 'apikey: YOUR_API_KEY' \
-H 'workspace: YOUR_WORKSPACE_ID' \
-H 'Content-Type: application/json' \
-d \
'{
"destination": "https://rebrandly.com/api-solutions",
"domainId": "abc123xyz",
"count": 12000,
"ttl": 86400
}'
// slashtag and title are optional{
"links":[
{
"id":"abc123xyz",
"shortUrl":"rebrandly.com/abc12",
"slashtag":"abc12",
"destination":"https://rebrandly.com/api-solutions",
"ttl":3600,
"expiresAt":1726481918,
"ttlCapped":null
}
],
"count":1
}When the requested ttl exceeds your plan's maximum, the value is clamped and ttlCapped is returned with details:
{
"links":[
{
"id":"abc123xyz",
"shortUrl":"rebrandly.com/abc12",
"slashtag":"abc12",
"destination":"https://rebrandly.com/api-solutions",
"ttl":7776000,
"expiresAt":1726481918,
"ttlCapped":{
"requestedValue":31536000,
"appliedValue":7776000,
"reason":"plan_max_exceeded"
}
}
],
"count":1
}{
"links":[
{
"id":"abc123xyz",
"shortUrl":"rebrandly.com/abc12",
"slashtag":"abc12",
"destination":"https://rebrandly.com/api-solutions",
"ttl":7776000,
"expiresAt":1734257918
}
],
"count":1,
"ttlCapped":true
}Handling errors
| HTTP Status | Error type | Description |
|---|---|---|
| 403 | 403 - Already exists | Given pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag. |
| 403 | 403 - Invalid format | Invalid Link object. Double check value for property field. Details about validation failure in message field. |
