Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(api): point v0 deprecation notices at the v0 migration guide (#5623)

Gergő Móricza9ca1a386b8a
diff --git a/apps/api/src/__tests__/routes/deprecations-existing-routes.routes.test.ts b/apps/api/src/__tests__/routes/deprecations-existing-routes.routes.test.ts
index 60847f4a9..314a4febf 100644
--- a/apps/api/src/__tests__/routes/deprecations-existing-routes.routes.test.ts
+++ b/apps/api/src/__tests__/routes/deprecations-existing-routes.routes.test.ts
@@ -25,6 +25,9 @@ const EXISTING = {
type Key = keyof typeof EXISTING;
+const V0_GUIDE = "https://docs.firecrawl.dev/migrating-from-v0";
+const V0_SUNSET = "Thu, 10 Dec 2026 15:00:00 GMT";
+
// What the old middleware did, replayed on a copy, so we can compare bytes.
function legacyAnnotate(body: any, message: string, replacement?: string) {
const copy = JSON.parse(JSON.stringify(body));
@@ -52,15 +55,32 @@ const BODIES: Record<string, unknown> = {
};
describe("pre-existing deprecated routes are unchanged", () => {
+ // Before the v0 sunset, so every route still serves.
+ beforeEach(() => {
+ vi.useFakeTimers({ toFake: ["Date"] });
+ vi.setSystemTime(new Date("2026-11-01T00:00:00Z"));
+ });
+
+ afterEach(() => {
+ vi.useRealTimers();
+ });
+
for (const key of Object.keys(EXISTING) as Key[]) {
describe(key, () => {
- it("emits the shared 2026-05-06 Deprecation date and no Sunset", async () => {
+ it("emits the shared 2026-05-06 Deprecation date, and a Sunset only on v0", async () => {
const res = await request(appFor(key, BODIES.plain)).get("/probe");
expect(res.headers["deprecation"]).toBe(LEGACY_DEPRECATED_AT);
- expect(res.headers["sunset"]).toBeUndefined();
+ expect(res.headers["sunset"]).toBe(
+ key.startsWith("v0_") ? V0_SUNSET : undefined,
+ );
expect(res.headers["warning"]).toMatch(/^299 - "/);
- if (EXISTING[key]) {
+ if (key.startsWith("v0_")) {
+ expect(res.headers["warning"]).toContain(V0_GUIDE);
+ expect(res.headers["link"]).toBe(
+ `<${V0_GUIDE}>; rel="deprecation", <${EXISTING[key]}>; rel="successor-version"`,
+ );
+ } else if (EXISTING[key]) {
expect(res.headers["link"]).toBe(
`<${EXISTING[key]}>; rel="successor-version"`,
);
diff --git a/apps/api/src/lib/deprecations.ts b/apps/api/src/lib/deprecations.ts
index a349cc7af..7616ea23f 100644
--- a/apps/api/src/lib/deprecations.ts
+++ b/apps/api/src/lib/deprecations.ts
@@ -78,34 +78,47 @@ const DEPRECATIONS = {
deprecatedAt: "@1778025600",
},
v0_scrape: {
- message: "/v0/scrape is deprecated. Use /v2/scrape instead.",
+ message:
+ "/v0/scrape is deprecated. Use /v2/scrape instead. See https://docs.firecrawl.dev/migrating-from-v0.",
replacement: "/v2/scrape",
+ docs: "https://docs.firecrawl.dev/migrating-from-v0",
+ sunset: "Thu, 10 Dec 2026 15:00:00 GMT",
deprecatedAt: "@1778025600",
surface: "v0",
},
v0_crawl: {
- message: "/v0/crawl is deprecated. Use /v2/crawl instead.",
+ message:
+ "/v0/crawl is deprecated. Use /v2/crawl instead. See https://docs.firecrawl.dev/migrating-from-v0.",
replacement: "/v2/crawl",
+ docs: "https://docs.firecrawl.dev/migrating-from-v0",
+ sunset: "Thu, 10 Dec 2026 15:00:00 GMT",
deprecatedAt: "@1778025600",
surface: "v0",
},
v0_crawl_status: {
message:
- "/v0/crawl/status/:jobId is deprecated. Use /v2/crawl/:jobId instead.",
+ "/v0/crawl/status/:jobId is deprecated. Use /v2/crawl/:jobId instead. See https://docs.firecrawl.dev/migrating-from-v0.",
replacement: "/v2/crawl/:jobId",
+ docs: "https://docs.firecrawl.dev/migrating-from-v0",
+ sunset: "Thu, 10 Dec 2026 15:00:00 GMT",
deprecatedAt: "@1778025600",
surface: "v0",
},
v0_crawl_cancel: {
message:
- "/v0/crawl/cancel/:jobId is deprecated. Use DELETE /v2/crawl/:jobId instead.",
+ "/v0/crawl/cancel/:jobId is deprecated. Use DELETE /v2/crawl/:jobId instead. See https://docs.firecrawl.dev/migrating-from-v0.",
replacement: "/v2/crawl/:jobId",
+ docs: "https://docs.firecrawl.dev/migrating-from-v0",
+ sunset: "Thu, 10 Dec 2026 15:00:00 GMT",
deprecatedAt: "@1778025600",
surface: "v0",
},
v0_search: {
- message: "/v0/search is deprecated. Use /v2/search instead.",
+ message:
+ "/v0/search is deprecated. Use /v2/search instead. See https://docs.firecrawl.dev/migrating-from-v0.",
replacement: "/v2/search",
+ docs: "https://docs.firecrawl.dev/migrating-from-v0",
+ sunset: "Thu, 10 Dec 2026 15:00:00 GMT",
deprecatedAt: "@1778025600",
surface: "v0",
},