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

# Get branch

`GET /api/v1/branches/{branchId}`

## Request

- Base URL: `https://omniapp.co` (the document declares no server; this is the origin it was published from)
- URL: `https://omniapp.co/api/v1/branches/{branchId}`
- Auth: HTTP bearer

The branch and its parts as the user sees them: each model with changes, with the drafts on that model, and each draft on a model without changes, with whether the user may merge it and the reason when not. Parts the user cannot see are left out. A live branch the user cannot see is refused.

## Path parameters

- `branchId` string, uuid, required: Branch ID: the org-wide branch, as `orgBranchId` on branch responses. A model-level branch ID is not accepted.

## Query parameters

- `userId` string, uuid: User ID of the user to act as, as `userId` on other endpoints. Required with an organization API key; a user-scoped key may only name its own user.

## Response `200`

The branch

- BranchesGetResponse
  - `branch` BranchDetail, required
    - `createdAt` string, date-time, required: When the branch was created
    - `description` string, nullable, required: Branch description
    - `id` string, uuid, required: Branch ID
    - `name` string, required: Branch name
    - `openToViewers` boolean, required: Whether Viewers and Restricted Queriers of its models see the branch instead of production
    - `updatedAt` string, date-time, required: When the branch was last updated
    - `parts` BranchPart[], required: The parts the user may see, each with whether they may merge it
      - union
        - BranchModelPart
          - `allowed` boolean, required: Whether the user may merge this part
          - `reason` 'no_promote_rights' | 'git_follower' | 'pull_request_required' | 'pr_not_merged' | 'no_content_edit_rights': Why the user may not merge it; absent when allowed. `no_promote_rights`: the user may not update the model. `git_follower`: the model is a Git follower, so Omni never merges its branches; changes reach the shared model through git only. `pull_request_required`: the model merges through a pull request and none is open. `pr_not_merged`: the pull request is open and the branch merges when it does. `no_content_edit_rights`: the user may not edit the draft's document in a branch.
          - `drafts` BranchDraftSummary[], required: The drafts on this model the user may see
            - `documentId` string, uuid, required: Document ID of the published content the draft edits
            - `documentIdentifier` string, required: Identifier of the published content, as in its URL
            - `id` string, uuid, required: Draft ID
            - `modelId` string, uuid, required: ID of the model the draft's document is built on
            - `name` string, nullable, required: Draft name
          - `id` string, uuid, required: Model-level branch ID of the change
          - `kind` 'model', required: A model with changes on the branch. Its drafts go with it.
          - `modelId` string, uuid, required: Model ID the change is on
          - `modelName` string, nullable, required: Model name
          - `pullRequestUrl` string, nullable, required: The pull request opened for the change, if any
        - BranchDraftPart
          - `documentId` string, uuid, required: Document ID of the published content the draft edits
          - `documentIdentifier` string, required: Identifier of the published content, as in its URL
          - `id` string, uuid, required: Draft ID
          - `modelId` string, uuid, required: ID of the model the draft's document is built on
          - `name` string, nullable, required: Draft name
          - `allowed` boolean, required: Whether the user may merge this part
          - `reason` 'no_promote_rights' | 'git_follower' | 'pull_request_required' | 'pr_not_merged' | 'no_content_edit_rights': Why the user may not merge it; absent when allowed. `no_promote_rights`: the user may not update the model. `git_follower`: the model is a Git follower, so Omni never merges its branches; changes reach the shared model through git only. `pull_request_required`: the model merges through a pull request and none is open. `pr_not_merged`: the pull request is open and the branch merges when it does. `no_content_edit_rights`: the user may not edit the draft's document in a branch.
          - `kind` 'draft', required: A draft on a model that has no changes on the branch. It stands on its own.
  - `success` boolean, required: Whether the operation succeeded

## Other responses

- `400`: An organization API key without userId
- `401`: Authentication required
- `403`: Permission denied - the branch is not visible to the user
- `404`: Branch not found

## Changes

- **2026-10-27** `5775a7ba4b2f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omniapp/apis/omni-api/changes/api/v1/branches/:branchId/get.md)

---

[API](https://skmtc.dev/omniapp/apis/omni-api.md) - [All operations](https://skmtc.dev/omniapp/apis/omni-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omniapp/apis/omni-api/revisions/76b40ebc2292?raw)
