Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

write openapi spec to a file

Kiran Kbb2aa4274d92
diff --git a/apps/web/app/api/route.ts b/apps/web/app/api/route.ts
index 168f2b8a00..6d1df0d0e5 100644
--- a/apps/web/app/api/route.ts
+++ b/apps/web/app/api/route.ts
@@ -1,9 +1,8 @@
-import { openApiObject } from "@/lib/openapi";
+import { document } from "@/lib/openapi";
import { NextResponse } from "next/server";
-import { createDocument } from "zod-openapi";
-export const runtime = "edge";
+// export const runtime = "edge";
export function GET() {
- return NextResponse.json(createDocument(openApiObject));
-}
+ return NextResponse.json(document);
+}
\ No newline at end of file
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index 3d3705333a..b758c542ac 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -6,7 +6,9 @@ import {
WorkspaceSchema,
} from "@/lib/zod/schemas";
import { API_DOMAIN } from "@dub/utils";
-import { ZodOpenApiObject } from "zod-openapi";
+import fs from "fs";
+import path from "path";
+import { createDocument } from "zod-openapi";
import { analyticsPaths } from "./analytics";
import { domainsPaths } from "./domains";
import { linksPaths } from "./links";
@@ -15,7 +17,7 @@ import { qrCodePaths } from "./qr";
import { tagsPaths } from "./tags";
import { workspacesPaths } from "./workspaces";
-export const openApiObject: ZodOpenApiObject = {
+export const document = createDocument({
openapi: "3.0.3",
info: {
title: "Dub.co API",
@@ -88,4 +90,6 @@ export const openApiObject: ZodOpenApiObject = {
},
],
},
-};
+});
+
+fs.writeFileSync(path.join("openapi.json"), JSON.stringify(document, null, 2));
diff --git a/apps/web/openapi.json b/apps/web/openapi.json
new file mode 100644
index 0000000000..4d8844b0d8
--- /dev/null
+++ b/apps/web/openapi.json
@@ -0,0 +1,11863 @@
+{
+ "openapi": "3.0.3",
+ "info": {
+ "title": "Dub.co API",
+ "description": "Dub is link management infrastructure for companies to create marketing campaigns, link sharing features, and referral programs.",
+ "version": "0.0.1",
+ "contact": {
+ "name": "Dub.co Support",
+ "email": "[email protected]",
+ "url": "https://dub.co/api"
+ },
+ "license": {
+ "name": "AGPL-3.0 license",
+ "url": "https://github.com/dubinc/dub/blob/main/LICENSE.md"
+ }
+ },
+ "servers": [
+ {
+ "url": "http://api.localhost:8888",
+ "description": "Production API"
+ }
+ ],
+ "x-speakeasy-globals": {
+ "parameters": [
+ {
+ "x-speakeasy-globals-hidden": true,
+ "name": "workspaceId",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "x-speakeasy-globals-hidden": true,
+ "name": "projectSlug",
+ "in": "query",
+ "deprecated": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ]
+ },
+ "paths": {
+ "/links": {
+ "post": {
+ "operationId": "createLink",
+ "x-speakeasy-name-override": "create",
+ "x-speakeasy-usage-example": true,
+ "summary": "Create a new link",
+ "description": "Create a new link for the authenticated workspace.",
+ "tags": [
+ "Links"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "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."
+ },
+ "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."
+ },
+ "url": {
+ "type": "string",
+ "description": "The destination URL of the short link.",
+ "example": "https://google/com"
+ },
+ "archived": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link is archived."
+ },
+ "publicStats": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link's stats are publicly accessible."
+ },
+ "tagId": {
+ "type": "string",
+ "nullable": true,
+ "description": "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead.",
+ "deprecated": true
+ },
+ "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)."
+ },
+ "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,
+ "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 Social Media Cards feature."
+ },
+ "title": {
+ "type": "string",
+ "nullable": true,
+ "description": "The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "image": {
+ "type": "string",
+ "nullable": true,
+ "description": "The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "rewrite": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link uses link cloaking."
+ },
+ "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,
+ "properties": {
+ "AF": {
+ "type": "string"
+ },
+ "AL": {
+ "type": "string"
+ },
+ "DZ": {
+ "type": "string"
+ },
+ "AS": {
+ "type": "string"
+ },
+ "AD": {
+ "type": "string"
+ },
+ "AO": {
+ "type": "string"
+ },
+ "AI": {
+ "type": "string"
+ },
+ "AQ": {
+ "type": "string"
+ },
+ "AG": {
+ "type": "string"
+ },
+ "AR": {
+ "type": "string"
+ },
+ "AM": {
+ "type": "string"
+ },
+ "AW": {
+ "type": "string"
+ },
+ "AU": {
+ "type": "string"
+ },
+ "AT": {
+ "type": "string"
+ },
+ "AZ": {
+ "type": "string"
+ },
+ "BS": {
+ "type": "string"
+ },
+ "BH": {
+ "type": "string"
+ },
+ "BD": {
+ "type": "string"
+ },
+ "BB": {
+ "type": "string"
+ },
+ "BY": {
+ "type": "string"
+ },
+ "BE": {
+ "type": "string"
+ },
+ "BZ": {
+ "type": "string"
+ },
+ "BJ": {
+ "type": "string"
+ },
+ "BM": {
+ "type": "string"
+ },
+ "BT": {
+ "type": "string"
+ },
+ "BO": {
+ "type": "string"
+ },
+ "BA": {
+ "type": "string"
+ },
+ "BW": {
+ "type": "string"
+ },
+ "BV": {
+ "type": "string"
+ },
+ "BR": {
+ "type": "string"
+ },
+ "IO": {
+ "type": "string"
+ },
+ "BN": {
+ "type": "string"
+ },
+ "BG": {
+ "type": "string"
+ },
+ "BF": {
+ "type": "string"
+ },
+ "BI": {
+ "type": "string"
+ },
+ "KH": {
+ "type": "string"
+ },
+ "CM": {
+ "type": "string"
+ },
+ "CA": {
+ "type": "string"
+ },
+ "CV": {
+ "type": "string"
+ },
+ "KY": {
+ "type": "string"
+ },
+ "CF": {
+ "type": "string"
+ },
+ "TD": {
+ "type": "string"
+ },
+ "CL": {
+ "type": "string"
+ },
+ "CN": {
+ "type": "string"
+ },
+ "CX": {
+ "type": "string"
+ },
+ "CC": {
+ "type": "string"
+ },
+ "CO": {
+ "type": "string"
+ },
+ "KM": {
+ "type": "string"
+ },
+ "CG": {
+ "type": "string"
+ },
+ "CD": {
+ "type": "string"
+ },
+ "CK": {
+ "type": "string"
+ },
+ "CR": {
+ "type": "string"
+ },
+ "CI": {
+ "type": "string"
+ },
+ "HR": {
+ "type": "string"
+ },
+ "CU": {
+ "type": "string"
+ },
+ "CY": {
+ "type": "string"
+ },
+ "CZ": {
+ "type": "string"
+ },
+ "DK": {
+ "type": "string"
+ },
+ "DJ": {
+ "type": "string"
+ },
+ "DM": {
+ "type": "string"
+ },
+ "DO": {
+ "type": "string"
+ },
+ "EC": {
+ "type": "string"
+ },
+ "EG": {
+ "type": "string"
+ },
+ "SV": {
+ "type": "string"
+ },
+ "GQ": {
+ "type": "string"
+ },
+ "ER": {
+ "type": "string"
+ },
+ "EE": {
+ "type": "string"
+ },
+ "ET": {
+ "type": "string"
+ },
+ "FK": {
+ "type": "string"
+ },
+ "FO": {
+ "type": "string"
+ },
+ "FJ": {
+ "type": "string"
+ },
+ "FI": {
+ "type": "string"
+ },
+ "FR": {
+ "type": "string"
+ },
+ "GF": {
+ "type": "string"
+ },
+ "PF": {
+ "type": "string"
+ },
+ "TF": {
+ "type": "string"
+ },
+ "GA": {
+ "type": "string"
+ },
+ "GM": {
+ "type": "string"
+ },
+ "GE": {
+ "type": "string"
+ },
+ "DE": {
+ "type": "string"
+ },
+ "GH": {
+ "type": "string"
+ },
+ "GI": {
+ "type": "string"
+ },
+ "GR": {
+ "type": "string"
+ },
+ "GL": {
+ "type": "string"
+ },
+ "GD": {
+ "type": "string"
+ },
+ "GP": {
+ "type": "string"
+ },
+ "GU": {
+ "type": "string"
+ },
+ "GT": {
+ "type": "string"
+ },
+ "GN": {
+ "type": "string"
+ },
+ "GW": {
+ "type": "string"
+ },
+ "GY": {
+ "type": "string"
+ },
+ "HT": {
+ "type": "string"
+ },
+ "HM": {
+ "type": "string"
+ },
+ "VA": {
+ "type": "string"
+ },
+ "HN": {
+ "type": "string"
+ },
+ "HK": {
+ "type": "string"
+ },
+ "HU": {
+ "type": "string"
+ },
+ "IS": {
+ "type": "string"
+ },
+ "IN": {
+ "type": "string"
+ },
+ "ID": {
+ "type": "string"
+ },
+ "IR": {
+ "type": "string"
+ },
+ "IQ": {
+ "type": "string"
+ },
+ "IE": {
+ "type": "string"
+ },
+ "IL": {
+ "type": "string"
+ },
+ "IT": {
+ "type": "string"
+ },
+ "JM": {
+ "type": "string"
+ },
+ "JP": {
+ "type": "string"
+ },
+ "JO": {
+ "type": "string"
+ },
+ "KZ": {
+ "type": "string"
+ },
+ "KE": {
+ "type": "string"
+ },
+ "KI": {
+ "type": "string"
+ },
+ "KP": {
+ "type": "string"
+ },
+ "KR": {
+ "type": "string"
+ },
+ "KW": {
+ "type": "string"
+ },
+ "KG": {
+ "type": "string"
+ },
+ "LA": {
+ "type": "string"
+ },
+ "LV": {
+ "type": "string"
+ },
+ "LB": {
+ "type": "string"
+ },
+ "LS": {
+ "type": "string"
+ },
+ "LR": {
+ "type": "string"
+ },
+ "LY": {
+ "type": "string"
+ },
+ "LI": {
+ "type": "string"
+ },
+ "LT": {
+ "type": "string"
+ },
+ "LU": {
+ "type": "string"
+ },
+ "MO": {
+ "type": "string"
+ },
+ "MG": {
+ "type": "string"
+ },
+ "MW": {
+ "type": "string"
+ },
+ "MY": {
+ "type": "string"
+ },
+ "MV": {
+ "type": "string"
+ },
+ "ML": {
+ "type": "string"
+ },
+ "MT": {
+ "type": "string"
+ },
+ "MH": {
+ "type": "string"
+ },
+ "MQ": {
+ "type": "string"
+ },
+ "MR": {
+ "type": "string"
+ },
+ "MU": {
+ "type": "string"
+ },
+ "YT": {
+ "type": "string"
+ },
+ "MX": {
+ "type": "string"
+ },
+ "FM": {
+ "type": "string"
+ },
+ "MD": {
+ "type": "string"
+ },
+ "MC": {
+ "type": "string"
+ },
+ "MN": {
+ "type": "string"
+ },
+ "MS": {
+ "type": "string"
+ },
+ "MA": {
+ "type": "string"
+ },
+ "MZ": {
+ "type": "string"
+ },
+ "MM": {
+ "type": "string"
+ },
+ "NA": {
+ "type": "string"
+ },
+ "NR": {
+ "type": "string"
+ },
+ "NP": {
+ "type": "string"
+ },
+ "NL": {
+ "type": "string"
+ },
+ "NC": {
+ "type": "string"
+ },
+ "NZ": {
+ "type": "string"
+ },
+ "NI": {
+ "type": "string"
+ },
+ "NE": {
+ "type": "string"
+ },
+ "NG": {
+ "type": "string"
+ },
+ "NU": {
+ "type": "string"
+ },
+ "NF": {
+ "type": "string"
+ },
+ "MK": {
+ "type": "string"
+ },
+ "MP": {
+ "type": "string"
+ },
+ "NO": {
+ "type": "string"
+ },
+ "OM": {
+ "type": "string"
+ },
+ "PK": {
+ "type": "string"
+ },
+ "PW": {
+ "type": "string"
+ },
+ "PS": {
+ "type": "string"
+ },
+ "PA": {
+ "type": "string"
+ },
+ "PG": {
+ "type": "string"
+ },
+ "PY": {
+ "type": "string"
+ },
+ "PE": {
+ "type": "string"
+ },
+ "PH": {
+ "type": "string"
+ },
+ "PN": {
+ "type": "string"
+ },
+ "PL": {
+ "type": "string"
+ },
+ "PT": {
+ "type": "string"
+ },
+ "PR": {
+ "type": "string"
+ },
+ "QA": {
+ "type": "string"
+ },
+ "RE": {
+ "type": "string"
+ },
+ "RO": {
+ "type": "string"
+ },
+ "RU": {
+ "type": "string"
+ },
+ "RW": {
+ "type": "string"
+ },
+ "SH": {
+ "type": "string"
+ },
+ "KN": {
+ "type": "string"
+ },
+ "LC": {
+ "type": "string"
+ },
+ "PM": {
+ "type": "string"
+ },
+ "VC": {
+ "type": "string"
+ },
+ "WS": {
+ "type": "string"
+ },
+ "SM": {
+ "type": "string"
+ },
+ "ST": {
+ "type": "string"
+ },
+ "SA": {
+ "type": "string"
+ },
+ "SN": {
+ "type": "string"
+ },
+ "SC": {
+ "type": "string"
+ },
+ "SL": {
+ "type": "string"
+ },
+ "SG": {
+ "type": "string"
+ },
+ "SK": {
+ "type": "string"
+ },
+ "SI": {
+ "type": "string"
+ },
+ "SB": {
+ "type": "string"
+ },
+ "SO": {
+ "type": "string"
+ },
+ "ZA": {
+ "type": "string"
+ },
+ "GS": {
+ "type": "string"
+ },
+ "ES": {
+ "type": "string"
+ },
+ "LK": {
+ "type": "string"
+ },
+ "SD": {
+ "type": "string"
+ },
+ "SR": {
+ "type": "string"
+ },
+ "SJ": {
+ "type": "string"
+ },
+ "SZ": {
+ "type": "string"
+ },
+ "SE": {
+ "type": "string"
+ },
+ "CH": {
+ "type": "string"
+ },
+ "SY": {
+ "type": "string"
+ },
+ "TW": {
+ "type": "string"
+ },
+ "TJ": {
+ "type": "string"
+ },
+ "TZ": {
+ "type": "string"
+ },
+ "TH": {
+ "type": "string"
+ },
+ "TL": {
+ "type": "string"
+ },
+ "TG": {
+ "type": "string"
+ },
+ "TK": {
+ "type": "string"
+ },
+ "TO": {
+ "type": "string"
+ },
+ "TT": {
+ "type": "string"
+ },
+ "TN": {
+ "type": "string"
+ },
+ "TR": {
+ "type": "string"
+ },
+ "TM": {
+ "type": "string"
+ },
+ "TC": {
+ "type": "string"
+ },
+ "TV": {
+ "type": "string"
+ },
+ "UG": {
+ "type": "string"
+ },
+ "UA": {
+ "type": "string"
+ },
+ "AE": {
+ "type": "string"
+ },
+ "GB": {
+ "type": "string"
+ },
+ "US": {
+ "type": "string"
+ },
+ "UM": {
+ "type": "string"
+ },
+ "UY": {
+ "type": "string"
+ },
+ "UZ": {
+ "type": "string"
+ },
+ "VU": {
+ "type": "string"
+ },
+ "VE": {
+ "type": "string"
+ },
+ "VN": {
+ "type": "string"
+ },
+ "VG": {
+ "type": "string"
+ },
+ "VI": {
+ "type": "string"
+ },
+ "WF": {
+ "type": "string"
+ },
+ "EH": {
+ "type": "string"
+ },
+ "YE": {
+ "type": "string"
+ },
+ "ZM": {
+ "type": "string"
+ },
+ "ZW": {
+ "type": "string"
+ },
+ "AX": {
+ "type": "string"
+ },
+ "BQ": {
+ "type": "string"
+ },
+ "CW": {
+ "type": "string"
+ },
+ "GG": {
+ "type": "string"
+ },
+ "IM": {
+ "type": "string"
+ },
+ "JE": {
+ "type": "string"
+ },
+ "ME": {
+ "type": "string"
+ },
+ "BL": {
+ "type": "string"
+ },
+ "MF": {
+ "type": "string"
+ },
+ "RS": {
+ "type": "string"
+ },
+ "SX": {
+ "type": "string"
+ },
+ "SS": {
+ "type": "string"
+ },
+ "XK": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`."
+ }
+ },
+ "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",
+ "summary": "Retrieve a list of links",
+ "description": "Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links.",
+ "tags": [
+ "Links"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "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": "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagIds",
+ "description": "The tag IDs to filter the links by.",
+ "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).",
+ "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": "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": "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": "Whether to include tags in the response. Defaults to `false` if not provided.",
+ "schema": {
+ "type": "boolean",
+ "default": "false",
+ "description": "Whether to include tags in the response. Defaults to `false` if not provided."
+ }
+ },
+ {
+ "in": "query",
+ "name": "sort",
+ "description": "The field to sort the links by. The default is `createdAt`, and sort order is always descending.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "createdAt",
+ "clicks",
+ "lastClicked"
+ ],
+ "default": "createdAt",
+ "description": "The field to sort the links by. The default is `createdAt`, and sort order is always descending."
+ }
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "description": "The page number for pagination (each page contains 100 links).",
+ "schema": {
+ "type": "number",
+ "description": "The page number for pagination (each page contains 100 links)."
+ }
+ }
+ ],
+ "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 the number of links",
+ "description": "Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.",
+ "tags": [
+ "Links"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "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": "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagIds",
+ "description": "The tag IDs to filter the links by.",
+ "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).",
+ "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": "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": "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": "Whether to include tags in the response. Defaults to `false` if not provided.",
+ "schema": {
+ "type": "boolean",
+ "default": "false",
+ "description": "Whether to include tags in the response. Defaults to `false` if not provided."
+ }
+ },
+ {
+ "in": "query",
+ "name": "groupBy",
+ "description": "The field to group the links by.",
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "domain"
+ ]
+ },
+ {
+ "type": "string",
+ "enum": [
+ "tagId"
+ ]
+ }
+ ],
+ "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 from their domain and key.",
+ "tags": [
+ "Links"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "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`."
+ },
+ "required": true
+ },
+ {
+ "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`."
+ },
+ "required": true
+ }
+ ],
+ "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}": {
+ "put": {
+ "operationId": "editLink",
+ "x-speakeasy-name-override": "update",
+ "x-speakeasy-max-method-params": 2,
+ "summary": "Edit a link",
+ "description": "Edit a link for the authenticated workspace.",
+ "tags": [
+ "Links"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "linkId",
+ "description": "The id of the link to edit. You can get this via the `getLinkInfo` endpoint.",
+ "schema": {
+ "type": "string",
+ "description": "The id of the link to edit. You can get this via the `getLinkInfo` endpoint."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "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."
+ },
+ "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."
+ },
+ "url": {
+ "type": "string",
+ "description": "The destination URL of the short link.",
+ "example": "https://google/com"
+ },
+ "archived": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link is archived."
+ },
+ "publicStats": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link's stats are publicly accessible."
+ },
+ "tagId": {
+ "type": "string",
+ "nullable": true,
+ "description": "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead.",
+ "deprecated": true
+ },
+ "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)."
+ },
+ "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,
+ "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 Social Media Cards feature."
+ },
+ "title": {
+ "type": "string",
+ "nullable": true,
+ "description": "The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "image": {
+ "type": "string",
+ "nullable": true,
+ "description": "The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "rewrite": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link uses link cloaking."
+ },
+ "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,
+ "properties": {
+ "AF": {
+ "type": "string"
+ },
+ "AL": {
+ "type": "string"
+ },
+ "DZ": {
+ "type": "string"
+ },
+ "AS": {
+ "type": "string"
+ },
+ "AD": {
+ "type": "string"
+ },
+ "AO": {
+ "type": "string"
+ },
+ "AI": {
+ "type": "string"
+ },
+ "AQ": {
+ "type": "string"
+ },
+ "AG": {
+ "type": "string"
+ },
+ "AR": {
+ "type": "string"
+ },
+ "AM": {
+ "type": "string"
+ },
+ "AW": {
+ "type": "string"
+ },
+ "AU": {
+ "type": "string"
+ },
+ "AT": {
+ "type": "string"
+ },
+ "AZ": {
+ "type": "string"
+ },
+ "BS": {
+ "type": "string"
+ },
+ "BH": {
+ "type": "string"
+ },
+ "BD": {
+ "type": "string"
+ },
+ "BB": {
+ "type": "string"
+ },
+ "BY": {
+ "type": "string"
+ },
+ "BE": {
+ "type": "string"
+ },
+ "BZ": {
+ "type": "string"
+ },
+ "BJ": {
+ "type": "string"
+ },
+ "BM": {
+ "type": "string"
+ },
+ "BT": {
+ "type": "string"
+ },
+ "BO": {
+ "type": "string"
+ },
+ "BA": {
+ "type": "string"
+ },
+ "BW": {
+ "type": "string"
+ },
+ "BV": {
+ "type": "string"
+ },
+ "BR": {
+ "type": "string"
+ },
+ "IO": {
+ "type": "string"
+ },
+ "BN": {
+ "type": "string"
+ },
+ "BG": {
+ "type": "string"
+ },
+ "BF": {
+ "type": "string"
+ },
+ "BI": {
+ "type": "string"
+ },
+ "KH": {
+ "type": "string"
+ },
+ "CM": {
+ "type": "string"
+ },
+ "CA": {
+ "type": "string"
+ },
+ "CV": {
+ "type": "string"
+ },
+ "KY": {
+ "type": "string"
+ },
+ "CF": {
+ "type": "string"
+ },
+ "TD": {
+ "type": "string"
+ },
+ "CL": {
+ "type": "string"
+ },
+ "CN": {
+ "type": "string"
+ },
+ "CX": {
+ "type": "string"
+ },
+ "CC": {
+ "type": "string"
+ },
+ "CO": {
+ "type": "string"
+ },
+ "KM": {
+ "type": "string"
+ },
+ "CG": {
+ "type": "string"
+ },
+ "CD": {
+ "type": "string"
+ },
+ "CK": {
+ "type": "string"
+ },
+ "CR": {
+ "type": "string"
+ },
+ "CI": {
+ "type": "string"
+ },
+ "HR": {
+ "type": "string"
+ },
+ "CU": {
+ "type": "string"
+ },
+ "CY": {
+ "type": "string"
+ },
+ "CZ": {
+ "type": "string"
+ },
+ "DK": {
+ "type": "string"
+ },
+ "DJ": {
+ "type": "string"
+ },
+ "DM": {
+ "type": "string"
+ },
+ "DO": {
+ "type": "string"
+ },
+ "EC": {
+ "type": "string"
+ },
+ "EG": {
+ "type": "string"
+ },
+ "SV": {
+ "type": "string"
+ },
+ "GQ": {
+ "type": "string"
+ },
+ "ER": {
+ "type": "string"
+ },
+ "EE": {
+ "type": "string"
+ },
+ "ET": {
+ "type": "string"
+ },
+ "FK": {
+ "type": "string"
+ },
+ "FO": {
+ "type": "string"
+ },
+ "FJ": {
+ "type": "string"
+ },
+ "FI": {
+ "type": "string"
+ },
+ "FR": {
+ "type": "string"
+ },
+ "GF": {
+ "type": "string"
+ },
+ "PF": {
+ "type": "string"
+ },
+ "TF": {
+ "type": "string"
+ },
+ "GA": {
+ "type": "string"
+ },
+ "GM": {
+ "type": "string"
+ },
+ "GE": {
+ "type": "string"
+ },
+ "DE": {
+ "type": "string"
+ },
+ "GH": {
+ "type": "string"
+ },
+ "GI": {
+ "type": "string"
+ },
+ "GR": {
+ "type": "string"
+ },
+ "GL": {
+ "type": "string"
+ },
+ "GD": {
+ "type": "string"
+ },
+ "GP": {
+ "type": "string"
+ },
+ "GU": {
+ "type": "string"
+ },
+ "GT": {
+ "type": "string"
+ },
+ "GN": {
+ "type": "string"
+ },
+ "GW": {
+ "type": "string"
+ },
+ "GY": {
+ "type": "string"
+ },
+ "HT": {
+ "type": "string"
+ },
+ "HM": {
+ "type": "string"
+ },
+ "VA": {
+ "type": "string"
+ },
+ "HN": {
+ "type": "string"
+ },
+ "HK": {
+ "type": "string"
+ },
+ "HU": {
+ "type": "string"
+ },
+ "IS": {
+ "type": "string"
+ },
+ "IN": {
+ "type": "string"
+ },
+ "ID": {
+ "type": "string"
+ },
+ "IR": {
+ "type": "string"
+ },
+ "IQ": {
+ "type": "string"
+ },
+ "IE": {
+ "type": "string"
+ },
+ "IL": {
+ "type": "string"
+ },
+ "IT": {
+ "type": "string"
+ },
+ "JM": {
+ "type": "string"
+ },
+ "JP": {
+ "type": "string"
+ },
+ "JO": {
+ "type": "string"
+ },
+ "KZ": {
+ "type": "string"
+ },
+ "KE": {
+ "type": "string"
+ },
+ "KI": {
+ "type": "string"
+ },
+ "KP": {
+ "type": "string"
+ },
+ "KR": {
+ "type": "string"
+ },
+ "KW": {
+ "type": "string"
+ },
+ "KG": {
+ "type": "string"
+ },
+ "LA": {
+ "type": "string"
+ },
+ "LV": {
+ "type": "string"
+ },
+ "LB": {
+ "type": "string"
+ },
+ "LS": {
+ "type": "string"
+ },
+ "LR": {
+ "type": "string"
+ },
+ "LY": {
+ "type": "string"
+ },
+ "LI": {
+ "type": "string"
+ },
+ "LT": {
+ "type": "string"
+ },
+ "LU": {
+ "type": "string"
+ },
+ "MO": {
+ "type": "string"
+ },
+ "MG": {
+ "type": "string"
+ },
+ "MW": {
+ "type": "string"
+ },
+ "MY": {
+ "type": "string"
+ },
+ "MV": {
+ "type": "string"
+ },
+ "ML": {
+ "type": "string"
+ },
+ "MT": {
+ "type": "string"
+ },
+ "MH": {
+ "type": "string"
+ },
+ "MQ": {
+ "type": "string"
+ },
+ "MR": {
+ "type": "string"
+ },
+ "MU": {
+ "type": "string"
+ },
+ "YT": {
+ "type": "string"
+ },
+ "MX": {
+ "type": "string"
+ },
+ "FM": {
+ "type": "string"
+ },
+ "MD": {
+ "type": "string"
+ },
+ "MC": {
+ "type": "string"
+ },
+ "MN": {
+ "type": "string"
+ },
+ "MS": {
+ "type": "string"
+ },
+ "MA": {
+ "type": "string"
+ },
+ "MZ": {
+ "type": "string"
+ },
+ "MM": {
+ "type": "string"
+ },
+ "NA": {
+ "type": "string"
+ },
+ "NR": {
+ "type": "string"
+ },
+ "NP": {
+ "type": "string"
+ },
+ "NL": {
+ "type": "string"
+ },
+ "NC": {
+ "type": "string"
+ },
+ "NZ": {
+ "type": "string"
+ },
+ "NI": {
+ "type": "string"
+ },
+ "NE": {
+ "type": "string"
+ },
+ "NG": {
+ "type": "string"
+ },
+ "NU": {
+ "type": "string"
+ },
+ "NF": {
+ "type": "string"
+ },
+ "MK": {
+ "type": "string"
+ },
+ "MP": {
+ "type": "string"
+ },
+ "NO": {
+ "type": "string"
+ },
+ "OM": {
+ "type": "string"
+ },
+ "PK": {
+ "type": "string"
+ },
+ "PW": {
+ "type": "string"
+ },
+ "PS": {
+ "type": "string"
+ },
+ "PA": {
+ "type": "string"
+ },
+ "PG": {
+ "type": "string"
+ },
+ "PY": {
+ "type": "string"
+ },
+ "PE": {
+ "type": "string"
+ },
+ "PH": {
+ "type": "string"
+ },
+ "PN": {
+ "type": "string"
+ },
+ "PL": {
+ "type": "string"
+ },
+ "PT": {
+ "type": "string"
+ },
+ "PR": {
+ "type": "string"
+ },
+ "QA": {
+ "type": "string"
+ },
+ "RE": {
+ "type": "string"
+ },
+ "RO": {
+ "type": "string"
+ },
+ "RU": {
+ "type": "string"
+ },
+ "RW": {
+ "type": "string"
+ },
+ "SH": {
+ "type": "string"
+ },
+ "KN": {
+ "type": "string"
+ },
+ "LC": {
+ "type": "string"
+ },
+ "PM": {
+ "type": "string"
+ },
+ "VC": {
+ "type": "string"
+ },
+ "WS": {
+ "type": "string"
+ },
+ "SM": {
+ "type": "string"
+ },
+ "ST": {
+ "type": "string"
+ },
+ "SA": {
+ "type": "string"
+ },
+ "SN": {
+ "type": "string"
+ },
+ "SC": {
+ "type": "string"
+ },
+ "SL": {
+ "type": "string"
+ },
+ "SG": {
+ "type": "string"
+ },
+ "SK": {
+ "type": "string"
+ },
+ "SI": {
+ "type": "string"
+ },
+ "SB": {
+ "type": "string"
+ },
+ "SO": {
+ "type": "string"
+ },
+ "ZA": {
+ "type": "string"
+ },
+ "GS": {
+ "type": "string"
+ },
+ "ES": {
+ "type": "string"
+ },
+ "LK": {
+ "type": "string"
+ },
+ "SD": {
+ "type": "string"
+ },
+ "SR": {
+ "type": "string"
+ },
+ "SJ": {
+ "type": "string"
+ },
+ "SZ": {
+ "type": "string"
+ },
+ "SE": {
+ "type": "string"
+ },
+ "CH": {
+ "type": "string"
+ },
+ "SY": {
+ "type": "string"
+ },
+ "TW": {
+ "type": "string"
+ },
+ "TJ": {
+ "type": "string"
+ },
+ "TZ": {
+ "type": "string"
+ },
+ "TH": {
+ "type": "string"
+ },
+ "TL": {
+ "type": "string"
+ },
+ "TG": {
+ "type": "string"
+ },
+ "TK": {
+ "type": "string"
+ },
+ "TO": {
+ "type": "string"
+ },
+ "TT": {
+ "type": "string"
+ },
+ "TN": {
+ "type": "string"
+ },
+ "TR": {
+ "type": "string"
+ },
+ "TM": {
+ "type": "string"
+ },
+ "TC": {
+ "type": "string"
+ },
+ "TV": {
+ "type": "string"
+ },
+ "UG": {
+ "type": "string"
+ },
+ "UA": {
+ "type": "string"
+ },
+ "AE": {
+ "type": "string"
+ },
+ "GB": {
+ "type": "string"
+ },
+ "US": {
+ "type": "string"
+ },
+ "UM": {
+ "type": "string"
+ },
+ "UY": {
+ "type": "string"
+ },
+ "UZ": {
+ "type": "string"
+ },
+ "VU": {
+ "type": "string"
+ },
+ "VE": {
+ "type": "string"
+ },
+ "VN": {
+ "type": "string"
+ },
+ "VG": {
+ "type": "string"
+ },
+ "VI": {
+ "type": "string"
+ },
+ "WF": {
+ "type": "string"
+ },
+ "EH": {
+ "type": "string"
+ },
+ "YE": {
+ "type": "string"
+ },
+ "ZM": {
+ "type": "string"
+ },
+ "ZW": {
+ "type": "string"
+ },
+ "AX": {
+ "type": "string"
+ },
+ "BQ": {
+ "type": "string"
+ },
+ "CW": {
+ "type": "string"
+ },
+ "GG": {
+ "type": "string"
+ },
+ "IM": {
+ "type": "string"
+ },
+ "JE": {
+ "type": "string"
+ },
+ "ME": {
+ "type": "string"
+ },
+ "BL": {
+ "type": "string"
+ },
+ "MF": {
+ "type": "string"
+ },
+ "RS": {
+ "type": "string"
+ },
+ "SX": {
+ "type": "string"
+ },
+ "SS": {
+ "type": "string"
+ },
+ "XK": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`."
+ }
+ },
+ "required": [
+ "url"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "The edited 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 can get this via the `getLinkInfo` endpoint.",
+ "schema": {
+ "type": "string",
+ "description": "The id of the link to delete. You can get this via the `getLinkInfo` endpoint."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The deleted link",
+ "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": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "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."
+ },
+ "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."
+ },
+ "url": {
+ "type": "string",
+ "description": "The destination URL of the short link.",
+ "example": "https://google/com"
+ },
+ "archived": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link is archived."
+ },
+ "publicStats": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link's stats are publicly accessible."
+ },
+ "tagId": {
+ "type": "string",
+ "nullable": true,
+ "description": "The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead.",
+ "deprecated": true
+ },
+ "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)."
+ },
+ "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,
+ "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 Social Media Cards feature."
+ },
+ "title": {
+ "type": "string",
+ "nullable": true,
+ "description": "The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "image": {
+ "type": "string",
+ "nullable": true,
+ "description": "The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "rewrite": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link uses link cloaking."
+ },
+ "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,
+ "properties": {
+ "AF": {
+ "type": "string"
+ },
+ "AL": {
+ "type": "string"
+ },
+ "DZ": {
+ "type": "string"
+ },
+ "AS": {
+ "type": "string"
+ },
+ "AD": {
+ "type": "string"
+ },
+ "AO": {
+ "type": "string"
+ },
+ "AI": {
+ "type": "string"
+ },
+ "AQ": {
+ "type": "string"
+ },
+ "AG": {
+ "type": "string"
+ },
+ "AR": {
+ "type": "string"
+ },
+ "AM": {
+ "type": "string"
+ },
+ "AW": {
+ "type": "string"
+ },
+ "AU": {
+ "type": "string"
+ },
+ "AT": {
+ "type": "string"
+ },
+ "AZ": {
+ "type": "string"
+ },
+ "BS": {
+ "type": "string"
+ },
+ "BH": {
+ "type": "string"
+ },
+ "BD": {
+ "type": "string"
+ },
+ "BB": {
+ "type": "string"
+ },
+ "BY": {
+ "type": "string"
+ },
+ "BE": {
+ "type": "string"
+ },
+ "BZ": {
+ "type": "string"
+ },
+ "BJ": {
+ "type": "string"
+ },
+ "BM": {
+ "type": "string"
+ },
+ "BT": {
+ "type": "string"
+ },
+ "BO": {
+ "type": "string"
+ },
+ "BA": {
+ "type": "string"
+ },
+ "BW": {
+ "type": "string"
+ },
+ "BV": {
+ "type": "string"
+ },
+ "BR": {
+ "type": "string"
+ },
+ "IO": {
+ "type": "string"
+ },
+ "BN": {
+ "type": "string"
+ },
+ "BG": {
+ "type": "string"
+ },
+ "BF": {
+ "type": "string"
+ },
+ "BI": {
+ "type": "string"
+ },
+ "KH": {
+ "type": "string"
+ },
+ "CM": {
+ "type": "string"
+ },
+ "CA": {
+ "type": "string"
+ },
+ "CV": {
+ "type": "string"
+ },
+ "KY": {
+ "type": "string"
+ },
+ "CF": {
+ "type": "string"
+ },
+ "TD": {
+ "type": "string"
+ },
+ "CL": {
+ "type": "string"
+ },
+ "CN": {
+ "type": "string"
+ },
+ "CX": {
+ "type": "string"
+ },
+ "CC": {
+ "type": "string"
+ },
+ "CO": {
+ "type": "string"
+ },
+ "KM": {
+ "type": "string"
+ },
+ "CG": {
+ "type": "string"
+ },
+ "CD": {
+ "type": "string"
+ },
+ "CK": {
+ "type": "string"
+ },
+ "CR": {
+ "type": "string"
+ },
+ "CI": {
+ "type": "string"
+ },
+ "HR": {
+ "type": "string"
+ },
+ "CU": {
+ "type": "string"
+ },
+ "CY": {
+ "type": "string"
+ },
+ "CZ": {
+ "type": "string"
+ },
+ "DK": {
+ "type": "string"
+ },
+ "DJ": {
+ "type": "string"
+ },
+ "DM": {
+ "type": "string"
+ },
+ "DO": {
+ "type": "string"
+ },
+ "EC": {
+ "type": "string"
+ },
+ "EG": {
+ "type": "string"
+ },
+ "SV": {
+ "type": "string"
+ },
+ "GQ": {
+ "type": "string"
+ },
+ "ER": {
+ "type": "string"
+ },
+ "EE": {
+ "type": "string"
+ },
+ "ET": {
+ "type": "string"
+ },
+ "FK": {
+ "type": "string"
+ },
+ "FO": {
+ "type": "string"
+ },
+ "FJ": {
+ "type": "string"
+ },
+ "FI": {
+ "type": "string"
+ },
+ "FR": {
+ "type": "string"
+ },
+ "GF": {
+ "type": "string"
+ },
+ "PF": {
+ "type": "string"
+ },
+ "TF": {
+ "type": "string"
+ },
+ "GA": {
+ "type": "string"
+ },
+ "GM": {
+ "type": "string"
+ },
+ "GE": {
+ "type": "string"
+ },
+ "DE": {
+ "type": "string"
+ },
+ "GH": {
+ "type": "string"
+ },
+ "GI": {
+ "type": "string"
+ },
+ "GR": {
+ "type": "string"
+ },
+ "GL": {
+ "type": "string"
+ },
+ "GD": {
+ "type": "string"
+ },
+ "GP": {
+ "type": "string"
+ },
+ "GU": {
+ "type": "string"
+ },
+ "GT": {
+ "type": "string"
+ },
+ "GN": {
+ "type": "string"
+ },
+ "GW": {
+ "type": "string"
+ },
+ "GY": {
+ "type": "string"
+ },
+ "HT": {
+ "type": "string"
+ },
+ "HM": {
+ "type": "string"
+ },
+ "VA": {
+ "type": "string"
+ },
+ "HN": {
+ "type": "string"
+ },
+ "HK": {
+ "type": "string"
+ },
+ "HU": {
+ "type": "string"
+ },
+ "IS": {
+ "type": "string"
+ },
+ "IN": {
+ "type": "string"
+ },
+ "ID": {
+ "type": "string"
+ },
+ "IR": {
+ "type": "string"
+ },
+ "IQ": {
+ "type": "string"
+ },
+ "IE": {
+ "type": "string"
+ },
+ "IL": {
+ "type": "string"
+ },
+ "IT": {
+ "type": "string"
+ },
+ "JM": {
+ "type": "string"
+ },
+ "JP": {
+ "type": "string"
+ },
+ "JO": {
+ "type": "string"
+ },
+ "KZ": {
+ "type": "string"
+ },
+ "KE": {
+ "type": "string"
+ },
+ "KI": {
+ "type": "string"
+ },
+ "KP": {
+ "type": "string"
+ },
+ "KR": {
+ "type": "string"
+ },
+ "KW": {
+ "type": "string"
+ },
+ "KG": {
+ "type": "string"
+ },
+ "LA": {
+ "type": "string"
+ },
+ "LV": {
+ "type": "string"
+ },
+ "LB": {
+ "type": "string"
+ },
+ "LS": {
+ "type": "string"
+ },
+ "LR": {
+ "type": "string"
+ },
+ "LY": {
+ "type": "string"
+ },
+ "LI": {
+ "type": "string"
+ },
+ "LT": {
+ "type": "string"
+ },
+ "LU": {
+ "type": "string"
+ },
+ "MO": {
+ "type": "string"
+ },
+ "MG": {
+ "type": "string"
+ },
+ "MW": {
+ "type": "string"
+ },
+ "MY": {
+ "type": "string"
+ },
+ "MV": {
+ "type": "string"
+ },
+ "ML": {
+ "type": "string"
+ },
+ "MT": {
+ "type": "string"
+ },
+ "MH": {
+ "type": "string"
+ },
+ "MQ": {
+ "type": "string"
+ },
+ "MR": {
+ "type": "string"
+ },
+ "MU": {
+ "type": "string"
+ },
+ "YT": {
+ "type": "string"
+ },
+ "MX": {
+ "type": "string"
+ },
+ "FM": {
+ "type": "string"
+ },
+ "MD": {
+ "type": "string"
+ },
+ "MC": {
+ "type": "string"
+ },
+ "MN": {
+ "type": "string"
+ },
+ "MS": {
+ "type": "string"
+ },
+ "MA": {
+ "type": "string"
+ },
+ "MZ": {
+ "type": "string"
+ },
+ "MM": {
+ "type": "string"
+ },
+ "NA": {
+ "type": "string"
+ },
+ "NR": {
+ "type": "string"
+ },
+ "NP": {
+ "type": "string"
+ },
+ "NL": {
+ "type": "string"
+ },
+ "NC": {
+ "type": "string"
+ },
+ "NZ": {
+ "type": "string"
+ },
+ "NI": {
+ "type": "string"
+ },
+ "NE": {
+ "type": "string"
+ },
+ "NG": {
+ "type": "string"
+ },
+ "NU": {
+ "type": "string"
+ },
+ "NF": {
+ "type": "string"
+ },
+ "MK": {
+ "type": "string"
+ },
+ "MP": {
+ "type": "string"
+ },
+ "NO": {
+ "type": "string"
+ },
+ "OM": {
+ "type": "string"
+ },
+ "PK": {
+ "type": "string"
+ },
+ "PW": {
+ "type": "string"
+ },
+ "PS": {
+ "type": "string"
+ },
+ "PA": {
+ "type": "string"
+ },
+ "PG": {
+ "type": "string"
+ },
+ "PY": {
+ "type": "string"
+ },
+ "PE": {
+ "type": "string"
+ },
+ "PH": {
+ "type": "string"
+ },
+ "PN": {
+ "type": "string"
+ },
+ "PL": {
+ "type": "string"
+ },
+ "PT": {
+ "type": "string"
+ },
+ "PR": {
+ "type": "string"
+ },
+ "QA": {
+ "type": "string"
+ },
+ "RE": {
+ "type": "string"
+ },
+ "RO": {
+ "type": "string"
+ },
+ "RU": {
+ "type": "string"
+ },
+ "RW": {
+ "type": "string"
+ },
+ "SH": {
+ "type": "string"
+ },
+ "KN": {
+ "type": "string"
+ },
+ "LC": {
+ "type": "string"
+ },
+ "PM": {
+ "type": "string"
+ },
+ "VC": {
+ "type": "string"
+ },
+ "WS": {
+ "type": "string"
+ },
+ "SM": {
+ "type": "string"
+ },
+ "ST": {
+ "type": "string"
+ },
+ "SA": {
+ "type": "string"
+ },
+ "SN": {
+ "type": "string"
+ },
+ "SC": {
+ "type": "string"
+ },
+ "SL": {
+ "type": "string"
+ },
+ "SG": {
+ "type": "string"
+ },
+ "SK": {
+ "type": "string"
+ },
+ "SI": {
+ "type": "string"
+ },
+ "SB": {
+ "type": "string"
+ },
+ "SO": {
+ "type": "string"
+ },
+ "ZA": {
+ "type": "string"
+ },
+ "GS": {
+ "type": "string"
+ },
+ "ES": {
+ "type": "string"
+ },
+ "LK": {
+ "type": "string"
+ },
+ "SD": {
+ "type": "string"
+ },
+ "SR": {
+ "type": "string"
+ },
+ "SJ": {
+ "type": "string"
+ },
+ "SZ": {
+ "type": "string"
+ },
+ "SE": {
+ "type": "string"
+ },
+ "CH": {
+ "type": "string"
+ },
+ "SY": {
+ "type": "string"
+ },
+ "TW": {
+ "type": "string"
+ },
+ "TJ": {
+ "type": "string"
+ },
+ "TZ": {
+ "type": "string"
+ },
+ "TH": {
+ "type": "string"
+ },
+ "TL": {
+ "type": "string"
+ },
+ "TG": {
+ "type": "string"
+ },
+ "TK": {
+ "type": "string"
+ },
+ "TO": {
+ "type": "string"
+ },
+ "TT": {
+ "type": "string"
+ },
+ "TN": {
+ "type": "string"
+ },
+ "TR": {
+ "type": "string"
+ },
+ "TM": {
+ "type": "string"
+ },
+ "TC": {
+ "type": "string"
+ },
+ "TV": {
+ "type": "string"
+ },
+ "UG": {
+ "type": "string"
+ },
+ "UA": {
+ "type": "string"
+ },
+ "AE": {
+ "type": "string"
+ },
+ "GB": {
+ "type": "string"
+ },
+ "US": {
+ "type": "string"
+ },
+ "UM": {
+ "type": "string"
+ },
+ "UY": {
+ "type": "string"
+ },
+ "UZ": {
+ "type": "string"
+ },
+ "VU": {
+ "type": "string"
+ },
+ "VE": {
+ "type": "string"
+ },
+ "VN": {
+ "type": "string"
+ },
+ "VG": {
+ "type": "string"
+ },
+ "VI": {
+ "type": "string"
+ },
+ "WF": {
+ "type": "string"
+ },
+ "EH": {
+ "type": "string"
+ },
+ "YE": {
+ "type": "string"
+ },
+ "ZM": {
+ "type": "string"
+ },
+ "ZW": {
+ "type": "string"
+ },
+ "AX": {
+ "type": "string"
+ },
+ "BQ": {
+ "type": "string"
+ },
+ "CW": {
+ "type": "string"
+ },
+ "GG": {
+ "type": "string"
+ },
+ "IM": {
+ "type": "string"
+ },
+ "JE": {
+ "type": "string"
+ },
+ "ME": {
+ "type": "string"
+ },
+ "BL": {
+ "type": "string"
+ },
+ "MF": {
+ "type": "string"
+ },
+ "RS": {
+ "type": "string"
+ },
+ "SX": {
+ "type": "string"
+ },
+ "SS": {
+ "type": "string"
+ },
+ "XK": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`."
+ }
+ },
+ "required": [
+ "url"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "The created 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"
+ }
+ }
+ }
+ },
+ "/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"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to generate a QR code for. Defaults to `https://dub.co` if not provided.",
+ "schema": {
+ "type": "string",
+ "format": "uri",
+ "default": "https://dub.co",
+ "description": "The URL to generate a QR code for. Defaults to `https://dub.co` if not provided."
+ }
+ },
+ {
+ "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": "includeMargin",
+ "description": "Whether to include a margin around the QR code. Defaults to `false` if not provided.",
+ "schema": {
+ "type": "boolean",
+ "default": "false",
+ "description": "Whether to include a margin around the QR code. Defaults to `false` if not provided."
+ }
+ }
+ ],
+ "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"
+ }
+ }
+ }
+ },
+ "/analytics/clicks": {
+ "get": {
+ "operationId": "getClicksAnalytics",
+ "x-speakeasy-name-override": "clicks",
+ "summary": "Retrieve clicks analytics",
+ "description": "Retrieve the number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "number",
+ "description": "The number of clicks matching the specified queries."
+ }
+ }
+ }
+ },
+ "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/timeseries": {
+ "get": {
+ "operationId": "getTimeseriesAnalytics",
+ "x-speakeasy-name-override": "timeseries",
+ "summary": "Retrieve timeseries analytics",
+ "description": "Retrieve the number of clicks for a link, a domain, or the authenticated workspace over a period of time.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The number of clicks over a period of time",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "start": {
+ "type": "string",
+ "description": "The starting timestamp of the interval"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks in the interval"
+ }
+ },
+ "required": [
+ "start",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/country": {
+ "get": {
+ "operationId": "getCountryAnalytics",
+ "x-speakeasy-name-override": "countries",
+ "summary": "Retrieve country analytics",
+ "description": "Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top countries by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "country": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The 2-letter country code: https://d.to/geo"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this country"
+ }
+ },
+ "required": [
+ "country",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/city": {
+ "get": {
+ "operationId": "getCityAnalytics",
+ "x-speakeasy-name-override": "cities",
+ "summary": "Retrieve city analytics",
+ "description": "Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top cities by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "The name of the city"
+ },
+ "country": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The 2-letter country code of the city: https://d.to/geo"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this city"
+ }
+ },
+ "required": [
+ "city",
+ "country",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/device": {
+ "get": {
+ "operationId": "getDeviceAnalytics",
+ "x-speakeasy-name-override": "devices",
+ "summary": "Retrieve device analytics",
+ "description": "Retrieve the top devices by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top devices by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "device": {
+ "type": "string",
+ "description": "The name of the device"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this device"
+ }
+ },
+ "required": [
+ "device",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/browser": {
+ "get": {
+ "operationId": "getBrowserAnalytics",
+ "x-speakeasy-name-override": "browsers",
+ "summary": "Retrieve browser analytics",
+ "description": "Retrieve the top browsers by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top browsers by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "string",
+ "description": "The name of the browser"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this browser"
+ }
+ },
+ "required": [
+ "browser",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/os": {
+ "get": {
+ "operationId": "getOSAnalytics",
+ "x-speakeasy-name-override": "os",
+ "summary": "Retrieve OS analytics",
+ "description": "Retrieve the top OS by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top OS by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "os": {
+ "type": "string",
+ "description": "The name of the OS"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this OS"
+ }
+ },
+ "required": [
+ "os",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/referer": {
+ "get": {
+ "operationId": "getRefererAnalytics",
+ "x-speakeasy-name-override": "referers",
+ "summary": "Retrieve referer analytics",
+ "description": "Retrieve the top referers by number of clicks for a link, a domain, or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top referers by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "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"
+ }
+ },
+ "required": [
+ "referer",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/top_links": {
+ "get": {
+ "operationId": "getTopLinks",
+ "x-speakeasy-name-override": "topLinks",
+ "summary": "Retrieve top links",
+ "description": "Retrieve the top links by number of clicks for a domain or the authenticated workspace.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top links by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "link": {
+ "type": "string",
+ "description": "The unique ID of the short link"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this link"
+ }
+ },
+ "required": [
+ "link",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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/top_urls": {
+ "get": {
+ "operationId": "getTopURLs",
+ "x-speakeasy-name-override": "topUrls",
+ "summary": "Retrieve top URLs",
+ "description": "Retrieve the top URLs by number of clicks for a given short link.",
+ "tags": [
+ "Analytics"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ {
+ "in": "query",
+ "name": "domain",
+ "description": "The domain of the short link.",
+ "schema": {
+ "type": "string",
+ "description": "The domain of the short link."
+ }
+ },
+ {
+ "in": "query",
+ "name": "key",
+ "description": "The short link slug.",
+ "schema": {
+ "type": "string",
+ "description": "The short link slug."
+ }
+ },
+ {
+ "in": "query",
+ "name": "interval",
+ "description": "The interval to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "1h",
+ "24h",
+ "7d",
+ "30d",
+ "90d",
+ "all"
+ ],
+ "description": "The interval to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "country",
+ "description": "The country to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "AF",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "CV",
+ "KY",
+ "CF",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MK",
+ "MP",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SZ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "AX",
+ "BQ",
+ "CW",
+ "GG",
+ "IM",
+ "JE",
+ "ME",
+ "BL",
+ "MF",
+ "RS",
+ "SX",
+ "SS",
+ "XK"
+ ],
+ "description": "The country to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "city",
+ "description": "The city to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The city to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "device",
+ "description": "The device to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The device to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "browser",
+ "description": "The browser to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The browser to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "os",
+ "description": "The OS to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The OS to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "referer",
+ "description": "The referer to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The referer to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The URL to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "tagId",
+ "description": "The tag ID to retrieve analytics for.",
+ "schema": {
+ "type": "string",
+ "description": "The tag ID to retrieve analytics for."
+ }
+ },
+ {
+ "in": "query",
+ "name": "qr",
+ "description": "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": "Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both."
+ }
+ },
+ {
+ "in": "query",
+ "name": "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."
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The top URLs by number of clicks",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The destination URL"
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks from this URL"
+ }
+ },
+ "required": [
+ "url",
+ "clicks"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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": {
+ "get": {
+ "operationId": "getWorkspaces",
+ "x-speakeasy-name-override": "list",
+ "summary": "Retrieve a list of workspaces",
+ "description": "Retrieve a list of workspaces for the authenticated user.",
+ "tags": [
+ "Workspaces"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "A list of workspaces",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "$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"
+ }
+ }
+ },
+ "post": {
+ "operationId": "createWorkspace",
+ "x-speakeasy-name-override": "create",
+ "summary": "Create a workspace",
+ "description": "Create a new workspace for the authenticated user.",
+ "tags": [
+ "Workspaces"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "minLength": 1,
+ "maxLength": 32
+ },
+ "slug": {
+ "type": "string",
+ "minLength": 3,
+ "maxLength": 48
+ },
+ "domain": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "slug"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "The created 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"
+ }
+ }
+ }
+ },
+ "/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"
+ }
+ }
+ }
+ },
+ "/tags": {
+ "post": {
+ "operationId": "createTag",
+ "x-speakeasy-name-override": "create",
+ "summary": "Create a new tag",
+ "description": "Create a new tag for the authenticated workspace.",
+ "tags": [
+ "Tags"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "tag": {
+ "type": "string",
+ "minLength": 1,
+ "description": "The name of the tag to create."
+ },
+ "color": {
+ "type": "string",
+ "enum": [
+ "red",
+ "yellow",
+ "green",
+ "blue",
+ "purple",
+ "pink",
+ "brown"
+ ],
+ "description": "The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown."
+ }
+ },
+ "required": [
+ "tag"
+ ]
+ }
+ }
+ }
+ },
+ "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": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "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"
+ }
+ }
+ }
+ },
+ "/domains": {
+ "post": {
+ "operationId": "addDomain",
+ "x-speakeasy-name-override": "add",
+ "summary": "Add a domain",
+ "description": "Add a domain to the authenticated workspace.",
+ "tags": [
+ "Domains"
+ ],
+ "security": [
+ {
+ "token": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the domain.",
+ "example": "acme.com"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "redirect",
+ "rewrite"
+ ],
+ "default": "redirect",
+ "description": "The type of redirect to use for this domain.",
+ "example": "redirect"
+ },
+ "target": {
+ "type": "string",
+ "nullable": true,
+ "description": "The page your users will get redirected to when they visit your domain.",
+ "example": "https://acme.com/landing"
+ },
+ "expiredUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "Redirect users to a specific URL when any link under this domain has expired.",
+ "example": "https://acme.com/expired"
+ },
+ "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,
+ "default": "https://dub.co/help/article/what-is-dub",
+ "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"
+ }
+ },
+ "required": [
+ "slug"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "The domain was added.",
+ "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",
+ "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": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "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": "editDomain",
+ "x-speakeasy-name-override": "update",
+ "x-speakeasy-max-method-params": 2,
+ "summary": "Edit a domain",
+ "description": "Edit 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
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "slug": {
+ "type": "string",
+ "minLength": 1,
+ "description": "Name of the domain.",
+ "example": "acme.com"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "redirect",
+ "rewrite"
+ ],
+ "default": "redirect",
+ "description": "The type of redirect to use for this domain.",
+ "example": "redirect"
+ },
+ "target": {
+ "type": "string",
+ "nullable": true,
+ "description": "The page your users will get redirected to when they visit your domain.",
+ "example": "https://acme.com/landing"
+ },
+ "expiredUrl": {
+ "type": "string",
+ "nullable": true,
+ "description": "Redirect users to a specific URL when any link under this domain has expired.",
+ "example": "https://acme.com/expired"
+ },
+ "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,
+ "default": "https://dub.co/help/article/what-is-dub",
+ "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"
+ }
+ }
+ }
+ }
+ }
+ },
+ "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",
+ "summary": "Delete a domain",
+ "description": "Delete a domain from a 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
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": 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/{slug}/primary": {
+ "post": {
+ "operationId": "setPrimaryDomain",
+ "x-speakeasy-name-override": "setPrimary",
+ "summary": "Set a domain as primary",
+ "description": "Set a domain as primary 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
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The domain was set as primary",
+ "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"
+ }
+ }
+ }
+ },
+ "/domains/{slug}/transfer": {
+ "post": {
+ "operationId": "transferDomain",
+ "x-speakeasy-name-override": "transfer",
+ "x-speakeasy-max-method-params": 2,
+ "summary": "Transfer a domain",
+ "description": "Transfer a domain to another workspace within the authenticated account.",
+ "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
+ },
+ {
+ "in": "query",
+ "name": "workspaceId",
+ "description": "The ID of the workspace.",
+ "schema": {
+ "type": "string",
+ "description": "The ID of the workspace.",
+ "example": "ws_cluuwcv0r..."
+ },
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "projectSlug",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "schema": {
+ "type": "string",
+ "description": "The slug of the project. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "newWorkspaceId": {
+ "type": "string",
+ "minLength": 1,
+ "description": "The ID of the new workspace to transfer the domain to."
+ }
+ },
+ "required": [
+ "newWorkspaceId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "The domain transfer initiated",
+ "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"
+ }
+ }
+ }
+ },
+ "/metatags": {
+ "get": {
+ "operationId": "getMetatags",
+ "x-speakeasy-name-override": "get",
+ "summary": "Retrieve the metatags for a URL",
+ "description": "Retrieve the metatags for a URL.",
+ "tags": [
+ "Metatags"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "url",
+ "description": "The URL to retrieve metatags for.",
+ "schema": {
+ "type": "string",
+ "example": "https://dub.co",
+ "description": "The URL to retrieve metatags for."
+ },
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The retrieved metatags",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "nullable": true,
+ "description": "The meta title tag for the URL.",
+ "example": "Dub.co - Link Management for Modern Marketing Teams"
+ },
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "The meta description tag for the URL.",
+ "example": "Dub.co is the open-source link management infrastructure ..."
+ },
+ "image": {
+ "type": "string",
+ "nullable": true,
+ "description": "The OpenGraph image for the URL.",
+ "example": "https://assets.dub.co/thumbnail.jpg"
+ }
+ },
+ "required": [
+ "title",
+ "description",
+ "image"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "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."
+ },
+ "archived": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link is archived."
+ },
+ "expiresAt": {
+ "type": "string",
+ "nullable": true,
+ "format": "date-time",
+ "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 Social Media Cards feature."
+ },
+ "title": {
+ "type": "string",
+ "nullable": true,
+ "description": "The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "description": {
+ "type": "string",
+ "nullable": true,
+ "description": "The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "image": {
+ "type": "string",
+ "nullable": true,
+ "description": "The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true."
+ },
+ "rewrite": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link uses link cloaking."
+ },
+ "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,
+ "properties": {
+ "AF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AQ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BB": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BJ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CX": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DJ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "EC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "EG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GQ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ER": {
+ "type": "string",
+ "format": "uri"
+ },
+ "EE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ET": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FJ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "DE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GP": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "HU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ID": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IQ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "JM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "JP": {
+ "type": "string",
+ "format": "uri"
+ },
+ "JO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KP": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LB": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ML": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MQ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "YT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MX": {
+ "type": "string",
+ "format": "uri"
+ },
+ "FM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NP": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MP": {
+ "type": "string",
+ "format": "uri"
+ },
+ "NO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "OM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "QA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "RE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "RO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "RU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "RW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "KN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "PM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "WS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ST": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SB": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ZA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ES": {
+ "type": "string",
+ "format": "uri"
+ },
+ "LK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SD": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SJ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TJ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TK": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TO": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TT": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TR": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TC": {
+ "type": "string",
+ "format": "uri"
+ },
+ "TV": {
+ "type": "string",
+ "format": "uri"
+ },
+ "UG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "UA": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GB": {
+ "type": "string",
+ "format": "uri"
+ },
+ "US": {
+ "type": "string",
+ "format": "uri"
+ },
+ "UM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "UY": {
+ "type": "string",
+ "format": "uri"
+ },
+ "UZ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VU": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VN": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "VI": {
+ "type": "string",
+ "format": "uri"
+ },
+ "WF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "EH": {
+ "type": "string",
+ "format": "uri"
+ },
+ "YE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ZM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ZW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "AX": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BQ": {
+ "type": "string",
+ "format": "uri"
+ },
+ "CW": {
+ "type": "string",
+ "format": "uri"
+ },
+ "GG": {
+ "type": "string",
+ "format": "uri"
+ },
+ "IM": {
+ "type": "string",
+ "format": "uri"
+ },
+ "JE": {
+ "type": "string",
+ "format": "uri"
+ },
+ "ME": {
+ "type": "string",
+ "format": "uri"
+ },
+ "BL": {
+ "type": "string",
+ "format": "uri"
+ },
+ "MF": {
+ "type": "string",
+ "format": "uri"
+ },
+ "RS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SX": {
+ "type": "string",
+ "format": "uri"
+ },
+ "SS": {
+ "type": "string",
+ "format": "uri"
+ },
+ "XK": {
+ "type": "string",
+ "format": "uri"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"
+ },
+ "publicStats": {
+ "type": "boolean",
+ "default": false,
+ "description": "Whether the short link's stats are publicly accessible."
+ },
+ "tagId": {
+ "type": "string",
+ "nullable": true,
+ "description": "The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead.",
+ "deprecated": true
+ },
+ "tags": {
+ "type": "array",
+ "nullable": true,
+ "items": {
+ "$ref": "#/components/schemas/TagSchema"
+ },
+ "description": "The tags assigned to the short link."
+ },
+ "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."
+ },
+ "userId": {
+ "type": "string",
+ "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."
+ },
+ "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."
+ },
+ "projectId": {
+ "type": "string",
+ "description": "The project ID of the short link. This field is deprecated – use `workspaceId` instead.",
+ "deprecated": true
+ }
+ },
+ "required": [
+ "id",
+ "domain",
+ "key",
+ "url",
+ "archived",
+ "expiresAt",
+ "expiredUrl",
+ "password",
+ "proxy",
+ "title",
+ "description",
+ "image",
+ "rewrite",
+ "ios",
+ "android",
+ "geo",
+ "publicStats",
+ "tagId",
+ "tags",
+ "comments",
+ "shortLink",
+ "qrCode",
+ "utm_source",
+ "utm_medium",
+ "utm_campaign",
+ "utm_term",
+ "utm_content",
+ "userId",
+ "workspaceId",
+ "clicks",
+ "lastClicked",
+ "createdAt",
+ "updatedAt",
+ "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."
+ },
+ "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."
+ },
+ "domainsLimit": {
+ "type": "number",
+ "description": "The domains limit of the workspace."
+ },
+ "tagsLimit": {
+ "type": "number",
+ "description": "The tags limit of the workspace."
+ },
+ "usersLimit": {
+ "type": "number",
+ "description": "The users limit of the workspace."
+ },
+ "plan": {
+ "type": "string",
+ "enum": [
+ "free",
+ "pro",
+ "business",
+ "business plus",
+ "business extra",
+ "business max",
+ "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."
+ },
+ "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."
+ }
+ },
+ "required": [
+ "role"
+ ]
+ },
+ "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."
+ }
+ },
+ "required": [
+ "slug",
+ "primary"
+ ]
+ },
+ "description": "The domains of the workspace."
+ },
+ "inviteCode": {
+ "type": "string",
+ "nullable": true,
+ "description": "The invite code of the workspace."
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "slug",
+ "logo",
+ "usage",
+ "usageLimit",
+ "linksUsage",
+ "linksLimit",
+ "domainsLimit",
+ "tagsLimit",
+ "usersLimit",
+ "plan",
+ "stripeId",
+ "billingCycleStart",
+ "createdAt",
+ "users",
+ "domains",
+ "inviteCode"
+ ],
+ "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",
+ "pink",
+ "brown"
+ ],
+ "description": "The color of the tag."
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "color"
+ ],
+ "title": "Tag"
+ },
+ "DomainSchema": {
+ "type": "object",
+ "properties": {
+ "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",
+ "description": "Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.",
+ "default": "https://dub.co/help/article/what-is-dub",
+ "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"
+ },
+ "target": {
+ "type": "string",
+ "nullable": true,
+ "description": "The page your users will get redirected to when they visit your domain.",
+ "example": "https://acme.com/landing"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of redirect to use for this domain.",
+ "enum": [
+ "redirect",
+ "rewrite"
+ ]
+ },
+ "clicks": {
+ "type": "number",
+ "description": "The number of clicks on the domain.",
+ "default": 0
+ }
+ },
+ "required": [
+ "slug",
+ "verified",
+ "primary",
+ "archived",
+ "placeholder",
+ "expiredUrl",
+ "target",
+ "type",
+ "clicks"
+ ]
+ }
+ },
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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": {
+ "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"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file