Skip to main content

Endpoint

Press a keyboard key (e.g., Enter, Tab, Escape, ArrowDown).

Authentication

Requires userId in the request body to identify the session owner.

Parameters

string
required
The tab ID returned from POST /tabs
string
required
The user ID that owns this tab’s session
string
required
The key to press. Supports all Playwright keyboard keys:
  • Character keys: "a", "B", "1", "#"
  • Special keys: "Enter", "Tab", "Escape", "Backspace", "Delete"
  • Arrow keys: "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"
  • Modifier keys: "Shift", "Control", "Alt", "Meta"
  • Function keys: "F1" through "F12"
  • Navigation: "Home", "End", "PageUp", "PageDown"

Response

boolean
true if the key was pressed successfully

Example

Response:

Common use cases

Submit a form

Scroll with arrow keys

Error responses

Notes

  • Key names are case-sensitive: use "Enter" not "enter"
  • Modifier keys can be combined with +: "Control+c", "Shift+Tab"
  • Key press happens wherever focus currently is on the page
  • Use /type endpoint instead for typing text strings
  • For pressing Enter after typing, use the pressEnter parameter in /type