---
title: "Get branch"
method: GET
path: "/api/projects/{projectId}/branches/{branchId}"
tags: ["Branches"]
---

# Get branch

`GET /api/projects/{projectId}/branches/{branchId}`

Retrieves details of a specific branch including its latest commit and change requests.

## Path parameters

- `projectId` string, uuid, required
- `branchId` union, required
  - string, uuid
  - 'main'

## Response `200`

Branch details with latest commit and change requests

- object — Branch details with latest commit and change requests
  - `id` string, uuid, required — Branch ID
  - `name` string, required — Branch name
  - `default` boolean, required — Whether this is the default (main) branch
  - `projectId` string, uuid, required — Project ID
  - `baseCommitId` string, uuid, nullable, required — Base commit ID
  - `createdById` string, uuid, nullable, required — ID of user who created the branch
  - `createdBy` object, nullable — User who created the branch
    - `id` string, uuid, required — User ID
    - `email` string, required — User email
    - `firstName` string, nullable, required — User first name
    - `lastName` string, nullable, required — User last name
  - `createdAt` string, date-time, required — Creation timestamp
  - `updatedAt` string, date-time, required — Last update timestamp
  - `changeRequests` object[], required — Pending change requests
    - `id` string, uuid, required — Change request ID
    - `status` string, required — Change request status
    - `type` string, required — Change request type
    - `branchId` string, uuid, nullable, required — Associated branch ID
    - `projectId` string, uuid, required — Associated project ID
    - `createdAt` string, date-time, required — Creation timestamp
  - `latestCommit` object, nullable, required — Latest commit on the branch
    - `id` string, uuid, required — Commit ID
    - `message` string, nullable, required — Commit message
    - `branchId` string, uuid, required — Branch ID
    - `projectId` string, uuid, required — Project ID
    - `createdById` string, uuid, nullable, required — ID of user who created the commit
    - `createdBy` object, nullable — User who created the commit
      - `id` string, uuid, required — User ID
      - `email` string, required — User email
      - `firstName` string, nullable, required — User first name
      - `lastName` string, nullable, required — User last name
    - `createdAt` string, date-time, required — Creation timestamp
    - `files` unknown[] — Commit files
      - unknown
  - `totalCommits` number, required — Total number of commits on the branch

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
