GET
/
repos
/
{repo_id}
/
trees
/
{ref_id}
/
{path}
curl --request GET \
  --url https://api.diversion.dev/v0/repos/{repo_id}/trees/{ref_id}/{path} \
  --header 'Authorization: Bearer <token>'
{
  "object": "FileEntry",
  "items": [
    {
      "path": "hello.cc",
      "prev_path": "<string>",
      "status": 1,
      "mode": 16877,
      "mtime": "2023-11-07T05:31:56Z",
      "blob": {
        "storage_uri": "repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
        "storage_backend": 1,
        "size": 123,
        "sha": "<string>"
      }
    }
  ],
  "workspace_journal_ordinal_id": 123
}

Authorizations

Authorization
string
headerrequired

This API uses OAuth 2 with the implicit grant flow

Path Parameters

repo_id
string
required

The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.

ref_id
string
required

An ID of a workspace, branch or commit.

path
string
required

A path to a file inside the repository.

Query Parameters

recurse
boolean
default: true

Specifies if to recursively iterate file tree to next directory levels

skip
integer

Skip a number of items returned from a listing api

limit
integer

Limit the number of entries returned from walk

offset
string

Offset item name in directory when iterating its entries (non-inclusive)

include_deleted
boolean
default: false

Should the tree contain also deleted items or omit them from response

workspace_journal_ordinal_id
integer

The ordinal ID of the journal entry the walk references, if applicable

dirs_only
boolean
default: false

Return only directories in the file tree walk

Response

200 - application/json
object
enum<string>
required
Available options:
FileEntry
items
object[]
required
workspace_journal_ordinal_id
integer

The ordinal ID of the journal entry the walk references, if applicable