Get contents
curl --request GET \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/contents/{path} \
--header 'Authorization: <api-key>'{
"type": "file",
"encoding": "<string>",
"size": 123,
"name": "<string>",
"path": "<string>",
"content": "<string>",
"sha": "<string>",
"url": "<string>",
"git_url": "<string>",
"html_url": "<string>",
"download_url": "<string>",
"_links": {
"git": "<string>",
"self": "<string>",
"html": "<string>"
}
}Repositories
Get contents
Get the contents of a file, directory, symlink, or submodule in a repository.
GET
/
repos
/
{owner}
/
{repo}
/
contents
/
{path}
Get contents
curl --request GET \
--url https://gogs.example.com/api/v1/repos/{owner}/{repo}/contents/{path} \
--header 'Authorization: <api-key>'{
"type": "file",
"encoding": "<string>",
"size": 123,
"name": "<string>",
"path": "<string>",
"content": "<string>",
"sha": "<string>",
"url": "<string>",
"git_url": "<string>",
"html_url": "<string>",
"download_url": "<string>",
"_links": {
"git": "<string>",
"self": "<string>",
"html": "<string>"
}
}Authorizations
Personal access token. Use format: token {YOUR_ACCESS_TOKEN}
Path Parameters
Repository owner
Repository name
File or directory path
Query Parameters
Branch, tag, or commit. Defaults to the default branch.