List Repository File Tree (By Repo ID)
Request
GET
https://api.sourcecraft.tech/repos/id:{repo_id}/trees
Path parameters
|
Name |
Description |
|
repo_id |
Type: string Example: `` |
Query parameters
|
Name |
Description |
|
page_size |
Type: string<uint64> The maximum number of tree entries 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: `` |
|
path |
Type: string Path within repository to get the tree for. If not specified, returns the root tree Example: `` |
|
recursive |
Type: boolean Whether to retrieve tree entries recursively. If false, only immediate children are returned |
|
revision |
Type: string Git reference (branch, tag, or commit SHA). If empty, the default branch (usually main) will be used. Example: `` |
Responses
200 OK
A successful response.
Body
application/json
{
"trees": [
{
"name": "example",
"path": "example",
"type": "file"
}
],
"next_page_token": "example"
}
|
Name |
Description |
|
next_page_token |
Type: string A token, which can be sent as Example: |
|
trees |
Type: TreeEntry[] Example
|
TreeEntry.Type
Type: string
Enum: file, executable, dir, symlink, submodule
TreeEntry
|
Name |
Description |
|
name |
Type: string Example: |
|
path |
Type: string Example: |
|
type |
Type: TreeEntry.Type Enum: |
Example
{
"name": "example",
"path": "example",
"type": "file"
}
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: |