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 PUT HTTP 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 propertyTypeConstraintsDescription
destinationstringrequired
UTF8
Valid URL
Max 2048 chars
The destination URL you want your branded short link to point to
countintegerrequired
Positive integer
Min value 1
Max value 50,000
Number of links to be created
domainIdstringrequired
Domain Id
Domain to use to create the short links
ttlintegeroptional
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 maxTTL. If the value you provide exceeds the cap, it is silently reduced and the response includes ttlCapped: true.

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 StatusError typeDescription
403403 - Already existsGiven pair of slashtag and domain forms a branded short link which already exists. Either change the domain or the slashtag.
403403 - Invalid formatInvalid Link object. Double check value for property field. Details about validation failure in message field.