Prerequisites
- A Mergram account with API access
- A saved template (created in the visual editor)
- A Make account
Before you begin
Create and test your template in the Mergram visual editor first. Ensure the field layout and data mapping work correctly with a preview before setting up automation. You need a saved template ID for API calls.
Step 1: Create an API Key
- Open Developer → API Keys in Mergram
- Click Generate New Key, give it a name, and select scopes:
merge— Trigger PDF mergesemail— Trigger email campaignstemplates:read— List and view templates
- Copy the key — you won’t be able to see it again
Step 2: Configure in Make
-
Create a scenario — Start with a trigger module (e.g., Google Sheets, Webhook, HTTP)
-
Add an HTTP module — Choose HTTP → Make a Request
-
Configure the HTTP request:
- URL:
https://mergram.com/api/v1/merge - Method:
POST - Headers:
Authorization: Bearer mg_your_key_hereContent-Type: application/json
- Body type:
Raw→JSON
- URL:
-
Build the JSON payload — Map scenario data to the merge request:
{
"templateId": "tmpl_abc123",
"data": [
{ "Name": "Alice Chen", "Amount": "$1,500.00" },
{ "Name": "Bob Martinez", "Amount": "$2,300.00" }
],
"outputConfig": {
"combinePdf": false,
"filenameTemplate": "Invoice_[[Name]]"
}
}
Step 3: Check Job Status & Download Results
Poll the job status endpoint:
GET /api/v1/jobs/job_xyz789
Authorization: Bearer mg_your_key_here
Download results when complete:
GET /api/v1/jobs/job_xyz789/output
Authorization: Bearer mg_your_key_here
Rate limits
If you’re sending many requests in rapid succession, add a Sleep module (1–2 seconds) between iterations to avoid hitting rate limits.
Make-specific features
Routers
Use Router modules to branch your scenario based on conditions. Each route can perform a different action:
- Route 1: If
Type = "Invoice"→ POST to/api/v1/mergewith invoice template - Route 2: If
Type = "Email"→ POST to/api/v1/emailwith email config - Route 3: If
Type = "Archive"→ POST to/api/v1/mergewith combined PDF mode
Iterators
The Iterator module processes items in an array one at a time. Use it when your trigger returns multiple records:
- Trigger — Fetch rows from a database or spreadsheet
- Iterator — Loop over each row
- HTTP module — Create a merge job per row
- Sleep — Wait 1–2 seconds between requests
Error Handlers
Add Error Handler routes to gracefully handle failures:
- Ignore — Skip failed items and continue the scenario
- Break — Stop the scenario and send an error notification
- Retry — Automatically retry failed requests with configurable attempts and delay
- Commit — Log the error but continue processing remaining items
Robust scenarios
Always add an Error Handler to HTTP modules that call the Mergram API. Network timeouts and temporary rate limits are common in automated workflows. Retry logic prevents transient failures from breaking your entire scenario.
Data Stores
Use Data Stores to persist state between scenario runs. Store job IDs, track which records have been processed, or cache template IDs for quick lookup.
Functions
Make’s Functions let you transform data between modules:
parseJSON()— Parse API response bodiesformatDate()— Format dates for merge templatessubstring()— Truncate long valuesreplace()— Clean or transform data before sending to the API
Scenarios
Organize your automation into Scenarios:
- Scenario 1 — Triggered merge: Form submission → Generate PDF → Email
- Scenario 2 — Scheduled batch: Cron trigger → Fetch spreadsheet rows → Bulk merge → Upload to cloud
- Scenario 3 — Webhook handler: External system → Parse payload → Merge → Send notification
Make operations
Each module execution counts as one operation. A scenario with 5 modules processing 100 rows consumes 500 operations. Check your Make plan’s monthly operation limit.
Common Scenario Templates
- Google Sheets → PDF — New or updated row triggers a merge
- Webhook → PDF — External system sends data via webhook
- Scheduler → Batch — Daily scheduled batch merge from a data source
- Airtable → Email — New record generates PDF and sends via email campaign
- Shopify → Invoice — New order creates and archives a PDF invoice
Best Practices
- Store API keys in Make’s connection settings — Use HTTP module connections instead of hardcoding keys
- Add Sleep modules in loops — Prevent rate limiting when processing many rows
- Use Error Handlers on every HTTP module — Handle API failures gracefully
- Test with a single record first — Verify the scenario works before enabling batch processing
- Monitor scenario execution logs — Check Make’s execution history for errors and performance issues
Limitations
- Operation costs — Each module execution counts as one Make operation; a scenario with 5 modules processing 100 rows consumes 500 operations
- No file upload via Make — PDF templates and spreadsheets must exist in Mergram before triggering a merge
- Polling required — No webhook callbacks for job completion; poll the status endpoint with a Sleep module
- Rate limits — Standard API rate limits apply (100 total requests per minute, 20 write operations per minute)
- No template creation via Make — Templates must be created in the Mergram visual editor