{"openapi":"3.0.3","info":{"title":"Dub API","description":"Dub is the modern link attribution platform for short links and conversion tracking.","version":"0.0.1","contact":{"name":"Dub Support","email":"support@dub.co","url":"https://dub.co/support"},"license":{"name":"AGPL-3.0 license","url":"https://github.com/dubinc/dub/blob/main/LICENSE.md"}},"servers":[{"url":"https://api.dub.co","description":"Production API"}],"paths":{"/links":{"post":{"operationId":"createLink","x-speakeasy-name-override":"create","x-speakeasy-usage-example":true,"summary":"Create a link","description":"Create a link for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The destination URL of the short link.","example":"https://google.com","maxLength":32000,"type":"string"},"domain":{"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).","type":"string","maxLength":190},"key":{"description":"The short link slug. If not provided, a random 7-character slug will be generated.","type":"string","maxLength":190},"keyLength":{"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`.","type":"number","minimum":3,"maximum":190},"externalId":{"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. Pass `null` or an empty string to remove it.","example":"123456","nullable":true,"type":"string","maxLength":255},"tenantId":{"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. Pass `null` or an empty string to remove it.","nullable":true,"type":"string","maxLength":255},"prefix":{"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.","type":"string"},"trackConversion":{"description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","type":"boolean"},"archived":{"description":"Whether the short link is archived. Defaults to `false` if not provided.","type":"boolean"},"tagIds":{"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tagNames":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"folderId":{"description":"The unique ID existing folder to assign the short link to.","nullable":true,"type":"string"},"comments":{"description":"The comments for the short link.","nullable":true,"type":"string"},"expiresAt":{"description":"The date and time when the short link will expire at.","nullable":true,"type":"string"},"expiredUrl":{"description":"The URL to redirect to when the short link has expired.","maxLength":32000,"nullable":true,"type":"string"},"password":{"description":"The password required to access the destination URL of the short link.","nullable":true,"type":"string"},"proxy":{"description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","type":"boolean"},"title":{"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","nullable":true,"type":"string"},"description":{"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","nullable":true,"type":"string"},"image":{"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","nullable":true,"type":"string"},"video":{"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","nullable":true,"type":"string"},"rewrite":{"description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","type":"boolean"},"ios":{"description":"The iOS destination URL for the short link for iOS device targeting.","nullable":true,"type":"string","maxLength":32000},"android":{"description":"The Android destination URL for the short link for Android device targeting.","nullable":true,"type":"string","maxLength":32000},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","type":"boolean"},"utm_source":{"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_medium":{"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_campaign":{"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_term":{"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_content":{"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","nullable":true,"type":"string","maxLength":255},"ref":{"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","nullable":true,"type":"string","maxLength":255},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"publicStats":{"description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"type":"boolean"},"tagId":{"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"nullable":true,"type":"string"},"webhookIds":{"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true,"nullable":true,"type":"array","items":{"type":"string"}}},"required":["url"]}}}},"responses":{"200":{"description":"The created link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"get":{"operationId":"getLinks","x-speakeasy-name-override":"list","x-speakeasy-pagination":{"type":"offsetLimit","inputs":[{"name":"page","in":"parameters","type":"page"},{"name":"pageSize","in":"parameters","type":"limit"}],"outputs":{"results":"$"}},"summary":"List all links","description":"Retrieve a paginated list of links for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"domain","schema":{"description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.","type":"string"},"description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."},{"in":"query","name":"tagId","schema":{"description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","deprecated":true,"type":"string"},"description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by."},{"in":"query","name":"tagIds","schema":{"description":"The tag IDs to filter the links by.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false,"description":"The tag IDs to filter the links by."},{"in":"query","name":"tagNames","schema":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false,"description":"The unique name of the tags assigned to the short link (case insensitive)."},{"in":"query","name":"folderId","schema":{"description":"The folder ID to filter the links by.","type":"string"},"description":"The folder ID to filter the links by."},{"in":"query","name":"search","schema":{"description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url.","type":"string"},"description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url."},{"in":"query","name":"userId","schema":{"description":"The user ID to filter the links by.","type":"string"},"description":"The user ID to filter the links by."},{"in":"query","name":"tenantId","schema":{"description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.","type":"string"},"description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant."},{"in":"query","name":"showArchived","schema":{"default":false,"description":"Whether to include archived links in the response. Defaults to `false` if not provided.","type":"boolean"},"description":"Whether to include archived links in the response. Defaults to `false` if not provided."},{"in":"query","name":"withTags","schema":{"default":false,"description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","deprecated":true,"type":"boolean"},"description":"DEPRECATED. Filter for links that have at least one tag assigned to them."},{"in":"query","name":"endingBefore","schema":{"description":"If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`.","example":"link_1KAP4CDPBSVMMBMH9XX3YZZ0Z...","type":"string"},"description":"If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`."},{"in":"query","name":"startingAfter","schema":{"description":"If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`.","example":"link_1KAP4CDPBSVMMBMH9XX3YZZ0Z...","type":"string"},"description":"If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`."},{"in":"query","name":"page","schema":{"description":"DEPRECATED. Use `startingAfter` instead.","example":1,"deprecated":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"description":"DEPRECATED. Use `startingAfter` instead."},{"in":"query","name":"pageSize","schema":{"default":100,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":100},"description":"The number of items per page."}],"responses":{"200":{"description":"A list of links","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkSchema"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/links/count":{"get":{"operationId":"getLinksCount","x-speakeasy-name-override":"count","summary":"Retrieve links count","description":"Retrieve the number of links for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"domain","schema":{"description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.","type":"string"},"description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned."},{"in":"query","name":"tagId","schema":{"description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","deprecated":true,"type":"string"},"description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by."},{"in":"query","name":"tagIds","schema":{"description":"The tag IDs to filter the links by.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false,"description":"The tag IDs to filter the links by."},{"in":"query","name":"tagNames","schema":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false,"description":"The unique name of the tags assigned to the short link (case insensitive)."},{"in":"query","name":"folderId","schema":{"description":"The folder ID to filter the links by.","type":"string"},"description":"The folder ID to filter the links by."},{"in":"query","name":"search","schema":{"description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url.","type":"string"},"description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url."},{"in":"query","name":"userId","schema":{"description":"The user ID to filter the links by.","type":"string"},"description":"The user ID to filter the links by."},{"in":"query","name":"tenantId","schema":{"description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.","type":"string"},"description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant."},{"in":"query","name":"showArchived","schema":{"default":false,"description":"Whether to include archived links in the response. Defaults to `false` if not provided.","type":"boolean"},"description":"Whether to include archived links in the response. Defaults to `false` if not provided."},{"in":"query","name":"withTags","schema":{"default":false,"description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","deprecated":true,"type":"boolean"},"description":"DEPRECATED. Filter for links that have at least one tag assigned to them."},{"in":"query","name":"groupBy","schema":{"description":"The field to group the links by.","anyOf":[{"type":"string","enum":["domain"]},{"type":"string","enum":["tagId"]},{"type":"string","enum":["userId"]},{"type":"string","enum":["folderId"]}]},"description":"The field to group the links by."}],"responses":{"200":{"description":"A list of links","content":{"application/json":{"schema":{"type":"number","description":"The number of links matching the query."}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/links/info":{"get":{"operationId":"getLinkInfo","x-speakeasy-name-override":"get","summary":"Retrieve a link","description":"Retrieve the info for a link.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"domain","schema":{"type":"string","minLength":1,"description":"The domain of the link to retrieve. E.g. for `d.to/github`, the domain is `d.to`."}},{"in":"query","name":"key","schema":{"type":"string","minLength":1,"description":"The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`."}},{"in":"query","name":"linkId","schema":{"description":"The unique ID of the short link.","example":"clux0rgak00011...","type":"string"},"description":"The unique ID of the short link."},{"in":"query","name":"externalId","schema":{"description":"This is the ID of the link in the your database.","example":"123456","type":"string"},"description":"This is the ID of the link in the your database."}],"responses":{"200":{"description":"The retrieved link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/links/{linkId}":{"patch":{"operationId":"updateLink","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a link","description":"Update a link for the authenticated workspace. If there's no change, returns it as it is.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"linkId","schema":{"type":"string","description":"The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."},"required":true,"description":"The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The destination URL of the short link.","example":"https://google.com","maxLength":32000,"type":"string"},"domain":{"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).","type":"string","maxLength":190},"key":{"description":"The short link slug. If not provided, a random 7-character slug will be generated.","type":"string","maxLength":190},"externalId":{"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. Pass `null` or an empty string to remove it.","example":"123456","nullable":true,"type":"string","maxLength":255},"tenantId":{"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. Pass `null` or an empty string to remove it.","nullable":true,"type":"string","maxLength":255},"trackConversion":{"description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","type":"boolean"},"archived":{"description":"Whether the short link is archived. Defaults to `false` if not provided.","type":"boolean"},"tagIds":{"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tagNames":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"folderId":{"description":"The unique ID existing folder to assign the short link to.","nullable":true,"type":"string"},"comments":{"description":"The comments for the short link.","nullable":true,"type":"string"},"expiresAt":{"description":"The date and time when the short link will expire at.","nullable":true,"type":"string"},"expiredUrl":{"description":"The URL to redirect to when the short link has expired.","maxLength":32000,"nullable":true,"type":"string"},"password":{"description":"The password required to access the destination URL of the short link.","nullable":true,"type":"string"},"proxy":{"description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","type":"boolean"},"title":{"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","nullable":true,"type":"string"},"description":{"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","nullable":true,"type":"string"},"image":{"nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp|avif);base64,"},{"type":"string","format":"uri"}]},"video":{"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","nullable":true,"type":"string"},"rewrite":{"description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","type":"boolean"},"ios":{"description":"The iOS destination URL for the short link for iOS device targeting.","nullable":true,"type":"string","maxLength":32000},"android":{"description":"The Android destination URL for the short link for Android device targeting.","nullable":true,"type":"string","maxLength":32000},"geo":{"allOf":[{"$ref":"#/components/schemas/linkGeoTargeting"}]},"doIndex":{"description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","type":"boolean"},"utm_source":{"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_medium":{"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_campaign":{"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_term":{"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_content":{"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","nullable":true,"type":"string","maxLength":255},"ref":{"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","nullable":true,"type":"string","maxLength":255},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"publicStats":{"description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"type":"boolean"},"tagId":{"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"nullable":true,"type":"string"},"webhookIds":{"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true,"nullable":true,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"The updated link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"deleteLink","x-speakeasy-name-override":"delete","x-speakeasy-max-method-params":1,"summary":"Delete a link","description":"Delete a link for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"linkId","schema":{"type":"string","description":"The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."},"required":true,"description":"The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`."}],"responses":{"200":{"description":"The deleted link ID.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the link."}},"required":["id"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/links/bulk":{"post":{"operationId":"bulkCreateLinks","x-speakeasy-name-override":"createMany","summary":"Bulk create links","description":"Bulk create up to 100 links for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"url":{"description":"The destination URL of the short link.","example":"https://google.com","maxLength":32000,"type":"string"},"domain":{"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).","type":"string","maxLength":190},"key":{"description":"The short link slug. If not provided, a random 7-character slug will be generated.","type":"string","maxLength":190},"keyLength":{"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`.","type":"number","minimum":3,"maximum":190},"externalId":{"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. Pass `null` or an empty string to remove it.","example":"123456","nullable":true,"type":"string","maxLength":255},"tenantId":{"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. Pass `null` or an empty string to remove it.","nullable":true,"type":"string","maxLength":255},"prefix":{"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.","type":"string"},"trackConversion":{"description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","type":"boolean"},"archived":{"description":"Whether the short link is archived. Defaults to `false` if not provided.","type":"boolean"},"tagIds":{"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tagNames":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"folderId":{"description":"The unique ID existing folder to assign the short link to.","nullable":true,"type":"string"},"comments":{"description":"The comments for the short link.","nullable":true,"type":"string"},"expiresAt":{"description":"The date and time when the short link will expire at.","nullable":true,"type":"string"},"expiredUrl":{"description":"The URL to redirect to when the short link has expired.","maxLength":32000,"nullable":true,"type":"string"},"password":{"description":"The password required to access the destination URL of the short link.","nullable":true,"type":"string"},"proxy":{"description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","type":"boolean"},"title":{"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","nullable":true,"type":"string"},"description":{"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","nullable":true,"type":"string"},"image":{"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","nullable":true,"type":"string"},"video":{"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","nullable":true,"type":"string"},"rewrite":{"description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","type":"boolean"},"ios":{"description":"The iOS destination URL for the short link for iOS device targeting.","nullable":true,"type":"string","maxLength":32000},"android":{"description":"The Android destination URL for the short link for Android device targeting.","nullable":true,"type":"string","maxLength":32000},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","type":"boolean"},"utm_source":{"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_medium":{"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_campaign":{"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_term":{"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_content":{"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","nullable":true,"type":"string","maxLength":255},"ref":{"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","nullable":true,"type":"string","maxLength":255},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"publicStats":{"description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"type":"boolean"},"tagId":{"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"nullable":true,"type":"string"},"webhookIds":{"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true,"nullable":true,"type":"array","items":{"type":"string"}}},"required":["url"]}}}}},"responses":{"200":{"description":"The created links","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/LinkSchema"},{"$ref":"#/components/schemas/LinkErrorSchema"}]}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"patch":{"operationId":"bulkUpdateLinks","x-speakeasy-name-override":"updateMany","summary":"Bulk update links","description":"Bulk update up to 100 links with the same data for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"linkIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string"},"description":"The IDs of the links to update. Takes precedence over `externalIds`."},"externalIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string"},"description":"The external IDs of the links to update as stored in your database."},"data":{"type":"object","properties":{"url":{"description":"The destination URL of the short link.","example":"https://google.com","type":"string","maxLength":32000},"tenantId":{"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. Pass `null` or an empty string to remove it.","nullable":true,"type":"string","maxLength":255},"trackConversion":{"description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","type":"boolean"},"archived":{"description":"Whether the short link is archived. Defaults to `false` if not provided.","type":"boolean"},"tagIds":{"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tagNames":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"folderId":{"description":"The unique ID existing folder to assign the short link to.","nullable":true,"type":"string"},"comments":{"description":"The comments for the short link.","nullable":true,"type":"string"},"expiresAt":{"description":"The date and time when the short link will expire at.","nullable":true,"type":"string"},"expiredUrl":{"description":"The URL to redirect to when the short link has expired.","maxLength":32000,"nullable":true,"type":"string"},"password":{"description":"The password required to access the destination URL of the short link.","nullable":true,"type":"string"},"proxy":{"description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","type":"boolean"},"title":{"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","nullable":true,"type":"string"},"description":{"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","nullable":true,"type":"string"},"image":{"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","nullable":true,"type":"string"},"video":{"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","nullable":true,"type":"string"},"rewrite":{"description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","type":"boolean"},"ios":{"description":"The iOS destination URL for the short link for iOS device targeting.","nullable":true,"type":"string","maxLength":32000},"android":{"description":"The Android destination URL for the short link for Android device targeting.","nullable":true,"type":"string","maxLength":32000},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","type":"boolean"},"utm_source":{"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_medium":{"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_campaign":{"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_term":{"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_content":{"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","nullable":true,"type":"string","maxLength":255},"ref":{"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","nullable":true,"type":"string","maxLength":255},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"publicStats":{"description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"type":"boolean"},"tagId":{"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"nullable":true,"type":"string"},"webhookIds":{"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true,"nullable":true,"type":"array","items":{"type":"string"}}}}},"required":["data"]}}}},"responses":{"200":{"description":"The updated links","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkSchema"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"bulkDeleteLinks","x-speakeasy-name-override":"deleteMany","summary":"Bulk delete links","description":"Bulk delete up to 100 links for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"linkIds","schema":{"type":"array","items":{"type":"string"},"example":["clux0rgak00011...","clux0rgak00022..."],"description":"Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored."},"explode":false,"style":"form","required":true,"description":"Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored."}],"responses":{"200":{"description":"The deleted links count.","content":{"application/json":{"schema":{"type":"object","properties":{"deletedCount":{"type":"number","description":"The number of links deleted."}},"required":["deletedCount"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/links/upsert":{"put":{"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":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"The destination URL of the short link.","example":"https://google.com","maxLength":32000,"type":"string"},"domain":{"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).","type":"string","maxLength":190},"key":{"description":"The short link slug. If not provided, a random 7-character slug will be generated.","type":"string","maxLength":190},"keyLength":{"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`.","type":"number","minimum":3,"maximum":190},"externalId":{"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. Pass `null` or an empty string to remove it.","example":"123456","nullable":true,"type":"string","maxLength":255},"tenantId":{"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. Pass `null` or an empty string to remove it.","nullable":true,"type":"string","maxLength":255},"prefix":{"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.","type":"string"},"trackConversion":{"description":"Whether to track conversions for the short link. Defaults to `false` if not provided.","type":"boolean"},"archived":{"description":"Whether the short link is archived. Defaults to `false` if not provided.","type":"boolean"},"tagIds":{"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."],"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tagNames":{"description":"The unique name of the tags assigned to the short link (case insensitive).","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"folderId":{"description":"The unique ID existing folder to assign the short link to.","nullable":true,"type":"string"},"comments":{"description":"The comments for the short link.","nullable":true,"type":"string"},"expiresAt":{"description":"The date and time when the short link will expire at.","nullable":true,"type":"string"},"expiredUrl":{"description":"The URL to redirect to when the short link has expired.","maxLength":32000,"nullable":true,"type":"string"},"password":{"description":"The password required to access the destination URL of the short link.","nullable":true,"type":"string"},"proxy":{"description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.","type":"boolean"},"title":{"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","nullable":true,"type":"string"},"description":{"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","nullable":true,"type":"string"},"image":{"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","nullable":true,"type":"string"},"video":{"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","nullable":true,"type":"string"},"rewrite":{"description":"Whether the short link uses link cloaking. Defaults to `false` if not provided.","type":"boolean"},"ios":{"description":"The iOS destination URL for the short link for iOS device targeting.","nullable":true,"type":"string","maxLength":32000},"android":{"description":"The Android destination URL for the short link for Android device targeting.","nullable":true,"type":"string","maxLength":32000},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex","type":"boolean"},"utm_source":{"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_medium":{"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_campaign":{"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_term":{"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.","nullable":true,"type":"string","maxLength":255},"utm_content":{"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.","nullable":true,"type":"string","maxLength":255},"ref":{"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.","nullable":true,"type":"string","maxLength":255},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"publicStats":{"description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true,"type":"boolean"},"tagId":{"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"nullable":true,"type":"string"},"webhookIds":{"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true,"nullable":true,"type":"array","items":{"type":"string"}}},"required":["url"]}}}},"responses":{"200":{"description":"The upserted link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/analytics":{"get":{"operationId":"retrieveAnalytics","x-speakeasy-name-override":"retrieve","summary":"Retrieve analytics for a link, a domain, or the authenticated workspace.","description":"Retrieve analytics for a link, a domain, or the authenticated workspace. The response type depends on the `event` and `type` query parameters.","tags":["Analytics"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"event","schema":{"default":"clicks","description":"The type of event to retrieve analytics for. Defaults to `clicks`.","example":"leads","type":"string","enum":["clicks","leads","sales","composite"]},"description":"The type of event to retrieve analytics for. Defaults to `clicks`."},{"in":"query","name":"groupBy","schema":{"default":"count","description":"The parameter to group the analytics data points by. Defaults to `count` if undefined.","type":"string","enum":["count","timeseries","continents","regions","countries","cities","devices","browsers","os","trigger","triggers","event_names","referers","referer_urls","top_folders","top_link_tags","top_domains","top_links","top_urls","top_base_urls","utm_sources","utm_mediums","utm_campaigns","utm_terms","utm_contents"]},"description":"The parameter to group the analytics data points by. Defaults to `count` if undefined."},{"in":"query","name":"domain","schema":{"description":"The domain to filter analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `dub.co`, `dub.co,google.com`, `-spam.com`.","example":"dub.co","type":"string"},"description":"The domain to filter analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `dub.co`, `dub.co,google.com`, `-spam.com`."},{"in":"query","name":"key","schema":{"description":"The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link.","type":"string"},"description":"The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link."},{"in":"query","name":"linkId","schema":{"description":"The unique ID of the link to retrieve analytics for.Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `link_123`, `link_123,link_456`, `-link_789`.","type":"string"},"description":"The unique ID of the link to retrieve analytics for.Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `link_123`, `link_123,link_456`, `-link_789`."},{"in":"query","name":"externalId","schema":{"description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.","type":"string"},"description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter."},{"in":"query","name":"tenantId","schema":{"description":"The ID of the tenant that created the link inside your system. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tenant_123`, `tenant_123,tenant_456`, `-tenant_789`.","type":"string"},"description":"The ID of the tenant that created the link inside your system. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tenant_123`, `tenant_123,tenant_456`, `-tenant_789`."},{"in":"query","name":"tagId","schema":{"description":"The tag ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tag_123`, `tag_123,tag_456`, `-tag_789`.","type":"string"},"description":"The tag ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tag_123`, `tag_123,tag_456`, `-tag_789`."},{"in":"query","name":"folderId","schema":{"description":"The folder ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `folder_123`, `folder_123,folder_456`, `-folder_789`. If not provided, return analytics for all links.","type":"string"},"description":"The folder ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `folder_123`, `folder_123,folder_456`, `-folder_789`. If not provided, return analytics for all links."},{"in":"query","name":"customerId","schema":{"description":"The ID of the customer to retrieve analytics for.","type":"string"},"description":"The ID of the customer to retrieve analytics for."},{"in":"query","name":"interval","schema":{"description":"The interval to retrieve analytics for. If undefined, defaults to 24h.","type":"string","enum":["24h","7d","30d","90d","1y","mtd","qtd","ytd","all"]},"description":"The interval to retrieve analytics for. If undefined, defaults to 24h."},{"in":"query","name":"start","schema":{"description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`.","type":"string"},"description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`."},{"in":"query","name":"end","schema":{"description":"The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`.","type":"string"},"description":"The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`."},{"in":"query","name":"timezone","schema":{"description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","example":"America/New_York","default":"UTC","type":"string"},"description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."},{"in":"query","name":"country","schema":{"description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code (see https://d.to/geo). Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `US`, `US,BR,FR`, `-US`.","type":"string"},"description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code (see https://d.to/geo). Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `US`, `US,BR,FR`, `-US`."},{"in":"query","name":"city","schema":{"description":"The city to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `New York`, `New York,London`, `-New York`.","type":"string"},"description":"The city to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `New York`, `New York,London`, `-New York`."},{"in":"query","name":"region","schema":{"description":"The ISO 3166-2 region code to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NY`, `NY,CA`, `-NY`.","type":"string"},"description":"The ISO 3166-2 region code to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NY`, `NY,CA`, `-NY`."},{"in":"query","name":"continent","schema":{"description":"The continent to retrieve analytics for. Valid values: AF, AN, AS, EU, NA, OC, SA. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NA`, `NA,EU`, `-AS`.","type":"string"},"description":"The continent to retrieve analytics for. Valid values: AF, AN, AS, EU, NA, OC, SA. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NA`, `NA,EU`, `-AS`."},{"in":"query","name":"device","schema":{"description":"The device to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Desktop`, `Mobile,Tablet`, `-Mobile`.","type":"string"},"description":"The device to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Desktop`, `Mobile,Tablet`, `-Mobile`."},{"in":"query","name":"browser","schema":{"description":"The browser to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Chrome`, `Chrome,Firefox,Safari`, `-IE`.","type":"string"},"description":"The browser to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Chrome`, `Chrome,Firefox,Safari`, `-IE`."},{"in":"query","name":"os","schema":{"description":"The OS to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Windows`, `Mac,Windows,Linux`, `-Windows`.","type":"string"},"description":"The OS to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Windows`, `Mac,Windows,Linux`, `-Windows`."},{"in":"query","name":"trigger","schema":{"description":"The trigger to retrieve analytics for. Valid values: qr, link, pageview. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `qr`, `qr,link`, `-qr`. If undefined, returns all trigger types.","type":"string"},"description":"The trigger to retrieve analytics for. Valid values: qr, link, pageview. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `qr`, `qr,link`, `-qr`. If undefined, returns all trigger types."},{"in":"query","name":"eventName","schema":{"description":"The conversion event name to retrieve analytics for. Only available for lead and sale events. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Sign up`, `Sign up,Purchase`, `-Sign up`.","type":"string"},"description":"The conversion event name to retrieve analytics for. Only available for lead and sale events. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Sign up`, `Sign up,Purchase`, `-Sign up`."},{"in":"query","name":"referer","schema":{"description":"The referer hostname to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google.com`, `google.com,twitter.com`, `-facebook.com`.","type":"string"},"description":"The referer hostname to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google.com`, `google.com,twitter.com`, `-facebook.com`."},{"in":"query","name":"refererUrl","schema":{"description":"The full referer URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://google.com`, `https://google.com,https://twitter.com`, `-https://spam.com`.","type":"string"},"description":"The full referer URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://google.com`, `https://google.com,https://twitter.com`, `-https://spam.com`."},{"in":"query","name":"url","schema":{"description":"The destination URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://example.com`, `https://example.com,https://other.com`, `-https://spam.com`.","type":"string"},"description":"The destination URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://example.com`, `https://example.com,https://other.com`, `-https://spam.com`."},{"in":"query","name":"utm_source","schema":{"description":"The UTM source to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google`, `google,twitter`, `-spam`.","type":"string"},"description":"The UTM source to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google`, `google,twitter`, `-spam`."},{"in":"query","name":"utm_medium","schema":{"description":"The UTM medium to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `cpc`, `cpc,social`, `-email`.","type":"string"},"description":"The UTM medium to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `cpc`, `cpc,social`, `-email`."},{"in":"query","name":"utm_campaign","schema":{"description":"The UTM campaign to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `summer_sale`, `summer_sale,winter_sale`, `-old_campaign`.","type":"string"},"description":"The UTM campaign to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `summer_sale`, `summer_sale,winter_sale`, `-old_campaign`."},{"in":"query","name":"utm_term","schema":{"description":"The UTM term to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`).","type":"string"},"description":"The UTM term to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`)."},{"in":"query","name":"utm_content","schema":{"description":"The UTM content to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`).","type":"string"},"description":"The UTM content to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`)."},{"in":"query","name":"root","schema":{"description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both.","type":"boolean"},"description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both."},{"in":"query","name":"saleType","schema":{"description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.","type":"string","enum":["new","recurring"]},"description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both."},{"in":"query","name":"query","schema":{"description":"Search the events by a custom metadata value. Only available for lead and sale events. Examples: `metadata['key']:'value'`","type":"string","maxLength":10000},"description":"Search the events by a custom metadata value. Only available for lead and sale events. Examples: `metadata['key']:'value'`"},{"in":"query","name":"tagIds","schema":{"description":"Deprecated: Use `tagId` instead. The tag IDs to retrieve analytics for.","deprecated":true,"type":"string"},"description":"Deprecated: Use `tagId` instead. The tag IDs to retrieve analytics for."},{"in":"query","name":"qr","schema":{"description":"Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both.","deprecated":true,"type":"boolean"},"description":"Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."}],"responses":{"200":{"description":"Analytics data","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AnalyticsCount"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTimeseries"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsContinents"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCountries"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsRegions"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCities"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsDevices"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsBrowsers"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsOS"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTriggers"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsEventNames"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsReferers"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsRefererUrls"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTopLinks"}},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTopUrls"}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/events":{"get":{"operationId":"listEvents","x-speakeasy-name-override":"list","summary":"List all events","description":"Retrieve a paginated list of events for the authenticated workspace.","tags":["Events"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"event","schema":{"default":"clicks","description":"The type of event to retrieve analytics for. Defaults to 'clicks'.","type":"string","enum":["clicks","leads","sales"]},"description":"The type of event to retrieve analytics for. Defaults to 'clicks'."},{"in":"query","name":"domain","schema":{"description":"The domain to filter analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `dub.co`, `dub.co,google.com`, `-spam.com`.","example":"dub.co","type":"string"},"description":"The domain to filter analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `dub.co`, `dub.co,google.com`, `-spam.com`."},{"in":"query","name":"key","schema":{"description":"The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link.","type":"string"},"description":"The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link."},{"in":"query","name":"linkId","schema":{"description":"The unique ID of the link to retrieve analytics for.Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `link_123`, `link_123,link_456`, `-link_789`.","type":"string"},"description":"The unique ID of the link to retrieve analytics for.Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `link_123`, `link_123,link_456`, `-link_789`."},{"in":"query","name":"externalId","schema":{"description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.","type":"string"},"description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter."},{"in":"query","name":"tenantId","schema":{"description":"The ID of the tenant that created the link inside your system. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tenant_123`, `tenant_123,tenant_456`, `-tenant_789`.","type":"string"},"description":"The ID of the tenant that created the link inside your system. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tenant_123`, `tenant_123,tenant_456`, `-tenant_789`."},{"in":"query","name":"tagId","schema":{"description":"The tag ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tag_123`, `tag_123,tag_456`, `-tag_789`.","type":"string"},"description":"The tag ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tag_123`, `tag_123,tag_456`, `-tag_789`."},{"in":"query","name":"folderId","schema":{"description":"The folder ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `folder_123`, `folder_123,folder_456`, `-folder_789`. If not provided, return analytics for all links.","type":"string"},"description":"The folder ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `folder_123`, `folder_123,folder_456`, `-folder_789`. If not provided, return analytics for all links."},{"in":"query","name":"customerId","schema":{"description":"The ID of the customer to retrieve analytics for.","type":"string"},"description":"The ID of the customer to retrieve analytics for."},{"in":"query","name":"interval","schema":{"description":"The interval to retrieve analytics for. If undefined, defaults to 24h.","type":"string","enum":["24h","7d","30d","90d","1y","mtd","qtd","ytd","all"]},"description":"The interval to retrieve analytics for. If undefined, defaults to 24h."},{"in":"query","name":"start","schema":{"description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`.","type":"string"},"description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`."},{"in":"query","name":"end","schema":{"description":"The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`.","type":"string"},"description":"The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`."},{"in":"query","name":"timezone","schema":{"description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","example":"America/New_York","default":"UTC","type":"string"},"description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."},{"in":"query","name":"country","schema":{"description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code (see https://d.to/geo). Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `US`, `US,BR,FR`, `-US`.","type":"string"},"description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code (see https://d.to/geo). Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `US`, `US,BR,FR`, `-US`."},{"in":"query","name":"city","schema":{"description":"The city to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `New York`, `New York,London`, `-New York`.","type":"string"},"description":"The city to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `New York`, `New York,London`, `-New York`."},{"in":"query","name":"region","schema":{"description":"The ISO 3166-2 region code to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NY`, `NY,CA`, `-NY`.","type":"string"},"description":"The ISO 3166-2 region code to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NY`, `NY,CA`, `-NY`."},{"in":"query","name":"continent","schema":{"description":"The continent to retrieve analytics for. Valid values: AF, AN, AS, EU, NA, OC, SA. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NA`, `NA,EU`, `-AS`.","type":"string"},"description":"The continent to retrieve analytics for. Valid values: AF, AN, AS, EU, NA, OC, SA. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NA`, `NA,EU`, `-AS`."},{"in":"query","name":"device","schema":{"description":"The device to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Desktop`, `Mobile,Tablet`, `-Mobile`.","type":"string"},"description":"The device to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Desktop`, `Mobile,Tablet`, `-Mobile`."},{"in":"query","name":"browser","schema":{"description":"The browser to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Chrome`, `Chrome,Firefox,Safari`, `-IE`.","type":"string"},"description":"The browser to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Chrome`, `Chrome,Firefox,Safari`, `-IE`."},{"in":"query","name":"os","schema":{"description":"The OS to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Windows`, `Mac,Windows,Linux`, `-Windows`.","type":"string"},"description":"The OS to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Windows`, `Mac,Windows,Linux`, `-Windows`."},{"in":"query","name":"trigger","schema":{"description":"The trigger to retrieve analytics for. Valid values: qr, link, pageview. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `qr`, `qr,link`, `-qr`. If undefined, returns all trigger types.","type":"string"},"description":"The trigger to retrieve analytics for. Valid values: qr, link, pageview. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `qr`, `qr,link`, `-qr`. If undefined, returns all trigger types."},{"in":"query","name":"eventName","schema":{"description":"The conversion event name to retrieve analytics for. Only available for lead and sale events. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Sign up`, `Sign up,Purchase`, `-Sign up`.","type":"string"},"description":"The conversion event name to retrieve analytics for. Only available for lead and sale events. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Sign up`, `Sign up,Purchase`, `-Sign up`."},{"in":"query","name":"referer","schema":{"description":"The referer hostname to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google.com`, `google.com,twitter.com`, `-facebook.com`.","type":"string"},"description":"The referer hostname to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google.com`, `google.com,twitter.com`, `-facebook.com`."},{"in":"query","name":"refererUrl","schema":{"description":"The full referer URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://google.com`, `https://google.com,https://twitter.com`, `-https://spam.com`.","type":"string"},"description":"The full referer URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://google.com`, `https://google.com,https://twitter.com`, `-https://spam.com`."},{"in":"query","name":"url","schema":{"description":"The destination URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://example.com`, `https://example.com,https://other.com`, `-https://spam.com`.","type":"string"},"description":"The destination URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://example.com`, `https://example.com,https://other.com`, `-https://spam.com`."},{"in":"query","name":"utm_source","schema":{"description":"The UTM source to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google`, `google,twitter`, `-spam`.","type":"string"},"description":"The UTM source to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google`, `google,twitter`, `-spam`."},{"in":"query","name":"utm_medium","schema":{"description":"The UTM medium to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `cpc`, `cpc,social`, `-email`.","type":"string"},"description":"The UTM medium to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `cpc`, `cpc,social`, `-email`."},{"in":"query","name":"utm_campaign","schema":{"description":"The UTM campaign to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `summer_sale`, `summer_sale,winter_sale`, `-old_campaign`.","type":"string"},"description":"The UTM campaign to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `summer_sale`, `summer_sale,winter_sale`, `-old_campaign`."},{"in":"query","name":"utm_term","schema":{"description":"The UTM term to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`).","type":"string"},"description":"The UTM term to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`)."},{"in":"query","name":"utm_content","schema":{"description":"The UTM content to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`).","type":"string"},"description":"The UTM content to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`)."},{"in":"query","name":"root","schema":{"description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both.","type":"boolean"},"description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both."},{"in":"query","name":"saleType","schema":{"description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.","type":"string","enum":["new","recurring"]},"description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both."},{"in":"query","name":"query","schema":{"description":"Search the events by a custom metadata value. Only available for lead and sale events. Examples: `metadata['key']:'value'`","type":"string","maxLength":10000},"description":"Search the events by a custom metadata value. Only available for lead and sale events. Examples: `metadata['key']:'value'`"},{"in":"query","name":"tagIds","schema":{"description":"Deprecated: Use `tagId` instead. The tag IDs to retrieve analytics for.","deprecated":true,"type":"string"},"description":"Deprecated: Use `tagId` instead. The tag IDs to retrieve analytics for."},{"in":"query","name":"qr","schema":{"description":"Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both.","deprecated":true,"type":"boolean"},"description":"Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."},{"in":"query","name":"page","schema":{"default":1,"description":"The page number for pagination. The first page is `1`.","example":1,"deprecated":false,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991}},{"in":"query","name":"limit","schema":{"default":100,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":1000},"description":"The number of items per page."},{"in":"query","name":"sortOrder","schema":{"description":"The sort order. The default is `desc`.","default":"desc","type":"string","enum":["asc","desc"]},"description":"The sort order. The default is `desc`."},{"in":"query","name":"sortBy","schema":{"default":"timestamp","description":"The field to sort the events by. The default is `timestamp`.","type":"string","enum":["timestamp"]},"description":"The field to sort the events by. The default is `timestamp`."},{"in":"query","name":"order","schema":{"description":"DEPRECATED. Use `sortOrder` instead.","deprecated":true,"default":"desc","type":"string","enum":["asc","desc"]},"description":"DEPRECATED. Use `sortOrder` instead."}],"responses":{"200":{"description":"A list of events","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"event":{"type":"string","enum":["click"]},"timestamp":{"type":"string"},"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"],"additionalProperties":false},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"],"additionalProperties":false},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"],"additionalProperties":false},"click_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.id` instead."},"link_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.id` instead."},"domain":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.domain` instead."},"key":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.key` instead."},"url":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.url` instead."},"continent":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.continent` instead."},"country":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.country` instead."},"city":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.city` instead."},"device":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.device` instead."},"browser":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.browser` instead."},"os":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.os` instead."},"qr":{"type":"number","deprecated":true,"description":"Deprecated: Use `click.qr` instead."},"ip":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.ip` instead."}},"required":["event","timestamp","click","link","click_id","link_id","domain","key","url","continent","country","city","device","browser","os","qr","ip"],"additionalProperties":false,"title":"ClickEvent"},{"type":"object","properties":{"event":{"type":"string","enum":["lead"]},"timestamp":{"type":"string"},"eventId":{"type":"string"},"eventName":{"type":"string"},"metadata":{"nullable":true},"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"],"additionalProperties":false},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"],"additionalProperties":false},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"}},"required":["id","externalId","createdAt"],"additionalProperties":false},"click_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.id` instead."},"link_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.id` instead."},"domain":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.domain` instead."},"key":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.key` instead."},"url":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.url` instead."},"continent":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.continent` instead."},"country":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.country` instead."},"city":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.city` instead."},"device":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.device` instead."},"browser":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.browser` instead."},"os":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.os` instead."},"qr":{"type":"number","deprecated":true,"description":"Deprecated: Use `click.qr` instead."},"ip":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.ip` instead."}},"required":["event","timestamp","eventId","eventName","click","link","customer","click_id","link_id","domain","key","url","continent","country","city","device","browser","os","qr","ip"],"additionalProperties":false,"title":"LeadEvent"},{"type":"object","properties":{"event":{"type":"string","enum":["sale"]},"timestamp":{"type":"string"},"eventId":{"type":"string"},"eventName":{"type":"string"},"sale":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1580` JPY). Learn more: https://d.to/currency"},"invoiceId":{"default":null,"description":"The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.","nullable":true,"type":"string"},"paymentProcessor":{"default":"custom","description":"The payment processor via which the sale was made.","type":"string","enum":["stripe","shopify","polar","paddle","apple","revenuecat","lemonsqueezy","dub","custom"]},"currency":{"description":"The currency of the sale. Accepts ISO 4217 currency codes. Sales will be automatically converted and stored as USD at the latest exchange rates. Learn more: https://d.to/currency"}},"required":["amount","invoiceId","paymentProcessor","currency"],"additionalProperties":false},"metadata":{"nullable":true},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"],"additionalProperties":false},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"],"additionalProperties":false},"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"}},"required":["id","externalId","createdAt"],"additionalProperties":false},"saleAmount":{"description":"Deprecated: Use `sale.amount` instead.","deprecated":true,"type":"number"},"invoice_id":{"type":"string","description":"Deprecated: Use `sale.invoiceId` instead.","deprecated":true},"payment_processor":{"type":"string","description":"Deprecated: Use `sale.paymentProcessor` instead.","deprecated":true},"click_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.id` instead."},"link_id":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.id` instead."},"domain":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.domain` instead."},"key":{"type":"string","deprecated":true,"description":"Deprecated: Use `link.key` instead."},"url":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.url` instead."},"continent":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.continent` instead."},"country":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.country` instead."},"city":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.city` instead."},"device":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.device` instead."},"browser":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.browser` instead."},"os":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.os` instead."},"qr":{"type":"number","deprecated":true,"description":"Deprecated: Use `click.qr` instead."},"ip":{"type":"string","deprecated":true,"description":"Deprecated: Use `click.ip` instead."}},"required":["event","timestamp","eventId","eventName","sale","link","click","customer","saleAmount","invoice_id","payment_processor","click_id","link_id","domain","key","url","continent","country","city","device","browser","os","qr","ip"],"additionalProperties":false,"title":"SaleEvent"}],"type":"object"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/tags":{"post":{"operationId":"createTag","x-speakeasy-name-override":"create","summary":"Create a tag","description":"Create a tag for the authenticated workspace.","tags":["Tags"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":190,"description":"The name of the tag to create."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","gray","pink"],"description":"The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, brown, gray."},"tag":{"type":"string","minLength":1,"maxLength":190,"description":"The name of the tag to create.","deprecated":true}}}}}},"responses":{"201":{"description":"The created tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"get":{"operationId":"getTags","x-speakeasy-name-override":"list","summary":"List all tags","description":"Retrieve a paginated list of tags for the authenticated workspace.","tags":["Tags"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"sortBy","schema":{"default":"name","description":"The field to sort the tags by.","type":"string","enum":["name","createdAt"]},"description":"The field to sort the tags by."},{"in":"query","name":"sortOrder","schema":{"default":"asc","description":"The order to sort the tags by.","type":"string","enum":["asc","desc"]},"description":"The order to sort the tags by."},{"in":"query","name":"search","schema":{"description":"The search term to filter the tags by.","type":"string"},"description":"The search term to filter the tags by."},{"in":"query","name":"ids","schema":{"description":"IDs of tags to filter by.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"IDs of tags to filter by."},{"in":"query","name":"page","schema":{"description":"The page number for pagination. The first page is `1`.","example":1,"deprecated":false,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"description":"The page number for pagination. The first page is `1`."},{"in":"query","name":"pageSize","schema":{"default":100,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":100},"description":"The number of items per page."}],"responses":{"200":{"description":"A list of tags","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/tags/{id}":{"patch":{"operationId":"updateTag","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a tag","description":"Update a tag in the workspace.","tags":["Tags"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The ID of the tag to update."},"required":true,"description":"The ID of the tag to update."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":190,"description":"The name of the tag to create."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","gray","pink"],"description":"The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, brown, gray."},"tag":{"type":"string","minLength":1,"maxLength":190,"description":"The name of the tag to create.","deprecated":true}}}}}},"responses":{"200":{"description":"The updated tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"deleteTag","x-speakeasy-name-override":"delete","x-speakeasy-max-method-params":1,"summary":"Delete a tag","description":"Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag.","tags":["Tags"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The ID of the tag to delete."},"required":true,"description":"The ID of the tag to delete."}],"responses":{"200":{"description":"The deleted tag ID.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the deleted tag."}},"required":["id"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/folders":{"post":{"operationId":"createFolder","x-speakeasy-name-override":"create","summary":"Create a folder","description":"Create a folder for the authenticated workspace.","tags":["Folders"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":190,"description":"The name of the folder."},"description":{"description":"The description of the folder.","nullable":true,"type":"string","maxLength":500},"accessLevel":{"default":"write","description":"The workspace-level access level settings for the folder. Default is `write` which allows full access to the folder for all team members. The other options are `read` (view-only access) and `null` (no access) and are only available on Business plans and above.","nullable":true,"type":"string","enum":["write","read"]}},"required":["name"]}}}},"responses":{"201":{"description":"The created folder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"get":{"operationId":"listFolders","x-speakeasy-name-override":"list","summary":"List all folders","description":"Retrieve a paginated list of folders for the authenticated workspace.","tags":["Folders"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"search","schema":{"description":"The search term to filter the folders by.","type":"string"},"description":"The search term to filter the folders by."},{"in":"query","name":"page","schema":{"description":"The page number for pagination. The first page is `1`.","example":1,"deprecated":false,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"description":"The page number for pagination. The first page is `1`."},{"in":"query","name":"pageSize","schema":{"default":50,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":50},"description":"The number of items per page."}],"responses":{"200":{"description":"A list of folders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FolderSchema"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/folders/{id}":{"patch":{"operationId":"updateFolder","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a folder","description":"Update a folder in the workspace.","tags":["Folders"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The ID of the folder to update."},"required":true,"description":"The ID of the folder to update."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":190,"description":"The name of the folder."},"description":{"description":"The description of the folder.","nullable":true,"type":"string","maxLength":500},"accessLevel":{"description":"The access level of the folder within the workspace.","nullable":true,"type":"string","enum":["write","read"]}}}}}},"responses":{"200":{"description":"The updated folder.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"deleteFolder","x-speakeasy-name-override":"delete","x-speakeasy-max-method-params":1,"summary":"Delete a folder","description":"Delete a folder from the workspace. All existing links will still work, but they will no longer be associated with this folder.","tags":["Folders"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The ID of the folder to delete."},"required":true,"description":"The ID of the folder to delete."}],"responses":{"200":{"description":"The deleted folder ID.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the deleted folder."}},"required":["id"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/domains":{"post":{"operationId":"createDomain","x-speakeasy-name-override":"create","summary":"Create a domain","description":"Create a domain for the authenticated workspace.","tags":["Domains"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":190,"description":"Name of the domain.","example":"acme.com"},"expiredUrl":{"description":"Redirect users to a specific URL when any link under this domain has expired.","example":"https://acme.com/expired","nullable":true,"type":"string","maxLength":32000},"notFoundUrl":{"description":"Redirect users to a specific URL when a link under this domain doesn't exist.","example":"https://acme.com/not-found","nullable":true,"type":"string","maxLength":32000},"archived":{"default":false,"description":"Whether to archive this domain. `false` will unarchive a previously archived domain.","example":false,"type":"boolean"},"placeholder":{"description":"Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.","example":"https://dub.co/help/article/dub-links","nullable":true,"type":"string","maxLength":100},"logo":{"description":"The logo of the domain.","nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp|avif);base64,"},{"type":"string","format":"uri"},{"type":"string","format":"uri"}]},"assetLinks":{"description":"assetLinks.json configuration file (for deep link support on Android).","nullable":true,"type":"string"},"appleAppSiteAssociation":{"description":"apple-app-site-association configuration file (for deep link support on iOS).","nullable":true,"type":"string"}},"required":["slug"]}}}},"responses":{"201":{"description":"The domain was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"get":{"operationId":"listDomains","x-speakeasy-name-override":"list","x-speakeasy-pagination":{"type":"offsetLimit","inputs":[{"name":"page","in":"parameters","type":"page"},{"name":"pageSize","in":"parameters","type":"limit"}],"outputs":{"results":"$"}},"summary":"List all domains","description":"Retrieve a paginated list of domains for the authenticated workspace.","tags":["Domains"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"archived","schema":{"default":false,"description":"Whether to include archived domains in the response. Defaults to `false` if not provided.","type":"boolean"},"description":"Whether to include archived domains in the response. Defaults to `false` if not provided."},{"in":"query","name":"search","schema":{"description":"The search term to filter the domains by.","type":"string"},"description":"The search term to filter the domains by."},{"in":"query","name":"page","schema":{"description":"The page number for pagination. The first page is `1`.","example":1,"deprecated":false,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"description":"The page number for pagination. The first page is `1`."},{"in":"query","name":"pageSize","schema":{"default":50,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":50},"description":"The number of items per page."}],"responses":{"200":{"description":"The domains were retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainSchema"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/domains/{slug}":{"patch":{"operationId":"updateDomain","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a domain","description":"Update a domain for the authenticated workspace.","tags":["Domains"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"slug","schema":{"type":"string","description":"The domain name.","example":"acme.com"},"required":true,"description":"The domain name."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":190,"description":"Name of the domain.","example":"acme.com"},"expiredUrl":{"description":"Redirect users to a specific URL when any link under this domain has expired.","example":"https://acme.com/expired","nullable":true,"type":"string","maxLength":32000},"notFoundUrl":{"description":"Redirect users to a specific URL when a link under this domain doesn't exist.","example":"https://acme.com/not-found","nullable":true,"type":"string","maxLength":32000},"archived":{"default":false,"description":"Whether to archive this domain. `false` will unarchive a previously archived domain.","example":false,"type":"boolean"},"placeholder":{"description":"Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.","example":"https://dub.co/help/article/dub-links","nullable":true,"type":"string","maxLength":100},"logo":{"description":"The logo of the domain.","nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp|avif);base64,"},{"type":"string","format":"uri"},{"type":"string","format":"uri"}]},"assetLinks":{"description":"assetLinks.json configuration file (for deep link support on Android).","nullable":true,"type":"string"},"appleAppSiteAssociation":{"description":"apple-app-site-association configuration file (for deep link support on iOS).","nullable":true,"type":"string"}}}}}},"responses":{"200":{"description":"The domain was updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainSchema"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"deleteDomain","x-speakeasy-name-override":"delete","x-speakeasy-max-method-params":1,"summary":"Delete a domain","description":"Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain.","tags":["Domains"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"slug","schema":{"type":"string","description":"The domain name.","example":"acme.com"},"required":true,"description":"The domain name."}],"responses":{"200":{"description":"The domain was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"The domain name.","example":"acme.com"}},"required":["slug"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/domains/register":{"post":{"operationId":"registerDomain","x-speakeasy-name-override":"register","summary":"Register a domain","description":"Register a domain for the authenticated workspace. Only available for Enterprise Plans.","tags":["Domains"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"description":"The domain to claim. We only support .link domains for now.","example":"acme.link","type":"string","minLength":1,"pattern":".*\\.link$"}},"required":["domain"]}}}},"responses":{"201":{"description":"The domain was registered.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name."},"status":{"type":"string","description":"The status of the domain registration."},"expiration":{"nullable":true,"type":"number","description":"The expiration timestamp of the domain (Unix timestamp in milliseconds)."}},"required":["domain","status","expiration"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/domains/status":{"get":{"operationId":"checkDomainStatus","x-speakeasy-name-override":"checkStatus","summary":"Check the availability of one or more domains","description":"Check if a domain name is available for purchase. You can check multiple domains at once.","tags":["Domains"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"domains","schema":{"description":"The domains to search. We only support .link domains for now.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false,"required":true,"description":"The domains to search. We only support .link domains for now."}],"responses":{"200":{"description":"The domain status was retrieved.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name."},"available":{"type":"boolean","description":"Whether the domain is available."},"premium":{"nullable":true,"description":"Whether the domain is a premium domain.","type":"boolean"},"prices":{"nullable":true,"description":"Price details for the domain. Will be null if the domain is not available.","type":"object","properties":{"registration":{"nullable":true,"description":"The domain's registration price in USD cents.","type":"number"},"renewal":{"nullable":true,"description":"The domain's renewal price in USD cents.","type":"number"}},"required":["registration","renewal"],"additionalProperties":false},"price":{"nullable":true,"description":"Deprecated: Use `prices` instead.","deprecated":true,"type":"string"}},"required":["domain","available","premium","prices","price"],"additionalProperties":false}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/track/lead":{"post":{"operationId":"trackLead","x-speakeasy-name-override":"lead","summary":"Track a lead","description":"Track a lead for a short link.","tags":["Track"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clickId":{"type":"string","description":"The unique ID of the click that the lead conversion event is attributed to. You can read this value from `dub_id` cookie. [For deferred lead tracking]: If an empty string is provided, Dub will try to find an existing customer with the provided `customerExternalId` and use the `clickId` from the customer if found."},"eventName":{"type":"string","minLength":1,"maxLength":255,"description":"The name of the lead event to track. Can also be used as a unique identifier to associate a given lead event for a customer for a subsequent sale event (via the `leadEventName` prop in `/track/sale`).","example":"Sign up"},"customerExternalId":{"type":"string","minLength":1,"maxLength":100,"description":"The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer."},"customerName":{"default":null,"description":"The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).","nullable":true,"type":"string","maxLength":100},"customerEmail":{"default":null,"description":"The email address of the customer.","nullable":true,"type":"string","maxLength":100,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"customerAvatar":{"default":null,"description":"The avatar URL of the customer.","nullable":true,"type":"string"},"mode":{"default":"async","description":"The mode to use for tracking the lead event. `async` will not block the request; `wait` will block the request until the lead event is fully recorded in Dub; `deferred` will defer the lead event creation to a subsequent request.","type":"string","enum":["async","wait","deferred"]},"eventQuantity":{"description":"The numerical value associated with this lead event (e.g., number of provisioned seats in a free trial). If defined as N, the lead event will be tracked N times.","nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":100},"metadata":{"description":"Additional metadata to be stored with the lead event. Max 10,000 characters.","default":null,"nullable":true,"type":"object","additionalProperties":{}}},"required":["clickId","eventName","customerExternalId"]}}}},"responses":{"200":{"description":"A lead was tracked.","content":{"application/json":{"schema":{"type":"object","properties":{"click":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false},"link":{"nullable":true,"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"url":{"type":"string","description":"The destination URL of the short link."},"tenantId":{"nullable":true,"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.","type":"string"},"externalId":{"nullable":true,"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.","type":"string"}},"required":["id","domain","key","shortLink","url","tenantId","externalId"],"additionalProperties":false},"customer":{"type":"object","properties":{"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"avatar":{"nullable":true,"type":"string"},"externalId":{"nullable":true,"type":"string"}},"required":["name","email","avatar","externalId"],"additionalProperties":false}},"required":["click","link","customer"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/track/sale":{"post":{"operationId":"trackSale","x-speakeasy-name-override":"sale","summary":"Track a sale","description":"Track a sale for a short link.","tags":["Track"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customerExternalId":{"type":"string","minLength":1,"maxLength":100,"description":"The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer."},"amount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1580` JPY). Learn more: https://d.to/currency"},"currency":{"description":"The currency of the sale. Accepts ISO 4217 currency codes. Sales will be automatically converted and stored as USD at the latest exchange rates. Learn more: https://d.to/currency","default":"usd","type":"string"},"eventName":{"default":"Purchase","description":"The name of the sale event. Recommended format: `Invoice paid` or `Subscription created`.","example":"Invoice paid","type":"string","maxLength":255},"paymentProcessor":{"default":"custom","description":"The payment processor via which the sale was made.","type":"string","enum":["stripe","shopify","polar","paddle","apple","revenuecat","lemonsqueezy","dub","custom"]},"invoiceId":{"default":null,"description":"The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.","nullable":true,"type":"string"},"metadata":{"description":"Additional metadata to be stored with the sale event. Max 10,000 characters when stringified.","default":null,"nullable":true,"type":"object","additionalProperties":{}},"leadEventName":{"default":null,"description":"The name of the lead event that occurred before the sale (case-sensitive). This is used to associate the sale event with a particular lead event (instead of the latest lead event for a link-customer combination, which is the default behavior). For direct sale tracking, this field can also be used to specify the lead event name.","example":"Cloned template 1481267","nullable":true,"type":"string"},"clickId":{"description":"[For direct sale tracking]: The unique ID of the click that the sale conversion event is attributed to. You can read this value from `dub_id` cookie.","nullable":true,"type":"string"},"customerName":{"default":null,"description":"[For direct sale tracking]: The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”).","nullable":true,"type":"string","maxLength":100},"customerEmail":{"default":null,"description":"[For direct sale tracking]: The email address of the customer.","nullable":true,"type":"string","maxLength":100,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"customerAvatar":{"default":null,"description":"[For direct sale tracking]: The avatar URL of the customer.","nullable":true,"type":"string"}},"required":["customerExternalId","amount"]}}}},"responses":{"200":{"description":"A sale was tracked.","content":{"application/json":{"schema":{"type":"object","properties":{"eventName":{"type":"string"},"customer":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"avatar":{"nullable":true,"type":"string"},"externalId":{"nullable":true,"type":"string"}},"required":["id","name","email","avatar","externalId"],"additionalProperties":false},"sale":{"nullable":true,"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"paymentProcessor":{"type":"string"},"invoiceId":{"nullable":true,"type":"string"},"metadata":{"nullable":true,"type":"object","additionalProperties":{}}},"required":["amount","currency","paymentProcessor","invoiceId","metadata"],"additionalProperties":false}},"required":["eventName","customer","sale"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/track/open":{"post":{"operationId":"trackOpen","x-speakeasy-ignore":true,"summary":"Track a deep link open event","description":"This endpoint is used to track when a user opens your app via a Dub-powered deep link (for both iOS and Android).","tags":["Track"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"deepLink":{"description":"The deep link that brought the user to the app. If left blank, Dub will fallback to probabilistic tracking by using the `dubDomain` parameter to check if there is an associated click event for the user's IP address. Learn more: https://d.to/ddl","type":"string","maxLength":32000},"dubDomain":{"description":"Your deep link custom domain on Dub (e.g. `acme.link`). This is used in probabilistic tracking to check if there is an associated click event for the user's IP address. Learn more: https://d.to/ddl","type":"string"}}}}}},"responses":{"200":{"description":"The response from the tracked open event.","content":{"application/json":{"schema":{"type":"object","properties":{"clickId":{"nullable":true,"description":"The click ID of the associated open event (or the prior click that led the user to the app store for probabilistic tracking). Learn more: https://d.to/ddl","type":"string"},"link":{"nullable":true,"description":"The deep link that brought the user to the app. This will be `null` if the open event was not associated with a link (e.g. a direct download from the app store). Learn more: https://d.to/ddl","type":"object","properties":{"id":{"type":"string","description":"The ID of the deep link.","example":"link_xxx"},"domain":{"type":"string","description":"The domain of the deep link.","example":"acme.link"},"key":{"type":"string","description":"The key of the deep link.","example":"fb-promo"},"url":{"type":"string","description":"The URL of the deep link.","example":"https://acme.com/product/123"}},"required":["id","domain","key","url"],"additionalProperties":false}},"required":["clickId","link"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/customers":{"get":{"operationId":"getCustomers","x-speakeasy-name-override":"list","x-speakeasy-pagination":{"type":"cursor","inputs":[{"name":"startingAfter","in":"parameters","type":"cursor"}],"outputs":{"nextCursor":"$[-1].id"}},"summary":"List all customers","description":"Retrieve a paginated list of customers for the authenticated workspace.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"email","schema":{"description":"A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`.","type":"string"},"description":"A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`."},{"in":"query","name":"externalId","schema":{"description":"A case-sensitive filter on the list based on the customer's `externalId` field. The value must be a string. Takes precedence over `search`.","type":"string"},"description":"A case-sensitive filter on the list based on the customer's `externalId` field. The value must be a string. Takes precedence over `search`."},{"in":"query","name":"search","schema":{"description":"A search query to filter customers by email, name, or customer ID (`cus_...`). If `email` or `externalId` is provided, this will be ignored.","type":"string"},"description":"A search query to filter customers by email, name, or customer ID (`cus_...`). If `email` or `externalId` is provided, this will be ignored."},{"in":"query","name":"country","schema":{"description":"A filter on the list based on the customer's `country` field.","type":"string"},"description":"A filter on the list based on the customer's `country` field."},{"in":"query","name":"linkId","schema":{"description":"A filter on the list based on the customer's `linkId` field (the referral link ID).","type":"string"},"description":"A filter on the list based on the customer's `linkId` field (the referral link ID)."},{"in":"query","name":"includeExpandedFields","schema":{"description":"Whether to include expanded fields on the customer (`link`).","type":"boolean"},"description":"Whether to include expanded fields on the customer (`link`)."},{"in":"query","name":"sortBy","schema":{"default":"createdAt","description":"The field to sort the customers by. The default is `createdAt`.","type":"string","enum":["createdAt","saleAmount","firstSaleAt","subscriptionCanceledAt"]},"description":"The field to sort the customers by. The default is `createdAt`."},{"in":"query","name":"sortOrder","schema":{"default":"desc","description":"The sort order. The default is `desc`.","type":"string","enum":["asc","desc"]},"description":"The sort order. The default is `desc`."},{"in":"query","name":"endingBefore","schema":{"description":"If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`.","example":"cus_1KAP4CDPBSVMMBMH9XX3YZZ0Z","type":"string"},"description":"If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`."},{"in":"query","name":"startingAfter","schema":{"description":"If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`.","example":"cus_1KAP4CDPBSVMMBMH9XX3YZZ0Z","type":"string"},"description":"If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`."},{"in":"query","name":"page","schema":{"description":"DEPRECATED. Use `startingAfter` instead.","example":1,"deprecated":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"description":"DEPRECATED. Use `startingAfter` instead."},{"in":"query","name":"pageSize","schema":{"default":100,"description":"The number of items per page.","example":50,"type":"integer","exclusiveMinimum":true,"maximum":100},"description":"The number of items per page."}],"responses":{"200":{"description":"The list of customers.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"},"link":{"nullable":true,"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"url":{"type":"string","description":"The destination URL of the short link."}},"required":["id","domain","key","shortLink","url"],"additionalProperties":false}},"required":["id","externalId","createdAt"],"additionalProperties":false}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/customers/{id}":{"get":{"operationId":"getCustomer","x-speakeasy-name-override":"get","summary":"Retrieve a customer","description":"Retrieve a customer by ID for the authenticated workspace. To retrieve a customer by external ID, prefix the ID with `ext_`.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"required":true,"description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},{"in":"query","name":"includeExpandedFields","schema":{"description":"Whether to include expanded fields on the customer (`link`).","type":"boolean"},"description":"Whether to include expanded fields on the customer (`link`)."}],"responses":{"200":{"description":"The customer object.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"},"link":{"nullable":true,"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"url":{"type":"string","description":"The destination URL of the short link."}},"required":["id","domain","key","shortLink","url"],"additionalProperties":false}},"required":["id","externalId","createdAt"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"patch":{"operationId":"updateCustomer","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a customer","description":"Update a customer for the authenticated workspace.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"required":true,"description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},{"in":"query","name":"includeExpandedFields","schema":{"description":"Whether to include expanded fields on the customer (`link`).","type":"boolean"},"description":"Whether to include expanded fields on the customer (`link`)."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"description":"The customer's email address.","nullable":true,"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"description":"The customer's name. If not provided, the email address will be used, and if email is not provided, a random name will be generated.","nullable":true,"type":"string"},"avatar":{"description":"The customer's avatar URL. If not provided, a random avatar will be generated.","nullable":true,"type":"string","format":"uri"},"externalId":{"type":"string","description":"The customer's unique identifier your database. This is useful for associating subsequent conversion events from Dub's API to your internal systems."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"type":"string","description":"The customer's country in ISO 3166-1 alpha-2 format. Updating this field will only affect the customer's country in Dub's system (and has no effect on existing conversion events)."},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Set to a timestamp to mark the subscription as canceled, or `null` to clear it (e.g. if they resubscribe).","nullable":true,"type":"string"}}}}}},"responses":{"200":{"description":"The customer was updated.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"},"link":{"nullable":true,"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"url":{"type":"string","description":"The destination URL of the short link."}},"required":["id","domain","key","shortLink","url"],"additionalProperties":false}},"required":["id","externalId","createdAt"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}},"delete":{"operationId":"deleteCustomer","x-speakeasy-name-override":"delete","x-speakeasy-max-method-params":1,"summary":"Delete a customer","description":"Delete a customer from a workspace.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"required":true,"description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."}],"responses":{"200":{"description":"The customer was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."}},"required":["id"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}},"/qr":{"get":{"operationId":"getQRCode","x-speakeasy-name-override":"get","summary":"Retrieve a QR code","description":"Retrieve a QR code for a link.","tags":["QR Codes"],"parameters":[{"in":"query","name":"url","schema":{"description":"The URL to generate a QR code for.","type":"string","maxLength":32000},"required":true,"description":"The URL to generate a QR code for."},{"in":"query","name":"logo","schema":{"description":"The logo to include in the QR code. Can only be used with a paid plan on Dub.","type":"string"},"description":"The logo to include in the QR code. Can only be used with a paid plan on Dub."},{"in":"query","name":"size","schema":{"default":600,"description":"The size of the QR code in pixels. Defaults to `600` if not provided.","type":"number"},"description":"The size of the QR code in pixels. Defaults to `600` if not provided."},{"in":"query","name":"level","schema":{"default":"L","description":"The level of error correction to use for the QR code. Defaults to `L` if not provided.","type":"string","enum":["L","M","Q","H"]},"description":"The level of error correction to use for the QR code. Defaults to `L` if not provided."},{"in":"query","name":"fgColor","schema":{"default":"#000000","description":"The foreground color of the QR code in hex format. Defaults to `#000000` if not provided.","type":"string"},"description":"The foreground color of the QR code in hex format. Defaults to `#000000` if not provided."},{"in":"query","name":"bgColor","schema":{"description":"The background color of the QR code in hex format. Defaults to `#ffffff` for `png`. When omitted for `svg`, the background is transparent.","type":"string"},"description":"The background color of the QR code in hex format. Defaults to `#ffffff` for `png`. When omitted for `svg`, the background is transparent."},{"in":"query","name":"hideLogo","schema":{"default":false,"description":"Whether to hide the logo in the QR code. Can only be used with a paid plan on Dub.","type":"boolean"},"description":"Whether to hide the logo in the QR code. Can only be used with a paid plan on Dub."},{"in":"query","name":"margin","schema":{"default":2,"description":"The size of the margin around the QR code. Defaults to 2 if not provided.","type":"number"},"description":"The size of the margin around the QR code. Defaults to 2 if not provided."},{"in":"query","name":"includeMargin","schema":{"default":true,"description":"DEPRECATED: Margin is included by default. Use the `margin` prop to customize the margin size.","deprecated":true,"type":"boolean"},"description":"DEPRECATED: Margin is included by default. Use the `margin` prop to customize the margin size."},{"in":"query","name":"format","schema":{"default":"png","description":"The format of the QR code. Defaults to `png` if not provided.","type":"string","enum":["png","svg"]},"description":"The format of the QR code. Defaults to `png` if not provided."}],"responses":{"200":{"description":"The QR code","content":{"image/png":{"schema":{"type":"string"}},"image/svg+xml":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"410":{"$ref":"#/components/responses/410"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}},"components":{"schemas":{"linkGeoTargeting":{"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","nullable":true,"type":"object","additionalProperties":{"type":"string","maxLength":32000}},"LinkWebhookEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"anyOf":[{"type":"string","enum":["link.created"]},{"type":"string","enum":["link.updated"]},{"type":"string","enum":["link.deleted"]}]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchema"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a link is created, updated, or deleted."},"LinkClickedEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["link.clicked"]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"]},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchema"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"]}},"required":["click","link"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a link is clicked."},"LeadCreatedEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["lead.created"]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"eventName":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"}},"required":["id","externalId","createdAt"]},"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"]},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchema"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"]},"metadata":{"default":null,"nullable":true,"type":"object","additionalProperties":{}}},"required":["eventName","customer","click","link","metadata"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a lead is created."},"SaleCreatedEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["sale.created"]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"eventName":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."},"name":{"description":"Name of the customer.","nullable":true,"type":"string"},"email":{"description":"Email of the customer.","nullable":true,"type":"string"},"avatar":{"description":"Avatar URL of the customer.","nullable":true,"type":"string"},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"stripeCustomerId":{"description":"The customer's Stripe customer ID. This is useful for attributing recurring sale events to the customer.","nullable":true,"type":"string"},"country":{"description":"Country of the customer.","nullable":true,"type":"string"},"sales":{"description":"Total number of sales for the customer.","nullable":true,"type":"number"},"saleAmount":{"description":"Total amount of sales for the customer.","nullable":true,"type":"number"},"createdAt":{"description":"The date the customer was created (usually the signup date or trial start date).","type":"string"},"firstSaleAt":{"description":"The date the customer made their first sale. Useful for calculating the time to first sale and LTV.","nullable":true,"type":"string"},"subscriptionCanceledAt":{"description":"The date the customer canceled their subscription. Useful for calculating LTV and churn rate.","nullable":true,"type":"string"}},"required":["id","externalId","createdAt"]},"click":{"type":"object","properties":{"id":{"type":"string"},"timestamp":{"type":"string"},"url":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"continent":{"type":"string"},"device":{"type":"string"},"browser":{"type":"string"},"os":{"type":"string"},"ua":{"nullable":true,"type":"string"},"trigger":{"nullable":true,"type":"string"},"referer":{"type":"string"},"refererUrl":{"type":"string"},"qr":{"type":"boolean"},"ip":{"type":"string"}},"required":["id","timestamp","url","country","city","region","continent","device","browser","os","referer","refererUrl","qr","ip"]},"link":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string"},"trackConversion":{"type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"type":"boolean"},"expiresAt":{"nullable":true,"type":"string"},"expiredUrl":{"nullable":true,"type":"string"},"disabledAt":{"nullable":true,"type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchema"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"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}]},"testStartedAt":{"nullable":true,"type":"string"},"testCompletedAt":{"nullable":true,"type":"string"},"userId":{"nullable":true,"type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId","webhookIds"]},"sale":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"paymentProcessor":{"type":"string"},"invoiceId":{"nullable":true,"type":"string"}},"required":["amount","currency","paymentProcessor","invoiceId"]},"metadata":{"default":null,"nullable":true,"type":"object","additionalProperties":{}}},"required":["eventName","customer","click","link","sale","metadata"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a sale is created."},"LinkTagSchema":{"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","gray","pink"],"description":"The color of the tag."}},"required":["id","name","color"],"title":"LinkTag"},"AnalyticsCount":{"type":"object","properties":{"clicks":{"default":0,"type":"number","description":"The total number of clicks"},"leads":{"default":0,"type":"number","description":"The total number of leads"},"sales":{"default":0,"type":"number","description":"The total number of sales"},"saleAmount":{"description":"The total amount of sales, in cents","default":0,"type":"number"}},"required":["clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsTimeseries":{"type":"object","properties":{"start":{"type":"string","description":"The starting timestamp of the interval"},"clicks":{"default":0,"type":"number","description":"The number of clicks in the interval"},"leads":{"default":0,"type":"number","description":"The number of leads in the interval"},"sales":{"default":0,"type":"number","description":"The number of sales in the interval"},"saleAmount":{"description":"The total amount of sales in the interval, in cents","default":0,"type":"number"}},"required":["start","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsContinents":{"type":"object","properties":{"continent":{"type":"string","enum":["AF","AN","AS","EU","NA","OC","SA"],"description":"The 2-letter ISO 3166-1 code representing the continent associated with the location of the user."},"clicks":{"default":0,"type":"number","description":"The number of clicks from this continent"},"leads":{"default":0,"type":"number","description":"The number of leads from this continent"},"sales":{"default":0,"type":"number","description":"The number of sales from this continent"},"saleAmount":{"description":"The total amount of sales from this continent, in cents","default":0,"type":"number"}},"required":["continent","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsCountries":{"type":"object","properties":{"country":{"type":"string","description":"The 2-letter ISO 3166-1 country code of the country. Learn more: https://d.to/geo"},"region":{"default":"*","type":"string","enum":["*"]},"city":{"default":"*","type":"string","enum":["*"]},"clicks":{"default":0,"type":"number","description":"The number of clicks from this country"},"leads":{"default":0,"type":"number","description":"The number of leads from this country"},"sales":{"default":0,"type":"number","description":"The number of sales from this country"},"saleAmount":{"description":"The total amount of sales from this country, in cents","default":0,"type":"number"}},"required":["country","region","city","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsRegions":{"type":"object","properties":{"country":{"type":"string","description":"The 2-letter ISO 3166-1 country code of the country. Learn more: https://d.to/geo"},"region":{"type":"string","description":"The 2-letter ISO 3166-2 region code of the region."},"city":{"default":"*","type":"string","enum":["*"]},"clicks":{"default":0,"type":"number","description":"The number of clicks from this region"},"leads":{"default":0,"type":"number","description":"The number of leads from this region"},"sales":{"default":0,"type":"number","description":"The number of sales from this region"},"saleAmount":{"description":"The total amount of sales from this region, in cents","default":0,"type":"number"}},"required":["country","region","city","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsCities":{"type":"object","properties":{"country":{"type":"string","description":"The 2-letter ISO 3166-1 country code of the country where this city is located. Learn more: https://d.to/geo"},"region":{"type":"string","description":"The 2-letter ISO 3166-2 region code representing the region associated with the location of the user."},"city":{"type":"string","description":"The name of the city"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this city"},"leads":{"default":0,"type":"number","description":"The number of leads from this city"},"sales":{"default":0,"type":"number","description":"The number of sales from this city"},"saleAmount":{"description":"The total amount of sales from this city, in cents","default":0,"type":"number"}},"required":["country","region","city","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsDevices":{"type":"object","properties":{"device":{"type":"string","description":"The name of the device"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this device"},"leads":{"default":0,"type":"number","description":"The number of leads from this device"},"sales":{"default":0,"type":"number","description":"The number of sales from this device"},"saleAmount":{"description":"The total amount of sales from this device, in cents","default":0,"type":"number"}},"required":["device","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsBrowsers":{"type":"object","properties":{"browser":{"type":"string","description":"The name of the browser"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this browser"},"leads":{"default":0,"type":"number","description":"The number of leads from this browser"},"sales":{"default":0,"type":"number","description":"The number of sales from this browser"},"saleAmount":{"description":"The total amount of sales from this browser, in cents","default":0,"type":"number"}},"required":["browser","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsOS":{"type":"object","properties":{"os":{"type":"string","description":"The name of the OS"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this OS"},"leads":{"default":0,"type":"number","description":"The number of leads from this OS"},"sales":{"default":0,"type":"number","description":"The number of sales from this OS"},"saleAmount":{"description":"The total amount of sales from this OS, in cents","default":0,"type":"number"}},"required":["os","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsTriggers":{"type":"object","properties":{"trigger":{"type":"string","enum":["qr","link","pageview","deeplink"],"description":"The type of trigger method: link click or QR scan"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this trigger method"},"leads":{"default":0,"type":"number","description":"The number of leads from this trigger method"},"sales":{"default":0,"type":"number","description":"The number of sales from this trigger method"},"saleAmount":{"description":"The total amount of sales from this trigger method, in cents","default":0,"type":"number"}},"required":["trigger","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsEventNames":{"type":"object","properties":{"eventName":{"type":"string","description":"The name of the conversion event (lead or sale)"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this event name"},"leads":{"default":0,"type":"number","description":"The number of leads from this event name"},"sales":{"default":0,"type":"number","description":"The number of sales from this event name"},"saleAmount":{"description":"The total amount of sales from this event name, in cents","default":0,"type":"number"}},"required":["eventName","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsReferers":{"type":"object","properties":{"referer":{"type":"string","description":"The name of the referer. If unknown, this will be `(direct)`"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this referer"},"leads":{"default":0,"type":"number","description":"The number of leads from this referer"},"sales":{"default":0,"type":"number","description":"The number of sales from this referer"},"saleAmount":{"description":"The total amount of sales from this referer, in cents","default":0,"type":"number"}},"required":["referer","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsRefererUrls":{"type":"object","properties":{"refererUrl":{"type":"string","description":"The full URL of the referer. If unknown, this will be `(direct)`"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this referer to this URL"},"leads":{"default":0,"type":"number","description":"The number of leads from this referer to this URL"},"sales":{"default":0,"type":"number","description":"The number of sales from this referer to this URL"},"saleAmount":{"description":"The total amount of sales from this referer to this URL, in cents","default":0,"type":"number"}},"required":["refererUrl","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsTopLinks":{"type":"object","properties":{"link":{"type":"string","description":"The unique ID of the short link","deprecated":true},"id":{"type":"string","description":"The unique ID of the short link"},"domain":{"type":"string","description":"The domain of the short link"},"key":{"type":"string","description":"The key of the short link"},"shortLink":{"type":"string","description":"The short link URL"},"url":{"type":"string","description":"The destination URL of the short link"},"title":{"description":"The custom link preview title (og:title)","nullable":true,"type":"string"},"comments":{"description":"The comments of the short link","nullable":true,"type":"string"},"folderId":{"description":"The ID of the folder that the link belongs to (if applicable)","nullable":true,"type":"string"},"createdAt":{"type":"string","description":"The creation timestamp of the short link"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this link"},"leads":{"default":0,"type":"number","description":"The number of leads from this link"},"sales":{"default":0,"type":"number","description":"The number of sales from this link"},"saleAmount":{"description":"The total amount of sales from this link, in cents","default":0,"type":"number"}},"required":["link","id","domain","key","shortLink","url","createdAt","clicks","leads","sales","saleAmount"],"additionalProperties":false},"AnalyticsTopUrls":{"type":"object","properties":{"url":{"type":"string","description":"The full destination URL (including query parameters)"},"clicks":{"default":0,"type":"number","description":"The number of clicks from this URL"},"leads":{"default":0,"type":"number","description":"The number of leads from this URL"},"sales":{"default":0,"type":"number","description":"The number of sales from this URL"},"saleAmount":{"description":"The total amount of sales from this URL, in cents","default":0,"type":"number"}},"required":["url","clicks","leads","sales","saleAmount"],"additionalProperties":false},"LinkSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the short link."},"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)."},"key":{"type":"string","description":"The short link slug. If not provided, a random 7-character slug will be generated."},"url":{"type":"string","description":"The destination URL of the short link."},"trackConversion":{"default":false,"description":"Whether to track conversions for the short link.","type":"boolean"},"externalId":{"nullable":true,"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.","type":"string"},"tenantId":{"nullable":true,"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.","type":"string"},"archived":{"default":false,"description":"Whether the short link is archived.","type":"boolean"},"expiresAt":{"nullable":true,"description":"The date and time when the short link will expire in ISO-8601 format.","type":"string"},"expiredUrl":{"nullable":true,"description":"The URL to redirect to when the short link has expired.","type":"string","format":"uri"},"disabledAt":{"nullable":true,"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.","type":"string"},"password":{"nullable":true,"description":"The password required to access the destination URL of the short link.","type":"string"},"proxy":{"default":false,"description":"Whether the short link uses Custom Link Previews feature.","type":"boolean"},"title":{"nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"description":{"nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"image":{"nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true.","type":"string"},"video":{"nullable":true,"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","type":"string"},"rewrite":{"default":false,"description":"Whether the short link uses link cloaking.","type":"boolean"},"doIndex":{"default":false,"description":"Whether to allow search engines to index the short link.","type":"boolean"},"ios":{"nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting.","type":"string"},"android":{"nullable":true,"description":"The Android destination URL for the short link for Android device targeting.","type":"string"},"geo":{"nullable":true,"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.","type":"object","additionalProperties":{"type":"string","format":"uri"}},"publicStats":{"default":false,"description":"Whether the short link's stats are publicly accessible.","type":"boolean"},"tags":{"nullable":true,"description":"The tags assigned to the short link.","type":"array","items":{"$ref":"#/components/schemas/LinkTagSchemaOutput"}},"folderId":{"nullable":true,"description":"The unique ID of the folder assigned to the short link.","type":"string"},"comments":{"nullable":true,"description":"The comments for the short link.","type":"string"},"shortLink":{"type":"string","format":"uri","description":"The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."},"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`)."},"utm_source":{"nullable":true,"description":"The UTM source of the short link.","type":"string"},"utm_medium":{"nullable":true,"description":"The UTM medium of the short link.","type":"string"},"utm_campaign":{"nullable":true,"description":"The UTM campaign of the short link.","type":"string"},"utm_term":{"nullable":true,"description":"The UTM term of the short link.","type":"string"},"utm_content":{"nullable":true,"description":"The UTM content of the short link.","type":"string"},"testVariants":{"nullable":true,"minItems":2,"maxItems":4,"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"],"additionalProperties":false},"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}]},"testStartedAt":{"description":"The date and time when the tests started.","nullable":true,"type":"string"},"testCompletedAt":{"description":"The date and time when the tests were or will be completed.","nullable":true,"type":"string"},"userId":{"nullable":true,"description":"The user ID of the creator of the short link.","type":"string"},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"default":0,"description":"The number of clicks on the short link.","type":"number"},"leads":{"default":0,"description":"The number of leads the short link has generated.","type":"number"},"conversions":{"default":0,"description":"The number of leads that converted to paying customers.","type":"number"},"sales":{"default":0,"description":"The total number of sales (includes recurring sales) generated by the short link.","type":"number"},"saleAmount":{"description":"The total dollar value of sales (in cents) generated by the short link.","default":0,"type":"number"},"lastClicked":{"nullable":true,"description":"The date and time when the short link was last clicked.","type":"string"},"createdAt":{"type":"string","description":"The date and time when the short link was created."},"updatedAt":{"type":"string","description":"The date and time when the short link was last updated."},"tagId":{"nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true,"type":"string"},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true},"webhookIds":{"type":"array","items":{"type":"string"},"description":"Deprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","archived","expiresAt","expiredUrl","disabledAt","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","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","webhookIds"],"additionalProperties":false,"title":"Link"},"FolderSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the folder."},"name":{"type":"string","description":"The name of the folder."},"description":{"nullable":true,"description":"The description of the folder.","type":"string"},"type":{"type":"string","enum":["default","mega"]},"accessLevel":{"default":"write","description":"The workspace-level access level settings for the folder. Default is `write` which allows full access to the folder for all team members. The other options are `read` (view-only access) and `null` (no access) and are only available on Business plans and above.","nullable":true,"type":"string","enum":["write","read"]},"createdAt":{"description":"The date the folder was created.","type":"string"},"updatedAt":{"description":"The date the folder was updated.","type":"string"}},"required":["id","name","description","type","accessLevel","createdAt","updatedAt"],"additionalProperties":false},"DomainSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the domain."},"slug":{"type":"string","description":"The domain name.","example":"acme.com"},"verified":{"default":false,"description":"Whether the domain is verified.","type":"boolean"},"primary":{"default":false,"description":"Whether the domain is the primary domain for the workspace.","type":"boolean"},"archived":{"default":false,"type":"boolean","description":"Whether the domain is archived."},"placeholder":{"nullable":true,"description":"Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.","example":"https://dub.co/help/article/dub-links","type":"string"},"expiredUrl":{"nullable":true,"description":"The URL to redirect to when a link under this domain has expired.","example":"https://acme.com/expired","type":"string"},"notFoundUrl":{"nullable":true,"description":"The URL to redirect to when a link under this domain doesn't exist.","example":"https://acme.com/not-found","type":"string"},"logo":{"nullable":true,"description":"The logo of the domain.","type":"string"},"assetLinks":{"default":null,"description":"assetLinks.json configuration file (for deep link support on Android).","nullable":true,"type":"string"},"appleAppSiteAssociation":{"default":null,"description":"apple-app-site-association configuration file (for deep link support on iOS).","nullable":true,"type":"string"},"createdAt":{"description":"The date the domain was created.","type":"string"},"updatedAt":{"description":"The date the domain was last updated.","type":"string"},"registeredDomain":{"nullable":true,"description":"The registered domain record.","type":"object","properties":{"id":{"type":"string","description":"The ID of the registered domain record."},"autoRenewalDisabledAt":{"nullable":true,"description":"The date the domain auto-renew is disabled.","type":"string"},"createdAt":{"description":"The date the domain was created.","type":"string"},"expiresAt":{"description":"The date the domain expires.","type":"string"},"renewalFee":{"type":"number","description":"The fee to renew the domain."}},"required":["id","autoRenewalDisabledAt","createdAt","expiresAt","renewalFee"],"additionalProperties":false}},"required":["id","slug","verified","primary","archived","placeholder","expiredUrl","notFoundUrl","logo","assetLinks","appleAppSiteAssociation","createdAt","updatedAt","registeredDomain"],"additionalProperties":false},"LinkTagSchemaOutput":{"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","gray","pink"],"description":"The color of the tag."}},"required":["id","name","color"],"additionalProperties":false,"title":"LinkTag"},"WebhookEvent":{"anyOf":[{"$ref":"#/components/schemas/LinkWebhookEvent"},{"$ref":"#/components/schemas/LinkClickedEvent"},{"$ref":"#/components/schemas/LeadCreatedEvent"},{"$ref":"#/components/schemas/SaleCreatedEvent"}],"description":"Webhook event schema","x-speakeasy-include":true},"LinkErrorSchema":{"type":"object","properties":{"link":{"description":"The link that caused the error."},"error":{"type":"string","description":"The error message."},"code":{"type":"string","enum":["bad_request","unauthorized","forbidden","exceeded_limit","not_found","conflict","invite_pending","invite_expired","unprocessable_entity","rate_limit_exceeded","internal_server_error"],"description":"The error code."}},"required":["link","error","code"],"additionalProperties":false,"title":"LinkError"}},"responses":{"400":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"401":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"403":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"404":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"409":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"410":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"422":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"429":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}},"500":{"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"},"message":{"x-speakeasy-error-message":true,"type":"string","description":"A human readable explanation of what went wrong.","example":"The requested resource was not found."},"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"}},"required":["code","message"]}},"required":["error"]}}}}},"securitySchemes":{"token":{"type":"http","description":"Default authentication mechanism","scheme":"bearer","x-speakeasy-example":"DUB_API_KEY"}}}}