---
title: "Branch commit"
method: POST
path: "/api/projects/{projectId}/branches/{branchId}/commit"
tags: ["Branches"]
---

# Branch commit

`POST /api/projects/{projectId}/branches/{branchId}/commit`

Creates a new commit on a branch with the specified changes.

## Path parameters

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

## Request body

- object
  - `baseCommitId` string, uuid
  - `message` string, required
  - `changes` union[]
    - union
      - object
        - `type` 'added', required
        - `path` string, required
        - `content` unknown
      - object
        - `type` 'removed', required
        - `path` string, required
      - object
        - `type` 'modified', required
        - `path` string, required
        - `content` unknown
  - `resolutions` object[]
    - `path` string, required
    - `resolution` 'useLeft' | 'useRight' | 'manual', required
    - `content` unknown
    - `hash` string

## Response `200`

Commit result

- object — Commit result
  - `success` boolean, required — Whether the commit was successful
  - `commitId` string, uuid, required — ID of the newly created commit
  - `stats` object, required — Commit statistics
    - `totalFiles` number, required — Total number of files in the commit
    - `reusedContent` number, required — Number of reused file contents
    - `newContent` number, required — Number of new file contents

---

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