Data Feeds
Data Feeds fetch data from an external JSON endpoint for each recipient at send time and make it available in templates as {{ feed.<name>.field }} (loyalty points, stock, cart, weather…). Decision record:…
Data Feeds fetch data from an external JSON endpoint for each recipient at send time and make it available in templates as
{{ feed.<name>.field }} (loyalty points, stock, cart, weather…). Decision record:
docs/adr/0028-data-feeds-dynamic-content-ai.md.
Defining a feed
Dashboard → Messages → Dynamic Content → Data Feeds → New feed, or the public API:
curl -X POST https://api.pushizo.example/v1/apps/$APP_ID/data-feeds \
-H "Authorization: Bearer $API_KEY" -H "content-type: application/json" \
-d '{
"name": "profil",
"url_template": "https://api.ornek.com/u/{{ user.external_id }}?sehir={{ user.tags.sehir }}",
"secret_headers": { "Authorization": "Bearer <servis-anahtarı>" },
"cache_ttl_seconds": 300,
"timeout_ms": 1500
}'| Field | Description |
|---|---|
name | Liquid name: lowercase letters, digits, underscores (feed.profil). Unique within the app. |
url_template | Can use user.*, subscription.*, custom_data.* via Liquid; values are URL-encoded. |
method | GET (default) or POST. |
body_template | POST only: a JSON template; variables are JSON string-escaped. |
headers | Non-secret headers (visible in responses). |
secret_headers | Secret headers: stored with envelope encryption and never shown again (only their names). Kept if omitted on update; null removes them all. |
cache_ttl_seconds | 0–86400; the cache key is feed + resolved URL (+ body). Editing the feed invalidates the cache. |
timeout_ms | 100–2000 (2 s maximum). |
Security (SSRF)
- Only
https://and public addresses:localhost,.local/.internal, private/reserved IPs (10/8, 172.16/12, 192.168/16, 127/8, the 169.254.169.254 metadata address, local IPv6…) and usernames/passwords in the URL are rejected. - The hostname is resolved via DNS at request time; if it resolves to a private address no request is made, and the connection is pinned to the verified IP (DNS rebinding protection). Redirects are not followed.
- The response must be at most 256 KB and JSON (an object or array).
- In local development,
WEBHOOK_ALLOW_INSECURE_TARGETS=trueallows http/local addresses (it cannot be enabled in production).
Using feeds in templates and fallback content
If a feed cannot be fetched (timeout, HTTP error, non-JSON response, open circuit), sending does not stop; the feed value is simply empty. So always provide a fallback wherever you use a feed:
{% if feed.profil %}You have {{ feed.profil.puan }} points!{% else %}Discover your points!{% endif %}Only feeds referenced in the template are fetched (feed.profil → only profil). Within a single send, the same
resolved URL is requested only once.
Circuit breaker
If a feed fails 5 times in a row, the circuit opens for 30 s and no requests are made during that time. When the period ends, a single attempt is made: if it succeeds the circuit closes, otherwise it opens again. The state is shared across all worker instances in Redis.
Trying it out (test)
Click Try in the dashboard or call POST /v1/apps/{appId}/data-feeds/{feedId}/test {"external_id": "…"}: it fetches
with the sample user's values, bypassing the cache, and returns the status, HTTP code, duration, resolved URL and a JSON preview.
Monitoring
- Metrics:
data_feed_fetch_total{status="ok|cached|timeout|error|circuit_open|blocked"},data_feed_fetch_duration_seconds. - The worker log warning "data feed çekilemedi; varsayılan içerikle devam" (data feed could not be fetched; continuing with default content) includes the feed ID, status and a short error; URLs and headers are not logged.
Apple and Google Wallet
Create coupons, loyalty cards and tickets. The pass lives in the phone's wallet and updates whenever you change it. No push permission required.
AI content assistant (Claude, OpenRouter)
The AI assistant panel in the message and template editors suggests headings and body text, adjusts tone and length, generates A/B variants, scores email subject lines and produces approval-gated translations; in the inbox it summarizes conversations and suggests replies…