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 Example: `` |
|
page_token |
Type: string A page token, received from a previous call. When paginating, all other parameters must match Example: `` |
|
sort_by |
Type: string Ordering options: comma separated list of fields. 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
|
|
next_page_token |
Type: string A token, which can be sent as Example: |
Signature
|
Name |
Description |
|
date |
Type: string<date-time> Example: |
|
|
Type: string Example: |
|
name |
Type: string 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. Example
|
|
modified |
Type: string[] Files that were modified in this commit. Example
|
|
removed |
Type: string[] Files that were removed in this commit. Example
|
Example
{
"added": [
"example"
],
"modified": [
"example"
],
"removed": [
"example"
]
}
UserEmbedded
|
Name |
Description |
|
id |
Type: string Example: |
|
slug |
Type: string 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: |
|
verified |
Type: boolean |
|
verified_at |
Type: string<date-time> Example: |
Example
{
"verified": true,
"reason": "SIGNATURE_VERIFICATION_REASON_VALID",
"verified_at": "2025-01-01T00:00:00Z"
}
Commit
|
Name |
Description |
|
author |
Type: Signature Example
|
|
author_user |
Type: UserEmbedded Example
|
|
committer |
Type: Signature Example
|
|
committer_user |
Type: UserEmbedded Example
|
|
file_changes |
Type: CommitFileChanges Example
|
|
hash |
Type: string Example: |
|
merge_tag |
Type: string Example: |
|
message |
Type: string Example: |
|
parent_hashes |
Type: string[] Example
|
|
signature_verification |
Type: SignatureVerification Example
|
|
tree_hash |
Type: string 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
|
|
name |
Type: string 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
Example
|
||
|
error_code |
Type: string Example: |
||
|
message |
Type: string Example: |
||
|
request_id |
Type: string Example: |