---
title: "Compare branches"
method: GET
path: "/projects/{project_id}/branches/{name}/compare"
tags: ["Branches"]
---

# Compare branches

`GET /projects/{project_id}/branches/{name}/compare`

Compare branch with main branch.

*Note: Comparing a branch may take several minutes depending on the project size. Consider using the `POST /compare` endpoint for creating comparison asynchronously.*

## Path parameters

- `project_id` string, required
- `name` string, required

## Query parameters

- `name` string

## Headers

- `X-PhraseApp-OTP` string

## Response `200`

OK

- BranchComparison — Comparison result of a branch against its base branch. Top-level properties correspond to resource types. Each resource type lists changes made in the base branch (`base_changes`), changes made in the feature branch (`head_changes`), and conflicting entries (`conflicts`).
  - `translation_keys` BranchComparisonDiff
    - `base_changes` BranchComparisonChange[] — Changes made to this resource type in the base branch since the branch was created.
      - `from` object, nullable
      - `to` object, nullable
    - `head_changes` BranchComparisonChange[] — Changes made to this resource type in the feature branch.
      - `from` object, nullable
      - `to` object, nullable
    - `conflicts` object — Conflicting changes present in both branches, keyed by conflict type. Possible conflict type keys: `changed_in_head_changed_in_base`, `added_in_head_added_in_base`, `changed_in_head_deleted_in_base`, `deleted_in_head_changed_in_base`. Each value contains `base` and `head` arrays of changed attribute objects.
  - `translations` BranchComparisonDiff
    - `base_changes` BranchComparisonChange[] — Changes made to this resource type in the base branch since the branch was created.
      - `from` object, nullable
      - `to` object, nullable
    - `head_changes` BranchComparisonChange[] — Changes made to this resource type in the feature branch.
      - `from` object, nullable
      - `to` object, nullable
    - `conflicts` object — Conflicting changes present in both branches, keyed by conflict type. Possible conflict type keys: `changed_in_head_changed_in_base`, `added_in_head_added_in_base`, `changed_in_head_deleted_in_base`, `deleted_in_head_changed_in_base`. Each value contains `base` and `head` arrays of changed attribute objects.
  - `locales` BranchComparisonDiff
    - `base_changes` BranchComparisonChange[] — Changes made to this resource type in the base branch since the branch was created.
      - `from` object, nullable
      - `to` object, nullable
    - `head_changes` BranchComparisonChange[] — Changes made to this resource type in the feature branch.
      - `from` object, nullable
      - `to` object, nullable
    - `conflicts` object — Conflicting changes present in both branches, keyed by conflict type. Possible conflict type keys: `changed_in_head_changed_in_base`, `added_in_head_added_in_base`, `changed_in_head_deleted_in_base`, `deleted_in_head_changed_in_base`. Each value contains `base` and `head` arrays of changed attribute objects.
  - `tags` BranchComparisonDiff
    - `base_changes` BranchComparisonChange[] — Changes made to this resource type in the base branch since the branch was created.
      - `from` object, nullable
      - `to` object, nullable
    - `head_changes` BranchComparisonChange[] — Changes made to this resource type in the feature branch.
      - `from` object, nullable
      - `to` object, nullable
    - `conflicts` object — Conflicting changes present in both branches, keyed by conflict type. Possible conflict type keys: `changed_in_head_changed_in_base`, `added_in_head_added_in_base`, `changed_in_head_deleted_in_base`, `deleted_in_head_changed_in_base`. Each value contains `base` and `head` arrays of changed attribute objects.

## Other responses

- `400` — Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry.
- `404` — Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry.
- `409` — Conflict. The request conflicts with the current state of the resource. Reconcile the conflicting state and retry.
- `429` — Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying.

---

[API](https://skmtc.net/phrase/apis/control-hub-service.md) · [All operations](https://skmtc.net/phrase/apis/control-hub-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phrase/control-hub-service/revisions/98ecac7ba2bf/schema)
