Set Up Template Headers

Guvener
@guvener
video

Template Headers let you send custom HTTP headers with every document generation request. This is perfect for authentication, API keys, or any custom headers your backend requires when generating PDFs.

In this guide, we'll walk you through setting up Headers from the Template Settings screen in Uhuu.


Step 1. Open Template Settings

From your Uhuu dashboard, navigate to the template you want to configure.
Click Settings to open the configuration panel.

You'll find a Headers section where you can add, edit, or remove Headers.


Step 2. Add a PDF Header

Click Add Header to create a new entry. Each header has two key fields:

  • Key: The header name (e.g., "Authorization", "X-API-Key", "Custom-Header").
    • Must contain only letters, numbers, hyphens, and underscores
    • Maximum 128 characters
  • Value: The header value (e.g., "Bearer token123", "your-api-key", "custom-value").
    • Maximum 128 characters
    • Values are masked for security when not editing

Example Headers

Common Use Cases

Authentication Headers:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
X-API-Key: your-secret-api-key-here

Custom Business Headers:

X-Company-ID: 12345
X-User-Role: admin
X-Request-Source: uhuu-dashboard

API Integration Headers:

X-Client-Version: 2.1.0
X-Request-ID: req_abc123def456
Content-Type: application/json

How Headers Are Used

When Uhuu generates a PDF from your template, it automatically includes all configured headers in the request to your backend:

  1. Template Processing: Uhuu processes your template with the provided data
  2. Header Injection: All configured Headers are added to the HTTP request
  3. Backend Communication: Your backend receives the request with custom headers
  4. PDF Generation: Your backend can use these headers for authentication, logging, or business logic