List Repository File Tree

Request

GET

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

Path parameters

Name

Description

org_slug

Type: string

Example: ``

repo_slug

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

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.
Examples: mybranch, tags:v1.0.0

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 page_token to retrieve the next page.
If this field is omitted, there are no subsequent pages.

Example: example

trees

Type: TreeEntry[]

Example
[
  {
    "name": "example",
    "path": "example",
    "type": "file"
  }
]

TreeEntry.Type

Type: string

Enum: file, executable, dir, symlink, submodule

TreeEntry

Name

Description

name

Type: string

Example: example

path

Type: string

Example: example

type

Type: TreeEntry.Type

Enum: file, executable, dir, symlink, submodule

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

[additional]

Type: string

Example: example

Example
{}

error_code

Type: string

Example: example

message

Type: string

Example: example

request_id

Type: string

Example: example

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