List Repository Branches

Request

GET

https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/branches

Path parameters

Name

Description

org_slug

Type: string

Example: ``

repo_slug

Type: string

Example: ``

Query parameters

Name

Description

filter

Type: string

Filter branches by name contains

Example: ``

page_size

Type: string<uint64>

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

Example: ``

page_token

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: ``

sort_by

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: ``

Responses

200 OK

A successful response.

Body

application/json
{
  "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"
}

Name

Description

branches

Type: Branch[]

Example
[
  {
    "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"
      }
    }
  }
]

next_page_token

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: example

Signature

Name

Description

date

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

email

Type: string

Example: example

name

Type: string

Example: example

Example
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}

CommitFileChanges

Name

Description

added

Type: string[]

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

Example
[
  "example"
]

modified

Type: string[]

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

Example
[
  "example"
]

removed

Type: string[]

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

Example
[
  "example"
]
Example
{
  "added": [
    "example"
  ],
  "modified": [
    "example"
  ],
  "removed": [
    "example"
  ]
}

UserEmbedded

Name

Description

id

Type: string

Example: example

slug

Type: string

Example: example

Example
{
  "id": "example",
  "slug": "example"
}

SignatureVerificationReason

Type: string

Enum: 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

SignatureVerification

Name

Description

reason

Type: SignatureVerificationReason

Enum: 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

verified

Type: boolean

verified_at

Type: string<date-time>

Example: 2025-01-01T00:00:00Z

Example
{
  "verified": true,
  "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
  "verified_at": "2025-01-01T00:00:00Z"
}

Commit

Name

Description

author

Type: Signature

Example
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}

author_user

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

committer

Type: Signature

Example
{
  "name": "example",
  "email": "example",
  "date": "2025-01-01T00:00:00Z"
}

committer_user

Type: UserEmbedded

Example
{
  "id": "example",
  "slug": "example"
}

file_changes

Type: CommitFileChanges

Example
{
  "added": [
    "example"
  ],
  "modified": [
    "example"
  ],
  "removed": [
    "example"
  ]
}

hash

Type: string

Example: example

merge_tag

Type: string

Example: example

message

Type: string

Example: example

parent_hashes

Type: string[]

Example
[
  "example"
]

signature_verification

Type: SignatureVerification

Example
{
  "verified": true,
  "reason": "SIGNATURE_VERIFICATION_REASON_VALID",
  "verified_at": "2025-01-01T00:00:00Z"
}

tree_hash

Type: string

Example: example

Example
{
  "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"
  }
}

Branch

Name

Description

commit

Type: Commit

Example
{
  "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"
  }
}

name

Type: string

Example: example

Example
{
  "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"
    }
  }
}

default

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

Body

application/json
{
  "error_code": "example",
  "message": "example",
  "request_id": "example",
  "details": {}
}

Name

Description

details

Type: Optional details. Exact structure depends on error_code

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example

Предыдущая
Следующая