---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/api-ref/Repository/ListBranchesByID.md
  - https://sourcecraft.dev/portal/docs/ru/api-ref/Repository/ListBranchesByID.md
  - href: en/api-ref/Repository/ListBranchesByID.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

<div class="openapi">

# List Repository Branches (By Repo ID)

<!-- markdownlint-disable-file -->

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://api.sourcecraft.tech/repos/id:{repo_id}/branches
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_repo_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_filter_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Filter branches by name contains

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_page_size_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uint64&gt;

The maximum number of branches to return. The service may return fewer than
this value

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_page_token_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

A page token, received from a previous call.
Provide this to retrieve the subsequent page.

When paginating, all other parameters must match
the call that provided the page token.

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
||

_sort_by_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Ordering options: comma separated list of fields.
Default sorting order is ascending. To specify descending order for a field,
append a "-" prefix; for example: "foo, -bar"
Redundant space characters in the syntax are insignificant. "foo, -bar", " foo , -bar", and "foo,bar"
are all equivalent.
Available fields: name

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__200">

## 200 OK

A successful response.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "branches": [
    {
      "name": "example",
      "commit": {
        "hash": "example",
        "message": "example",
        "author": {
          "name": "example",
          "email": "example",
          "date": "2025-01-01T00:00:00Z"
        },
        "committer": null,
        "tree_hash": "example",
        "parent_hashes": [
          "example"
        ],
        "merge_tag": "example",
        "file_changes": {
          "added": [
            null
          ],
          "modified": [
            null
          ],
          "removed": [
            null
          ]
        },
        "author_user": {
          "id": "example",
          "slug": "example"
        },
        "committer_user": null,
        "signature_verification": {
          "verified": true,
          "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
          "verified_at": "2025-01-01T00:00:00Z"
        }
      }
    }
  ],
  "next_page_token": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_branches_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Branch](#entity-Branch)[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "name": "example",
    "commit": {
      "hash": "example",
      "message": "example",
      "author": {
        "name": "example",
        "email": "example",
        "date": "2025-01-01T00:00:00Z"
      },
      "committer": null,
      "tree_hash": "example",
      "parent_hashes": [
        "example"
      ],
      "merge_tag": "example",
      "file_changes": {
        "added": [
          "example"
        ],
        "modified": [
          "example"
        ],
        "removed": [
          "example"
        ]
      },
      "author_user": {
        "id": "example",
        "slug": "example"
      },
      "committer_user": null,
      "signature_verification": {
        "verified": true,
        "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
        "verified_at": "2025-01-01T00:00:00Z"
      }
    }
  }
]
```

{% endcut %}
{.table-cell}
||
||

_next_page_token_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### Signature {#entity-Signature}

#|
|| **Name** | **Description** ||
||

_date_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_email_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_name_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### CommitFileChanges {#entity-CommitFileChanges}

#|
|| **Name** | **Description** ||
||

_added_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

Files that were added in this commit.
Limited to 1000 files maximum. Empty list means no files were added.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_modified_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

Files that were modified in this commit.
Limited to 1000 files maximum. Empty list means no files were modified.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_removed_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

Files that were removed in this commit.
Limited to 1000 files maximum. Empty list means no files were removed.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "added": [
    "example"
  ],
  "modified": [
    "example"
  ],
  "removed": [
    "example"
  ]
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### UserEmbedded {#entity-UserEmbedded}

#|
|| **Name** | **Description** ||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_slug_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### SignatureVerificationReason {#entity-SignatureVerificationReason}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `SIGNATURE_VERIFICATION_REASON_VALID`, `SIGNATURE_VERIFICATION_REASON_INVALID`, `SIGNATURE_VERIFICATION_REASON_MALFORMED_SIGNATURE`, `SIGNATURE_VERIFICATION_REASON_UNKNOWN_KEY`, `SIGNATURE_VERIFICATION_REASON_NO_USER`, `SIGNATURE_VERIFICATION_REASON_BAD_EMAIL`, `SIGNATURE_VERIFICATION_REASON_EXPIRED_KEY`, `SIGNATURE_VERIFICATION_REASON_NOT_SIGNING_KEY`

</div>

<div class="openapi-entity">

### SignatureVerification {#entity-SignatureVerification}

#|
|| **Name** | **Description** ||
||

_reason_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [SignatureVerificationReason](#entity-SignatureVerificationReason)

_Enum:_{.json-schema-reset .json-schema-value} `SIGNATURE_VERIFICATION_REASON_VALID`, `SIGNATURE_VERIFICATION_REASON_INVALID`, `SIGNATURE_VERIFICATION_REASON_MALFORMED_SIGNATURE`, `SIGNATURE_VERIFICATION_REASON_UNKNOWN_KEY`, `SIGNATURE_VERIFICATION_REASON_NO_USER`, `SIGNATURE_VERIFICATION_REASON_BAD_EMAIL`, `SIGNATURE_VERIFICATION_REASON_EXPIRED_KEY`, `SIGNATURE_VERIFICATION_REASON_NOT_SIGNING_KEY`
{.table-cell}
||
||

_verified_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: boolean
{.table-cell}
||
||

_verified_at_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "verified": true,
  "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
  "verified_at": "2025-01-01T00:00:00Z"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### Commit {#entity-Commit}

#|
|| **Name** | **Description** ||
||

_author_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Signature](#entity-Signature)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}
```

{% endcut %}
{.table-cell}
||
||

_author_user_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UserEmbedded](#entity-UserEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_committer_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Signature](#entity-Signature)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}
```

{% endcut %}
{.table-cell}
||
||

_committer_user_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UserEmbedded](#entity-UserEmbedded)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "id": "example",
  "slug": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_file_changes_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [CommitFileChanges](#entity-CommitFileChanges)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "added": [
    "example"
  ],
  "modified": [
    "example"
  ],
  "removed": [
    "example"
  ]
}
```

{% endcut %}
{.table-cell}
||
||

_hash_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_merge_tag_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_parent_hashes_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_signature_verification_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [SignatureVerification](#entity-SignatureVerification)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "verified": true,
  "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
  "verified_at": "2025-01-01T00:00:00Z"
}
```

{% endcut %}
{.table-cell}
||
||

_tree_hash_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "hash": "example",
  "message": "example",
  "author": {
    "name": "example",
    "email": "example",
    "date": "2025-01-01T00:00:00Z"
  },
  "committer": null,
  "tree_hash": "example",
  "parent_hashes": [
    "example"
  ],
  "merge_tag": "example",
  "file_changes": {
    "added": [
      "example"
    ],
    "modified": [
      "example"
    ],
    "removed": [
      "example"
    ]
  },
  "author_user": {
    "id": "example",
    "slug": "example"
  },
  "committer_user": null,
  "signature_verification": {
    "verified": true,
    "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
    "verified_at": "2025-01-01T00:00:00Z"
  }
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### Branch {#entity-Branch}

#|
|| **Name** | **Description** ||
||

_commit_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Commit](#entity-Commit)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "hash": "example",
  "message": "example",
  "author": {
    "name": "example",
    "email": "example",
    "date": "2025-01-01T00:00:00Z"
  },
  "committer": null,
  "tree_hash": "example",
  "parent_hashes": [
    "example"
  ],
  "merge_tag": "example",
  "file_changes": {
    "added": [
      "example"
    ],
    "modified": [
      "example"
    ],
    "removed": [
      "example"
    ]
  },
  "author_user": {
    "id": "example",
    "slug": "example"
  },
  "committer_user": null,
  "signature_verification": {
    "verified": true,
    "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
    "verified_at": "2025-01-01T00:00:00Z"
  }
}
```

{% endcut %}
{.table-cell}
||
||

_name_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "commit": {
    "hash": "example",
    "message": "example",
    "author": {
      "name": "example",
      "email": "example",
      "date": "2025-01-01T00:00:00Z"
    },
    "committer": null,
    "tree_hash": "example",
    "parent_hashes": [
      "example"
    ],
    "merge_tag": "example",
    "file_changes": {
      "added": [
        "example"
      ],
      "modified": [
        "example"
      ],
      "removed": [
        "example"
      ]
    },
    "author_user": {
      "id": "example",
      "slug": "example"
    },
    "committer_user": null,
    "signature_verification": {
      "verified": true,
      "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
      "verified_at": "2025-01-01T00:00:00Z"
    }
  }
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__default">

## default

Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": null
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_details_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: unknown

_Example:_{.json-schema-reset .json-schema-example} `null`
{.table-cell}
||
||

_error_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_request_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.