# Get branch

Endpoint: GET /code/api/v1/repos/{repo_identifier}/branches/{branch_name}
Version: 1.0
Security: x-api-key

## Query parameters:

  - `accountIdentifier` (string, required)
    Account Identifier for the Entity.

  - `orgIdentifier` (string)
    Organization Identifier for the Entity.

  - `projectIdentifier` (string)
    Project Identifier for the Entity.

  - `include_checks` (boolean)
    If true, the summary of check for the branch commit SHA would be included in the response.

  - `include_rules` (boolean)
    If true, a list of rules that apply to this branch would be included in the response.

  - `include_pullreqs` (boolean)
    If true, a list of pull requests from the branch would be included in the response.

  - `max_divergence` (integer)
    If greater than zero, branch divergence from the default branch will be included in the response. The divergence would be calculated up the this many commits.

## Path parameters:

  - `repo_identifier` (string, required)

  - `branch_name` (string, required)

## Response 200 fields (application/json):

  - `check_summary` (object)

  - `check_summary.error` (integer)

  - `check_summary.failure` (integer)

  - `check_summary.pending` (integer)

  - `check_summary.running` (integer)

  - `check_summary.success` (integer)

  - `commit` (object)

  - `commit.author` (object)

  - `commit.author.identity` (object)

  - `commit.author.identity.email` (string)

  - `commit.author.identity.name` (string)

  - `commit.author.when` (string)

  - `commit.committer` (object)

  - `commit.message` (string)

  - `commit.parent_shas` (array)

  - `commit.sha` (string)
    Git object hash

  - `commit.signature` (object,null)

  - `commit.signature.created` (integer)

  - `commit.signature.key_fingerprint` (string)

  - `commit.signature.key_id` (string)

  - `commit.signature.key_scheme` (string)
    Enum: "pgp", "ssh"

  - `commit.signature.result` (string)
    Enum: "bad", "good", "invalid", "key_expired", "revoked", "unsupported", "unverified"

  - `commit.signature.updated` (integer)

  - `commit.stats` (object)

  - `commit.stats.files` (array)

  - `commit.stats.files.changes` (integer)

  - `commit.stats.files.deletions` (integer)

  - `commit.stats.files.insertions` (integer)

  - `commit.stats.files.old_path` (string)

  - `commit.stats.files.path` (string)

  - `commit.stats.files.status` (string)

  - `commit.stats.total` (object)

  - `commit.stats.total.changes` (integer)

  - `commit.stats.total.deletions` (integer)

  - `commit.stats.total.insertions` (integer)

  - `commit.title` (string)

  - `commit_divergence` (object)

  - `commit_divergence.ahead` (integer)

  - `commit_divergence.behind` (integer)

  - `is_default` (boolean)

  - `name` (string)

  - `pull_requests` (array)

  - `pull_requests.author` (object,null)

  - `pull_requests.author.created` (integer)

  - `pull_requests.author.display_name` (string)

  - `pull_requests.author.email` (string)

  - `pull_requests.author.id` (integer)

  - `pull_requests.author.type` (string)
    Enum: "service", "serviceaccount", "user"

  - `pull_requests.author.uid` (string)

  - `pull_requests.author.updated` (integer)

  - `pull_requests.check_summary` (object)

  - `pull_requests.closed` (integer,null)

  - `pull_requests.created` (integer)

  - `pull_requests.description` (string)

  - `pull_requests.edited` (integer)

  - `pull_requests.is_draft` (boolean)

  - `pull_requests.labels` (array)

  - `pull_requests.labels.color` (string)
    Enum: "blue", "brown", "cyan", "green", "indigo", "lime", "mint", "orange", "pink", "purple", "red", "violet", "yellow"

  - `pull_requests.labels.id` (integer)

  - `pull_requests.labels.key` (string)

  - `pull_requests.labels.scope` (integer)

  - `pull_requests.labels.value` (string,null)

  - `pull_requests.labels.value_color` (string)
    Enum: "blue", "brown", "cyan", "green", "indigo", "lime", "mint", "orange", "pink", "purple", "red", "violet", "yellow"

  - `pull_requests.labels.value_count` (integer)

  - `pull_requests.labels.value_id` (integer,null)

  - `pull_requests.merge_base_sha` (string)

  - `pull_requests.merge_check_status` (string)

  - `pull_requests.merge_conflicts` (array)

  - `pull_requests.merge_method` (string)
    Enum: "fast-forward", "merge", "rebase", "squash"

  - `pull_requests.merge_target_sha` (string,null)

  - `pull_requests.merge_violations_bypassed` (boolean,null)

  - `pull_requests.merged` (integer,null)

  - `pull_requests.merger` (object,null)

  - `pull_requests.number` (integer)

  - `pull_requests.rebase_check_status` (string)

  - `pull_requests.rebase_conflicts` (array)

  - `pull_requests.rules` (array)

  - `pull_requests.rules.identifier` (string)

  - `pull_requests.rules.repo_path` (string)

  - `pull_requests.rules.space_path` (string)

  - `pull_requests.rules.state` (string,null)
    Enum: "active", "disabled", "monitor"

  - `pull_requests.rules.type` (string)
    Enum: "branch", "push", "tag"

  - `pull_requests.source_branch` (string)

  - `pull_requests.source_repo` (object)

  - `pull_requests.source_repo.default_branch` (string)

  - `pull_requests.source_repo.fork_id` (integer)

  - `pull_requests.source_repo.id` (integer)

  - `pull_requests.source_repo.identifier` (string)

  - `pull_requests.source_repo.parent_id` (integer)

  - `pull_requests.source_repo.path` (string)

  - `pull_requests.source_repo.type` (string)

  - `pull_requests.source_repo_id` (integer,null)

  - `pull_requests.source_sha` (string)

  - `pull_requests.state` (string)
    Enum: "closed", "merged", "open"

  - `pull_requests.stats` (object)

  - `pull_requests.stats.additions` (integer,null)

  - `pull_requests.stats.commits` (integer,null)

  - `pull_requests.stats.conversations` (integer)

  - `pull_requests.stats.deletions` (integer,null)

  - `pull_requests.stats.files_changed` (integer,null)

  - `pull_requests.stats.unresolved_count` (integer)

  - `pull_requests.substate` (string)
    Enum: "", "auto_merge", "merge_queue"

  - `pull_requests.target_branch` (string)

  - `pull_requests.target_repo_id` (integer)

  - `pull_requests.title` (string)

  - `pull_requests.updated` (integer)

  - `rules` (array)

  - `sha` (string)
    Git object hash

## Response 401 fields (application/json):

  - `message` (string)

  - `values` (object)


