> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# List branches

## `page.listBranches()`

List all branches that exist for a page.

Each entry in the returned array contains the branch's page ID and branch ID.
Use the page ID with [`webflow.switchPage()`](/designer/reference/switch-page) to navigate to a branch.

### Syntax

```typescript
page.listBranches(): Promise<Array<{pageId: string, branchId: string}>>
```

### Returns

**Promise\<Array\<\{pageId: string, branchId: string}>>**

A Promise that resolves to an array of objects, one per branch.
Each object contains:

| Property   | Type     | Description                                                                                     |
| :--------- | :------- | :---------------------------------------------------------------------------------------------- |
| `pageId`   | `string` | The page ID of the branch. Pass this value to `webflow.switchPage()` to navigate to the branch. |
| `branchId` | `string` | The branch identifier.                                                                          |

The array is empty when the page has no branches.

### Example

```typescript
const currentPage = await webflow.getCurrentPage()

const branches = await currentPage.listBranches()
if (branches.length > 0) {
  console.log(`Found ${branches.length} branch(es):`)
  for (const branch of branches) {
    console.log(`  pageId: ${branch.pageId}, branchId: ${branch.branchId}`)
  }

  // Navigate to the first branch
  const allPages = await webflow.getAllPagesAndFolders()
  const branchPage = allPages.find(p => p.id === branches[0].pageId)
  if (branchPage) {
    await webflow.switchPage(branchPage)
  }
} else {
  console.log('No branches found for this page.')
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

### Designer Ability

| Designer Ability        | Locale | Branch | Workflow | Sitemode |
| :---------------------- | :----- | :----- | :------- | :------- |
| **canReadPageSettings** | Any    | Any    | Any      | Any      |