--- title: "system.perspective.closeAllPopups" description: "Closes all popups on the page with the given pageId, all pages in the Session with the given sessionId, or all open popups." --- # system.perspective.closeAllPopups > Closes all popups on the page with the given pageId, all pages in the Session with the given sessionId, or all open popups. ## Description Closes all open popups on the page with the given pageId, or on all pages in the Session with the given sessionId if no pageId is provided. If neither a pageId nor a sessionId is provided, all open popups on every page in the current Session are closed. ## Syntax `system.perspective.closeAllPopups([sessionId], [pageId])` ### Parameters | Type | Parameter | Description | |---|---|---| | String | `sessionId` | Identifier of the Session to target. If omitted, the current Session will be used automatically. [Optional] | | String | `pageId` | Identifier of the page to target. If omitted, the current page will be used automatically. [Optional] | ### Returns Nothing ### Scope Gateway, Perspective Session ## Code Examples ```python title="Code Snippet" # Closes all open popup pages. system.perspective.closeAllPopups() ```