---
title: "Get commit diff"
method: GET
path: "/api/projects/{projectId}/commits/{commitId}/diff"
tags: ["Branches"]
---

# Get commit diff

`GET /api/projects/{projectId}/commits/{commitId}/diff`

Retrieves the diff (file changes) for a specific commit compared to its previous commit.

## Path parameters

- `projectId` string, uuid, required
- `commitId` string, uuid, required

## Query parameters

- `content` union
  - 'true' | 'false' | 'True' | 'False' | 'TRUE' | 'FALSE'
  - boolean

## Response `200`

Commit diff with file changes and statistics

- object — Commit diff with file changes and statistics
  - `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
  - `branch` object, required — Branch the commit belongs to
    - `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[] — 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
  - `previousCommit` object, nullable — Previous commit
    - `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
  - `changes` object[], nullable, required — List of file changes
    - `type` 'added' | 'deleted' | 'modified' | 'renamed', required — Type of change
    - `file` unknown
    - `from` unknown
    - `to` unknown
  - `stats` object, required — Change statistics
    - `filesAdded` number, required — Number of files added
    - `filesDeleted` number, required — Number of files deleted
    - `filesModified` number, required — Number of files modified
    - `filesRenamed` number — Number of files renamed
    - `totalChanges` number, required — Total number of changes

---

[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)
