Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>()` for deliberate API escape hatches:

Expand Down
2 changes: 1 addition & 1 deletion examples/full-platform/lib/polymorfa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions packages/browser/test/transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
Expand All @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions packages/typescript/test/transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}),
Expand All @@ -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 () => {
Expand Down
Loading