---
title: "List the local branches and pull requests a workspace review can read, checked-out branch first"
method: GET
path: "/api/v1/sessions/{sessionId}/workspace/branches"
tags: ["sessions"]
---

# List the local branches and pull requests a workspace review can read, checked-out branch first

`GET /api/v1/sessions/{sessionId}/workspace/branches`

## Request

- Base URL: `http://127.0.0.1:3001`
- URL: `http://127.0.0.1:3001/api/v1/sessions/{sessionId}/workspace/branches`
- Auth: none declared

## Path parameters

- `sessionId` string, required: Session identifier, e.g. project-1.

## Response `200`

OK

- WorkspaceBranchesResponse
  - `branches` WorkspaceBranchResponse[], required: The checked-out row first, then the rest newest first; at most 200 rows.
    - `checkedOut` boolean, required
    - `detached` boolean
    - `isDefault` boolean, required
    - `kind` 'local' | 'remote' | 'pull_request', required: local reads as a branch view (or the checked-out worktree); pull_request reads as a pull request view.
    - `name` string, required: Branch name, the pull request's source branch, or empty for a detached HEAD.
    - `prNumber` integer
    - `prTitle` string
    - `prUrl` string: Pass as sourceUrl with prNumber to read a pull_request row.
    - `tipSha` string
    - `updatedAt` string, date-time, nullable: The tip's committer time, or the pull request's last update.
  - `defaultBranch` string
  - `sessionId` string, required
  - `supported` boolean, required: False for scratch sessions, which have no Git history.
  - `truncated` boolean, required

## Other responses

- `404`: Not Found
- `500`: Internal Server Error
- `501`: Not Implemented

## Changes

- **2026-10-21** `8f160e6183cd`: 3 info
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `404`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `500`
  - removed the `agent_switch_saga` enum value from the `reporting_owner` response property for the response status `501`
- **2026-10-21** `9fd7084a4f87`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/changes/api/v1/sessions/:sessionId/workspace/branches/get.md)

---

[API](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon.md) - [All operations](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/llms.txt) - [OpenAPI document](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/revisions/61d7efd08578?raw)
