Skip to content

Get repository contents at the root

GET
/v1/repos/{username}/{repo_name}/contents
username
required
Username
string
repo_name
required
Repo Name
string
ref
Any of:
string

Branch name or 40-character commit hexsha. Defaults to the default branch.

Directory listing as JSON, or raw file bytes

string format: binary
X-Amendable-Git-Type
string
Allowed values: tree blob

Tree for a directory, blob for a file

X-Amendable-Git-Hexsha
string

Git object id

X-Amendable-Git-Size
string

Blob size in bytes. Present only for files.

The file is larger than the contents API will return in one response, or this account has exceeded its transfer quota. Directory listings still include oversized files and their size.

GenericError
object
detail
Detail
Example
{
"detail": "Blob too large to fetch via the contents API (max 67108864 bytes)"
}

The repository, ref, or path was not found, or the repository has no commit

GenericError
object
detail
Detail
Example
{
"detail": "Path not found"
}

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string