Get repository contents at the root
GET/v1/repos/{username}/{repo_name}/contents
GET
/v1/repos/{username}/{repo_name}/contents
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”username
required
Username
string
repo_name
required
Repo Name
string
Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”Directory listing as JSON, or raw file bytes
string format: binary
ContentsTreeResponse
object
type
Type
string
path
required
Path
Path of this directory, empty at the repository root
string
hexsha
required
Hexsha
string
entries
required
Entries
Array
Any of:
ContentsTreeEntry
object
type
Type
string
name
required
Name
string
path
required
Path
string
hexsha
required
Hexsha
string
mode
required
Mode
integer
ContentsBlobEntry
object
type
Type
string
name
required
Name
string
path
required
Path
string
hexsha
required
Hexsha
string
mode
required
Mode
integer
size
required
Size
integer
mime_type
required
Mime Type
string
Headers
Section titled “Headers”X-Amendable-Git-Type
string
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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string