Templates
Create and manage reusable LaTeX templates. Templates can be used as starting points when creating new projects. Define your document structure, packages, and boilerplate once, then spin up new projects from that template in a single API call.
Overview
Templates are user-scoped: each authenticated user manages their own collection. When you create a new project via POST /projects with a "template" field, the project's file tree is pre-populated from the matching template source.
GET /templates/mine
List all custom templates created by the authenticated user.
Auth: Bearer token or API key
curl https://api.texer.org/templates/mine \
-H "Authorization: Bearer YOUR_TOKEN"{
"templates": [
{
"id": "tpl_d4f6g8",
"title": "Lab Report",
"description": "Standard lab report with abstract, methods, results.",
"created_at": "2025-05-20T14:00:00Z"
}
],
"total": 1
}POST /templates
Save a new custom template from LaTeX source. Provide a title, optional description, and the full LaTeX source that will be used to populate new projects.
Auth: Bearer token or API key
curl -X POST https://api.texer.org/templates \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Lab Report",
"description": "Standard lab report template",
"source": "\\documentclass{article}\n\\title{Lab Report}\n..."
}'{
"id": "tpl_h9j1k3",
"title": "Lab Report",
"description": "Standard lab report template",
"created_at": "2025-06-15T09:20:00Z"
}