GET
/
links
import { Dub } from "dub";

const dub = new Dub({
  token: "DUB_API_KEY",
});

async function run() {
  const result = await dub.links.list();

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();
[
  {
    "id": "<string>",
    "domain": "<string>",
    "key": "<string>",
    "url": "<string>",
    "trackConversion": false,
    "externalId": "<string>",
    "tenantId": "<string>",
    "programId": "<string>",
    "partnerId": "<string>",
    "archived": false,
    "expiresAt": "<string>",
    "expiredUrl": "<string>",
    "password": "<string>",
    "proxy": false,
    "title": "<string>",
    "description": "<string>",
    "image": "<string>",
    "video": "<string>",
    "rewrite": false,
    "doIndex": false,
    "ios": "<string>",
    "android": "<string>",
    "geo": {
      "AF": "<string>",
      "AL": "<string>",
      "DZ": "<string>",
      "AS": "<string>",
      "AD": "<string>",
      "AO": "<string>",
      "AI": "<string>",
      "AQ": "<string>",
      "AG": "<string>",
      "AR": "<string>",
      "AM": "<string>",
      "AW": "<string>",
      "AU": "<string>",
      "AT": "<string>",
      "AZ": "<string>",
      "BS": "<string>",
      "BH": "<string>",
      "BD": "<string>",
      "BB": "<string>",
      "BY": "<string>",
      "BE": "<string>",
      "BZ": "<string>",
      "BJ": "<string>",
      "BM": "<string>",
      "BT": "<string>",
      "BO": "<string>",
      "BA": "<string>",
      "BW": "<string>",
      "BV": "<string>",
      "BR": "<string>",
      "IO": "<string>",
      "BN": "<string>",
      "BG": "<string>",
      "BF": "<string>",
      "BI": "<string>",
      "KH": "<string>",
      "CM": "<string>",
      "CA": "<string>",
      "CV": "<string>",
      "KY": "<string>",
      "CF": "<string>",
      "TD": "<string>",
      "CL": "<string>",
      "CN": "<string>",
      "CX": "<string>",
      "CC": "<string>",
      "CO": "<string>",
      "KM": "<string>",
      "CG": "<string>",
      "CD": "<string>",
      "CK": "<string>",
      "CR": "<string>",
      "CI": "<string>",
      "HR": "<string>",
      "CU": "<string>",
      "CY": "<string>",
      "CZ": "<string>",
      "DK": "<string>",
      "DJ": "<string>",
      "DM": "<string>",
      "DO": "<string>",
      "EC": "<string>",
      "EG": "<string>",
      "SV": "<string>",
      "GQ": "<string>",
      "ER": "<string>",
      "EE": "<string>",
      "ET": "<string>",
      "FK": "<string>",
      "FO": "<string>",
      "FJ": "<string>",
      "FI": "<string>",
      "FR": "<string>",
      "GF": "<string>",
      "PF": "<string>",
      "TF": "<string>",
      "GA": "<string>",
      "GM": "<string>",
      "GE": "<string>",
      "DE": "<string>",
      "GH": "<string>",
      "GI": "<string>",
      "GR": "<string>",
      "GL": "<string>",
      "GD": "<string>",
      "GP": "<string>",
      "GU": "<string>",
      "GT": "<string>",
      "GN": "<string>",
      "GW": "<string>",
      "GY": "<string>",
      "HT": "<string>",
      "HM": "<string>",
      "VA": "<string>",
      "HN": "<string>",
      "HK": "<string>",
      "HU": "<string>",
      "IS": "<string>",
      "IN": "<string>",
      "ID": "<string>",
      "IR": "<string>",
      "IQ": "<string>",
      "IE": "<string>",
      "IL": "<string>",
      "IT": "<string>",
      "JM": "<string>",
      "JP": "<string>",
      "JO": "<string>",
      "KZ": "<string>",
      "KE": "<string>",
      "KI": "<string>",
      "KP": "<string>",
      "KR": "<string>",
      "KW": "<string>",
      "KG": "<string>",
      "LA": "<string>",
      "LV": "<string>",
      "LB": "<string>",
      "LS": "<string>",
      "LR": "<string>",
      "LY": "<string>",
      "LI": "<string>",
      "LT": "<string>",
      "LU": "<string>",
      "MO": "<string>",
      "MG": "<string>",
      "MW": "<string>",
      "MY": "<string>",
      "MV": "<string>",
      "ML": "<string>",
      "MT": "<string>",
      "MH": "<string>",
      "MQ": "<string>",
      "MR": "<string>",
      "MU": "<string>",
      "YT": "<string>",
      "MX": "<string>",
      "FM": "<string>",
      "MD": "<string>",
      "MC": "<string>",
      "MN": "<string>",
      "MS": "<string>",
      "MA": "<string>",
      "MZ": "<string>",
      "MM": "<string>",
      "NA": "<string>",
      "NR": "<string>",
      "NP": "<string>",
      "NL": "<string>",
      "NC": "<string>",
      "NZ": "<string>",
      "NI": "<string>",
      "NE": "<string>",
      "NG": "<string>",
      "NU": "<string>",
      "NF": "<string>",
      "MK": "<string>",
      "MP": "<string>",
      "NO": "<string>",
      "OM": "<string>",
      "PK": "<string>",
      "PW": "<string>",
      "PS": "<string>",
      "PA": "<string>",
      "PG": "<string>",
      "PY": "<string>",
      "PE": "<string>",
      "PH": "<string>",
      "PN": "<string>",
      "PL": "<string>",
      "PT": "<string>",
      "PR": "<string>",
      "QA": "<string>",
      "RE": "<string>",
      "RO": "<string>",
      "RU": "<string>",
      "RW": "<string>",
      "SH": "<string>",
      "KN": "<string>",
      "LC": "<string>",
      "PM": "<string>",
      "VC": "<string>",
      "WS": "<string>",
      "SM": "<string>",
      "ST": "<string>",
      "SA": "<string>",
      "SN": "<string>",
      "SC": "<string>",
      "SL": "<string>",
      "SG": "<string>",
      "SK": "<string>",
      "SI": "<string>",
      "SB": "<string>",
      "SO": "<string>",
      "ZA": "<string>",
      "GS": "<string>",
      "ES": "<string>",
      "LK": "<string>",
      "SD": "<string>",
      "SR": "<string>",
      "SJ": "<string>",
      "SZ": "<string>",
      "SE": "<string>",
      "CH": "<string>",
      "SY": "<string>",
      "TW": "<string>",
      "TJ": "<string>",
      "TZ": "<string>",
      "TH": "<string>",
      "TL": "<string>",
      "TG": "<string>",
      "TK": "<string>",
      "TO": "<string>",
      "TT": "<string>",
      "TN": "<string>",
      "TR": "<string>",
      "TM": "<string>",
      "TC": "<string>",
      "TV": "<string>",
      "UG": "<string>",
      "UA": "<string>",
      "AE": "<string>",
      "GB": "<string>",
      "US": "<string>",
      "UM": "<string>",
      "UY": "<string>",
      "UZ": "<string>",
      "VU": "<string>",
      "VE": "<string>",
      "VN": "<string>",
      "VG": "<string>",
      "VI": "<string>",
      "WF": "<string>",
      "EH": "<string>",
      "YE": "<string>",
      "ZM": "<string>",
      "ZW": "<string>",
      "AX": "<string>",
      "BQ": "<string>",
      "CW": "<string>",
      "GG": "<string>",
      "IM": "<string>",
      "JE": "<string>",
      "ME": "<string>",
      "BL": "<string>",
      "MF": "<string>",
      "RS": "<string>",
      "SX": "<string>",
      "SS": "<string>",
      "XK": "<string>"
    },
    "publicStats": false,
    "tagId": "<string>",
    "tags": [
      {
        "id": "<string>",
        "name": "<string>",
        "color": "red"
      }
    ],
    "folderId": "<string>",
    "webhookIds": [
      "<string>"
    ],
    "comments": "<string>",
    "shortLink": "<string>",
    "qrCode": "<string>",
    "utm_source": "<string>",
    "utm_medium": "<string>",
    "utm_campaign": "<string>",
    "utm_term": "<string>",
    "utm_content": "<string>",
    "testVariants": [
      {
        "url": "https://example.com/variant-1",
        "percentage": 50
      },
      {
        "url": "https://example.com/variant-2",
        "percentage": 50
      }
    ],
    "testStartedAt": "<string>",
    "testCompletedAt": "<string>",
    "userId": "<string>",
    "workspaceId": "<string>",
    "clicks": 0,
    "lastClicked": "<string>",
    "leads": 0,
    "sales": 0,
    "saleAmount": 0,
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "projectId": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

domain
string

The domain to filter the links by. E.g. ac.me. If not provided, all links for the workspace will be returned.

tagId
string
deprecated

Deprecated. Use tagIds instead. The tag ID to filter the links by.

tagIds

The tag IDs to filter the links by.

tagNames

The unique name of the tags assigned to the short link (case insensitive).

folderId
string

The folder ID to filter the links by.

The search term to filter the links by. The search term will be matched against the short link slug and the destination url.

userId
string

The user ID to filter the links by.

tenantId
string

The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.

showArchived
boolean
default:false

Whether to include archived links in the response. Defaults to false if not provided.

withTags
boolean
default:false
deprecated

DEPRECATED. Filter for links that have at least one tag assigned to them.

sortBy
enum<string>
default:createdAt

The field to sort the links by. The default is createdAt.

Available options:
createdAt,
clicks,
saleAmount,
lastClicked
sortOrder
enum<string>
default:desc

The sort order. The default is desc.

Available options:
asc,
desc
sort
enum<string>
default:createdAt
deprecated

DEPRECATED. Use sortBy instead.

Available options:
createdAt,
clicks,
saleAmount,
lastClicked
page
number
default:1

The page number for pagination.

Required range: x > 0
Example:

1

pageSize
number
default:100

The number of items per page.

Required range: 0 < x <= 100
Example:

50

Response

200
application/json
A list of links

The response is of type object[].