Skip to main content

Authentication

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

Endpoint

method
string
required
GET
endpoint
string
required
/links

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.
tagIds
string
The tag IDs to filter the links by. Can be a comma-separated list.
tagNames
string
The unique name of the tags assigned to the short link (case insensitive). Can be a comma-separated list.
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.
sortBy
string
default:"createdAt"
The field to sort the links by. Options: createdAt, clicks, saleAmount, lastClicked.
sortOrder
string
default:"desc"
The sort order. Options: asc, desc.
page
number
default:"1"
The page number for pagination.
pageSize
number
default:"100"
The number of links to return per page. Maximum is 100.

Response

Returns an array of link objects.
[].id
string
The unique ID of the short link.
[].domain
string
The domain of the short link.
[].key
string
The short link slug.
[].url
string
The destination URL of the short link.
[].externalId
string
The ID of the link in your database.
[].trackConversion
boolean
Whether to track conversions for the short link.
[].archived
boolean
Whether the short link is archived.
[].expiresAt
string
The date and time when the short link will expire in ISO-8601 format.
[].password
string
The password required to access the destination URL of the short link.
[].proxy
boolean
Whether the short link uses Custom Link Previews feature.
[].title
string
The title of the short link.
[].description
string
The description of the short link.
[].image
string
The image of the short link.
[].rewrite
boolean
Whether the short link uses link cloaking.
[].ios
string
The iOS destination URL for the short link.
[].android
string
The Android destination URL for the short link.
[].geo
object
Geo targeting information for the short link.
[].tags
array
The tags assigned to the short link.
[].comments
string
The comments for the short link.
The full URL of the short link, including the https protocol.
[].qrCode
string
The full URL of the QR code for the short link.
[].utm_source
string
The UTM source of the short link.
[].utm_medium
string
The UTM medium of the short link.
[].utm_campaign
string
The UTM campaign of the short link.
[].workspaceId
string
The workspace ID of the short link.
[].clicks
number
The number of clicks on the short link.
[].leads
number
The number of leads the short link has generated.
[].conversions
number
The number of leads that converted to paying customers.
[].sales
number
The total number of sales generated by the short link.
[].saleAmount
number
The total dollar value of sales (in cents) generated by the short link.
[].lastClicked
string
The date and time when the short link was last clicked.
[].createdAt
string
The date and time when the short link was created.
[].updatedAt
string
The date and time when the short link was last updated.
curl -X GET "https://api.dub.co/links?domain=dub.sh&page=1&pageSize=10" \
  -H "Authorization: Bearer <token>"
[
  {
    "id": "clux0rgak00011...",
    "domain": "dub.sh",
    "key": "try",
    "url": "https://google.com",
    "archived": false,
    "expiresAt": null,
    "expiredUrl": null,
    "password": null,
    "proxy": false,
    "title": null,
    "description": null,
    "image": null,
    "rewrite": false,
    "doIndex": false,
    "ios": null,
    "android": null,
    "geo": null,
    "publicStats": false,
    "tags": [],
    "folderId": null,
    "comments": null,
    "shortLink": "https://dub.sh/try",
    "qrCode": "https://api.dub.co/qr?url=https://dub.sh/try",
    "utm_source": null,
    "utm_medium": null,
    "utm_campaign": null,
    "utm_term": null,
    "utm_content": null,
    "userId": "user_123",
    "workspaceId": "ws_123",
    "clicks": 0,
    "leads": 0,
    "conversions": 0,
    "sales": 0,
    "saleAmount": 0,
    "lastClicked": null,
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z"
  }
]

Build docs developers (and LLMs) love