Endpoint
Authentication
RequiresuserId in the request body to identify the session owner.
Parameters
string
required
The tab ID returned from
POST /tabsstring
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 successfullyExample
Common use cases
Submit a form
Navigate with keyboard
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
/typeendpoint instead for typing text strings - For pressing Enter after typing, use the
pressEnterparameter in/type
Related endpoints
- Type text - Type text into an element
- Click element - Click to focus an element first