---
title: "Set the page viewport size"
method: POST
path: "/tabs/{tabId}/viewport"
tags: ["Interaction"]
---

# Set the page viewport size

`POST /tabs/{tabId}/viewport`

Physically resizes the page via Playwright's `page.setViewportSize`, triggering a real layout reflow. Use for responsive testing — `window.resizeTo()` is a no-op on non-popup windows.

## Path parameters

- `tabId` string, required

## Request body

- object
  - `userId` string, required
  - `width` integer, required
  - `height` integer, required

## Response `200`

Viewport set.

- object
  - `ok` boolean
  - `width` integer
  - `height` integer

## Other responses

- `400` — Width or height missing or out of range.
- `404` — Tab not found.

## Changes

- **2026-05-06** `6003b4f03390` — 1 info
  - endpoint added
- **2026-04-25** `80bb18f1c19f` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/jo-inc/apis/camofox-browser/changes/tabs/:tabId/viewport/post.md)

---

[API](https://skmtc.dev/jo-inc/apis/camofox-browser.md) · [All operations](https://skmtc.dev/jo-inc/apis/camofox-browser/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jo-inc/camofox-browser/revisions/d007e73dad3d/schema)
