What are Data Sources? How to Create and Use Them
1 What are Data Sources?
A Data Source is a place where you store structured data that gets pulled into your AMP emails in real-time. When a recipient opens your email in Gmail, Yahoo, Mail.ru, FairEmail, or AOL, the email fetches fresh data from your Data Source endpoint — so the content is always up to date.
This powers dynamic use cases like:
- Product catalogs — prices and availability update without resending
- Blog digests — latest articles appear automatically
- Event listings — sold-out events disappear in real-time
- Shipping status — recipients see current tracking info
- Countdown timers — live sale countdowns
Data Sources are managed at the account level — not per template. You create them once in the Data Sources dashboard, and reuse them across any number of email templates.
MiN8T supports two source types: JSON file (paste your own JSON) and Google Sheets (connect via OAuth). Both generate a public, CORS-compliant endpoint URL that AMP emails fetch data from.
2 Creating a JSON Data Source
Step 1: Open Data Sources Dashboard
In the MiN8T sidebar, click "Data Sources" (database icon). This opens the Data Sources dashboard at /data-sources.
Step 2: Click "New Source"
Click the "+ New Source" button in the subheader. A modal opens with the creation form.
Step 3: Fill in Source Details
- Name (required) — e.g., "Product Catalog", "Weekly Deals"
- Description (optional) — e.g., "Latest products from online store"
- Source Type — click "JSON"
Step 4: Paste JSON Content
Paste your JSON into the editor. The JSON must follow this structure:
{
"items": [
{
"title": "Samsung Galaxy Note 10",
"url": "https://shop.com/samsung",
"imgUrl": "https://cdn.shop.com/samsung.jpg",
"price": "$999.99",
"text": "The latest flagship smartphone"
},
{
"title": "iPhone 15 Pro",
"url": "https://shop.com/iphone",
"imgUrl": "https://cdn.shop.com/iphone.jpg",
"price": "$1199.99",
"text": "Pro camera. Pro display."
}
]
}
Rules:
- The root must contain an
itemsarray - Each item must be an object (not a string or array)
- Maximum 1,000 items
- Maximum 5MB total JSON size
- Maximum 10 levels of nesting
- All URLs must use HTTPS (HTTP is rejected)
- Field names are arbitrary — you choose them and reference them as
{{fieldName}}in your template
As you type, MiN8T validates the JSON in real-time. A green checkmark shows: "Valid JSON - 2 items - title, url, imgUrl, price, text". Red errors appear for invalid syntax, missing items array, or HTTPS violations.
HTML tags like <script>, event handlers (onclick), and javascript: URIs are automatically stripped from JSON values on save. This protects against stored XSS.
Step 5: Configure Options
- Cache TTL — how long the endpoint caches data (default: 300 seconds / 5 minutes). Range: 60-3600 seconds.
- Randomizer — toggle on to shuffle items in random order on each request. Each recipient sees products in a different sequence.
Step 6: Save
Click "Create Source". MiN8T generates a unique endpoint URL and the source appears in your dashboard as a card with:
- Source name and "JSON" type badge
- Green "Active" status badge
- Request count (starts at 0)
- Item count and field names
- Full endpoint URL with copy button
3 Creating a Google Sheets Data Source
Instead of pasting JSON, you can connect a Google Spreadsheet. The first row of your sheet becomes the variable names, and each subsequent row becomes an item.
Step 1: Create Source and Select Google Sheets
Click "+ New Source", enter a name, and click the "Google Sheets" button.
Step 2: Sign In with Google
Click "Sign in with Google". A popup opens with Google's OAuth consent screen. Authorize MiN8T to access your spreadsheets (read-only — MiN8T cannot modify your sheets).
The OAuth popup closes automatically after authorization. Your modal transitions to the spreadsheet picker.
Step 3: Select a Spreadsheet
A list of your Google Drive spreadsheets appears. You can:
- Search by name using the search bar
- Sort alphabetically (A-Z) or by most recently modified
Click the spreadsheet you want to use.
Step 4: Select a Sheet Tab
If your spreadsheet has multiple tabs, select which sheet contains your data. Click the sheet name to connect it.
Step 5: Connected
MiN8T reads the column headers and displays:
- Spreadsheet name and sheet name
- Item count (number of data rows)
- Field names (column headers become
{{variables}})
Your spreadsheet structure should look like:
| title | url | imgUrl | price |
|----------------|------------------|----------------------|---------|
| Samsung Galaxy | https://shop.com | https://cdn/sam.jpg | $999 |
| iPhone 15 Pro | https://shop.com | https://cdn/iph.jpg | $1199 |
Column headers become mustache variables: {{title}}, {{url}}, {{imgUrl}}, {{price}}.
4 The Public Endpoint
Every Data Source gets a unique, public endpoint URL:
https://api.min8t.com/emailformdata/v1/list/{hash}/{name}
In development:
http://localhost:3001/emailformdata/v1/list/{hash}/{name}
The {hash} is a 64-character cryptographic random string — it acts as the authentication. Anyone with the URL can read the data, but the hash is unpredictable (256 bits of entropy).
What the Endpoint Returns
GET /emailformdata/v1/list/{hash}/{name}
Response (200):
{
"items": [
{ "title": "Samsung Galaxy Note 10", "url": "...", "imgUrl": "...", "price": "$999" },
{ "title": "iPhone 15 Pro", "url": "...", "imgUrl": "...", "price": "$1199" }
]
}
AMP CORS Headers
The endpoint automatically sets all required AMP CORS headers:
Access-Control-Allow-Origin— echoes the requesting email client originAMP-Access-Control-Allow-Source-Origin— echoes the sender's emailAccess-Control-Expose-Headers
Allowed origins: Gmail, Yahoo, Mail.ru, AOL, FairEmail. Rate limited to 100 requests per minute per IP.
You don't need to configure CORS yourself. MiN8T handles all AMP-required headers automatically.
5 Using Data Sources in the Email Editor
Unlike traditional editors where you manually paste <amp-list> code, MiN8T lets you connect data sources visually — no code required.
Step 1: Design Your Product Card
In the editor, drag text, image, and button blocks into a container. Style them as your product card layout — fonts, colors, spacing, everything.
Step 2: Open the Data Tab
Select the container (or structure/stripe). In the property panel, click the "Data" tab.
Step 3: Select "AMP Data Source"
You'll see two options: "Website Page" (for OG tag scraping) and "AMP Data Source". Under AMP Data Source, a dropdown lists all your active data sources.
Step 4: Pick a Data Source
Select your data source from the dropdown. The panel shows:
- Green connected status with source name
- Available variables as clickable
{{tag}}badges (click to copy) - Layout height input (controls
amp-listheight) - "Auto-map to blocks" button
Step 5: Auto-Map Variables
Click "Auto-map to blocks". MiN8T intelligently maps your data source fields to the blocks in your container:
- Text blocks ←
{{title}},{{description}} - Image blocks ←
{{imgUrl}},{{imageUrl}} - Button blocks ←
{{url}},{{link}}(URL) +{{buttonText}},{{ctaText}}(label)
The mapping summary shows which block received which variable. You can also type {{variables}} manually into any block content.
No code required. MiN8T automatically wraps your container in <amp-list> on export. The AMP scripts (amp-list-0.1.js, amp-mustache-0.2.js) are auto-injected. You just pick a source and map variables.
SMART Badge
When a container, structure, or stripe has a data source connected, a blue "SMART" badge appears on it in the canvas. This visual indicator shows which elements are data-driven.
6 Randomizer
When enabled, the randomizer shuffles the items array using a Fisher-Yates algorithm before each response. Each recipient sees products in a different order — useful for A/B testing product placement or keeping content fresh.
The shuffle happens server-side after cache retrieval but before the response. The canonical order stays in the cache; only the response is randomized.
Toggle it on in the create/edit modal under the cache TTL setting.
7 Updating Content After Sending
This is the key advantage of AMP Data Sources: you can update content after the email is sent.
- Go to the Data Sources dashboard
- Click "Edit" on your data source
- Update the JSON (or the Google Sheet updates automatically)
- Save
The next time a recipient opens the email, they see the updated content. No need to resend the campaign.
Gmail may stop rendering AMP content after approximately 30 days. After that, recipients see the static HTML fallback. Design your fallback accordingly.
Deactivating a Source
If you deactivate a data source (toggle the status to "Inactive"), the endpoint returns a 404. AMP clients will fall back to the HTML version. Reactivate at any time to restore dynamic content.
8 Next Steps
- How to Test and Export AMP Emails — send a test, verify in Gmail, export with 3-part MIME
- AMP Email Whitelisting Guide — get approved by Gmail and Yahoo
- Create a Data Storage to collect form responses from AMP emails
- Connect a Google Sheet for spreadsheet-driven dynamic content
Last updated: April 2026. All details verified against MiN8T's actual codebase implementation.