| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | The unique ID of the short link. | |
domain |
str | ✔️ | The domain of the short link. If not provided, the primary domain for the workspace will be used (or dub.sh if the workspace has no domains). |
|
key |
str | ✔️ | The short link slug. If not provided, a random 7-character slug will be generated. | |
url |
str | ✔️ | The destination URL of the short link. | |
track_conversion |
Optional[bool] | ➖ | Whether to track conversions for the short link. | |
external_id |
Nullable[str] | ✔️ | The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace. | |
tenant_id |
Nullable[str] | ✔️ | The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant. | |
program_id |
Nullable[str] | ✔️ | The ID of the program the short link is associated with. | |
partner_id |
Nullable[str] | ✔️ | The ID of the partner the short link is associated with. | |
archived |
Optional[bool] | ➖ | Whether the short link is archived. | |
expires_at |
Nullable[str] | ✔️ | The date and time when the short link will expire in ISO-8601 format. | |
expired_url |
Nullable[str] | ✔️ | The URL to redirect to when the short link has expired. | |
disabled_at |
Nullable[str] | ✔️ | The date and time when the short link was disabled. When a short link is disabled, it will redirect to its domain's not found URL, and its stats will be excluded from your overall stats. | |
password |
Nullable[str] | ✔️ | The password required to access the destination URL of the short link. | |
proxy |
Optional[bool] | ➖ | Whether the short link uses Custom Link Previews feature. | |
title |
Nullable[str] | ✔️ | The title of the short link. Will be used for Custom Link Previews if proxy is true. |
|
description |
Nullable[str] | ✔️ | The description of the short link. Will be used for Custom Link Previews if proxy is true. |
|
image |
Nullable[str] | ✔️ | The image of the short link. Will be used for Custom Link Previews if proxy is true. |
|
video |
Nullable[str] | ✔️ | The custom link preview video (og:video). Will be used for Custom Link Previews if proxy is true. Learn more: https://d.to/og |
|
rewrite |
Optional[bool] | ➖ | Whether the short link uses link cloaking. | |
do_index |
Optional[bool] | ➖ | Whether to allow search engines to index the short link. | |
ios |
Nullable[str] | ✔️ | The iOS destination URL for the short link for iOS device targeting. | |
android |
Nullable[str] | ✔️ | The Android destination URL for the short link for Android device targeting. | |
geo |
Dict[str, str] | ✔️ | Geo targeting information for the short link in JSON format {[COUNTRY]: https://example.com }. See https://d.to/geo for more information. |
|
public_stats |
Optional[bool] | ➖ | Whether the short link's stats are publicly accessible. | |
tags |
List[components.LinkTagSchemaOutput] | ✔️ | The tags assigned to the short link. | |
folder_id |
Nullable[str] | ✔️ | The unique ID of the folder assigned to the short link. | |
webhook_ids |
List[str] | ✔️ | The IDs of the webhooks that the short link is associated with. | |
comments |
Nullable[str] | ✔️ | The comments for the short link. | |
short_link |
str | ✔️ | The full URL of the short link, including the https protocol (e.g. https://dub.sh/try). |
|
qr_code |
str | ✔️ | The full URL of the QR code for the short link (e.g. https://api.dub.co/qr?url=https://dub.sh/try). |
|
utm_source |
Nullable[str] | ✔️ | The UTM source of the short link. | |
utm_medium |
Nullable[str] | ✔️ | The UTM medium of the short link. | |
utm_campaign |
Nullable[str] | ✔️ | The UTM campaign of the short link. | |
utm_term |
Nullable[str] | ✔️ | The UTM term of the short link. | |
utm_content |
Nullable[str] | ✔️ | The UTM content of the short link. | |
test_variants |
List[components.TestVariants] | ➖ | An array of A/B test URLs and the percentage of traffic to send to each URL. | [ { "url": "https://example.com/variant-1", "percentage": 50 }, { "url": "https://example.com/variant-2", "percentage": 50 } ] |
test_started_at |
OptionalNullable[str] | ➖ | The date and time when the tests started. | |
test_completed_at |
OptionalNullable[str] | ➖ | The date and time when the tests were or will be completed. | |
user_id |
Nullable[str] | ✔️ | The user ID of the creator of the short link. | |
workspace_id |
str | ✔️ | The workspace ID of the short link. | |
clicks |
Optional[float] | ➖ | The number of clicks on the short link. | |
leads |
Optional[float] | ➖ | The number of leads the short link has generated. | |
conversions |
Optional[float] | ➖ | The number of leads that converted to paying customers. | |
sales |
Optional[float] | ➖ | The total number of sales (includes recurring sales) generated by the short link. | |
sale_amount |
Optional[float] | ➖ | The total dollar value of sales (in cents) generated by the short link. | |
last_clicked |
Nullable[str] | ✔️ | The date and time when the short link was last clicked. | |
created_at |
str | ✔️ | The date and time when the short link was created. | |
updated_at |
str | ✔️ | The date and time when the short link was last updated. | |
tag_id |
Nullable[str] | ✔️ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. Deprecated: Use tags instead. The unique ID of the tag assigned to the short link. |
|
project_id |
str | ✔️ | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. Deprecated: Use workspaceId instead. The project ID of the short link. |