Documentation Index
Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
Use this file to discover all available pages before exploring further.
Scenario
Your SendGrid marketing contacts hold thousands of subscribers with custom fields — company size, industry, role, signup source, engagement score. Creating personas one by one won’t scale. This job triggers a SendGrid contact export, downloads the CSV, segments contacts by meaningful clusters, then batch-creates Mavera personas for each segment. The result is a persona library that mirrors your actual subscriber base, ready for focus groups and content generation. Flow: SendGridPOST /v3/marketing/contacts/exports → Poll → Download CSV → Segment by custom fields → Mavera POST /api/v1/personas (batch) → Persona library at scale
Architecture
Code
Example Output
Error Handling
Export takes too long
Export takes too long
Large contact lists (100K+) can take 5-10 minutes to export. The code polls for 5 minutes (30 attempts × 10s). Increase for very large lists or use segment-specific exports.
CSV parsing edge cases
CSV parsing edge cases
Contact fields may contain commas within quoted strings. The JavaScript parser uses regex matching for quoted fields. For production, use a proper CSV parser like
csv-parse (Node) or Python’s built-in csv module.Custom field names
Custom field names
Custom fields in SendGrid use the names you defined. Check your fields at
GET /v3/marketing/field_definitions. Common patterns: custom_industry, custom_role, or the exact name you set.Export rate limit
Export rate limit
You can only have one active export at a time. If a previous export is in progress, the API returns 429. Wait for it to complete before triggering a new one.