{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}
{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}
{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}
{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}
{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}
{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}
{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}
Links
Upsert a link
Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.
{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}
{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}
{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}
{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}
{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}
{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}
{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}
Authorizations
Authorization
string
header
required
Default authentication mechanism
Body
application/json
url
string
required
The destination URL of the short link.
Maximum string length: 32000
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 (or dub.sh if the workspace has no domains).
Maximum string length: 190
key
string
The short link slug. If not provided, a random 7-character slug will be generated.
Maximum string length: 190
keyLength
number
The length of the short link slug. Defaults to 7 if not provided. When used with prefix, the total length of the key will be prefix.length + keyLength.
Required range: 3 <= x <= 190
externalId
string | null
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.
Required string length: 1 - 255
Example:
"123456"
tenantId
string | null
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.
Maximum string length: 255
programId
string | null
The ID of the program the short link is associated with.
partnerId
string | null
The ID of the partner the short link is associated with.
prefix
string
The prefix of the short link slug for randomly-generated keys (e.g. if prefix is /c/, generated keys will be in the /c/:key format). Will be ignored if key is provided.
trackConversion
boolean
Whether to track conversions for the short link. Defaults to false if not provided.
archived
boolean
Whether the short link is archived. Defaults to false if not provided.
tagIds
stringstring[]
The unique IDs of the tags assigned to the short link.
Example:
["clux0rgak00011..."]
tagNames
stringstring[]
The unique name of the tags assigned to the short link (case insensitive).
folderId
string | null
The unique ID existing folder to assign the short link to.
comments
string | null
The comments for the short link.
expiresAt
string | null
The date and time when the short link will expire at.
expiredUrl
string | null
The URL to redirect to when the short link has expired.
Maximum string length: 32000
password
string | null
The password required to access the destination URL of the short link.
proxy
boolean
Whether the short link uses Custom Link Previews feature. Defaults to false if not provided.
title
string | null
The custom link preview title (og:title). Will be used for Custom Link Previews if proxy is true. Learn more: https://d.to/og
description
string | null
The custom link preview description (og:description). Will be used for Custom Link Previews if proxy is true. Learn more: https://d.to/og
image
string | null
The custom link preview image (og:image). Will be used for Custom Link Previews if proxy is true. Learn more: https://d.to/og
video
string | null
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
boolean
Whether the short link uses link cloaking. Defaults to false if not provided.
ios
string | null
The iOS destination URL for the short link for iOS device targeting.
Maximum string length: 32000
android
string | null
The Android destination URL for the short link for Android device targeting.
Maximum string length: 32000
geo
object | null
Geo targeting information for the short link in JSON format {[COUNTRY]: https://example.com }. See https://d.to/geo for more information.
Show child attributes
doIndex
boolean
Allow search engines to index your short link. Defaults to false if not provided. Learn more: https://d.to/noindex
utm_source
string | null
The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.
utm_medium
string | null
The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.
utm_campaign
string | null
The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.
utm_term
string | null
The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.
utm_content
string | null
The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.
ref
string | null
The referral tag of the short link. If set, this will populate or override the ref query parameter in the destination URL.
webhookIds
string[] | null
An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.
testVariants
object[] | null
An array of A/B test URLs and the percentage of traffic to send to each URL.
The date and time when the tests were or will be completed.
publicStats
boolean
deprecated
Deprecated: Use dashboard instead. Whether the short link's stats are publicly accessible. Defaults to false if not provided.
tagId
string | null
deprecated
Deprecated: Use tagIds instead. The unique ID of the tag assigned to the short link.
Response
The upserted link
id
string
required
The unique ID of the short link.
domain
string
required
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
string
required
The short link slug. If not provided, a random 7-character slug will be generated.
url
string<uri>
required
The destination URL of the short link.
trackConversion
boolean
default:false
required
Whether to track conversions for the short link.
externalId
string | null
required
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.
tenantId
string | null
required
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.
programId
string | null
required
The ID of the program the short link is associated with.
partnerId
string | null
required
The ID of the partner the short link is associated with.
archived
boolean
default:false
required
Whether the short link is archived.
expiresAt
string | null
required
The date and time when the short link will expire in ISO-8601 format.
expiredUrl
string<uri> | null
required
The URL to redirect to when the short link has expired.
disabledAt
string | null
required
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
string | null
required
The password required to access the destination URL of the short link.
proxy
boolean
default:false
required
Whether the short link uses Custom Link Previews feature.
title
string | null
required
The title of the short link. Will be used for Custom Link Previews if proxy is true.
description
string | null
required
The description of the short link. Will be used for Custom Link Previews if proxy is true.
image
string | null
required
The image of the short link. Will be used for Custom Link Previews if proxy is true.
video
string | null
required
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
boolean
default:false
required
Whether the short link uses link cloaking.
doIndex
boolean
default:false
required
Whether to allow search engines to index the short link.
ios
string | null
required
The iOS destination URL for the short link for iOS device targeting.
android
string | null
required
The Android destination URL for the short link for Android device targeting.
geo
object | null
required
Geo targeting information for the short link in JSON format {[COUNTRY]: https://example.com }. See https://d.to/geo for more information.
Show child attributes
publicStats
boolean
default:false
required
Whether the short link's stats are publicly accessible.
tags
LinkTag · object[] | null
required
The tags assigned to the short link.
Show child attributes
folderId
string | null
required
The unique ID of the folder assigned to the short link.
webhookIds
string[]
required
The IDs of the webhooks that the short link is associated with.
comments
string | null
required
The comments for the short link.
shortLink
string<uri>
required
The full URL of the short link, including the https protocol (e.g. https://dub.sh/try).
qrCode
string<uri>
required
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
string | null
required
The UTM source of the short link.
utm_medium
string | null
required
The UTM medium of the short link.
utm_campaign
string | null
required
The UTM campaign of the short link.
utm_term
string | null
required
The UTM term of the short link.
utm_content
string | null
required
The UTM content of the short link.
userId
string | null
required
The user ID of the creator of the short link.
workspaceId
string
required
The workspace ID of the short link.
clicks
number
default:0
required
The number of clicks on the short link.
leads
number
default:0
required
The number of leads the short link has generated.
conversions
number
default:0
required
The number of leads that converted to paying customers.
sales
number
default:0
required
The total number of sales (includes recurring sales) generated by the short link.
saleAmount
number
default:0
required
The total dollar value of sales (in cents) generated by the short link.
lastClicked
string | null
required
The date and time when the short link was last clicked.
createdAt
string
required
The date and time when the short link was created.
updatedAt
string
required
The date and time when the short link was last updated.
tagId
string | null
required
deprecated
Deprecated: Use tags instead. The unique ID of the tag assigned to the short link.
projectId
string
required
deprecated
Deprecated: Use workspaceId instead. The project ID of the short link.
testVariants
object[] | null
An array of A/B test URLs and the percentage of traffic to send to each URL.
The date and time when the tests were or will be completed.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Dub Docs","colors":{"primary":"#eb5611","light":"#eb5611","dark":"#eb5611"},"favicon":"/logos/favicon.png","logo":{"light":"https://mintcdn.com/speakeasy-20cf8bdf/_E--K8tjR4nKi8VA/logos/wordmark.svg?fit=max\u0026auto=format\u0026n=_E--K8tjR4nKi8VA\u0026q=85\u0026s=0a1a92eb58e30562139bd8d27351ee0a","dark":"https://mintcdn.com/speakeasy-20cf8bdf/_E--K8tjR4nKi8VA/logos/wordmark-dark.svg?fit=max\u0026auto=format\u0026n=_E--K8tjR4nKi8VA\u0026q=85\u0026s=50f1a5e1d39c867862ea7ae3f98d23a7","href":"https://dub.co/home"},"api":{"openapi":"https://spec.speakeasy.com/dub/dub/dub-with-code-samples"},"background":{"image":"https://mintlify.s3.us-west-1.amazonaws.com/speakeasy-20cf8bdf/images/background.png","decoration":null},"navbar":{"links":[{"label":"Support","href":"mailto:support@dub.co"},{"label":"Help Center","href":"https://dub.co/help"}],"primary":{"type":"button","label":"Dashboard","href":"https://d.to/try"}},"footer":{"socials":{"github":"https://github.com/dubinc/dub","linkedin":"https://www.linkedin.com/company/dubinc","twitter":"https://twitter.com/dubdotco","website":"https://dub.co"}},"integrations":{"ga4":{"measurementId":"G-QTBMHSTT3W"},"plausible":{"domain":"dub.co"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"speakeasy-20cf8bdf","hasAudioNarration":false,"actualSubdomain":"speakeasy-20cf8bdf","customDomains":[],"gitSource":{"type":"github","owner":"speakeasy-sdks","repo":"dub-docs","deployBranch":"code-words-demo","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"}},"buildId":"6ae925d6b6c76232801082ef:success","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"API Reference","count":38},{"language":"default","tag":"Documentation","count":33},{"language":"default","tag":"SDKs","count":25},{"language":"default","tag":"Links","count":14},{"language":"default","tag":"Quickstarts","count":14},{"language":"default","tag":"Conversions","count":13},{"language":"default","tag":"Integrations","count":10},{"language":"default","tag":"List of integrations","count":8},{"language":"default","tag":"Client-side SDKs","count":8},{"language":"default","tag":"Concepts","count":7}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/endpoint/upsert-a-link","slug":"/api-reference/endpoint/upsert-a-link","pageMetadata":{"openapi":"put /links/upsert","og:title":"Upsert a link with the Dub API - API Reference","title":"Upsert a link","description":"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.","href":"/api-reference/endpoint/upsert-a-link"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"put /links/upsert","og:title":"Upsert a link with the Dub API - API Reference","title":"Upsert a link","description":"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.","href":"/api-reference/endpoint/upsert-a-link"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/speakeasy-20cf8bdf/4789bbebaced7fe0/code-words.js"],"openApiReferenceData":{"operation":{"operationId":"upsertLink","x-speakeasy-name-override":"upsert","x-speakeasy-usage-example":true,"summary":"Upsert a link","description":"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.","tags":["Links"],"security":["0e169555-a815-44d4-82c5-3078d117f787"],"requestBody":"e4ba86df-c9a0-4b38-99a9-b6b03fe9e181","responses":{"200":"76393e9e-6b2f-4e80-8193-f843c99ab56f","400":"e66c48f6-b7ec-4850-bee0-ce2d89526671","401":"97a6c643-6f13-492b-bdf0-d43376a5b765","403":"d2c3a6a2-011c-4541-8387-d8db08b3742c","404":"1b152950-cabc-494d-b9ef-abd331227bd5","409":"a1b3cbe2-153a-4f7c-8117-11b880c5f2d2","410":"1d730298-3a44-491c-a2b3-cdd6201a95e6","422":"8acda6cc-c3f3-46a6-881a-3a9f5ddb09ef","429":"ae6712be-a284-4d07-9522-5f421123a20e","500":"08b8d5a3-79db-4ee0-b8f5-e3d42f2b15fb"},"x-codeSamples":[{"lang":"python","label":"upsertLink","source":"from dub import Dub\n\n\nwith Dub(\n token=\"DUB_API_KEY\",\n) as d_client:\n\n res = d_client.links.upsert(request={\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n \"test_variants\": [\n {\n \"url\": \"https://example.com/variant-1\",\n \"percentage\": 50,\n },\n {\n \"url\": \"https://example.com/variant-2\",\n \"percentage\": 50,\n },\n ],\n })\n\n # Handle response\n print(res)"},{"lang":"php","label":"upsertLink","source":"declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$sdk = Dub\\Dub::builder()\n ->setSecurity(\n 'DUB_API_KEY'\n )\n ->build();\n\n$request = new Operations\\UpsertLinkRequestBody(\n url: 'https://google.com',\n externalId: '123456',\n tagIds: [\n 'clux0rgak00011...',\n ],\n testVariants: [\n new Operations\\UpsertLinkTestVariants(\n url: 'https://example.com/variant-1',\n percentage: 50,\n ),\n new Operations\\UpsertLinkTestVariants(\n url: 'https://example.com/variant-2',\n percentage: 50,\n ),\n ],\n);\n\n$response = $sdk->links->upsert(\n request: $request\n);\n\nif ($response->linkSchema !== null) {\n // handle response\n}"},{"lang":"go","label":"upsertLink","source":"package main\n\nimport(\n\t\"context\"\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n res, err := s.Links.Upsert(ctx, \u0026operations.UpsertLinkRequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.Pointer(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateUpsertLinkTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n TestVariants: []operations.UpsertLinkTestVariants{\n operations.UpsertLinkTestVariants{\n URL: \"https://example.com/variant-1\",\n Percentage: 50,\n },\n operations.UpsertLinkTestVariants{\n URL: \"https://example.com/variant-2\",\n Percentage: 50,\n },\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"},{"lang":"ruby","label":"upsertLink","source":"require 'dub'\n\nModels = ::OpenApiSDK::Models\ns = ::OpenApiSDK::Dub.new(\n security: Models::Shared::Security.new(\n token: 'DUB_API_KEY',\n ),\n )\n\nreq = Models::Operations::UpsertLinkRequestBody.new(\n url: 'https://google.com',\n external_id: '123456',\n tag_ids: [\n 'clux0rgak00011...',\n ],\n test_variants: [\n Models::Operations::UpsertLinkTestVariants.new(\n url: 'https://example.com/variant-1',\n percentage: 50.0,\n ),\n Models::Operations::UpsertLinkTestVariants.new(\n url: 'https://example.com/variant-2',\n percentage: 50.0,\n ),\n ],\n)\n\nres = s.links.upsert(request: req)\n\nunless res.nil?\n # handle response\nend"},{"lang":"typescript","label":"upsertLink","source":"import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.upsert();\n\n console.log(result);\n}\n\nrun();"}],"method":"put","type":"path","servers":["865bcb85-ca3b-4717-ba05-2d70378c0768"],"path":"/links/upsert","baseUrlOptions":["https://api.dub.co"],"title":"Upsert a link","codeSamples":[{"label":"upsertLink","lang":"python","source":"from dub import Dub\n\n\nwith Dub(\n token=\"DUB_API_KEY\",\n) as d_client:\n\n res = d_client.links.upsert(request={\n \"url\": \"https://google.com\",\n \"external_id\": \"123456\",\n \"tag_ids\": [\n \"clux0rgak00011...\",\n ],\n \"test_variants\": [\n {\n \"url\": \"https://example.com/variant-1\",\n \"percentage\": 50,\n },\n {\n \"url\": \"https://example.com/variant-2\",\n \"percentage\": 50,\n },\n ],\n })\n\n # Handle response\n print(res)"},{"label":"upsertLink","lang":"php","source":"declare(strict_types=1);\n\nrequire 'vendor/autoload.php';\n\nuse Dub;\nuse Dub\\Models\\Operations;\n\n$sdk = Dub\\Dub::builder()\n ->setSecurity(\n 'DUB_API_KEY'\n )\n ->build();\n\n$request = new Operations\\UpsertLinkRequestBody(\n url: 'https://google.com',\n externalId: '123456',\n tagIds: [\n 'clux0rgak00011...',\n ],\n testVariants: [\n new Operations\\UpsertLinkTestVariants(\n url: 'https://example.com/variant-1',\n percentage: 50,\n ),\n new Operations\\UpsertLinkTestVariants(\n url: 'https://example.com/variant-2',\n percentage: 50,\n ),\n ],\n);\n\n$response = $sdk->links->upsert(\n request: $request\n);\n\nif ($response->linkSchema !== null) {\n // handle response\n}"},{"label":"upsertLink","lang":"go","source":"package main\n\nimport(\n\t\"context\"\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n res, err := s.Links.Upsert(ctx, \u0026operations.UpsertLinkRequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.Pointer(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateUpsertLinkTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n TestVariants: []operations.UpsertLinkTestVariants{\n operations.UpsertLinkTestVariants{\n URL: \"https://example.com/variant-1\",\n Percentage: 50,\n },\n operations.UpsertLinkTestVariants{\n URL: \"https://example.com/variant-2\",\n Percentage: 50,\n },\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"},{"label":"upsertLink","lang":"ruby","source":"require 'dub'\n\nModels = ::OpenApiSDK::Models\ns = ::OpenApiSDK::Dub.new(\n security: Models::Shared::Security.new(\n token: 'DUB_API_KEY',\n ),\n )\n\nreq = Models::Operations::UpsertLinkRequestBody.new(\n url: 'https://google.com',\n external_id: '123456',\n tag_ids: [\n 'clux0rgak00011...',\n ],\n test_variants: [\n Models::Operations::UpsertLinkTestVariants.new(\n url: 'https://example.com/variant-1',\n percentage: 50.0,\n ),\n Models::Operations::UpsertLinkTestVariants.new(\n url: 'https://example.com/variant-2',\n percentage: 50.0,\n ),\n ],\n)\n\nres = s.links.upsert(request: req)\n\nunless res.nil?\n # handle response\nend"},{"label":"upsertLink","lang":"typescript","source":"import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.upsert();\n\n console.log(result);\n}\n\nrun();"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com","isRequired":true,"uniqueKey":"url","typeLabel":"string"},"domain":{"type":"string","maxLength":190,"description":"The domain of the short link (without protocol). If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains).","uniqueKey":"domain","typeLabel":"string"},"key":{"type":"string","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated.","uniqueKey":"key","typeLabel":"string"},"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`.","uniqueKey":"keyLength","typeLabel":"number"},"externalId":{"oneOf":[{"type":"string","minLength":1,"maxLength":255,"description":"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.","example":"123456","uniqueKey":"externalId.oneOf.0","typeLabel":"string"},{"type":"null","minLength":1,"maxLength":255,"description":"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.","example":"123456","uniqueKey":"externalId.oneOf.1","typeLabel":"null"}],"uniqueKey":"externalId","typeLabel":"string | null"},"tenantId":{"oneOf":[{"type":"string","maxLength":255,"description":"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.","uniqueKey":"tenantId.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":255,"description":"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.","uniqueKey":"tenantId.oneOf.1","typeLabel":"null"}],"uniqueKey":"tenantId","typeLabel":"string | null"},"programId":{"oneOf":[{"type":"string","description":"The ID of the program the short link is associated with.","uniqueKey":"programId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The ID of the program the short link is associated with.","uniqueKey":"programId.oneOf.1","typeLabel":"null"}],"uniqueKey":"programId","typeLabel":"string | null"},"partnerId":{"oneOf":[{"type":"string","description":"The ID of the partner the short link is associated with.","uniqueKey":"partnerId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The ID of the partner the short link is associated with.","uniqueKey":"partnerId.oneOf.1","typeLabel":"null"}],"uniqueKey":"partnerId","typeLabel":"string | null"},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided.","uniqueKey":"prefix","typeLabel":"string"},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","uniqueKey":"trackConversion","typeLabel":"boolean"},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided.","uniqueKey":"archived","typeLabel":"boolean"},"tagIds":{"oneOf":[{"type":"string","description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"uniqueKey":"tagIds.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"tagIds.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"uniqueKey":"tagIds.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"tagIds","typeLabel":"string | string[]"},"tagNames":{"oneOf":[{"type":"string","description":"The unique name of the tags assigned to the short link (case insensitive).","uniqueKey":"tagNames.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"tagNames.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"The unique name of the tags assigned to the short link (case insensitive).","uniqueKey":"tagNames.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"tagNames","typeLabel":"string | string[]"},"folderId":{"oneOf":[{"type":"string","description":"The unique ID existing folder to assign the short link to.","uniqueKey":"folderId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The unique ID existing folder to assign the short link to.","uniqueKey":"folderId.oneOf.1","typeLabel":"null"}],"uniqueKey":"folderId","typeLabel":"string | null"},"comments":{"oneOf":[{"type":"string","description":"The comments for the short link.","uniqueKey":"comments.oneOf.0","typeLabel":"string"},{"type":"null","description":"The comments for the short link.","uniqueKey":"comments.oneOf.1","typeLabel":"null"}],"uniqueKey":"comments","typeLabel":"string | null"},"expiresAt":{"oneOf":[{"type":"string","description":"The date and time when the short link will expire at.","uniqueKey":"expiresAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the short link will expire at.","uniqueKey":"expiresAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"expiresAt","typeLabel":"string | null"},"expiredUrl":{"oneOf":[{"type":"string","maxLength":32000,"description":"The URL to redirect to when the short link has expired.","uniqueKey":"expiredUrl.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":32000,"description":"The URL to redirect to when the short link has expired.","uniqueKey":"expiredUrl.oneOf.1","typeLabel":"null"}],"uniqueKey":"expiredUrl","typeLabel":"string | null"},"password":{"oneOf":[{"type":"string","description":"The password required to access the destination URL of the short link.","uniqueKey":"password.oneOf.0","typeLabel":"string"},{"type":"null","description":"The password required to access the destination URL of the short link.","uniqueKey":"password.oneOf.1","typeLabel":"null"}],"uniqueKey":"password","typeLabel":"string | null"},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","uniqueKey":"proxy","typeLabel":"boolean"},"title":{"oneOf":[{"type":"string","description":"The custom link preview title (og:title). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"title.oneOf.0","typeLabel":"string"},{"type":"null","description":"The custom link preview title (og:title). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"title.oneOf.1","typeLabel":"null"}],"uniqueKey":"title","typeLabel":"string | null"},"description":{"oneOf":[{"type":"string","description":"The custom link preview description (og:description). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"description.oneOf.0","typeLabel":"string"},{"type":"null","description":"The custom link preview description (og:description). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"description.oneOf.1","typeLabel":"null"}],"uniqueKey":"description","typeLabel":"string | null"},"image":{"oneOf":[{"type":"string","description":"The custom link preview image (og:image). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"image.oneOf.0","typeLabel":"string"},{"type":"null","description":"The custom link preview image (og:image). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"image.oneOf.1","typeLabel":"null"}],"uniqueKey":"image","typeLabel":"string | null"},"video":{"oneOf":[{"type":"string","description":"The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"video.oneOf.0","typeLabel":"string"},{"type":"null","description":"The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","uniqueKey":"video.oneOf.1","typeLabel":"null"}],"uniqueKey":"video","typeLabel":"string | null"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","uniqueKey":"rewrite","typeLabel":"boolean"},"ios":{"oneOf":[{"type":"string","maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting.","uniqueKey":"ios.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting.","uniqueKey":"ios.oneOf.1","typeLabel":"null"}],"uniqueKey":"ios","typeLabel":"string | null"},"android":{"oneOf":[{"type":"string","maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting.","uniqueKey":"android.oneOf.0","typeLabel":"string"},{"type":"null","maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting.","uniqueKey":"android.oneOf.1","typeLabel":"null"}],"uniqueKey":"android","typeLabel":"string | null"},"geo":{"oneOf":[{"type":"object","additionalProperties":{"type":"string","maxLength":32000,"uniqueKey":"geo.oneOf.0.additionalProperties","typeLabel":"string"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","uniqueKey":"geo.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":{"type":"string","maxLength":32000,"uniqueKey":"geo.oneOf.1.additionalProperties","typeLabel":"string"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","uniqueKey":"geo.oneOf.1","typeLabel":"null"}],"uniqueKey":"geo","typeLabel":"object | null"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","uniqueKey":"doIndex","typeLabel":"boolean"},"utm_source":{"oneOf":[{"type":"string","description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","uniqueKey":"utm_source.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","uniqueKey":"utm_source.oneOf.1","typeLabel":"null"}],"uniqueKey":"utm_source","typeLabel":"string | null"},"utm_medium":{"oneOf":[{"type":"string","description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","uniqueKey":"utm_medium.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","uniqueKey":"utm_medium.oneOf.1","typeLabel":"null"}],"uniqueKey":"utm_medium","typeLabel":"string | null"},"utm_campaign":{"oneOf":[{"type":"string","description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","uniqueKey":"utm_campaign.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","uniqueKey":"utm_campaign.oneOf.1","typeLabel":"null"}],"uniqueKey":"utm_campaign","typeLabel":"string | null"},"utm_term":{"oneOf":[{"type":"string","description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","uniqueKey":"utm_term.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","uniqueKey":"utm_term.oneOf.1","typeLabel":"null"}],"uniqueKey":"utm_term","typeLabel":"string | null"},"utm_content":{"oneOf":[{"type":"string","description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","uniqueKey":"utm_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","uniqueKey":"utm_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"utm_content","typeLabel":"string | null"},"ref":{"oneOf":[{"type":"string","description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","uniqueKey":"ref.oneOf.0","typeLabel":"string"},{"type":"null","description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","uniqueKey":"ref.oneOf.1","typeLabel":"null"}],"uniqueKey":"ref","typeLabel":"string | null"},"webhookIds":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"webhookIds.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","uniqueKey":"webhookIds.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","uniqueKey":"webhookIds.oneOf.1","typeLabel":"null"}],"uniqueKey":"webhookIds","typeLabel":"string[] | null"},"testVariants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"testVariants.oneOf.0.items.[INDEX].url","typeLabel":"string"},"percentage":{"type":"number","minimum":10,"maximum":90,"isRequired":true,"uniqueKey":"testVariants.oneOf.0.items.[INDEX].percentage","typeLabel":"number"}},"required":["url","percentage"],"uniqueKey":"testVariants.oneOf.0.items.[INDEX]","typeLabel":"object"},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"uniqueKey":"testVariants.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"uniqueKey":"testVariants.oneOf.1","typeLabel":"null"}],"uniqueKey":"testVariants","typeLabel":"object[] | null"},"testStartedAt":{"oneOf":[{"type":"string","description":"The date and time when the tests started.","uniqueKey":"testStartedAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the tests started.","uniqueKey":"testStartedAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"testStartedAt","typeLabel":"string | null"},"testCompletedAt":{"oneOf":[{"type":"string","description":"The date and time when the tests were or will be completed.","uniqueKey":"testCompletedAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the tests were or will be completed.","uniqueKey":"testCompletedAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"testCompletedAt","typeLabel":"string | null"},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"uniqueKey":"publicStats","typeLabel":"boolean"},"tagId":{"oneOf":[{"type":"string","description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"uniqueKey":"tagId.oneOf.0","typeLabel":"string"},{"type":"null","description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"uniqueKey":"tagId.oneOf.1","typeLabel":"null"}],"uniqueKey":"tagId","typeLabel":"string | null"}},"required":["url"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"url":"https://google.com","domain":"\u003cstring>","key":"\u003cstring>","keyLength":96.5,"externalId":"123456","tenantId":"\u003cstring>","programId":"\u003cstring>","partnerId":"\u003cstring>","prefix":"\u003cstring>","trackConversion":true,"archived":true,"tagIds":["clux0rgak00011..."],"tagNames":"\u003cstring>","folderId":"\u003cstring>","comments":"\u003cstring>","expiresAt":"\u003cstring>","expiredUrl":"\u003cstring>","password":"\u003cstring>","proxy":true,"title":"\u003cstring>","description":"\u003cstring>","image":"\u003cstring>","video":"\u003cstring>","rewrite":true,"ios":"\u003cstring>","android":"\u003cstring>","geo":{},"doIndex":true,"utm_source":"\u003cstring>","utm_medium":"\u003cstring>","utm_campaign":"\u003cstring>","utm_term":"\u003cstring>","utm_content":"\u003cstring>","ref":"\u003cstring>","webhookIds":["\u003cstring>"],"testVariants":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"testStartedAt":"\u003cstring>","testCompletedAt":"\u003cstring>","publicStats":true,"tagId":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"76393e9e-6b2f-4e80-8193-f843c99ab56f":{"description":"The upserted link","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"domain":{"type":"string","description":"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).","isRequired":true,"uniqueKey":"domain","typeLabel":"string"},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated.","isRequired":true,"uniqueKey":"key","typeLabel":"string"},"url":{"type":"string","format":"uri","description":"The destination URL of the short link.","isRequired":true,"uniqueKey":"url","typeLabel":"string\u003curi>"},"trackConversion":{"type":"boolean","default":false,"description":"Whether to track conversions for the short link.","isRequired":true,"uniqueKey":"trackConversion","typeLabel":"boolean"},"externalId":{"oneOf":[{"type":"string","description":"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.","isRequired":true,"uniqueKey":"externalId.oneOf.0","typeLabel":"string"},{"type":"null","description":"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.","isRequired":true,"uniqueKey":"externalId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"externalId","typeLabel":"string | null"},"tenantId":{"oneOf":[{"type":"string","description":"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.","isRequired":true,"uniqueKey":"tenantId.oneOf.0","typeLabel":"string"},{"type":"null","description":"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.","isRequired":true,"uniqueKey":"tenantId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"tenantId","typeLabel":"string | null"},"programId":{"oneOf":[{"type":"string","description":"The ID of the program the short link is associated with.","isRequired":true,"uniqueKey":"programId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The ID of the program the short link is associated with.","isRequired":true,"uniqueKey":"programId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"programId","typeLabel":"string | null"},"partnerId":{"oneOf":[{"type":"string","description":"The ID of the partner the short link is associated with.","isRequired":true,"uniqueKey":"partnerId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The ID of the partner the short link is associated with.","isRequired":true,"uniqueKey":"partnerId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"partnerId","typeLabel":"string | null"},"archived":{"type":"boolean","default":false,"description":"Whether the short link is archived.","isRequired":true,"uniqueKey":"archived","typeLabel":"boolean"},"expiresAt":{"oneOf":[{"type":"string","description":"The date and time when the short link will expire in ISO-8601 format.","isRequired":true,"uniqueKey":"expiresAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the short link will expire in ISO-8601 format.","isRequired":true,"uniqueKey":"expiresAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"expiresAt","typeLabel":"string | null"},"expiredUrl":{"oneOf":[{"type":"string","format":"uri","description":"The URL to redirect to when the short link has expired.","isRequired":true,"uniqueKey":"expiredUrl.oneOf.0","typeLabel":"string\u003curi>"},{"type":"null","format":"uri","description":"The URL to redirect to when the short link has expired.","isRequired":true,"uniqueKey":"expiredUrl.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"expiredUrl","typeLabel":"string\u003curi> | null"},"disabledAt":{"oneOf":[{"type":"string","description":"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.","isRequired":true,"uniqueKey":"disabledAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"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.","isRequired":true,"uniqueKey":"disabledAt.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"disabledAt","typeLabel":"string | null"},"password":{"oneOf":[{"type":"string","description":"The password required to access the destination URL of the short link.","isRequired":true,"uniqueKey":"password.oneOf.0","typeLabel":"string"},{"type":"null","description":"The password required to access the destination URL of the short link.","isRequired":true,"uniqueKey":"password.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"password","typeLabel":"string | null"},"proxy":{"type":"boolean","default":false,"description":"Whether the short link uses Custom Link Previews feature.","isRequired":true,"uniqueKey":"proxy","typeLabel":"boolean"},"title":{"oneOf":[{"type":"string","description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"title.oneOf.0","typeLabel":"string"},{"type":"null","description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"title.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"title","typeLabel":"string | null"},"description":{"oneOf":[{"type":"string","description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"description.oneOf.0","typeLabel":"string"},{"type":"null","description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"description.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"description","typeLabel":"string | null"},"image":{"oneOf":[{"type":"string","description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"image.oneOf.0","typeLabel":"string"},{"type":"null","description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","isRequired":true,"uniqueKey":"image.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"image","typeLabel":"string | null"},"video":{"oneOf":[{"type":"string","description":"The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","isRequired":true,"uniqueKey":"video.oneOf.0","typeLabel":"string"},{"type":"null","description":"The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og","isRequired":true,"uniqueKey":"video.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"video","typeLabel":"string | null"},"rewrite":{"type":"boolean","default":false,"description":"Whether the short link uses link cloaking.","isRequired":true,"uniqueKey":"rewrite","typeLabel":"boolean"},"doIndex":{"type":"boolean","default":false,"description":"Whether to allow search engines to index the short link.","isRequired":true,"uniqueKey":"doIndex","typeLabel":"boolean"},"ios":{"oneOf":[{"type":"string","description":"The iOS destination URL for the short link for iOS device targeting.","isRequired":true,"uniqueKey":"ios.oneOf.0","typeLabel":"string"},{"type":"null","description":"The iOS destination URL for the short link for iOS device targeting.","isRequired":true,"uniqueKey":"ios.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"ios","typeLabel":"string | null"},"android":{"oneOf":[{"type":"string","description":"The Android destination URL for the short link for Android device targeting.","isRequired":true,"uniqueKey":"android.oneOf.0","typeLabel":"string"},{"type":"null","description":"The Android destination URL for the short link for Android device targeting.","isRequired":true,"uniqueKey":"android.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"android","typeLabel":"string | null"},"geo":{"oneOf":[{"type":"object","additionalProperties":{"type":"string","format":"uri","uniqueKey":"geo.oneOf.0.additionalProperties","typeLabel":"string\u003curi>"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","isRequired":true,"uniqueKey":"geo.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":{"type":"string","format":"uri","uniqueKey":"geo.oneOf.1.additionalProperties","typeLabel":"string\u003curi>"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","isRequired":true,"uniqueKey":"geo.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"geo","typeLabel":"object | null"},"publicStats":{"type":"boolean","default":false,"description":"Whether the short link's stats are publicly accessible.","isRequired":true,"uniqueKey":"publicStats","typeLabel":"boolean"},"tags":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the tag.","isRequired":true,"uniqueKey":"tags.oneOf.0.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"The name of the tag.","isRequired":true,"uniqueKey":"tags.oneOf.0.items.[INDEX].name","typeLabel":"string"},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","pink"],"description":"The color of the tag.","isRequired":true,"uniqueKey":"tags.oneOf.0.items.[INDEX].color","typeLabel":"enum\u003cstring>"}},"required":["id","name","color"],"title":"LinkTag","uniqueKey":"tags.oneOf.0.items.[INDEX]","typeLabel":"LinkTag · object"},"description":"The tags assigned to the short link.","isRequired":true,"uniqueKey":"tags.oneOf.0","typeLabel":"LinkTag · object[]"},{"type":"null","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the tag."},"name":{"type":"string","description":"The name of the tag."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","pink"],"description":"The color of the tag."}},"required":["id","name","color"],"title":"LinkTag"},"description":"The tags assigned to the short link.","isRequired":true,"uniqueKey":"tags.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"tags","typeLabel":"LinkTag · object[] | null"},"folderId":{"oneOf":[{"type":"string","description":"The unique ID of the folder assigned to the short link.","isRequired":true,"uniqueKey":"folderId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The unique ID of the folder assigned to the short link.","isRequired":true,"uniqueKey":"folderId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"folderId","typeLabel":"string | null"},"webhookIds":{"type":"array","items":{"type":"string","uniqueKey":"webhookIds.items.[INDEX]","typeLabel":"string"},"description":"The IDs of the webhooks that the short link is associated with.","isRequired":true,"uniqueKey":"webhookIds","typeLabel":"string[]"},"comments":{"oneOf":[{"type":"string","description":"The comments for the short link.","isRequired":true,"uniqueKey":"comments.oneOf.0","typeLabel":"string"},{"type":"null","description":"The comments for the short link.","isRequired":true,"uniqueKey":"comments.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"comments","typeLabel":"string | null"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`).","isRequired":true,"uniqueKey":"shortLink","typeLabel":"string\u003curi>"},"qrCode":{"type":"string","format":"uri","description":"The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`).","isRequired":true,"uniqueKey":"qrCode","typeLabel":"string\u003curi>"},"utm_source":{"oneOf":[{"type":"string","description":"The UTM source of the short link.","isRequired":true,"uniqueKey":"utm_source.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM source of the short link.","isRequired":true,"uniqueKey":"utm_source.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"utm_source","typeLabel":"string | null"},"utm_medium":{"oneOf":[{"type":"string","description":"The UTM medium of the short link.","isRequired":true,"uniqueKey":"utm_medium.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM medium of the short link.","isRequired":true,"uniqueKey":"utm_medium.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"utm_medium","typeLabel":"string | null"},"utm_campaign":{"oneOf":[{"type":"string","description":"The UTM campaign of the short link.","isRequired":true,"uniqueKey":"utm_campaign.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM campaign of the short link.","isRequired":true,"uniqueKey":"utm_campaign.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"utm_campaign","typeLabel":"string | null"},"utm_term":{"oneOf":[{"type":"string","description":"The UTM term of the short link.","isRequired":true,"uniqueKey":"utm_term.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM term of the short link.","isRequired":true,"uniqueKey":"utm_term.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"utm_term","typeLabel":"string | null"},"utm_content":{"oneOf":[{"type":"string","description":"The UTM content of the short link.","isRequired":true,"uniqueKey":"utm_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The UTM content of the short link.","isRequired":true,"uniqueKey":"utm_content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"utm_content","typeLabel":"string | null"},"userId":{"oneOf":[{"type":"string","description":"The user ID of the creator of the short link.","isRequired":true,"uniqueKey":"userId.oneOf.0","typeLabel":"string"},{"type":"null","description":"The user ID of the creator of the short link.","isRequired":true,"uniqueKey":"userId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"userId","typeLabel":"string | null"},"workspaceId":{"type":"string","description":"The workspace ID of the short link.","isRequired":true,"uniqueKey":"workspaceId","typeLabel":"string"},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link.","isRequired":true,"uniqueKey":"clicks","typeLabel":"number"},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated.","isRequired":true,"uniqueKey":"leads","typeLabel":"number"},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers.","isRequired":true,"uniqueKey":"conversions","typeLabel":"number"},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","isRequired":true,"uniqueKey":"sales","typeLabel":"number"},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link.","isRequired":true,"uniqueKey":"saleAmount","typeLabel":"number"},"lastClicked":{"oneOf":[{"type":"string","description":"The date and time when the short link was last clicked.","isRequired":true,"uniqueKey":"lastClicked.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the short link was last clicked.","isRequired":true,"uniqueKey":"lastClicked.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"lastClicked","typeLabel":"string | null"},"createdAt":{"type":"string","description":"The date and time when the short link was created.","isRequired":true,"uniqueKey":"createdAt","typeLabel":"string"},"updatedAt":{"type":"string","description":"The date and time when the short link was last updated.","isRequired":true,"uniqueKey":"updatedAt","typeLabel":"string"},"tagId":{"oneOf":[{"type":"string","description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"isRequired":true,"uniqueKey":"tagId.oneOf.0","typeLabel":"string"},{"type":"null","description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"isRequired":true,"uniqueKey":"tagId.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"tagId","typeLabel":"string | null"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true,"isRequired":true,"uniqueKey":"projectId","typeLabel":"string"},"testVariants":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"testVariants.oneOf.0.items.[INDEX].url","typeLabel":"string"},"percentage":{"type":"number","minimum":10,"maximum":90,"isRequired":true,"uniqueKey":"testVariants.oneOf.0.items.[INDEX].percentage","typeLabel":"number"}},"required":["url","percentage"],"uniqueKey":"testVariants.oneOf.0.items.[INDEX]","typeLabel":"object"},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"uniqueKey":"testVariants.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"uniqueKey":"testVariants.oneOf.1","typeLabel":"null"}],"uniqueKey":"testVariants","typeLabel":"object[] | null"},"testStartedAt":{"oneOf":[{"type":"string","description":"The date and time when the tests started.","uniqueKey":"testStartedAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the tests started.","uniqueKey":"testStartedAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"testStartedAt","typeLabel":"string | null"},"testCompletedAt":{"oneOf":[{"type":"string","description":"The date and time when the tests were or will be completed.","uniqueKey":"testCompletedAt.oneOf.0","typeLabel":"string"},{"type":"null","description":"The date and time when the tests were or will be completed.","uniqueKey":"testCompletedAt.oneOf.1","typeLabel":"null"}],"uniqueKey":"testCompletedAt","typeLabel":"string | null"}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link","uniqueKey":"","typeLabel":"Link · object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","domain":"\u003cstring>","key":"\u003cstring>","url":"\u003cstring>","trackConversion":false,"externalId":"\u003cstring>","tenantId":"\u003cstring>","programId":"\u003cstring>","partnerId":"\u003cstring>","archived":false,"expiresAt":"\u003cstring>","expiredUrl":"\u003cstring>","disabledAt":"\u003cstring>","password":"\u003cstring>","proxy":false,"title":"\u003cstring>","description":"\u003cstring>","image":"\u003cstring>","video":"\u003cstring>","rewrite":false,"doIndex":false,"ios":"\u003cstring>","android":"\u003cstring>","geo":{},"publicStats":false,"tags":[{"id":"\u003cstring>","name":"\u003cstring>","color":"red"}],"folderId":"\u003cstring>","webhookIds":["\u003cstring>"],"comments":"\u003cstring>","shortLink":"\u003cstring>","qrCode":"\u003cstring>","utm_source":"\u003cstring>","utm_medium":"\u003cstring>","utm_campaign":"\u003cstring>","utm_term":"\u003cstring>","utm_content":"\u003cstring>","userId":"\u003cstring>","workspaceId":"\u003cstring>","clicks":0,"leads":0,"conversions":0,"sales":0,"saleAmount":0,"lastClicked":"\u003cstring>","createdAt":"\u003cstring>","updatedAt":"\u003cstring>","tagId":"\u003cstring>","projectId":"\u003cstring>","testVariants":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}],"testStartedAt":"\u003cstring>","testCompletedAt":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e66c48f6-b7ec-4850-bee0-ce2d89526671":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).","content":{"application/json":{"schema":{"x-speakeasy-name-override":"BadRequest","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request"],"description":"A short code indicating the error code returned.","example":"bad_request","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#bad-request","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"bad_request","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#bad-request"}}}},"exampleType":"generated"}},"exampleType":"generated"},"97a6c643-6f13-492b-bdf0-d43376a5b765":{"description":"Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"Unauthorized","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"],"description":"A short code indicating the error code returned.","example":"unauthorized","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#unauthorized","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"unauthorized","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#unauthorized"}}}},"exampleType":"generated"}},"exampleType":"generated"},"d2c3a6a2-011c-4541-8387-d8db08b3742c":{"description":"The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"Forbidden","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"],"description":"A short code indicating the error code returned.","example":"forbidden","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#forbidden","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"forbidden","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#forbidden"}}}},"exampleType":"generated"}},"exampleType":"generated"},"1b152950-cabc-494d-b9ef-abd331227bd5":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"NotFound","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["not_found"],"description":"A short code indicating the error code returned.","example":"not_found","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#not-found","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"not_found","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#not-found"}}}},"exampleType":"generated"}},"exampleType":"generated"},"a1b3cbe2-153a-4f7c-8117-11b880c5f2d2":{"description":"This response is sent when a request conflicts with the current state of the server.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"Conflict","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["conflict"],"description":"A short code indicating the error code returned.","example":"conflict","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#conflict","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"conflict","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#conflict"}}}},"exampleType":"generated"}},"exampleType":"generated"},"1d730298-3a44-491c-a2b3-cdd6201a95e6":{"description":"This response is sent when the requested content has been permanently deleted from server, with no forwarding address.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InviteExpired","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invite_expired"],"description":"A short code indicating the error code returned.","example":"invite_expired","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#invite-expired","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"invite_expired","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#invite-expired"}}}},"exampleType":"generated"}},"exampleType":"generated"},"8acda6cc-c3f3-46a6-881a-3a9f5ddb09ef":{"description":"The request was well-formed but was unable to be followed due to semantic errors.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"UnprocessableEntity","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unprocessable_entity"],"description":"A short code indicating the error code returned.","example":"unprocessable_entity","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#unprocessable-entity","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"unprocessable_entity","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#unprocessable-entity"}}}},"exampleType":"generated"}},"exampleType":"generated"},"ae6712be-a284-4d07-9522-5f421123a20e":{"description":"The user has sent too many requests in a given amount of time (\"rate limiting\")","content":{"application/json":{"schema":{"x-speakeasy-name-override":"RateLimitExceeded","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["rate_limit_exceeded"],"description":"A short code indicating the error code returned.","example":"rate_limit_exceeded","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#rate-limit_exceeded","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"rate_limit_exceeded","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#rate-limit_exceeded"}}}},"exampleType":"generated"}},"exampleType":"generated"},"08b8d5a3-79db-4ee0-b8f5-e3d42f2b15fb":{"description":"The server has encountered a situation it does not know how to handle.","content":{"application/json":{"schema":{"x-speakeasy-name-override":"InternalServerError","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["internal_server_error"],"description":"A short code indicating the error code returned.","example":"internal_server_error","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"doc_url":{"type":"string","description":"A link to our documentation with more details about this error code","example":"https://dub.co/docs/api-reference/errors#internal-server_error","uniqueKey":"error.doc_url","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"internal_server_error","message":"The requested resource was not found.","doc_url":"https://dub.co/docs/api-reference/errors#internal-server_error"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"0e169555-a815-44d4-82c5-3078d117f787":{"token":{"type":"http","description":"Default authentication mechanism","scheme":"bearer","x-speakeasy-example":"DUB_API_KEY","scopes":[]}}},"servers":{"865bcb85-ca3b-4717-ba05-2d70378c0768":{"url":"https://api.dub.co","description":"Production API"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","description":"Default authentication mechanism","scheme":"bearer","x-speakeasy-example":"DUB_API_KEY","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Default authentication mechanism","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"token","name":"Authorization"}],"title":"token"}]},"originalFileLocation":"https://spec.speakeasy.com/dub/dub/dub-with-code-samples"},"subdomain":"speakeasy-20cf8bdf","siteName":"Dub Docs","title":"Upsert a link with the Dub API - API Reference","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T06:55:03.965Z","originalFileLocation":"api-reference/endpoint/upsert-a-link.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Dub Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upsert a link with the Dub API - API Reference\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Dub Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://speakeasy-20cf8bdf.mintlify.site/_mintlify/api/og/v2?division=Links\u0026amp;title=Upsert+a+link\u0026amp;description=Upsert+a+link+for+the+authenticated+workspace+by+its+URL.+If+a+link+with+the+same+URL+already+exists%2C+return+it+%28or+update+it+if+there+are+any+changes%29.+Otherwi\u0026amp;theme=bcc63e583e81eedcc7ef3943\u0026amp;signature=876a3a8348716d0f6e7789a2313ff41fef1637015d92940b66dd313f9faaa86d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Upsert a link with the Dub API - API Reference\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://speakeasy-20cf8bdf.mintlify.site/_mintlify/api/og/v2?division=Links\u0026amp;title=Upsert+a+link\u0026amp;description=Upsert+a+link+for+the+authenticated+workspace+by+its+URL.+If+a+link+with+the+same+URL+already+exists%2C+return+it+%28or+update+it+if+there+are+any+changes%29.+Otherwi\u0026amp;theme=bcc63e583e81eedcc7ef3943\u0026amp;signature=876a3a8348716d0f6e7789a2313ff41fef1637015d92940b66dd313f9faaa86d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/speakeasy-20cf8bdf/nRXDtUDoIccjE2_j/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Dub Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#eb5611\">\u003clink data-mint-head rel=\"canonical\" href=\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/upsert-a-link.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/#organization\",\"name\":\"Dub Docs\",\"url\":\"https://speakeasy-20cf8bdf.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/speakeasy-20cf8bdf/_E--K8tjR4nKi8VA/logos/wordmark.svg?fit=max\u0026auto=format\u0026n=_E--K8tjR4nKi8VA\u0026q=85\u0026s=0a1a92eb58e30562139bd8d27351ee0a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app#website\",\"name\":\"Dub Docs\",\"url\":\"https://speakeasy-20cf8bdf.mintlify.app\",\"publisher\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link#webpage\",\"url\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link\",\"name\":\"Upsert a link\",\"description\":\"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\",\"dateModified\":\"2026-01-07T06:55:03.965Z\",\"isPartOf\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Links\",\"item\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/create-a-new-link\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upsert a link\",\"item\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link#apireference\",\"headline\":\"Upsert a link\",\"name\":\"Upsert a link\",\"description\":\"Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.\",\"url\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link\",\"mainEntityOfPage\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/api-reference/endpoint/upsert-a-link#webpage\"},\"dateModified\":\"2026-01-07T06:55:03.965Z\",\"publisher\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://speakeasy-20cf8bdf.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Dub Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Dub Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/upsert-a-link.md","siteName":"Dub Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Introduction","icon":"webhook","href":"/api-reference/introduction"},{"title":"API Keys","icon":"key","href":"/api-reference/tokens"},{"title":"Rate limits","icon":"clock","href":"/api-reference/rate-limits"},{"title":"Pagination","icon":"list-ol","href":"/api-reference/pagination"},{"title":"Errors","icon":"bug","href":"/api-reference/errors"}]},{"group":"Links","pages":[{"openapi":"post /links","title":"Create a link","href":"/api-reference/endpoint/create-a-new-link"},{"openapi":"patch /links/{linkId}","title":"Update a link","description":"Update a link for the authenticated workspace. If there's no change, returns it as it is.","href":"/api-reference/endpoint/update-a-link"},{"openapi":"put /links/upsert","title":"Upsert a link","href":"/api-reference/endpoint/upsert-a-link"},{"openapi":"delete /links/{linkId}","title":"Delete a link","description":"Delete a link for the authenticated workspace.","href":"/api-reference/endpoint/delete-a-link"},{"openapi":"get /links/info","title":"Retrieve a link","href":"/api-reference/endpoint/retrieve-a-link"},{"openapi":"get /links","title":"Retrieve a list of links","href":"/api-reference/endpoint/retrieve-a-list-of-links"},{"openapi":"get /links/count","title":"Retrieve links count","href":"/api-reference/endpoint/retrieve-number-of-links"},{"openapi":"post /links/bulk","title":"Bulk create links","href":"/api-reference/endpoint/bulk-create-links"},{"openapi":"patch /links/bulk","title":"Bulk update links","href":"/api-reference/endpoint/bulk-update-links"},{"openapi":"delete /links/bulk","title":"Bulk delete links","href":"/api-reference/endpoint/bulk-delete-links"},{"title":"Retrieve a QR code","openapi":"get /qr","href":"/api-reference/endpoint/retrieve-a-qr-code"}]},{"group":"Analytics","pages":[{"title":"Retrieve analytics","openapi":"get /analytics","href":"/api-reference/endpoint/retrieve-analytics"},{"openapi":"get /events","title":"Retrieve a list of events","href":"/api-reference/endpoint/retrieve-a-list-of-events"}]},{"group":"Conversions","pages":[{"openapi":"post /track/lead","title":"Track a lead","href":"/api-reference/endpoint/track-lead"},{"openapi":"post /track/sale","title":"Track a sale","href":"/api-reference/endpoint/track-sale"}]},{"group":"Customers","pages":[{"openapi":"get /customers/{id}","title":"Retrieve a customer","href":"/api-reference/endpoint/retrieve-a-customer"},{"openapi":"get /customers","title":"Retrieve a list of customers","href":"/api-reference/endpoint/retrieve-a-list-of-customers"},{"openapi":"patch /customers/{id}","title":"Update a customer","href":"/api-reference/endpoint/update-a-customer"},{"openapi":"delete /customers/{id}","title":"Delete a customer","href":"/api-reference/endpoint/delete-a-customer"}]},{"group":"Tags","pages":[{"openapi":"post /tags","title":"Create a tag","href":"/api-reference/endpoint/create-a-new-tag"},{"openapi":"get /tags","title":"Retrieve a list of tags","href":"/api-reference/endpoint/retrieve-a-list-of-tags"},{"openapi":"patch /tags/{id}","title":"Update a tag","href":"/api-reference/endpoint/update-a-tag"}]},{"group":"Domains","pages":[{"openapi":"post /domains","title":"Create a domain","href":"/api-reference/endpoint/create-a-domain"},{"openapi":"patch /domains/{slug}","title":"Update a domain","href":"/api-reference/endpoint/update-a-domain"},{"openapi":"delete /domains/{slug}","title":"Delete a domain","href":"/api-reference/endpoint/delete-a-domain"},{"openapi":"get /domains","title":"Retrieve a list of domains","href":"/api-reference/endpoint/retrieve-a-list-of-domains"}]},{"group":"Workspaces","pages":[{"openapi":"get /workspaces/{idOrSlug}","title":"Retrieve a workspace","href":"/api-reference/endpoint/retrieve-a-workspace"},{"openapi":"patch /workspaces/{idOrSlug}","title":"Update a workspace","href":"/api-reference/endpoint/update-a-workspace"}]}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/overview"}]}]},"basePath":"","title":"Upsert a link with the Dub API - API Reference","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-D4yvBxwa.js","snippetPresets-CkhhQaIQ.js","utils-XnMGX2lF.js","style-to-object-BY3JEAdk.js","utils-CRXL1dwr.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DvwRKZnA.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DYtgUc7n.js","_Uint8Array-D8z7zjjJ.js","isObject-FP1Yky1u.js","ApiExamples-RYQSJVS4.js","usePlaygroundInputsStore-k_R_BTDL.js","shallow-BwVhzryZ.js","isEqual-Cx5TQjMc.js","CodeSnippets-BDe2dS5N.js","CodeSnippet-C1QlaNYl.js","use-playground-group-access-DyQ_1IIe.js","Page-DQd9HN9r.js","api-description-markdown-BpDftTKT.js","DynamicMarkdown-CZT_WAnN.js","SectionHeading-K1iuDm9j.js","MethodPill-Dx3JIwHJ.js","getPastedJson-buPTdYs_.js","Check2Icon-DmMrzBYX.js","axios-CsQoIw0U.js","Markdown-erv2ryQz.js","AssistantPageLink-DJ01X1Sn.js","dist-D9mz3EIS.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}