Skip to main content

Authentication

This endpoint requires authentication using a Bearer token.
Authorization: Bearer <token>

Endpoint

method
string
required
POST
endpoint
string
required
/links/bulk

Request Body

The request body should be an array of link objects. You can create up to 100 links at a time.
[].url
string
required
The destination URL of the short link.Example: https://google.com
[].domain
string
The domain of the short link (without protocol). If not provided, the primary domain for the workspace will be used.
[].key
string
The short link slug. If not provided, a random 7-character slug will be generated.
[].externalId
string
The ID of the link in your database.
[].tenantId
string
The ID of the tenant that created the link inside your system.
[].trackConversion
boolean
Whether to track conversions for the short link.
[].archived
boolean
Whether the short link is archived.
[].tagIds
array
The unique IDs of the tags assigned to the short link.
[].tagNames
array
The unique name of the tags assigned to the short link (case insensitive).
[].folderId
string
The unique ID existing folder to assign the short link to.
[].comments
string
The comments for the short link.
[].proxy
boolean
Whether the short link uses Custom Link Previews feature.
[].title
string
The custom link preview title (og:title).
[].description
string
The custom link preview description (og:description).
[].image
string
The custom link preview image (og:image).
See the Create a link endpoint for a full list of available fields.

Response

Returns an array of created links or error objects. Each item in the array will be either a successfully created link or an error object.
[].id
string
The unique ID of the short link (success case).
[].domain
string
The domain of the short link (success case).
[].key
string
The short link slug (success case).
[].url
string
The destination URL of the short link (success case).
The full URL of the short link (success case).
[].error
string
The error message (error case).
[].code
string
The error code (error case).
The link that caused the error (error case).
curl -X POST "https://api.dub.co/links/bulk" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "url": "https://google.com",
      "domain": "dub.sh",
      "key": "google"
    },
    {
      "url": "https://github.com",
      "domain": "dub.sh",
      "key": "github"
    }
  ]'
[
  {
    "id": "clux0rgak00011...",
    "domain": "dub.sh",
    "key": "google",
    "url": "https://google.com",
    "archived": false,
    "expiresAt": null,
    "expiredUrl": null,
    "password": null,
    "proxy": false,
    "title": null,
    "description": null,
    "image": null,
    "rewrite": false,
    "doIndex": false,
    "tags": [],
    "comments": null,
    "shortLink": "https://dub.sh/google",
    "qrCode": "https://api.dub.co/qr?url=https://dub.sh/google",
    "workspaceId": "ws_123",
    "clicks": 0,
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z"
  },
  {
    "id": "clux0rgak00022...",
    "domain": "dub.sh",
    "key": "github",
    "url": "https://github.com",
    "archived": false,
    "expiresAt": null,
    "expiredUrl": null,
    "password": null,
    "proxy": false,
    "title": null,
    "description": null,
    "image": null,
    "rewrite": false,
    "doIndex": false,
    "tags": [],
    "comments": null,
    "shortLink": "https://dub.sh/github",
    "qrCode": "https://api.dub.co/qr?url=https://dub.sh/github",
    "workspaceId": "ws_123",
    "clicks": 0,
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z"
  }
]

Build docs developers (and LLMs) love