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.

update analytics API docs

Steven Teyf4f5b3b8cfaf
diff --git a/apps/web/lib/zod/schemas/analytics.ts b/apps/web/lib/zod/schemas/analytics.ts
index 68d069dd7a..77ac4b3cdb 100644
--- a/apps/web/lib/zod/schemas/analytics.ts
+++ b/apps/web/lib/zod/schemas/analytics.ts
@@ -66,7 +66,7 @@ export const analyticsPathParamsSchema = z.object({
endpoint: oldAnalyticsEndpoints.optional(),
});
-// Query schema for /api/analytics endpoint
+// Query schema for GET /analytics and GET /events endpoints
export const analyticsQuerySchema = z
.object({
event: analyticsEvents,
@@ -75,16 +75,23 @@ export const analyticsQuerySchema = z
.string()
.optional()
.describe("The domain to filter analytics for."),
- key: z.string().optional().describe("The short link slug."),
+ key: z
+ .string()
+ .optional()
+ .describe(
+ "The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link.",
+ ),
linkId: z
.string()
.optional()
- .describe("The unique ID of the short link on Dub."),
+ .describe(
+ "The unique ID of the short link on Dub to retrieve analytics for.",
+ ),
externalId: z
.string()
.optional()
.describe(
- "This is the ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.",
+ "The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter.",
),
tenantId: z
.string()