# Template Tiger API Reference > **To render a template: POST /api/v1/templates/{name}/render with JSON body and X-API-Key header. Returns HTML.** ## Base URL https://app.templatetiger.dev ## Authentication All API requests require an `X-API-Key` header. API keys are created in the web interface at `/api-keys` and establish account context for template operations. ``` X-API-Key: your-api-key-here ``` ## Endpoints ### Render Template (Server-Side) **POST** `/api/v1/templates/{templateName}/render` Renders a template with the provided variables and returns HTML. **Request:** ```http POST /api/v1/templates/welcome-email/render HTTP/1.1 Host: app.templatetiger.dev Content-Type: application/json X-API-Key: YOUR_API_KEY { "user": { "firstName": "Amina", "lastName": "Khan" }, "ctaUrl": "https://example.com/activate" } ``` **Response (200 OK):** - Content-Type: `text/html` - Body: Rendered HTML (not JSON-wrapped) **Error Response:** ```json { "error": { "code": "TEMPLATE_NOT_FOUND", "message": "Template 'welcome-email' not found", "details": { "templateName": "welcome-email" } } } ``` ### Get Template Content (Client-Side Rendering) **GET** `/api/v1/templates/{templateName}` Returns raw Handlebars template content for client-side rendering. **Request:** ```http GET /api/v1/templates/welcome-email HTTP/1.1 Host: app.templatetiger.dev X-API-Key: YOUR_API_KEY ``` **Response (200 OK):** - Content-Type: `text/plain` - Body: Raw Handlebars template string ## Rate Limits - **Limit**: 60 requests per minute per API key - **Algorithm**: Fixed window (60 seconds) - **Headers**: `X-RateLimit-Limit`, `X-RateLimit-Remaining` ## Constraints - Request body: 256 KB max - Rendered output: 1 MB max - Template content: 50 KB max - Test data: 10 KB max - Render timeout: 10 seconds ## Code Examples ### cURL ```bash curl -X POST https://app.templatetiger.dev/api/v1/templates/welcome-email/render \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{"user": {"firstName": "Amina"}}' ``` ### JavaScript (Node.js) ```javascript const response = await fetch( "https://app.templatetiger.dev/api/v1/templates/welcome-email/render", { method: "POST", headers: { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY" }, body: JSON.stringify({ user: { firstName: "Amina" } }) } ); const html = await response.text(); ``` ### Python ```python import json import urllib.request req = urllib.request.Request( url="https://app.templatetiger.dev/api/v1/templates/welcome-email/render", data=json.dumps({"user": {"firstName": "Amina"}}).encode("utf-8"), headers={ "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY" }, method="POST" ) with urllib.request.urlopen(req) as resp: html = resp.read().decode("utf-8") ```