Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of 1.24.7, which is no longer the latest release. See the latest release.

Gets the metadata of all the entries of the root dir

GET
/repos/{owner}/{repo}/contents
curl --request GET \
--url https://gitea.com/api/v1/repos/example/example/contents \
--header 'Authorization: Basic <credentials>'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

ref
string

The name of the commit/branch/tag. Default to the repository’s default branch.

ContentsListResponse

Media typeapplication/json
Array<object>

ContentsResponse contains information about a repo’s entry’s (dir, file, symlink, submodule) metadata and content

object
_links

FileLinksResponse contains the links for a repo’s file

object
git
string
html
string
self
string
content

content is populated when type is file, otherwise null

string
download_url
string
encoding

encoding is populated when type is file, otherwise null

string
git_url
string
html_url
string
last_author_date
string format: date-time
last_commit_sha
string
last_committer_date
string format: date-time
name
string
path
string
sha
string
size
integer format: int64
submodule_git_url

submodule_git_url is populated when type is submodule, otherwise null

string
target

target is populated when type is symlink, otherwise null

string
type

type will be file, dir, symlink, or submodule

string
url
string
Examplegenerated
[
{
"_links": {
"git": "example",
"html": "example",
"self": "example"
},
"content": "example",
"download_url": "example",
"encoding": "example",
"git_url": "example",
"html_url": "example",
"last_author_date": "2026-04-15T12:00:00Z",
"last_commit_sha": "example",
"last_committer_date": "2026-04-15T12:00:00Z",
"name": "example",
"path": "example",
"sha": "example",
"size": 1,
"submodule_git_url": "example",
"target": "example",
"type": "example",
"url": "example"
}
]

APINotFound is a not found empty response

Media typeapplication/json