Templates API
Overview
Section titled “Overview”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.
Template Types
Section titled “Template Types”| Type | Description |
|---|---|
issues | Issue templates (bug reports, feature requests, etc.) |
workflows | Forgejo Actions / GitHub Actions workflow YAML files |
taskfiles | Taskfile task definitions |
readme | README boilerplate files for new projects |
contributing | CONTRIBUTING.md templates |
pullrequest | Pull request description templates |
Authentication
Section titled “Authentication”All template endpoints require a valid Forgejo API token, passed as a bearer token:
Authorization: token $TOKENSee Authentication for details.
Endpoints
Section titled “Endpoints”List All Templates
Section titled “List All Templates”GET /api/v1/templatesReturns every template across all types. Use the optional ?type=X query parameter to filter by a single type.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | (optional) Filter results to a single template type |
# List all templatescurl -H "Authorization: token $TOKEN" \ 'https://forgejo-proxy.hochguertel.work/api/v1/templates'
# List only workflow templatescurl -H "Authorization: token $TOKEN" \ 'https://forgejo-proxy.hochguertel.work/api/v1/templates?type=workflows'List Templates by Type
Section titled “List Templates by Type”GET /api/v1/templates/{type}Returns all templates belonging to the specified type.
Path Parameters
| Parameter | Description |
|---|---|
type | Template type — one of issues, workflows, taskfiles, readme, contributing, pullrequest |
curl -H "Authorization: token $TOKEN" \ 'https://forgejo-proxy.hochguertel.work/api/v1/templates/issues'Get a Specific Template
Section titled “Get a Specific Template”GET /api/v1/templates/{type}/{name}Returns the raw content of a single template file.
Path Parameters
| Parameter | Description |
|---|---|
type | Template type (see table above) |
name | Template file name (e.g., bug-report.md) |
curl -H "Authorization: token $TOKEN" \ 'https://forgejo-proxy.hochguertel.work/api/v1/templates/issues/bug-report.md'Lookup by Name (Deprecated)
Section titled “Lookup by Name (Deprecated)”GET /api/v1/templates/lookup/{name}curl -H "Authorization: token $TOKEN" \ 'https://forgejo-proxy.hochguertel.work/api/v1/templates/lookup/bug-report.md'CLI Usage
Section titled “CLI Usage”The thfg CLI wraps these endpoints:
# List all available templatesthfg template list
# List templates filtered by typethfg template list --type workflows
# Fetch the content of a specific templatethfg template get issues/bug-report
# List available template typesthfg template typesResponse Schemas
Section titled “Response Schemas”Template List
Section titled “Template List”[ { "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" }]Single Template
Section titled “Single Template”{ "name": "bug-report.md", "type": "issues", "path": "issues/bug-report.md", "content": "---\nname: Bug Report\nabout: Report a bug\n---\n\n## Description\n..."}