From 40483fcda9bdc3adc520a0ed1a23a371907aaf36 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Mon, 19 Oct 2026 17:44:46 +0300 Subject: [PATCH] docs: pin examples to API version 2026-09-22 The API now refuses Polymorfa-Version 2026-03-20 (polymorfa/polymorfa#782). The SDKs already default to 2026-09-22; update the README pins, the full-platform example and the retired-version test fixtures to match. Co-Authored-By: Claude --- README.md | 4 ++-- examples/full-platform/lib/polymorfa.ts | 2 +- packages/browser/README.md | 2 +- packages/browser/test/transport.test.ts | 6 +++--- packages/typescript/README.md | 2 +- packages/typescript/test/transport.test.ts | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index db18130b..289fcb5d 100644 --- a/README.md +++ b/README.md @@ -692,8 +692,8 @@ and `idempotencyKey`; the key does not make the API replay the append. Set `apiVersion` on a client or a single request. Use a date-form API revision, such as `2026-09-22`. The SDK sends it as the `Polymorfa-Version` header. -Native calls default to `2026-09-22`; the API accepts explicit revisions from -`2026-03-20` and rejects earlier pins. +Native calls default to `2026-09-22`, which is also the oldest revision the API +accepts. Earlier pins, including `2026-03-20`, return a `400` error. Every client exposes `raw.request()` for deliberate API escape hatches: diff --git a/examples/full-platform/lib/polymorfa.ts b/examples/full-platform/lib/polymorfa.ts index 508084b0..01049906 100644 --- a/examples/full-platform/lib/polymorfa.ts +++ b/examples/full-platform/lib/polymorfa.ts @@ -19,7 +19,7 @@ let bridgeClient: BridgeClient | undefined; function shared(): SharedClientOptions { const baseUrl = env.baseUrl(); return { - apiVersion: "2026-03-20", + apiVersion: "2026-09-22", ...(baseUrl === undefined ? {} : { baseUrl }), }; } diff --git a/packages/browser/README.md b/packages/browser/README.md index 5e6f9232..0c4abd3e 100644 --- a/packages/browser/README.md +++ b/packages/browser/README.md @@ -39,7 +39,7 @@ await messaging.messages.send({ Native Messaging requests default to `Polymorfa-Version: 2026-09-22`, matching the `whatsapp_ids` message-reference object. A temporary optional `whatsapp_id` output alias remains for older consumers. An explicit version header in request -options is preserved; versions before `2026-03-20` return the API error without an automatic +options is preserved; versions before `2026-09-22` return the API error without an automatic upgrade or resend. Raw Graph-compatible paths and same-origin application handlers receive no default native version header. Client-token permissions and Hybrid preview restrictions still apply. diff --git a/packages/browser/test/transport.test.ts b/packages/browser/test/transport.test.ts index ed58b024..96d5c9e3 100644 --- a/packages/browser/test/transport.test.ts +++ b/packages/browser/test/transport.test.ts @@ -90,7 +90,7 @@ describe("BrowserTransport", () => { error: { code: "invalid_parameter", message: - "API version 2026-03-19 is no longer supported. Minimum: 2026-03-20", + "API version 2026-03-20 is no longer supported. Minimum: 2026-09-22", param: "Polymorfa-Version", }, }, @@ -109,13 +109,13 @@ describe("BrowserTransport", () => { conversation: { phoneNumber: "+15551234567" }, content: { text: "Hello" }, }, - { headers: { "Polymorfa-Version": "2026-03-19" } }, + { headers: { "Polymorfa-Version": "2026-03-20" } }, ), ).rejects.toMatchObject({ code: "invalid_parameter", status: 400 }); expect(fetch).toHaveBeenCalledOnce(); expect( new Headers(fetch.mock.calls[0]?.[1]?.headers).get("polymorfa-version"), - ).toBe("2026-03-19"); + ).toBe("2026-03-20"); }); it("excludes raw Graph and application routes from the native default", async () => { diff --git a/packages/typescript/README.md b/packages/typescript/README.md index ac1f42ff..f8ba091c 100644 --- a/packages/typescript/README.md +++ b/packages/typescript/README.md @@ -52,7 +52,7 @@ const platform = new Client({ type: "organizationApiKey", value: process.env.POLYMORFA_PLATFORM_API_KEY!, }, - apiVersion: "2026-03-20", + apiVersion: "2026-09-22", }); const project = platform.project("project_123"); diff --git a/packages/typescript/test/transport.test.ts b/packages/typescript/test/transport.test.ts index f6bb3238..6b9685b9 100644 --- a/packages/typescript/test/transport.test.ts +++ b/packages/typescript/test/transport.test.ts @@ -174,13 +174,13 @@ describe("HttpTransport", () => { status: 400, headers: { "content-type": "application/json", - "polymorfa-version": "2026-03-19", + "polymorfa-version": "2026-03-20", }, body: JSON.stringify({ error: { code: "invalid_parameter", message: - "API version 2026-03-19 is no longer supported. Minimum: 2026-03-20", + "API version 2026-03-20 is no longer supported. Minimum: 2026-09-22", param: "Polymorfa-Version", }, }), @@ -189,11 +189,11 @@ describe("HttpTransport", () => { makeTransport(server.url, { maxNetworkRetries: 2 }).request({ method: "GET", path: "/messaging/number/hybrid-link", - headers: { "Polymorfa-Version": "2026-03-19" }, + headers: { "Polymorfa-Version": "2026-03-20" }, }), ).rejects.toMatchObject({ code: "invalid_parameter", status: 400 }); expect(server.requests).toHaveLength(1); - expect(server.requests[0]?.headers["polymorfa-version"]).toBe("2026-03-19"); + expect(server.requests[0]?.headers["polymorfa-version"]).toBe("2026-03-20"); }); it("keeps API version options ahead of raw headers for JSON and streaming calls", async () => {