Skip to content

Templates API

The proxy hosts a forgejo-proxy/templates Forgejo repository containing reusable templates organised into sub-folders by type. The API serves these templates over HTTP, allowing tools and scripts to fetch canonical templates without cloning the repository.

TypeDescription
issuesIssue templates (bug reports, feature requests, etc.)
workflowsForgejo Actions / GitHub Actions workflow YAML files
taskfilesTaskfile task definitions
readmeREADME boilerplate files for new projects
contributingCONTRIBUTING.md templates
pullrequestPull request description templates

All template endpoints require a valid Forgejo API token, passed as a bearer token:

Authorization: token $TOKEN

See Authentication for details.

GET /api/v1/templates

Returns every template across all types. Use the optional ?type=X query parameter to filter by a single type.

Query Parameters

ParameterTypeDescription
typestring(optional) Filter results to a single template type
Terminal window
# List all templates
curl -H "Authorization: token $TOKEN" \
'https://forgejo-proxy.hochguertel.work/api/v1/templates'
# List only workflow templates
curl -H "Authorization: token $TOKEN" \
'https://forgejo-proxy.hochguertel.work/api/v1/templates?type=workflows'
GET /api/v1/templates/{type}

Returns all templates belonging to the specified type.

Path Parameters

ParameterDescription
typeTemplate type — one of issues, workflows, taskfiles, readme, contributing, pullrequest
Terminal window
curl -H "Authorization: token $TOKEN" \
'https://forgejo-proxy.hochguertel.work/api/v1/templates/issues'
GET /api/v1/templates/{type}/{name}

Returns the raw content of a single template file.

Path Parameters

ParameterDescription
typeTemplate type (see table above)
nameTemplate file name (e.g., bug-report.md)
Terminal window
curl -H "Authorization: token $TOKEN" \
'https://forgejo-proxy.hochguertel.work/api/v1/templates/issues/bug-report.md'
GET /api/v1/templates/lookup/{name}
Terminal window
curl -H "Authorization: token $TOKEN" \
'https://forgejo-proxy.hochguertel.work/api/v1/templates/lookup/bug-report.md'

The thfg CLI wraps these endpoints:

Terminal window
# List all available templates
thfg template list
# List templates filtered by type
thfg template list --type workflows
# Fetch the content of a specific template
thfg template get issues/bug-report
# List available template types
thfg template types
[
{
"name": "bug-report.md",
"type": "issues",
"path": "issues/bug-report.md",
"download_url": "https://forgejo-proxy.hochguertel.work/api/v1/templates/issues/bug-report.md"
},
{
"name": "ci.yml",
"type": "workflows",
"path": "workflows/ci.yml",
"download_url": "https://forgejo-proxy.hochguertel.work/api/v1/templates/workflows/ci.yml"
}
]
{
"name": "bug-report.md",
"type": "issues",
"path": "issues/bug-report.md",
"content": "---\nname: Bug Report\nabout: Report a bug\n---\n\n## Description\n..."
}