{"openapi":"3.0.3","info":{"title":"Dub API","description":"Dub is the modern link attribution platform for short links, conversion tracking, and affiliate programs.","version":"0.0.1","contact":{"name":"Dub Support","email":"support@dub.co","url":"https://dub.co/api"},"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":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com"},"domain":{"type":"string","maxLength":190,"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","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"webhookIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true}},"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":"Retrieve a list of links","description":"Retrieve a paginated list of links for the authenticated workspace.","tags":["Links"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"domain","description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.","schema":{"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","description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","schema":{"type":"string","description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","deprecated":true}},{"in":"query","name":"tagIds","description":"The tag IDs to filter the links by.","style":"form","explode":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The tag IDs to filter the links by."}},{"in":"query","name":"tagNames","description":"The unique name of the tags assigned to the short link (case insensitive).","style":"form","explode":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."}},{"in":"query","name":"folderId","description":"The folder ID to filter the links by.","schema":{"type":"string","description":"The folder ID to filter the links by."}},{"in":"query","name":"search","description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url.","schema":{"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","description":"The user ID to filter the links by.","schema":{"type":"string","description":"The user ID to filter the links by."}},{"in":"query","name":"tenantId","description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.","schema":{"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","description":"Whether to include archived links in the response. Defaults to `false` if not provided.","schema":{"type":"boolean","default":"false","description":"Whether to include archived links in the response. Defaults to `false` if not provided."}},{"in":"query","name":"withTags","description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","schema":{"type":"boolean","default":"false","description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","deprecated":true}},{"in":"query","name":"sortBy","description":"The field to sort the links by. The default is `createdAt`.","schema":{"type":"string","enum":["createdAt","clicks","saleAmount","lastClicked"],"default":"createdAt","description":"The field to sort the links by. The default is `createdAt`."}},{"in":"query","name":"sortOrder","description":"The sort order. The default is `desc`.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The sort order. The default is `desc`."}},{"in":"query","name":"sort","description":"DEPRECATED. Use `sortBy` instead.","schema":{"type":"string","enum":["createdAt","clicks","saleAmount","lastClicked"],"default":"createdAt","description":"DEPRECATED. Use `sortBy` instead.","deprecated":true}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":100,"description":"The number of items per page.","example":50}}],"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","description":"The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.","schema":{"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","description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","schema":{"type":"string","description":"Deprecated: Use `tagIds` instead. The tag ID to filter the links by.","deprecated":true}},{"in":"query","name":"tagIds","description":"The tag IDs to filter the links by.","style":"form","explode":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The tag IDs to filter the links by."}},{"in":"query","name":"tagNames","description":"The unique name of the tags assigned to the short link (case insensitive).","style":"form","explode":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."}},{"in":"query","name":"folderId","description":"The folder ID to filter the links by.","schema":{"type":"string","description":"The folder ID to filter the links by."}},{"in":"query","name":"search","description":"The search term to filter the links by. The search term will be matched against the short link slug and the destination url.","schema":{"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","description":"The user ID to filter the links by.","schema":{"type":"string","description":"The user ID to filter the links by."}},{"in":"query","name":"tenantId","description":"The ID of the tenant that created the link inside your system. If set, will only return links for the specified tenant.","schema":{"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","description":"Whether to include archived links in the response. Defaults to `false` if not provided.","schema":{"type":"boolean","default":"false","description":"Whether to include archived links in the response. Defaults to `false` if not provided."}},{"in":"query","name":"withTags","description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","schema":{"type":"boolean","default":"false","description":"DEPRECATED. Filter for links that have at least one tag assigned to them.","deprecated":true}},{"in":"query","name":"groupBy","description":"The field to group the links by.","schema":{"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","description":"The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`.","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","description":"The unique ID of the short link.","schema":{"type":"string","description":"The unique ID of the short link.","example":"clux0rgak00011..."}},{"in":"query","name":"externalId","description":"This is the ID of the link in the your database.","schema":{"type":"string","description":"This is the ID of the link in the your database.","example":"123456"}}],"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","description":"The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`.","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}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com"},"domain":{"type":"string","maxLength":190,"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","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp);base64,"},{"type":"string","format":"uri"}]},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"webhookIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true}}}}}},"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","description":"The id of the link to delete. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`.","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}],"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"]}}}},"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":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com"},"domain":{"type":"string","maxLength":190,"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","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"webhookIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true}},"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":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"The IDs of the links to update. Takes precedence over `externalIds`.","default":[]},"externalIds":{"type":"array","items":{"type":"string"},"maxItems":100,"description":"The external IDs of the links to update as stored in your database.","default":[]},"data":{"type":"object","properties":{"url":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"webhookIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true}}}},"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","description":"Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored.","explode":false,"style":"form","schema":{"type":"array","items":{"type":"string"},"description":"Comma-separated list of link IDs to delete. Maximum of 100 IDs. Non-existing IDs will be ignored.","example":["clux0rgak00011...","clux0rgak00022..."]},"required":true}],"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"]}}}},"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":{"type":"string","maxLength":32000,"description":"The destination URL of the short link.","example":"https://google.com"},"domain":{"type":"string","maxLength":190,"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","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"trackConversion":{"type":"boolean","description":"Whether to track conversions for the short link. Defaults to `false` if not provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"$ref":"#/components/schemas/linkGeoTargeting"},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"webhookIds":{"type":"array","nullable":true,"items":{"type":"string"},"description":"An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"publicStats":{"type":"boolean","description":"Deprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.","deprecated":true},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.","deprecated":true}},"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","description":"The type of event to retrieve analytics for. Defaults to `clicks`.","schema":{"type":"string","enum":["clicks","leads","sales","composite"],"default":"clicks","description":"The type of event to retrieve analytics for. Defaults to `clicks`."}},{"in":"query","name":"groupBy","description":"The parameter to group the analytics data points by. Defaults to `count` if undefined.","schema":{"type":"string","enum":["count","timeseries","continents","regions","countries","cities","devices","browsers","os","trigger","triggers","referers","referer_urls","top_partners","top_links","top_urls","utm_sources","utm_mediums","utm_campaigns","utm_terms","utm_contents"],"default":"count","description":"The parameter to group the analytics data points by. Defaults to `count` if undefined."}},{"in":"query","name":"domain","description":"The domain to filter analytics for.","schema":{"type":"string","description":"The domain to filter analytics for."}},{"in":"query","name":"key","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.","schema":{"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","description":"The unique ID of the short link on Dub to retrieve analytics for.","schema":{"type":"string","description":"The unique ID of the short link on Dub to retrieve analytics for."}},{"in":"query","name":"externalId","description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.","schema":{"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","description":"The ID of the tenant that created the link inside your system.","schema":{"type":"string","description":"The ID of the tenant that created the link inside your system."}},{"in":"query","name":"programId","description":"The ID of the program to retrieve analytics for.","schema":{"type":"string","description":"The ID of the program to retrieve analytics for."}},{"in":"query","name":"partnerId","description":"The ID of the partner to retrieve analytics for.","schema":{"type":"string","description":"The ID of the partner to retrieve analytics for."}},{"in":"query","name":"customerId","description":"The ID of the customer to retrieve analytics for.","schema":{"type":"string","description":"The ID of the customer to retrieve analytics for."}},{"in":"query","name":"interval","description":"The interval to retrieve analytics for. If undefined, defaults to 24h.","schema":{"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","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`.","schema":{"type":"string","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`."}},{"in":"query","name":"end","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`.","schema":{"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","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","schema":{"type":"string","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","example":"America/New_York","default":"UTC"}},{"in":"query","name":"country","description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information.","schema":{"$ref":"#/components/schemas/countryCode"}},{"in":"query","name":"city","description":"The city to retrieve analytics for.","schema":{"type":"string","description":"The city to retrieve analytics for.","example":"New York"}},{"in":"query","name":"region","description":"The ISO 3166-2 region code to retrieve analytics for.","schema":{"$ref":"#/components/schemas/regionCode"}},{"in":"query","name":"continent","description":"The continent to retrieve analytics for.","schema":{"$ref":"#/components/schemas/continentCode"}},{"in":"query","name":"device","description":"The device to retrieve analytics for.","schema":{"type":"string","description":"The device to retrieve analytics for.","example":"Desktop"}},{"in":"query","name":"browser","description":"The browser to retrieve analytics for.","schema":{"type":"string","description":"The browser to retrieve analytics for.","example":"Chrome"}},{"in":"query","name":"os","description":"The OS to retrieve analytics for.","schema":{"type":"string","description":"The OS to retrieve analytics for.","example":"Windows"}},{"in":"query","name":"trigger","description":"The trigger to retrieve analytics for. If undefined, returns all trigger types.","schema":{"type":"string","enum":["qr","link","pageview","deeplink"],"description":"The trigger to retrieve analytics for. If undefined, returns all trigger types."}},{"in":"query","name":"referer","description":"The referer to retrieve analytics for.","schema":{"type":"string","description":"The referer to retrieve analytics for.","example":"google.com"}},{"in":"query","name":"refererUrl","description":"The full referer URL to retrieve analytics for.","schema":{"type":"string","description":"The full referer URL to retrieve analytics for.","example":"https://dub.co/blog"}},{"in":"query","name":"url","description":"The URL to retrieve analytics for.","schema":{"type":"string","description":"The URL to retrieve analytics for."}},{"in":"query","name":"tagIds","description":"The tag IDs to retrieve analytics for.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The tag IDs to retrieve analytics for."}},{"in":"query","name":"folderId","description":"The folder ID to retrieve analytics for. If not provided, return analytics for unsorted links.","schema":{"type":"string","description":"The folder ID to retrieve analytics for. If not provided, return analytics for unsorted links."}},{"in":"query","name":"root","description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both.","schema":{"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","description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.","schema":{"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","description":"Search the events by a custom metadata value. Only available for lead and sale events.","schema":{"type":"string","maxLength":10000,"description":"Search the events by a custom metadata value. Only available for lead and sale events.","example":"metadata['key']:'value'"}},{"in":"query","name":"tagId","description":"Deprecated: Use `tagIds` instead. The tag ID to retrieve analytics for.","schema":{"type":"string","description":"Deprecated: Use `tagIds` instead. The tag ID to retrieve analytics for.","deprecated":true}},{"in":"query","name":"qr","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.","schema":{"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.","deprecated":true}},{"in":"query","name":"utm_source","description":"The UTM source of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM source of the short link."}},{"in":"query","name":"utm_medium","description":"The UTM medium of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM medium of the short link."}},{"in":"query","name":"utm_campaign","description":"The UTM campaign of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM campaign of the short link."}},{"in":"query","name":"utm_term","description":"The UTM term of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM term of the short link."}},{"in":"query","name":"utm_content","description":"The UTM content of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM content of the short link."}},{"in":"query","name":"ref","description":"The ref of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The ref of the short link."}}],"responses":{"200":{"description":"Analytics data","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AnalyticsCount"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTimeseries"},"title":"AnalyticsTimeseries"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsContinents"},"title":"AnalyticsContinents"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCountries"},"title":"AnalyticsCountries"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsRegions"},"title":"AnalyticsRegions"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsCities"},"title":"AnalyticsCities"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsDevices"},"title":"AnalyticsDevices"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsBrowsers"},"title":"AnalyticsBrowsers"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsOS"},"title":"AnalyticsOS"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTriggers"},"title":"AnalyticsTriggers"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsReferers"},"title":"AnalyticsReferers"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsRefererUrls"},"title":"AnalyticsRefererUrls"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTopLinks"},"title":"AnalyticsTopLinks"},{"type":"array","items":{"$ref":"#/components/schemas/AnalyticsTopUrls"},"title":"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":"Retrieve a list of events","description":"Retrieve a paginated list of events for the authenticated workspace.","tags":["Events"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"event","description":"The type of event to retrieve analytics for. Defaults to 'clicks'.","schema":{"type":"string","enum":["clicks","leads","sales"],"default":"clicks","description":"The type of event to retrieve analytics for. Defaults to 'clicks'."}},{"in":"query","name":"domain","description":"The domain to filter analytics for.","schema":{"type":"string","description":"The domain to filter analytics for."}},{"in":"query","name":"key","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.","schema":{"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","description":"The unique ID of the short link on Dub to retrieve analytics for.","schema":{"type":"string","description":"The unique ID of the short link on Dub to retrieve analytics for."}},{"in":"query","name":"externalId","description":"The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.","schema":{"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","description":"The ID of the tenant that created the link inside your system.","schema":{"type":"string","description":"The ID of the tenant that created the link inside your system."}},{"in":"query","name":"programId","description":"The ID of the program to retrieve analytics for.","schema":{"type":"string","description":"The ID of the program to retrieve analytics for."}},{"in":"query","name":"partnerId","description":"The ID of the partner to retrieve analytics for.","schema":{"type":"string","description":"The ID of the partner to retrieve analytics for."}},{"in":"query","name":"customerId","description":"The ID of the customer to retrieve analytics for.","schema":{"type":"string","description":"The ID of the customer to retrieve analytics for."}},{"in":"query","name":"interval","description":"The interval to retrieve analytics for. If undefined, defaults to 24h.","schema":{"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","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`.","schema":{"type":"string","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`."}},{"in":"query","name":"end","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`.","schema":{"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","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","schema":{"type":"string","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","example":"America/New_York","default":"UTC"}},{"in":"query","name":"country","description":"The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information.","schema":{"$ref":"#/components/schemas/countryCode"}},{"in":"query","name":"city","description":"The city to retrieve analytics for.","schema":{"type":"string","description":"The city to retrieve analytics for.","example":"New York"}},{"in":"query","name":"region","description":"The ISO 3166-2 region code to retrieve analytics for.","schema":{"$ref":"#/components/schemas/regionCode"}},{"in":"query","name":"continent","description":"The continent to retrieve analytics for.","schema":{"$ref":"#/components/schemas/continentCode"}},{"in":"query","name":"device","description":"The device to retrieve analytics for.","schema":{"type":"string","description":"The device to retrieve analytics for.","example":"Desktop"}},{"in":"query","name":"browser","description":"The browser to retrieve analytics for.","schema":{"type":"string","description":"The browser to retrieve analytics for.","example":"Chrome"}},{"in":"query","name":"os","description":"The OS to retrieve analytics for.","schema":{"type":"string","description":"The OS to retrieve analytics for.","example":"Windows"}},{"in":"query","name":"trigger","description":"The trigger to retrieve analytics for. If undefined, returns all trigger types.","schema":{"type":"string","enum":["qr","link","pageview","deeplink"],"description":"The trigger to retrieve analytics for. If undefined, returns all trigger types."}},{"in":"query","name":"referer","description":"The referer to retrieve analytics for.","schema":{"type":"string","description":"The referer to retrieve analytics for.","example":"google.com"}},{"in":"query","name":"refererUrl","description":"The full referer URL to retrieve analytics for.","schema":{"type":"string","description":"The full referer URL to retrieve analytics for.","example":"https://dub.co/blog"}},{"in":"query","name":"url","description":"The URL to retrieve analytics for.","schema":{"type":"string","description":"The URL to retrieve analytics for."}},{"in":"query","name":"tagIds","description":"The tag IDs to retrieve analytics for.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The tag IDs to retrieve analytics for."}},{"in":"query","name":"folderId","description":"The folder ID to retrieve analytics for. If not provided, return analytics for unsorted links.","schema":{"type":"string","description":"The folder ID to retrieve analytics for. If not provided, return analytics for unsorted links."}},{"in":"query","name":"root","description":"Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both.","schema":{"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","description":"Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both.","schema":{"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","description":"Search the events by a custom metadata value. Only available for lead and sale events.","schema":{"type":"string","maxLength":10000,"description":"Search the events by a custom metadata value. Only available for lead and sale events.","example":"metadata['key']:'value'"}},{"in":"query","name":"tagId","description":"Deprecated: Use `tagIds` instead. The tag ID to retrieve analytics for.","schema":{"type":"string","description":"Deprecated: Use `tagIds` instead. The tag ID to retrieve analytics for.","deprecated":true}},{"in":"query","name":"qr","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.","schema":{"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.","deprecated":true}},{"in":"query","name":"utm_source","description":"The UTM source of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM source of the short link."}},{"in":"query","name":"utm_medium","description":"The UTM medium of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM medium of the short link."}},{"in":"query","name":"utm_campaign","description":"The UTM campaign of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM campaign of the short link."}},{"in":"query","name":"utm_term","description":"The UTM term of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM term of the short link."}},{"in":"query","name":"utm_content","description":"The UTM content of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The UTM content of the short link."}},{"in":"query","name":"ref","description":"The ref of the short link.","schema":{"type":"string","nullable":true,"maxLength":190,"description":"The ref of the short link."}},{"in":"query","name":"page","schema":{"type":"number","default":1}},{"in":"query","name":"limit","schema":{"type":"number","default":100}},{"in":"query","name":"sortOrder","description":"The sort order. The default is `desc`.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The sort order. The default is `desc`."}},{"in":"query","name":"sortBy","description":"The field to sort the events by. The default is `timestamp`.","schema":{"type":"string","enum":["timestamp"],"default":"timestamp","description":"The field to sort the events by. The default is `timestamp`."}},{"in":"query","name":"order","description":"DEPRECATED. Use `sortOrder` instead.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"DEPRECATED. Use `sortOrder` instead.","deprecated":true}}],"responses":{"200":{"description":"A list of events","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ClickEvent"},{"$ref":"#/components/schemas/LeadEvent"},{"$ref":"#/components/schemas/SaleEvent"}],"discriminator":{"propertyName":"event","mapping":{"click":"#/components/schemas/ClickEvent","lead":"#/components/schemas/LeadEvent","sale":"#/components/schemas/SaleEvent"}}}}}}},"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":50,"description":"The name of the tag to create."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","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."},"tag":{"type":"string","minLength":1,"description":"The name of the tag to create.","deprecated":true}}}}}},"responses":{"201":{"description":"The created tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagSchema"}}}},"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":"Retrieve a list of tags","description":"Retrieve a list of tags for the authenticated workspace.","tags":["Tags"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"sortBy","description":"The field to sort the tags by.","schema":{"type":"string","enum":["name","createdAt"],"default":"name","description":"The field to sort the tags by."}},{"in":"query","name":"sortOrder","description":"The order to sort the tags by.","schema":{"type":"string","enum":["asc","desc"],"default":"asc","description":"The order to sort the tags by."}},{"in":"query","name":"search","description":"The search term to filter the tags by.","schema":{"type":"string","description":"The search term to filter the tags by."}},{"in":"query","name":"ids","description":"IDs of tags to filter by.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"IDs of tags to filter by."}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":100,"description":"The number of items per page.","example":50}}],"responses":{"200":{"description":"A list of tags","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagSchema"}}}}},"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","description":"The ID of the tag to update.","schema":{"type":"string","description":"The ID of the tag to update."},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"The name of the tag to create."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","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."},"tag":{"type":"string","minLength":1,"description":"The name of the tag to create.","deprecated":true}}}}}},"responses":{"200":{"description":"The updated tag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagSchema"}}}},"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","description":"The ID of the tag to delete.","schema":{"type":"string","description":"The ID of the tag to delete."},"required":true}],"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"]}}}},"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."},"accessLevel":{"type":"string","nullable":true,"enum":["write","read",null],"default":null,"description":"The access level of the folder within the workspace."}},"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":"Retrieve a list of folders","description":"Retrieve a list of folders for the authenticated workspace.","tags":["Folders"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"search","description":"The search term to filter the folders by.","schema":{"type":"string","description":"The search term to filter the folders by."}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":50,"default":50,"description":"The number of items per page.","example":50}}],"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","description":"The ID of the folder to update.","schema":{"type":"string","description":"The ID of the folder to update."},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":190,"description":"The name of the folder."},"accessLevel":{"type":"string","nullable":true,"enum":["write","read",null],"default":null,"description":"The access level of the folder within the workspace."}}}}}},"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","description":"The ID of the folder to delete.","schema":{"type":"string","description":"The ID of the folder to delete."},"required":true}],"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"]}}}},"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":{"type":"string","nullable":true,"maxLength":32000,"description":"Redirect users to a specific URL when any link under this domain has expired.","example":"https://acme.com/expired"},"notFoundUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"Redirect users to a specific URL when a link under this domain doesn't exist.","example":"https://acme.com/not-found"},"archived":{"type":"boolean","default":false,"description":"Whether to archive this domain. `false` will unarchive a previously archived domain.","example":false},"placeholder":{"type":"string","nullable":true,"maxLength":100,"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/what-is-dub"},"logo":{"nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp);base64,"},{"type":"string","format":"uri"},{"type":"string","format":"uri"}],"description":"The logo of the domain."},"assetLinks":{"type":"string","nullable":true,"description":"assetLinks.json configuration file (for deep link support on Android)."},"appleAppSiteAssociation":{"type":"string","nullable":true,"description":"apple-app-site-association configuration file (for deep link support on iOS)."}},"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":"Retrieve a list of domains","description":"Retrieve a list of domains associated with the authenticated workspace.","tags":["Domains"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"archived","description":"Whether to include archived domains in the response. Defaults to `false` if not provided.","schema":{"type":"boolean","default":"false","description":"Whether to include archived domains in the response. Defaults to `false` if not provided."}},{"in":"query","name":"search","description":"The search term to filter the domains by.","schema":{"type":"string","description":"The search term to filter the domains by."}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":50,"default":50,"description":"The number of items per page.","example":50}}],"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","description":"The domain name.","schema":{"type":"string","description":"The domain name.","example":"acme.com"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":190,"description":"Name of the domain.","example":"acme.com"},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"Redirect users to a specific URL when any link under this domain has expired.","example":"https://acme.com/expired"},"notFoundUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"Redirect users to a specific URL when a link under this domain doesn't exist.","example":"https://acme.com/not-found"},"archived":{"type":"boolean","default":false,"description":"Whether to archive this domain. `false` will unarchive a previously archived domain.","example":false},"placeholder":{"type":"string","nullable":true,"maxLength":100,"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/what-is-dub"},"logo":{"nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp);base64,"},{"type":"string","format":"uri"},{"type":"string","format":"uri"}],"description":"The logo of the domain."},"assetLinks":{"type":"string","nullable":true,"description":"assetLinks.json configuration file (for deep link support on Android)."},"appleAppSiteAssociation":{"type":"string","nullable":true,"description":"apple-app-site-association configuration file (for deep link support on iOS)."}}}}}},"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","description":"The domain name.","schema":{"type":"string","description":"The domain name.","example":"acme.com"},"required":true}],"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"]}}}},"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":{"type":"string","pattern":".link$","minLength":1,"description":"The domain to claim. We only support .link domains for now.","example":"acme.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":{"type":"number","nullable":true,"description":"The expiration timestamp of the domain (Unix timestamp in milliseconds)."}},"required":["domain","status","expiration"]}}}},"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","description":"The domains to search. We only support .link domains for now.","style":"form","explode":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The domains to search. We only support .link domains for now."},"required":true}],"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."},"price":{"type":"string","nullable":true,"description":"The price description."},"premium":{"type":"boolean","nullable":true,"description":"Whether the domain is a premium domain."}},"required":["domain","available","price","premium"]}}}}},"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. 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":{"type":"string","nullable":true,"maxLength":100,"default":null,"description":"The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”)."},"customerEmail":{"type":"string","nullable":true,"format":"email","maxLength":100,"default":null,"description":"The email address of the customer."},"customerAvatar":{"type":"string","nullable":true,"default":null,"description":"The avatar URL of the customer."},"mode":{"type":"string","enum":["async","wait","deferred"],"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."},"eventQuantity":{"type":"number","nullable":true,"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."},"metadata":{"type":"object","nullable":true,"additionalProperties":{},"default":null,"description":"Additional metadata to be stored with the lead event. Max 10,000 characters."}},"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"]},"link":{"type":"object","nullable":true,"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","format":"uri","description":"The destination URL of the short link."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"tenantId":{"type":"string","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."},"externalId":{"type":"string","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."}},"required":["id","domain","key","shortLink","url","partnerId","programId","tenantId","externalId"],"title":"Link"},"customer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true}},"required":["name","email","avatar","externalId"]}},"required":["click","link","customer"]}}}},"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,"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. `1437` JPY). Learn more: https://d.to/currency"},"currency":{"type":"string","default":"usd","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"},"eventName":{"type":"string","maxLength":255,"default":"Purchase","description":"The name of the sale event. Recommended format: `Invoice paid` or `Subscription created`.","example":"Invoice paid"},"paymentProcessor":{"type":"string","enum":["stripe","shopify","polar","paddle","revenuecat","custom"],"default":"custom","description":"The payment processor via which the sale was made."},"invoiceId":{"type":"string","nullable":true,"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."},"metadata":{"type":"object","nullable":true,"additionalProperties":{},"default":null,"description":"Additional metadata to be stored with the sale event. Max 10,000 characters when stringified."},"leadEventName":{"type":"string","nullable":true,"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"},"clickId":{"type":"string","nullable":true,"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."},"customerName":{"type":"string","nullable":true,"maxLength":100,"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”)."},"customerEmail":{"type":"string","nullable":true,"format":"email","maxLength":100,"default":null,"description":"[For direct sale tracking]: The email address of the customer."},"customerAvatar":{"type":"string","nullable":true,"default":null,"description":"[For direct sale tracking]: The avatar URL of the customer."}},"required":["customerExternalId","amount"]}}}},"responses":{"200":{"description":"A sale was tracked.","content":{"application/json":{"schema":{"type":"object","properties":{"eventName":{"type":"string"},"customer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true}},"required":["id","name","email","avatar","externalId"]},"sale":{"type":"object","nullable":true,"properties":{"amount":{"type":"number"},"currency":{"type":"string"},"paymentProcessor":{"type":"string"},"invoiceId":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{}}},"required":["amount","currency","paymentProcessor","invoiceId","metadata"]}},"required":["eventName","customer","sale"]}}}},"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":{"type":"string","maxLength":32000,"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"},"dubDomain":{"type":"string","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"}}}}}},"responses":{"200":{"description":"The response from the tracked open event.","content":{"application/json":{"schema":{"type":"object","properties":{"clickId":{"type":"string","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). 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"},"link":{"type":"object","nullable":true,"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"],"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"}},"required":["clickId","link"]}}}},"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","summary":"Retrieve a list of customers","description":"Retrieve a list of customers for the authenticated workspace.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"email","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`.","schema":{"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","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`.","schema":{"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","description":"A search query to filter customers by email, externalId, or name. If `email` or `externalId` is provided, this will be ignored.","schema":{"type":"string","description":"A search query to filter customers by email, externalId, or name. If `email` or `externalId` is provided, this will be ignored."}},{"in":"query","name":"country","description":"A filter on the list based on the customer's `country` field.","schema":{"type":"string","description":"A filter on the list based on the customer's `country` field."}},{"in":"query","name":"linkId","description":"A filter on the list based on the customer's `linkId` field (the referral link ID).","schema":{"type":"string","description":"A filter on the list based on the customer's `linkId` field (the referral link ID)."}},{"in":"query","name":"includeExpandedFields","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`).","schema":{"type":"boolean","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`)."}},{"in":"query","name":"sortBy","description":"The field to sort the customers by. The default is `createdAt`.","schema":{"type":"string","enum":["createdAt","saleAmount"],"default":"createdAt","description":"The field to sort the customers by. The default is `createdAt`."}},{"in":"query","name":"sortOrder","description":"The sort order. The default is `desc`.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The sort order. The default is `desc`."}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":100,"description":"The number of items per page.","example":50}}],"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."},"link":{"type":"object","nullable":true,"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","format":"uri","description":"The destination URL of the short link."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."}},"required":["id","domain","key","shortLink","url","programId"],"title":"Link"},"programId":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."}},"required":["id","name","email","image"]},"discount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"amount":{"type":"number"},"type":{"type":"string","enum":["percentage","flat"]},"maxDuration":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"couponId":{"type":"string","nullable":true},"couponTestId":{"type":"string","nullable":true},"partnersCount":{"type":"number","nullable":true}},"required":["id","amount","type","maxDuration","couponId","couponTestId"]}},"required":["id","externalId","name","createdAt"]}}}}},"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"}}},"post":{"operationId":"createCustomer","x-speakeasy-name-override":"create","summary":"Create a customer","description":"[Deprecated]: Customer creation can only be done via tracking a lead event. Use the /track/lead endpoint instead.","deprecated":true,"tags":["Customers"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email","description":"Email of the customer in the client's app."},"name":{"type":"string","nullable":true,"description":"Name of the customer in the client's app. If not provided, a random name will be generated."},"avatar":{"type":"string","nullable":true,"format":"uri","description":"Avatar URL of the customer in the client's app."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."}},"required":["externalId"]}}}},"responses":{"201":{"description":"The customer was created.","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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."},"link":{"type":"object","nullable":true,"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","format":"uri","description":"The destination URL of the short link."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."}},"required":["id","domain","key","shortLink","url","programId"],"title":"Link"},"programId":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."}},"required":["id","name","email","image"]},"discount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"amount":{"type":"number"},"type":{"type":"string","enum":["percentage","flat"]},"maxDuration":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"couponId":{"type":"string","nullable":true},"couponTestId":{"type":"string","nullable":true},"partnersCount":{"type":"number","nullable":true}},"required":["id","amount","type","maxDuration","couponId","couponTestId"]}},"required":["id","externalId","name","createdAt"]}}}},"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.","tags":["Customers"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","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`).","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},{"in":"query","name":"includeExpandedFields","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`).","schema":{"type":"boolean","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`)."}}],"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."},"link":{"type":"object","nullable":true,"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","format":"uri","description":"The destination URL of the short link."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."}},"required":["id","domain","key","shortLink","url","programId"],"title":"Link"},"programId":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."}},"required":["id","name","email","image"]},"discount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"amount":{"type":"number"},"type":{"type":"string","enum":["percentage","flat"]},"maxDuration":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"couponId":{"type":"string","nullable":true},"couponTestId":{"type":"string","nullable":true},"partnersCount":{"type":"number","nullable":true}},"required":["id","amount","type","maxDuration","couponId","couponTestId"]}},"required":["id","externalId","name","createdAt"]}}}},"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","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`).","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},{"in":"query","name":"includeExpandedFields","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`).","schema":{"type":"boolean","description":"Whether to include expanded fields on the customer (`link`, `partner`, `discount`)."}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email","description":"Email of the customer in the client's app."},"name":{"type":"string","nullable":true,"description":"Name of the customer in the client's app. If not provided, a random name will be generated."},"avatar":{"type":"string","nullable":true,"format":"uri","description":"Avatar URL of the customer in the client's app."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."}}}}}},"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."},"link":{"type":"object","nullable":true,"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","format":"uri","description":"The destination URL of the short link."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."}},"required":["id","domain","key","shortLink","url","programId"],"title":"Link"},"programId":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."}},"required":["id","name","email","image"]},"discount":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"amount":{"type":"number"},"type":{"type":"string","enum":["percentage","flat"]},"maxDuration":{"type":"number","nullable":true},"description":{"type":"string","nullable":true},"couponId":{"type":"string","nullable":true},"couponTestId":{"type":"string","nullable":true},"partnersCount":{"type":"number","nullable":true}},"required":["id","amount","type","maxDuration","couponId","couponTestId"]}},"required":["id","externalId","name","createdAt"]}}}},"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","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`).","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}],"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"]}}}},"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"}}}},"/partners":{"post":{"operationId":"createPartner","x-speakeasy-name-override":"create","summary":"Create a partner","description":"Create a partner for a program. If partner exists, automatically enrolls them.","tags":["Partners"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true,"maxLength":100,"description":"The partner's full name. If undefined, the partner's email will be used in lieu of their name (e.g. `john@acme.com`)"},"email":{"type":"string","format":"email","minLength":1,"maxLength":190,"description":"The partner's email address. Partners will be able to claim their profile by signing up at `partners.dub.co` with this email."},"username":{"type":"string","nullable":true,"maxLength":100,"description":"The partner's unique username in your system (max 100 characters). This will be used to create a short link for the partner using your program's default domain. If not provided, Dub will try to generate a username from the partner's name or email."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image. If not provided, a default avatar will be used."},"tenantId":{"type":"string","description":"The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner."},"groupId":{"type":"string","description":"The group ID to add the partner to. If not provided, the partner will be added to the default group."},"country":{"type":"string","nullable":true,"description":"The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."},"description":{"type":"string","nullable":true,"maxLength":5000,"description":"A brief description of the partner and their background. Max 5,000 characters."},"linkProps":{"type":"object","properties":{"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."}},"description":"Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner."}},"required":["email"]}}}},"responses":{"201":{"description":"The created partner","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"companyName":{"type":"string","nullable":true,"maxLength":190,"description":"If the partner profile type is a company, this is the partner's legal company name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"description":{"type":"string","nullable":true,"maxLength":5000,"description":"A brief description of the partner and their background."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"paypalEmail":{"type":"string","nullable":true,"description":"The partner's PayPal email (for receiving payouts via PayPal)."},"stripeConnectId":{"type":"string","nullable":true,"description":"The partner's Stripe Connect ID (for receiving payouts via Stripe)."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"monthlyTraffic":{"type":"string","nullable":true,"enum":["ZeroToOneThousand","OneThousandToTenThousand","TenThousandToFiftyThousand","FiftyThousandToOneHundredThousand","OneHundredThousandPlus",null],"description":"The partner's monthly traffic."},"industryInterests":{"type":"array","items":{"type":"string","enum":["SaaS","DevTool","AI","Creative_And_Design","Productivity_Software","Marketing","Gaming","Finance","Sales","Ecommerce","Customer_Service_And_Support","Content_Management","Human_Resources","Security","Analytics_And_Data","Social_Media","Consumer_Tech","Education_And_Learning","Health_And_Fitness","Food_And_Beverage","Travel_And_Lifestyle","Entertainment_And_Media","Sports","Science_And_Engineering"]},"maxItems":8,"description":"The partner's industry interests."},"preferredEarningStructures":{"type":"array","items":{"type":"string","enum":["Revenue_Share","Per_Lead","Per_Sale","Per_Click","One_Time_Payment"]},"description":"The partner's preferred earning structures."},"salesChannels":{"type":"array","items":{"type":"string","enum":["Blogs","Coupons","Direct_Reselling","Newsletters","Social_Media","Events","Company_Referrals"]},"description":"The partner's sales channels."},"programId":{"type":"string","description":"The program's unique ID on Dub."},"groupId":{"type":"string","nullable":true,"description":"The partner's group ID on Dub."},"partnerId":{"type":"string","description":"The partner's unique ID on Dub."},"tenantId":{"type":"string","nullable":true,"description":"The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future."},"createdAt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","invited","declined","banned","archived"],"description":"The status of the partner's enrollment in the program."},"links":{"type":"array","nullable":true,"items":{"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","format":"uri","description":"The destination URL of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."}},"required":["id","domain","key","shortLink","url","clicks","leads","conversions","sales","saleAmount"],"title":"Link"},"description":"The partner's referral links in this program."},"totalCommissions":{"type":"number","default":0,"description":"The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."},"clickRewardId":{"type":"string","nullable":true},"leadRewardId":{"type":"string","nullable":true},"saleRewardId":{"type":"string","nullable":true},"discountId":{"type":"string","nullable":true},"applicationId":{"type":"string","nullable":true,"description":"If the partner submitted an application to join the program, this is the ID of the application."},"bannedAt":{"type":"string","nullable":true,"description":"If the partner was banned from the program, this is the date of the ban."},"bannedReason":{"type":"string","nullable":true,"enum":["tos_violation","inappropriate_content","fake_traffic","fraud","spam","brand_abuse",null],"description":"If the partner was banned from the program, this is the reason for the ban."},"clicks":{"type":"number","default":0,"description":"The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"leads":{"type":"number","default":0,"description":"The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"conversions":{"type":"number","default":0,"description":"The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."},"sales":{"type":"number","default":0,"description":"The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."},"saleAmount":{"type":"number","default":0,"description":"The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"netRevenue":{"type":"number","default":0,"description":"The total net revenue generated by the partner. Defaults to 0 if `includeExpandedFields` is false."},"website":{"type":"string","nullable":true,"description":"The partner's website URL (including the https protocol)."},"websiteTxtRecord":{"type":"string","nullable":true},"websiteVerifiedAt":{"type":"string","nullable":true},"youtube":{"type":"string","nullable":true,"description":"The partner's YouTube channel username (e.g. `johndoe`)."},"youtubeVerifiedAt":{"type":"string","nullable":true},"youtubeSubscriberCount":{"type":"number","nullable":true},"youtubeViewCount":{"type":"number","nullable":true},"twitter":{"type":"string","nullable":true,"description":"The partner's Twitter username (e.g. `johndoe`)."},"twitterVerifiedAt":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true,"description":"The partner's LinkedIn username (e.g. `johndoe`)."},"linkedinVerifiedAt":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true,"description":"The partner's Instagram username (e.g. `johndoe`)."},"instagramVerifiedAt":{"type":"string","nullable":true},"tiktok":{"type":"string","nullable":true,"description":"The partner's TikTok username (e.g. `johndoe`)."},"tiktokVerifiedAt":{"type":"string","nullable":true}},"required":["id","name","companyName","email","image","country","paypalEmail","stripeConnectId","payoutsEnabledAt","programId","partnerId","tenantId","createdAt","status","links","totalCommissions","clicks","leads","conversions","sales","saleAmount","netRevenue"]}}}},"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":"listPartners","x-speakeasy-name-override":"list","summary":"List all partners","description":"List all partners for a partner program.","tags":["Partners"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"status","description":"A filter on the list based on the partner's `status` field.","schema":{"type":"string","enum":["pending","approved","rejected","invited","declined","banned","archived"],"description":"A filter on the list based on the partner's `status` field.","example":"approved"}},{"in":"query","name":"country","description":"A filter on the list based on the partner's `country` field.","schema":{"type":"string","description":"A filter on the list based on the partner's `country` field.","example":"US"}},{"in":"query","name":"sortBy","description":"The field to sort the partners by. The default is `saleAmount`.","schema":{"type":"string","enum":["createdAt","clicks","leads","conversions","sales","saleAmount","totalCommissions","netRevenue"],"default":"saleAmount","description":"The field to sort the partners by. The default is `saleAmount`.","example":"saleAmount"}},{"in":"query","name":"sortOrder","description":"The sort order. The default is `desc`.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The sort order. The default is `desc`.","example":"desc"}},{"in":"query","name":"email","description":"Filter the partner list based on the partner's `email`. The value must be a string. Takes precedence over `search`.","schema":{"type":"string","description":"Filter the partner list based on the partner's `email`. The value must be a string. Takes precedence over `search`.","example":"panic@thedis.co"}},{"in":"query","name":"tenantId","description":"Filter the partner list based on the partner's `tenantId`. The value must be a string. Takes precedence over `email` and `search`.","schema":{"type":"string","description":"Filter the partner list based on the partner's `tenantId`. The value must be a string. Takes precedence over `email` and `search`.","example":"1K0NM7HCN944PEMZ3CQPH43H8"}},{"in":"query","name":"search","description":"A search query to filter partners by ID, name, email, or link.","schema":{"type":"string","description":"A search query to filter partners by ID, name, email, or link.","example":"john"}},{"in":"query","name":"includeExpandedFields","description":"Whether to include stats fields on the partner (`clicks`, `leads`, `conversions`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0.","schema":{"type":"boolean","description":"Whether to include stats fields on the partner (`clicks`, `leads`, `conversions`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0.","example":"true"}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":100,"description":"The number of items per page.","example":50}}],"responses":{"200":{"description":"The list of partners.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"companyName":{"type":"string","nullable":true,"maxLength":190,"description":"If the partner profile type is a company, this is the partner's legal company name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"description":{"type":"string","nullable":true,"maxLength":5000,"description":"A brief description of the partner and their background."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"paypalEmail":{"type":"string","nullable":true,"description":"The partner's PayPal email (for receiving payouts via PayPal)."},"stripeConnectId":{"type":"string","nullable":true,"description":"The partner's Stripe Connect ID (for receiving payouts via Stripe)."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"monthlyTraffic":{"type":"string","nullable":true,"enum":["ZeroToOneThousand","OneThousandToTenThousand","TenThousandToFiftyThousand","FiftyThousandToOneHundredThousand","OneHundredThousandPlus",null],"description":"The partner's monthly traffic."},"industryInterests":{"type":"array","items":{"type":"string","enum":["SaaS","DevTool","AI","Creative_And_Design","Productivity_Software","Marketing","Gaming","Finance","Sales","Ecommerce","Customer_Service_And_Support","Content_Management","Human_Resources","Security","Analytics_And_Data","Social_Media","Consumer_Tech","Education_And_Learning","Health_And_Fitness","Food_And_Beverage","Travel_And_Lifestyle","Entertainment_And_Media","Sports","Science_And_Engineering"]},"maxItems":8,"description":"The partner's industry interests."},"preferredEarningStructures":{"type":"array","items":{"type":"string","enum":["Revenue_Share","Per_Lead","Per_Sale","Per_Click","One_Time_Payment"]},"description":"The partner's preferred earning structures."},"salesChannels":{"type":"array","items":{"type":"string","enum":["Blogs","Coupons","Direct_Reselling","Newsletters","Social_Media","Events","Company_Referrals"]},"description":"The partner's sales channels."},"programId":{"type":"string","description":"The program's unique ID on Dub."},"groupId":{"type":"string","nullable":true,"description":"The partner's group ID on Dub."},"partnerId":{"type":"string","description":"The partner's unique ID on Dub."},"tenantId":{"type":"string","nullable":true,"description":"The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future."},"createdAt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","invited","declined","banned","archived"],"description":"The status of the partner's enrollment in the program."},"links":{"type":"array","nullable":true,"items":{"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","format":"uri","description":"The destination URL of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."}},"required":["id","domain","key","shortLink","url","clicks","leads","conversions","sales","saleAmount"],"title":"Link"},"description":"The partner's referral links in this program."},"totalCommissions":{"type":"number","default":0,"description":"The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."},"clickRewardId":{"type":"string","nullable":true},"leadRewardId":{"type":"string","nullable":true},"saleRewardId":{"type":"string","nullable":true},"discountId":{"type":"string","nullable":true},"applicationId":{"type":"string","nullable":true,"description":"If the partner submitted an application to join the program, this is the ID of the application."},"bannedAt":{"type":"string","nullable":true,"description":"If the partner was banned from the program, this is the date of the ban."},"bannedReason":{"type":"string","nullable":true,"enum":["tos_violation","inappropriate_content","fake_traffic","fraud","spam","brand_abuse",null],"description":"If the partner was banned from the program, this is the reason for the ban."},"clicks":{"type":"number","default":0,"description":"The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"leads":{"type":"number","default":0,"description":"The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"conversions":{"type":"number","default":0,"description":"The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."},"sales":{"type":"number","default":0,"description":"The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."},"saleAmount":{"type":"number","default":0,"description":"The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"netRevenue":{"type":"number","default":0,"description":"The total net revenue generated by the partner. Defaults to 0 if `includeExpandedFields` is false."},"website":{"type":"string","nullable":true,"description":"The partner's website URL (including the https protocol)."},"websiteTxtRecord":{"type":"string","nullable":true},"websiteVerifiedAt":{"type":"string","nullable":true},"youtube":{"type":"string","nullable":true,"description":"The partner's YouTube channel username (e.g. `johndoe`)."},"youtubeVerifiedAt":{"type":"string","nullable":true},"youtubeSubscriberCount":{"type":"number","nullable":true},"youtubeViewCount":{"type":"number","nullable":true},"twitter":{"type":"string","nullable":true,"description":"The partner's Twitter username (e.g. `johndoe`)."},"twitterVerifiedAt":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true,"description":"The partner's LinkedIn username (e.g. `johndoe`)."},"linkedinVerifiedAt":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true,"description":"The partner's Instagram username (e.g. `johndoe`)."},"instagramVerifiedAt":{"type":"string","nullable":true},"tiktok":{"type":"string","nullable":true,"description":"The partner's TikTok username (e.g. `johndoe`)."},"tiktokVerifiedAt":{"type":"string","nullable":true}},"required":["id","name","companyName","email","image","country","paypalEmail","stripeConnectId","payoutsEnabledAt","programId","partnerId","tenantId","createdAt","status","links","totalCommissions","clicks","leads","conversions","sales","saleAmount","netRevenue"]}}}}},"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"}}}},"/partners/links":{"post":{"operationId":"createPartnerLink","x-speakeasy-name-override":"createLink","summary":"Create a link for a partner","description":"Create a link for a partner that is enrolled in your program.","tags":["Partners"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner to create a link for. Will take precedence over `tenantId` if provided."},"tenantId":{"type":"string","nullable":true,"description":"The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown."},"url":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to shorten (if not provided, the program's default URL will be used). Will throw an error if the domain doesn't match the program's default URL domain."},"key":{"type":"string","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"linkProps":{"type":"object","properties":{"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."}},"description":"Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner."}}}}}},"responses":{"201":{"description":"The created partner 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":"retrieveLinks","x-speakeasy-name-override":"retrieveLinks","summary":"Retrieve a partner's links.","description":"Retrieve a partner's links by their partner ID or tenant ID.","tags":["Partners"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"partnerId","schema":{"type":"string"}},{"in":"query","name":"tenantId","schema":{"type":"string"}}],"responses":{"200":{"description":"The retrieved partner links.","content":{"application/json":{"schema":{"type":"array","items":{"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","format":"uri","description":"The destination URL of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."}},"required":["id","domain","key","shortLink","url","clicks","leads","conversions","sales","saleAmount"],"title":"Link"}}}}},"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"}}}},"/partners/links/upsert":{"put":{"operationId":"upsertPartnerLink","x-speakeasy-name-override":"upsertLink","summary":"Upsert a link for a partner","description":"Upsert a link for a partner that is enrolled in your program. 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":["Partners"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner to create a link for. Will take precedence over `tenantId` if provided."},"tenantId":{"type":"string","nullable":true,"description":"The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown."},"url":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to shorten (if not provided, the program's default URL will be used). Will throw an error if the domain doesn't match the program's default URL domain."},"key":{"type":"string","maxLength":190,"description":"The short link slug. If not provided, a random 7-character slug will be generated."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"linkProps":{"type":"object","properties":{"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."}},"description":"Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner."}}}}}},"responses":{"200":{"description":"The upserted partner 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"}}}},"/partners/analytics":{"get":{"operationId":"retrievePartnerAnalytics","x-speakeasy-name-override":"analytics","summary":"Retrieve analytics for a partner","description":"Retrieve analytics for a partner within a program. The response type vary based on the `groupBy` query parameter.","tags":["Partners"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"partnerId","description":"The ID of the partner to retrieve analytics for.","schema":{"type":"string","description":"The ID of the partner to retrieve analytics for."}},{"in":"query","name":"tenantId","description":"The ID of the tenant that created the link inside your system.","schema":{"type":"string","description":"The ID of the tenant that created the link inside your system."}},{"in":"query","name":"interval","description":"The interval to retrieve analytics for. If undefined, defaults to 24h.","schema":{"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","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`.","schema":{"type":"string","description":"The start date and time when to retrieve analytics from. If set, takes precedence over `interval`."}},{"in":"query","name":"end","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`.","schema":{"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","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","schema":{"type":"string","description":"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.","example":"America/New_York","default":"UTC"}},{"in":"query","name":"query","description":"Search the events by a custom metadata value. Only available for lead and sale events.","schema":{"type":"string","maxLength":10000,"description":"Search the events by a custom metadata value. Only available for lead and sale events.","example":"metadata['key']:'value'"}},{"in":"query","name":"groupBy","description":"The parameter to group the analytics data points by. Defaults to `count` if undefined.","schema":{"type":"string","enum":["top_links","timeseries","count"],"default":"count","description":"The parameter to group the analytics data points by. Defaults to `count` if undefined."}}],"responses":{"200":{"description":"Partner analytics data","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PartnerAnalyticsCount"},{"type":"array","items":{"$ref":"#/components/schemas/PartnerAnalyticsTimeseries"}},{"type":"array","items":{"$ref":"#/components/schemas/PartnerAnalyticsTopLinks"}}]}}}},"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"}}}},"/commissions":{"get":{"operationId":"listCommissions","x-speakeasy-name-override":"list","summary":"Get commissions for a program.","description":"Retrieve a list of commissions for a program.","tags":["Commissions"],"security":[{"token":[]}],"parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["click","lead","sale","custom"]}},{"in":"query","name":"customerId","description":"Filter the list of commissions by the associated customer.","schema":{"type":"string","description":"Filter the list of commissions by the associated customer."}},{"in":"query","name":"payoutId","description":"Filter the list of commissions by the associated payout.","schema":{"type":"string","description":"Filter the list of commissions by the associated payout."}},{"in":"query","name":"partnerId","description":"Filter the list of commissions by the associated partner.","schema":{"type":"string","description":"Filter the list of commissions by the associated partner."}},{"in":"query","name":"groupId","description":"Filter the list of commissions by the associated partner group.","schema":{"type":"string","description":"Filter the list of commissions by the associated partner group."}},{"in":"query","name":"invoiceId","description":"Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice.","schema":{"type":"string","description":"Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice."}},{"in":"query","name":"status","description":"Filter the list of commissions by their corresponding status.","schema":{"type":"string","enum":["pending","processed","paid","refunded","duplicate","fraud","canceled"],"description":"Filter the list of commissions by their corresponding status."}},{"in":"query","name":"sortBy","description":"The field to sort the list of commissions by.","schema":{"type":"string","enum":["createdAt","amount"],"default":"createdAt","description":"The field to sort the list of commissions by."}},{"in":"query","name":"sortOrder","description":"The sort order for the list of commissions.","schema":{"type":"string","enum":["asc","desc"],"default":"desc","description":"The sort order for the list of commissions."}},{"in":"query","name":"interval","description":"The interval to retrieve commissions for.","schema":{"type":"string","enum":["24h","7d","30d","90d","1y","mtd","qtd","ytd","all"],"default":"all","description":"The interval to retrieve commissions for."}},{"in":"query","name":"start","description":"The start date of the date range to filter the commissions by.","schema":{"type":"string","description":"The start date of the date range to filter the commissions by."}},{"in":"query","name":"end","description":"The end date of the date range to filter the commissions by.","schema":{"type":"string","description":"The end date of the date range to filter the commissions by."}},{"in":"query","name":"page","description":"The page number for pagination.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"default":1,"description":"The page number for pagination.","example":1}},{"in":"query","name":"pageSize","description":"The number of items per page.","schema":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":100,"description":"The number of items per page.","example":50}}],"responses":{"200":{"description":"The list of commissions.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The commission's unique ID on Dub.","example":"cm_1JVR7XRCSR0EDBAF39FZ4PMYE"},"type":{"type":"string","enum":["click","lead","sale","custom"]},"amount":{"type":"number"},"earnings":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","processed","paid","refunded","duplicate","fraud","canceled"]},"invoiceId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"userId":{"type":"string","nullable":true,"description":"The user who created the manual commission."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"partner":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."}},"required":["id","name","email","image","payoutsEnabledAt","country"]},"customer":{"type":"object","nullable":true,"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","createdAt"]}},"required":["id","amount","earnings","currency","status","invoiceId","description","quantity","createdAt","updatedAt","partner"]}}}}},"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"}}}},"/commissions/{id}":{"patch":{"operationId":"updateCommission","x-speakeasy-name-override":"update","summary":"Update a commission.","description":"Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales.","tags":["Commissions"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"id","description":"The commission's unique ID on Dub.","schema":{"type":"string","description":"The commission's unique ID on Dub.","example":"cm_1JVR7XRCSR0EDBAF39FZ4PMYE"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0,"description":"The new absolute amount for the sale. Paid commissions cannot be updated."},"modifyAmount":{"type":"number","description":"Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. Takes precedence over `amount`. Paid commissions cannot be updated."},"currency":{"type":"string","default":"usd","description":"The currency of the sale amount to update. Accepts ISO 4217 currency codes."},"status":{"type":"string","enum":["refunded","duplicate","canceled","fraud"],"description":"Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated."}}}}}},"responses":{"200":{"description":"The updated commission.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The commission's unique ID on Dub.","example":"cm_1JVR7XRCSR0EDBAF39FZ4PMYE"},"type":{"type":"string","enum":["click","lead","sale","custom"]},"amount":{"type":"number"},"earnings":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","processed","paid","refunded","duplicate","fraud","canceled"]},"invoiceId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"userId":{"type":"string","nullable":true,"description":"The user who created the manual commission."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"partner":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."}},"required":["id","name","email","image","payoutsEnabledAt","country"]},"customer":{"type":"object","nullable":true,"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","createdAt"]}},"required":["id","amount","earnings","currency","status","invoiceId","description","quantity","createdAt","updatedAt","partner"]}}}},"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"}}}},"/workspaces/{idOrSlug}":{"get":{"operationId":"getWorkspace","x-speakeasy-name-override":"get","summary":"Retrieve a workspace","description":"Retrieve a workspace for the authenticated user.","tags":["Workspaces"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"idOrSlug","description":"The ID or slug of the workspace.","schema":{"type":"string","description":"The ID or slug of the workspace."},"required":true}],"responses":{"200":{"description":"The retrieved workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSchema"}}}},"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":"updateWorkspace","x-speakeasy-name-override":"update","x-speakeasy-max-method-params":2,"summary":"Update a workspace","description":"Update a workspace by ID or slug.","tags":["Workspaces"],"security":[{"token":[]}],"parameters":[{"in":"path","name":"idOrSlug","description":"The ID or slug of the workspace to update.","schema":{"type":"string","description":"The ID or slug of the workspace to update."},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":32},"slug":{"type":"string","minLength":3,"maxLength":48},"logo":{"nullable":true,"anyOf":[{"type":"string","pattern":"^data:image\\/(png|jpeg|jpg|gif|webp);base64,"},{"type":"string","format":"uri"},{"type":"string","format":"uri"}]},"conversionEnabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSchema"}}}},"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"}}}},"/tokens/embed/referrals":{"post":{"operationId":"createReferralsEmbedToken","x-speakeasy-name-override":"referrals","summary":"Create a referrals embed token","description":"Create a referrals embed token for the given partner/tenant.","tags":["Embed Tokens"],"security":[{"token":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partnerId":{"type":"string"},"tenantId":{"type":"string"},"partner":{"type":"object","properties":{"name":{"type":"string","nullable":true,"maxLength":100,"description":"The partner's full name. If undefined, the partner's email will be used in lieu of their name (e.g. `john@acme.com`)"},"email":{"type":"string","format":"email","minLength":1,"maxLength":190,"description":"The partner's email address. Partners will be able to claim their profile by signing up at `partners.dub.co` with this email."},"username":{"type":"string","nullable":true,"maxLength":100,"description":"The partner's unique username in your system (max 100 characters). This will be used to create a short link for the partner using your program's default domain. If not provided, Dub will try to generate a username from the partner's name or email."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image. If not provided, a default avatar will be used."},"tenantId":{"type":"string","description":"The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner."},"groupId":{"type":"string","description":"The group ID to add the partner to. If not provided, the partner will be added to the default group."},"country":{"type":"string","nullable":true,"description":"The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."},"description":{"type":"string","nullable":true,"maxLength":5000,"description":"A brief description of the partner and their background. Max 5,000 characters."},"linkProps":{"type":"object","properties":{"keyLength":{"type":"number","minimum":3,"maximum":190,"description":"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`."},"externalId":{"type":"string","nullable":true,"minLength":1,"maxLength":255,"description":"The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.","example":"123456"},"tenantId":{"type":"string","nullable":true,"maxLength":255,"description":"The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."},"prefix":{"type":"string","description":"The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided."},"archived":{"type":"boolean","description":"Whether the short link is archived. Defaults to `false` if not provided."},"tagIds":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique IDs of the tags assigned to the short link.","example":["clux0rgak00011..."]},"tagNames":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The unique name of the tags assigned to the short link (case insensitive)."},"folderId":{"type":"string","nullable":true,"description":"The unique ID existing folder to assign the short link to."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire at."},"expiredUrl":{"type":"string","nullable":true,"maxLength":32000,"description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","description":"Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided."},"title":{"type":"string","nullable":true,"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"},"description":{"type":"string","nullable":true,"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"},"image":{"type":"string","nullable":true,"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"},"video":{"type":"string","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"},"rewrite":{"type":"boolean","description":"Whether the short link uses link cloaking. Defaults to `false` if not provided."},"ios":{"type":"string","nullable":true,"maxLength":32000,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"maxLength":32000,"description":"The Android destination URL for the short link for Android device targeting."},"doIndex":{"type":"boolean","description":"Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex"},"utm_source":{"type":"string","nullable":true,"description":"The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL."},"ref":{"type":"string","nullable":true,"description":"The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."}},"description":"Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner."}},"required":["email"]}}}}}},"responses":{"201":{"description":"The created public embed token.","content":{"application/json":{"schema":{"type":"object","properties":{"publicToken":{"type":"string"},"expires":{"type":"string"}},"required":["publicToken","expires"]}}}},"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","description":"The URL to generate a QR code for.","schema":{"type":"string","maxLength":32000,"description":"The URL to generate a QR code for."},"required":true},{"in":"query","name":"logo","description":"The logo to include in the QR code. Can only be used with a paid plan on Dub.","schema":{"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","description":"The size of the QR code in pixels. Defaults to `600` if not provided.","schema":{"type":"number","default":600,"description":"The size of the QR code in pixels. Defaults to `600` if not provided."}},{"in":"query","name":"level","description":"The level of error correction to use for the QR code. Defaults to `L` if not provided.","schema":{"type":"string","enum":["L","M","Q","H"],"default":"L","description":"The level of error correction to use for the QR code. Defaults to `L` if not provided."}},{"in":"query","name":"fgColor","description":"The foreground color of the QR code in hex format. Defaults to `#000000` if not provided.","schema":{"type":"string","default":"#000000","description":"The foreground color of the QR code in hex format. Defaults to `#000000` if not provided."}},{"in":"query","name":"bgColor","description":"The background color of the QR code in hex format. Defaults to `#ffffff` if not provided.","schema":{"type":"string","default":"#FFFFFF","description":"The background color of the QR code in hex format. Defaults to `#ffffff` if not provided."}},{"in":"query","name":"hideLogo","description":"Whether to hide the logo in the QR code. Can only be used with a paid plan on Dub.","schema":{"type":"boolean","default":"false","description":"Whether to hide the logo in the QR code. Can only be used with a paid plan on Dub."}},{"in":"query","name":"margin","description":"The size of the margin around the QR code. Defaults to 2 if not provided.","schema":{"type":"number","default":2,"description":"The size of the margin around the QR code. Defaults to 2 if not provided."}},{"in":"query","name":"includeMargin","description":"DEPRECATED: Margin is included by default. Use the `margin` prop to customize the margin size.","schema":{"type":"boolean","default":"true","description":"DEPRECATED: Margin is included by default. Use the `margin` prop to customize the margin size.","deprecated":true}}],"responses":{"200":{"description":"The QR code","content":{"image/png":{"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":{"securitySchemes":{"token":{"type":"http","description":"Default authentication mechanism","scheme":"bearer","x-speakeasy-example":"DUB_API_KEY"}},"schemas":{"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","format":"uri","description":"The destination URL of the short link."},"trackConversion":{"type":"boolean","default":false,"description":"Whether to track conversions for the short link."},"externalId":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean","default":false,"description":"Whether the short link is archived."},"expiresAt":{"type":"string","nullable":true,"description":"The date and time when the short link will expire in ISO-8601 format."},"expiredUrl":{"type":"string","nullable":true,"format":"uri","description":"The URL to redirect to when the short link has expired."},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean","default":false,"description":"Whether the short link uses Custom Link Previews feature."},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean","default":false,"description":"Whether the short link uses link cloaking."},"doIndex":{"type":"boolean","default":false,"description":"Whether to allow search engines to index the short link."},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean","default":false,"description":"Whether the short link's stats are publicly accessible."},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true,"description":"The date and time when the tests started."},"testCompletedAt":{"type":"string","nullable":true,"description":"The date and time when the tests were or will be completed."},"userId":{"type":"string","nullable":true,"description":"The user ID of the creator of the short link."},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string","nullable":true,"description":"The date and time when the short link was last clicked."},"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":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"WorkspaceSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the workspace."},"name":{"type":"string","description":"The name of the workspace."},"slug":{"type":"string","description":"The slug of the workspace."},"logo":{"type":"string","nullable":true,"default":null,"description":"The logo of the workspace."},"inviteCode":{"type":"string","nullable":true,"description":"The invite code of the workspace."},"plan":{"type":"string","enum":["free","pro","business","business plus","business extra","business max","advanced","enterprise"],"description":"The plan of the workspace."},"stripeId":{"type":"string","nullable":true,"description":"The Stripe ID of the workspace."},"billingCycleStart":{"type":"number","description":"The date and time when the billing cycle starts for the workspace."},"paymentFailedAt":{"type":"string","nullable":true,"description":"The date and time when the payment failed for the workspace."},"stripeConnectId":{"type":"string","nullable":true,"description":"The Stripe Connect ID of the workspace."},"totalLinks":{"type":"number","description":"The total number of links in the workspace."},"usage":{"type":"number","description":"The usage of the workspace."},"usageLimit":{"type":"number","description":"The usage limit of the workspace."},"linksUsage":{"type":"number","description":"The links usage of the workspace."},"linksLimit":{"type":"number","description":"The links limit of the workspace."},"payoutsUsage":{"type":"number","description":"The dollar amount of partner payouts processed in the current billing cycle (in cents)."},"payoutsLimit":{"type":"number","description":"The max dollar amount of partner payouts that can be processed within a billing cycle (in cents)."},"payoutFee":{"type":"number","description":"The processing fee (in decimals) for partner payouts. For card payments, an additional 0.03 is added to the fee. Learn more: https://d.to/payouts"},"domainsLimit":{"type":"number","description":"The domains limit of the workspace."},"tagsLimit":{"type":"number","description":"The tags limit of the workspace."},"foldersUsage":{"type":"number","description":"The folders usage of the workspace."},"foldersLimit":{"type":"number","description":"The folders limit of the workspace."},"groupsLimit":{"type":"number","description":"The groups limit of the workspace."},"usersLimit":{"type":"number","description":"The users limit of the workspace."},"aiUsage":{"type":"number","description":"The AI usage of the workspace."},"aiLimit":{"type":"number","description":"The AI limit of the workspace."},"conversionEnabled":{"type":"boolean","description":"Whether the workspace has conversion tracking enabled automatically for new links (d.to/conversions)."},"dotLinkClaimed":{"type":"boolean","description":"Whether the workspace has claimed a free .link domain. (dub.link/free)"},"createdAt":{"type":"string","description":"The date and time when the workspace was created."},"users":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["owner","member"],"description":"The role of the authenticated user in the workspace."},"defaultFolderId":{"type":"string","nullable":true,"description":"The ID of the default folder for the user in the workspace."}},"required":["role","defaultFolderId"]},"description":"The role of the authenticated user in the workspace."},"domains":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","description":"The domain name.","example":"acme.com"},"primary":{"type":"boolean","default":false,"description":"Whether the domain is the primary domain for the workspace."},"verified":{"type":"boolean","default":false,"description":"Whether the domain is verified."}},"required":["slug","primary","verified"]},"description":"The domains of the workspace."},"flags":{"type":"object","additionalProperties":{"type":"boolean"},"description":"The feature flags of the workspace, indicating which features are enabled."},"store":{"type":"object","nullable":true,"additionalProperties":{},"description":"The miscellaneous key-value store of the workspace."},"allowedHostnames":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Specifies hostnames permitted for client-side click tracking.","example":["dub.sh"]}},"required":["id","name","slug","logo","inviteCode","plan","stripeId","billingCycleStart","paymentFailedAt","stripeConnectId","totalLinks","usage","usageLimit","linksUsage","linksLimit","payoutsUsage","payoutsLimit","payoutFee","domainsLimit","tagsLimit","foldersUsage","foldersLimit","groupsLimit","usersLimit","aiUsage","aiLimit","conversionEnabled","dotLinkClaimed","createdAt","users","domains","store","allowedHostnames"],"title":"Workspace"},"TagSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the tag."},"name":{"type":"string","description":"The name of the tag."},"color":{"type":"string","enum":["red","yellow","green","blue","purple","brown","pink"],"description":"The color of the tag."}},"required":["id","name","color"],"title":"Tag"},"FolderSchema":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the folder."},"name":{"type":"string","description":"The name of the folder."},"type":{"type":"string","enum":["default","mega"]},"accessLevel":{"type":"string","nullable":true,"enum":["write","read",null],"default":null,"description":"The access level of the folder within the workspace."},"createdAt":{"type":"string","description":"The date the folder was created."},"updatedAt":{"type":"string","description":"The date the folder was updated."}},"required":["id","name","type","accessLevel","createdAt","updatedAt"]},"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":{"type":"boolean","default":false,"description":"Whether the domain is verified."},"primary":{"type":"boolean","default":false,"description":"Whether the domain is the primary domain for the workspace."},"archived":{"type":"boolean","description":"Whether the domain is archived.","default":false},"placeholder":{"type":"string","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/what-is-dub"},"expiredUrl":{"type":"string","nullable":true,"description":"The URL to redirect to when a link under this domain has expired.","example":"https://acme.com/expired"},"notFoundUrl":{"type":"string","nullable":true,"description":"The URL to redirect to when a link under this domain doesn't exist.","example":"https://acme.com/not-found"},"logo":{"type":"string","nullable":true,"description":"The logo of the domain."},"assetLinks":{"type":"string","nullable":true,"default":null,"description":"assetLinks.json configuration file (for deep link support on Android)."},"appleAppSiteAssociation":{"type":"string","nullable":true,"default":null,"description":"apple-app-site-association configuration file (for deep link support on iOS)."},"createdAt":{"type":"string","description":"The date the domain was created."},"updatedAt":{"type":"string","description":"The date the domain was last updated."},"registeredDomain":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The ID of the registered domain record."},"autoRenewalDisabledAt":{"type":"string","nullable":true,"description":"The date the domain auto-renew is disabled."},"createdAt":{"type":"string","description":"The date the domain was created."},"expiresAt":{"type":"string","description":"The date the domain expires."},"renewalFee":{"type":"number","description":"The fee to renew the domain."}},"required":["id","autoRenewalDisabledAt","createdAt","expiresAt","renewalFee"],"description":"The registered domain record."}},"required":["id","slug","verified","primary","archived","placeholder","expiredUrl","notFoundUrl","logo","assetLinks","appleAppSiteAssociation","createdAt","updatedAt","registeredDomain"]},"WebhookEvent":{"anyOf":[{"$ref":"#/components/schemas/LinkWebhookEvent"},{"$ref":"#/components/schemas/LinkClickedEvent"},{"$ref":"#/components/schemas/LeadCreatedEvent"},{"$ref":"#/components/schemas/SaleCreatedEvent"},{"$ref":"#/components/schemas/PartnerEnrolledEvent"},{"$ref":"#/components/schemas/CommissionCreatedEvent"}],"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","not_found","internal_server_error","unauthorized","forbidden","rate_limit_exceeded","invite_expired","invite_pending","exceeded_limit","conflict","unprocessable_entity"],"description":"The error code."}},"required":["error","code"],"title":"LinkError"},"linkGeoTargeting":{"type":"object","nullable":true,"additionalProperties":{"type":"string","maxLength":32000},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"countryCode":{"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 for more information."},"regionCode":{"type":"string","description":"The ISO 3166-2 region code to retrieve analytics for."},"continentCode":{"type":"string","enum":["AF","AN","AS","EU","NA","OC","SA"],"description":"The continent to retrieve analytics for."},"AnalyticsCount":{"type":"object","properties":{"clicks":{"type":"number","description":"The total number of clicks","default":0},"leads":{"type":"number","description":"The total number of leads","default":0},"sales":{"type":"number","description":"The total number of sales","default":0},"saleAmount":{"type":"number","description":"The total amount of sales, in cents","default":0}},"required":["clicks","leads","sales","saleAmount"],"title":"AnalyticsCount"},"AnalyticsTimeseries":{"type":"object","properties":{"start":{"type":"string","description":"The starting timestamp of the interval"},"clicks":{"type":"number","description":"The number of clicks in the interval","default":0},"leads":{"type":"number","description":"The number of leads in the interval","default":0},"sales":{"type":"number","description":"The number of sales in the interval","default":0},"saleAmount":{"type":"number","description":"The total amount of sales in the interval, in cents","default":0}},"required":["start","clicks","leads","sales","saleAmount"]},"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":{"type":"number","description":"The number of clicks from this continent","default":0},"leads":{"type":"number","description":"The number of leads from this continent","default":0},"sales":{"type":"number","description":"The number of sales from this continent","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this continent, in cents","default":0}},"required":["continent","clicks","leads","sales","saleAmount"]},"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":{"type":"string","enum":["*"],"default":"*"},"city":{"type":"string","enum":["*"],"default":"*"},"clicks":{"type":"number","description":"The number of clicks from this country","default":0},"leads":{"type":"number","description":"The number of leads from this country","default":0},"sales":{"type":"number","description":"The number of sales from this country","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this country, in cents","default":0}},"required":["country","region","city","clicks","leads","sales","saleAmount"]},"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":{"type":"string","enum":["*"],"default":"*"},"clicks":{"type":"number","description":"The number of clicks from this region","default":0},"leads":{"type":"number","description":"The number of leads from this region","default":0},"sales":{"type":"number","description":"The number of sales from this region","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this region, in cents","default":0}},"required":["country","region","city","clicks","leads","sales","saleAmount"]},"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":{"type":"number","description":"The number of clicks from this city","default":0},"leads":{"type":"number","description":"The number of leads from this city","default":0},"sales":{"type":"number","description":"The number of sales from this city","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this city, in cents","default":0}},"required":["country","region","city","clicks","leads","sales","saleAmount"]},"AnalyticsDevices":{"type":"object","properties":{"device":{"type":"string","description":"The name of the device"},"clicks":{"type":"number","description":"The number of clicks from this device","default":0},"leads":{"type":"number","description":"The number of leads from this device","default":0},"sales":{"type":"number","description":"The number of sales from this device","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this device, in cents","default":0}},"required":["device","clicks","leads","sales","saleAmount"]},"AnalyticsBrowsers":{"type":"object","properties":{"browser":{"type":"string","description":"The name of the browser"},"clicks":{"type":"number","description":"The number of clicks from this browser","default":0},"leads":{"type":"number","description":"The number of leads from this browser","default":0},"sales":{"type":"number","description":"The number of sales from this browser","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this browser, in cents","default":0}},"required":["browser","clicks","leads","sales","saleAmount"]},"AnalyticsOS":{"type":"object","properties":{"os":{"type":"string","description":"The name of the OS"},"clicks":{"type":"number","description":"The number of clicks from this OS","default":0},"leads":{"type":"number","description":"The number of leads from this OS","default":0},"sales":{"type":"number","description":"The number of sales from this OS","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this OS, in cents","default":0}},"required":["os","clicks","leads","sales","saleAmount"]},"AnalyticsTriggers":{"type":"object","properties":{"trigger":{"type":"string","enum":["qr","link","pageview","deeplink"],"description":"The type of trigger method: link click or QR scan"},"clicks":{"type":"number","description":"The number of clicks from this trigger method","default":0},"leads":{"type":"number","description":"The number of leads from this trigger method","default":0},"sales":{"type":"number","description":"The number of sales from this trigger method","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this trigger method, in cents","default":0}},"required":["trigger","clicks","leads","sales","saleAmount"]},"AnalyticsReferers":{"type":"object","properties":{"referer":{"type":"string","description":"The name of the referer. If unknown, this will be `(direct)`"},"clicks":{"type":"number","description":"The number of clicks from this referer","default":0},"leads":{"type":"number","description":"The number of leads from this referer","default":0},"sales":{"type":"number","description":"The number of sales from this referer","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this referer, in cents","default":0}},"required":["referer","clicks","leads","sales","saleAmount"]},"AnalyticsRefererUrls":{"type":"object","properties":{"refererUrl":{"type":"string","description":"The full URL of the referer. If unknown, this will be `(direct)`"},"clicks":{"type":"number","description":"The number of clicks from this referer to this URL","default":0},"leads":{"type":"number","description":"The number of leads from this referer to this URL","default":0},"sales":{"type":"number","description":"The number of sales from this referer to this URL","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this referer to this URL, in cents","default":0}},"required":["refererUrl","clicks","leads","sales","saleAmount"]},"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"},"comments":{"type":"string","nullable":true,"description":"The comments of the short link"},"title":{"type":"string","nullable":true,"description":"The custom link preview title (og:title)"},"createdAt":{"type":"string","description":"The creation timestamp of the short link"},"clicks":{"type":"number","description":"The number of clicks from this link","default":0},"leads":{"type":"number","description":"The number of leads from this link","default":0},"sales":{"type":"number","description":"The number of sales from this link","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this link, in cents","default":0}},"required":["link","id","domain","key","shortLink","url","createdAt","clicks","leads","sales","saleAmount"]},"AnalyticsTopUrls":{"type":"object","properties":{"url":{"type":"string","description":"The destination URL"},"clicks":{"type":"number","description":"The number of clicks from this URL","default":0},"leads":{"type":"number","description":"The number of leads from this URL","default":0},"sales":{"type":"number","description":"The number of sales from this URL","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this URL, in cents","default":0}},"required":["url","clicks","leads","sales","saleAmount"]},"ClickEvent":{"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"},"trigger":{"type":"string","nullable":true},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"click_id":{"type":"string","description":"Deprecated: Use `click.id` instead.","deprecated":true},"link_id":{"type":"string","description":"Deprecated: Use `link.id` instead.","deprecated":true},"domain":{"type":"string","description":"Deprecated: Use `link.domain` instead.","deprecated":true},"key":{"type":"string","description":"Deprecated: Use `link.key` instead.","deprecated":true},"url":{"type":"string","description":"Deprecated: Use `click.url` instead.","deprecated":true},"continent":{"type":"string","description":"Deprecated: Use `click.continent` instead.","deprecated":true},"country":{"type":"string","description":"Deprecated: Use `click.country` instead.","deprecated":true},"city":{"type":"string","description":"Deprecated: Use `click.city` instead.","deprecated":true},"device":{"type":"string","description":"Deprecated: Use `click.device` instead.","deprecated":true},"browser":{"type":"string","description":"Deprecated: Use `click.browser` instead.","deprecated":true},"os":{"type":"string","description":"Deprecated: Use `click.os` instead.","deprecated":true},"qr":{"type":"number","description":"Deprecated: Use `click.qr` instead.","deprecated":true},"ip":{"type":"string","description":"Deprecated: Use `click.ip` instead.","deprecated":true}},"required":["event","timestamp","click","link","click_id","link_id","domain","key","url","continent","country","city","device","browser","os","qr","ip"],"title":"ClickEvent"},"LeadEvent":{"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"},"trigger":{"type":"string","nullable":true},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","createdAt"]},"click_id":{"type":"string","description":"Deprecated: Use `click.id` instead.","deprecated":true},"link_id":{"type":"string","description":"Deprecated: Use `link.id` instead.","deprecated":true},"domain":{"type":"string","description":"Deprecated: Use `link.domain` instead.","deprecated":true},"key":{"type":"string","description":"Deprecated: Use `link.key` instead.","deprecated":true},"url":{"type":"string","description":"Deprecated: Use `click.url` instead.","deprecated":true},"continent":{"type":"string","description":"Deprecated: Use `click.continent` instead.","deprecated":true},"country":{"type":"string","description":"Deprecated: Use `click.country` instead.","deprecated":true},"city":{"type":"string","description":"Deprecated: Use `click.city` instead.","deprecated":true},"device":{"type":"string","description":"Deprecated: Use `click.device` instead.","deprecated":true},"browser":{"type":"string","description":"Deprecated: Use `click.browser` instead.","deprecated":true},"os":{"type":"string","description":"Deprecated: Use `click.os` instead.","deprecated":true},"qr":{"type":"number","description":"Deprecated: Use `click.qr` instead.","deprecated":true},"ip":{"type":"string","description":"Deprecated: Use `click.ip` instead.","deprecated":true}},"required":["event","timestamp","eventId","eventName","click","link","customer","click_id","link_id","domain","key","url","continent","country","city","device","browser","os","qr","ip"],"title":"LeadEvent"},"SaleEvent":{"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,"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. `1437` JPY). Learn more: https://d.to/currency"},"invoiceId":{"type":"string","nullable":true,"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."},"paymentProcessor":{"type":"string","enum":["stripe","shopify","polar","paddle","revenuecat","custom"],"default":"custom","description":"The payment processor via which the sale was made."}},"required":["amount","invoiceId","paymentProcessor"]},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"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"},"trigger":{"type":"string","nullable":true},"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"]},"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","createdAt"]},"saleAmount":{"type":"number","description":"Deprecated: Use `sale.amount` instead.","deprecated":true},"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","description":"Deprecated: Use `click.id` instead.","deprecated":true},"link_id":{"type":"string","description":"Deprecated: Use `link.id` instead.","deprecated":true},"domain":{"type":"string","description":"Deprecated: Use `link.domain` instead.","deprecated":true},"key":{"type":"string","description":"Deprecated: Use `link.key` instead.","deprecated":true},"url":{"type":"string","description":"Deprecated: Use `click.url` instead.","deprecated":true},"continent":{"type":"string","description":"Deprecated: Use `click.continent` instead.","deprecated":true},"country":{"type":"string","description":"Deprecated: Use `click.country` instead.","deprecated":true},"city":{"type":"string","description":"Deprecated: Use `click.city` instead.","deprecated":true},"device":{"type":"string","description":"Deprecated: Use `click.device` instead.","deprecated":true},"browser":{"type":"string","description":"Deprecated: Use `click.browser` instead.","deprecated":true},"os":{"type":"string","description":"Deprecated: Use `click.os` instead.","deprecated":true},"qr":{"type":"number","description":"Deprecated: Use `click.qr` instead.","deprecated":true},"ip":{"type":"string","description":"Deprecated: Use `click.ip` instead.","deprecated":true}},"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"],"title":"SaleEvent"},"PartnerAnalyticsCount":{"type":"object","properties":{"clicks":{"type":"number","description":"The total number of clicks","default":0},"leads":{"type":"number","description":"The total number of leads","default":0},"sales":{"type":"number","description":"The total number of sales","default":0},"saleAmount":{"type":"number","description":"The total amount of sales, in cents","default":0},"earnings":{"type":"number","default":0}},"required":["clicks","leads","sales","saleAmount","earnings"],"title":"PartnerAnalyticsCount"},"PartnerAnalyticsTimeseries":{"type":"object","properties":{"start":{"type":"string","description":"The starting timestamp of the interval"},"clicks":{"type":"number","description":"The number of clicks in the interval","default":0},"leads":{"type":"number","description":"The number of leads in the interval","default":0},"sales":{"type":"number","description":"The number of sales in the interval","default":0},"saleAmount":{"type":"number","description":"The total amount of sales in the interval, in cents","default":0},"earnings":{"type":"number","default":0}},"required":["start","clicks","leads","sales","saleAmount","earnings"],"title":"PartnerAnalyticsTimeseries"},"PartnerAnalyticsTopLinks":{"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"},"comments":{"type":"string","nullable":true,"description":"The comments of the short link"},"title":{"type":"string","nullable":true,"description":"The custom link preview title (og:title)"},"createdAt":{"type":"string","description":"The creation timestamp of the short link"},"clicks":{"type":"number","description":"The number of clicks from this link","default":0},"leads":{"type":"number","description":"The number of leads from this link","default":0},"sales":{"type":"number","description":"The number of sales from this link","default":0},"saleAmount":{"type":"number","description":"The total amount of sales from this link, in cents","default":0},"earnings":{"type":"number","default":0}},"required":["link","id","domain","key","shortLink","url","createdAt","clicks","leads","sales","saleAmount","earnings"],"title":"PartnerAnalyticsTopLinks"},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"}},"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"},"trigger":{"type":"string","nullable":true},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"}},"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","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"},"trigger":{"type":"string","nullable":true},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"totalClicks":{"type":"number"},"totalLeads":{"type":"number"},"totalConversions":{"type":"number"},"totalSales":{"type":"number"},"totalSaleAmount":{"type":"number"},"totalCommissions":{"type":"number"}},"required":["id","name","email","image","payoutsEnabledAt","country","totalClicks","totalLeads","totalConversions","totalSales","totalSaleAmount","totalCommissions"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{},"default":null}},"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","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"},"trigger":{"type":"string","nullable":true},"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":{"type":"string","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."},"tenantId":{"type":"string","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."},"programId":{"type":"string","nullable":true,"description":"The ID of the program the short link is associated with."},"partnerId":{"type":"string","nullable":true,"description":"The ID of the partner the short link is associated with."},"archived":{"type":"boolean"},"expiresAt":{"type":"string"},"expiredUrl":{"type":"string","nullable":true},"password":{"type":"string","nullable":true,"description":"The password required to access the destination URL of the short link."},"proxy":{"type":"boolean"},"title":{"type":"string","nullable":true,"description":"The title of the short link. Will be used for Custom Link Previews if `proxy` is true."},"description":{"type":"string","nullable":true,"description":"The description of the short link. Will be used for Custom Link Previews if `proxy` is true."},"image":{"type":"string","nullable":true,"description":"The image of the short link. Will be used for Custom Link Previews if `proxy` is true."},"video":{"type":"string","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"},"rewrite":{"type":"boolean"},"doIndex":{"type":"boolean"},"ios":{"type":"string","nullable":true,"description":"The iOS destination URL for the short link for iOS device targeting."},"android":{"type":"string","nullable":true,"description":"The Android destination URL for the short link for Android device targeting."},"geo":{"type":"object","nullable":true,"additionalProperties":{"type":"string","format":"uri"},"description":"Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."},"publicStats":{"type":"boolean"},"tags":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/TagSchema"},"description":"The tags assigned to the short link."},"folderId":{"type":"string","nullable":true,"description":"The unique ID of the folder assigned to the short link."},"webhookIds":{"type":"array","items":{"type":"string"},"description":"The IDs of the webhooks that the short link is associated with."},"comments":{"type":"string","nullable":true,"description":"The comments for the short link."},"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":{"type":"string","nullable":true,"description":"The UTM source of the short link."},"utm_medium":{"type":"string","nullable":true,"description":"The UTM medium of the short link."},"utm_campaign":{"type":"string","nullable":true,"description":"The UTM campaign of the short link."},"utm_term":{"type":"string","nullable":true,"description":"The UTM term of the short link."},"utm_content":{"type":"string","nullable":true,"description":"The UTM content of the short link."},"testVariants":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"percentage":{"type":"number","minimum":10,"maximum":90}},"required":["url","percentage"]},"minItems":2,"maxItems":4,"description":"An array of A/B test URLs and the percentage of traffic to send to each URL.","example":[{"url":"https://example.com/variant-1","percentage":50},{"url":"https://example.com/variant-2","percentage":50}]},"testStartedAt":{"type":"string","nullable":true},"testCompletedAt":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"workspaceId":{"type":"string","description":"The workspace ID of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."},"lastClicked":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tagId":{"type":"string","nullable":true,"description":"Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link.","deprecated":true},"projectId":{"type":"string","description":"Deprecated: Use `workspaceId` instead. The project ID of the short link.","deprecated":true}},"required":["id","domain","key","url","trackConversion","externalId","tenantId","programId","partnerId","archived","expiresAt","expiredUrl","password","proxy","title","description","image","video","rewrite","doIndex","ios","android","geo","publicStats","tags","folderId","webhookIds","comments","shortLink","qrCode","utm_source","utm_medium","utm_campaign","utm_term","utm_content","testStartedAt","testCompletedAt","userId","workspaceId","clicks","leads","conversions","sales","saleAmount","lastClicked","createdAt","updatedAt","tagId","projectId"],"title":"Link"},"sale":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"},"paymentProcessor":{"type":"string"},"invoiceId":{"type":"string","nullable":true}},"required":["amount","currency","paymentProcessor","invoiceId"]},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"totalClicks":{"type":"number"},"totalLeads":{"type":"number"},"totalConversions":{"type":"number"},"totalSales":{"type":"number"},"totalSaleAmount":{"type":"number"},"totalCommissions":{"type":"number"}},"required":["id","name","email","image","payoutsEnabledAt","country","totalClicks","totalLeads","totalConversions","totalSales","totalSaleAmount","totalCommissions"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{},"default":null}},"required":["eventName","customer","click","link","sale","metadata"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a sale is created."},"PartnerEnrolledEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["partner.enrolled"]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"companyName":{"type":"string","nullable":true,"maxLength":190,"description":"If the partner profile type is a company, this is the partner's legal company name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"description":{"type":"string","nullable":true,"maxLength":5000,"description":"A brief description of the partner and their background."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"paypalEmail":{"type":"string","nullable":true,"description":"The partner's PayPal email (for receiving payouts via PayPal)."},"stripeConnectId":{"type":"string","nullable":true,"description":"The partner's Stripe Connect ID (for receiving payouts via Stripe)."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"monthlyTraffic":{"type":"string","nullable":true,"enum":["ZeroToOneThousand","OneThousandToTenThousand","TenThousandToFiftyThousand","FiftyThousandToOneHundredThousand","OneHundredThousandPlus",null],"description":"The partner's monthly traffic."},"industryInterests":{"type":"array","items":{"type":"string","enum":["SaaS","DevTool","AI","Creative_And_Design","Productivity_Software","Marketing","Gaming","Finance","Sales","Ecommerce","Customer_Service_And_Support","Content_Management","Human_Resources","Security","Analytics_And_Data","Social_Media","Consumer_Tech","Education_And_Learning","Health_And_Fitness","Food_And_Beverage","Travel_And_Lifestyle","Entertainment_And_Media","Sports","Science_And_Engineering"]},"maxItems":8,"description":"The partner's industry interests."},"preferredEarningStructures":{"type":"array","items":{"type":"string","enum":["Revenue_Share","Per_Lead","Per_Sale","Per_Click","One_Time_Payment"]},"description":"The partner's preferred earning structures."},"salesChannels":{"type":"array","items":{"type":"string","enum":["Blogs","Coupons","Direct_Reselling","Newsletters","Social_Media","Events","Company_Referrals"]},"description":"The partner's sales channels."},"programId":{"type":"string","description":"The program's unique ID on Dub."},"groupId":{"type":"string","nullable":true,"description":"The partner's group ID on Dub."},"partnerId":{"type":"string","description":"The partner's unique ID on Dub."},"tenantId":{"type":"string","nullable":true,"description":"The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future."},"createdAt":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected","invited","declined","banned","archived"],"description":"The status of the partner's enrollment in the program."},"links":{"type":"array","nullable":true,"items":{"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","format":"uri","description":"The destination URL of the short link."},"clicks":{"type":"number","default":0,"description":"The number of clicks on the short link."},"leads":{"type":"number","default":0,"description":"The number of leads the short link has generated."},"conversions":{"type":"number","default":0,"description":"The number of leads that converted to paying customers."},"sales":{"type":"number","default":0,"description":"The total number of sales (includes recurring sales) generated by the short link."},"saleAmount":{"type":"number","default":0,"description":"The total dollar value of sales (in cents) generated by the short link."}},"required":["id","domain","key","shortLink","url","clicks","leads","conversions","sales","saleAmount"],"title":"Link"},"description":"The partner's referral links in this program."},"totalCommissions":{"type":"number","default":0,"description":"The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."},"clickRewardId":{"type":"string","nullable":true},"leadRewardId":{"type":"string","nullable":true},"saleRewardId":{"type":"string","nullable":true},"discountId":{"type":"string","nullable":true},"applicationId":{"type":"string","nullable":true,"description":"If the partner submitted an application to join the program, this is the ID of the application."},"bannedAt":{"type":"string","nullable":true,"description":"If the partner was banned from the program, this is the date of the ban."},"bannedReason":{"type":"string","nullable":true,"enum":["tos_violation","inappropriate_content","fake_traffic","fraud","spam","brand_abuse",null],"description":"If the partner was banned from the program, this is the reason for the ban."},"clicks":{"type":"number","default":0,"description":"The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"leads":{"type":"number","default":0,"description":"The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"conversions":{"type":"number","default":0,"description":"The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."},"sales":{"type":"number","default":0,"description":"The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."},"saleAmount":{"type":"number","default":0,"description":"The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."},"netRevenue":{"type":"number","default":0,"description":"The total net revenue generated by the partner. Defaults to 0 if `includeExpandedFields` is false."},"website":{"type":"string","nullable":true,"description":"The partner's website URL (including the https protocol)."},"websiteTxtRecord":{"type":"string","nullable":true},"websiteVerifiedAt":{"type":"string","nullable":true},"youtube":{"type":"string","nullable":true,"description":"The partner's YouTube channel username (e.g. `johndoe`)."},"youtubeVerifiedAt":{"type":"string","nullable":true},"youtubeSubscriberCount":{"type":"number","nullable":true},"youtubeViewCount":{"type":"number","nullable":true},"twitter":{"type":"string","nullable":true,"description":"The partner's Twitter username (e.g. `johndoe`)."},"twitterVerifiedAt":{"type":"string","nullable":true},"linkedin":{"type":"string","nullable":true,"description":"The partner's LinkedIn username (e.g. `johndoe`)."},"linkedinVerifiedAt":{"type":"string","nullable":true},"instagram":{"type":"string","nullable":true,"description":"The partner's Instagram username (e.g. `johndoe`)."},"instagramVerifiedAt":{"type":"string","nullable":true},"tiktok":{"type":"string","nullable":true,"description":"The partner's TikTok username (e.g. `johndoe`)."},"tiktokVerifiedAt":{"type":"string","nullable":true}},"required":["id","name","companyName","email","image","country","paypalEmail","stripeConnectId","payoutsEnabledAt","programId","partnerId","tenantId","createdAt","status","links","totalCommissions","clicks","leads","conversions","sales","saleAmount","netRevenue"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a partner is enrolled."},"CommissionCreatedEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","enum":["commission.created"]},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","description":"The commission's unique ID on Dub.","example":"cm_1JVR7XRCSR0EDBAF39FZ4PMYE"},"type":{"type":"string","enum":["click","lead","sale","custom"]},"amount":{"type":"number"},"earnings":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string","enum":["pending","processed","paid","refunded","duplicate","fraud","canceled"]},"invoiceId":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"quantity":{"type":"number"},"userId":{"type":"string","nullable":true,"description":"The user who created the manual commission."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"partner":{"type":"object","properties":{"id":{"type":"string","description":"The partner's unique ID on Dub."},"name":{"type":"string","maxLength":190,"description":"The partner's full legal name."},"email":{"type":"string","nullable":true,"maxLength":190,"description":"The partner's email address. Should be a unique value across Dub."},"image":{"type":"string","nullable":true,"description":"The partner's avatar image."},"payoutsEnabledAt":{"type":"string","nullable":true,"description":"The date when the partner enabled payouts."},"country":{"type":"string","nullable":true,"description":"The partner's country (required for tax purposes)."},"totalClicks":{"type":"number"},"totalLeads":{"type":"number"},"totalConversions":{"type":"number"},"totalSales":{"type":"number"},"totalSaleAmount":{"type":"number"},"totalCommissions":{"type":"number"}},"required":["id","name","email","image","payoutsEnabledAt","country","totalClicks","totalLeads","totalConversions","totalSales","totalSaleAmount","totalCommissions"]},"customer":{"type":"object","nullable":true,"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`)."},"externalId":{"type":"string","description":"Unique identifier for the customer in the client's app."},"name":{"type":"string","description":"Name of the customer."},"email":{"type":"string","nullable":true,"description":"Email of the customer."},"avatar":{"type":"string","nullable":true,"description":"Avatar URL of the customer."},"country":{"type":"string","nullable":true,"description":"Country of the customer."},"sales":{"type":"number","nullable":true,"description":"Total number of sales for the customer."},"saleAmount":{"type":"number","nullable":true,"description":"Total amount of sales for the customer."},"createdAt":{"type":"string","description":"The date the customer was created."}},"required":["id","externalId","name","createdAt"]}},"required":["id","amount","earnings","currency","status","invoiceId","description","quantity","createdAt","updatedAt","partner"]}},"required":["id","event","createdAt","data"],"description":"Triggered when a commission is created for a partner."}},"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"]}}}}}}}