Skip to main content

Authentication

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

Endpoint

method
string
required
PATCH
endpoint
string
required
/links/bulk

Request Body

The IDs of the links to update. Takes precedence over externalIds. Maximum of 100 IDs.Example: ["clux0rgak00011...", "clux0rgak00022..."]
externalIds
array
The external IDs of the links to update as stored in your database. Maximum of 100 IDs.Example: ["123456", "789012"]
data
object
required
The data to update on all specified links. All fields in the data object are optional.

Response

Returns an array of updated links or error objects.
[].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).
[].error
string
The error message (error case).
[].code
string
The error code (error case).
curl -X PATCH "https://api.dub.co/links/bulk" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "linkIds": ["clux0rgak00011...", "clux0rgak00022..."],
    "data": {
      "archived": true,
      "tagIds": ["tag_123"]
    }
  }'
[
  {
    "id": "clux0rgak00011...",
    "domain": "dub.sh",
    "key": "google",
    "url": "https://google.com",
    "archived": true,
    "expiresAt": null,
    "expiredUrl": null,
    "password": null,
    "proxy": false,
    "title": null,
    "description": null,
    "image": null,
    "rewrite": false,
    "doIndex": false,
    "tags": [
      {
        "id": "tag_123",
        "name": "Marketing",
        "color": "blue"
      }
    ],
    "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-02T00:00:00.000Z"
  },
  {
    "id": "clux0rgak00022...",
    "domain": "dub.sh",
    "key": "github",
    "url": "https://github.com",
    "archived": true,
    "expiresAt": null,
    "expiredUrl": null,
    "password": null,
    "proxy": false,
    "title": null,
    "description": null,
    "image": null,
    "rewrite": false,
    "doIndex": false,
    "tags": [
      {
        "id": "tag_123",
        "name": "Marketing",
        "color": "blue"
      }
    ],
    "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-02T00:00:00.000Z"
  }
]

Build docs developers (and LLMs) love