Overview
The ingestion API triggers TechCal’s automated event collection pipeline. It fetches events from configured sources (RSS feeds, APIs, ICS calendars, HTML scrapers), normalizes data, and queues events for moderation.Authentication
Requires both:- Valid Supabase authentication token
- Admin user privileges (
profiles.is_admin = true)
Request
HTTP Method
Headers
Must be
application/jsonBody Parameters
UUID of specific ingestion source to run. If omitted, runs all active sources.
Maximum number of events to normalize after ingestion
Response
Success Response (200)
Always
true for successful ingestion runsHuman-readable status message
ISO 8601 timestamp of ingestion completion
Error Responses
Examples
Run All Sources
Run Specific Source
Ingestion Pipeline
Pipeline Stages
-
Source Selection
- If
sourceIdprovided: Fetch single source - Otherwise: Fetch all sources where
is_active=true
- If
-
Interval Check
- Skip sources fetched within their
fetch_interval_minutes - Manual triggers bypass this check (force fetch)
- Skip sources fetched within their
-
Data Collection
- RSS: Parse XML feed
- API: Call REST endpoint
- ICS: Parse iCalendar file
- HTML: Scrape event listings
-
Deduplication
- Check for existing events by URL
- Use fuzzy matching for title/date similarity
- Skip duplicates, queue new events
-
Normalization
- Parse dates to ISO 8601
- Extract location and format
- Normalize tags and categories
- Calculate quality score
-
Quality Control
- Auto-publish: Score ≥ 75% → Publish immediately
- Moderation queue: Score < 75% → Requires review
- Auto-reject: Score < 50% → Flag for manual review
Quality Scoring
Events receive a quality score (0-100) based on:| Factor | Weight | Criteria |
|---|---|---|
| Title Quality | 20% | Length, clarity, no spam patterns |
| Description Quality | 20% | Length, formatting, detail level |
| Date Validity | 15% | Valid dates, reasonable duration |
| Location Data | 15% | Complete location or virtual indicator |
| Speaker Info | 10% | Speaker names and URLs present |
| Organizer Info | 10% | Reputable organizer |
| Image Quality | 5% | High-res image present |
| Tag Relevance | 5% | Relevant tech tags |
Supported Source Types
- RSS Feed
- API
- ICS Calendar
- HTML Scraper
Configuration:Extraction:
- Title:
<title> - Description:
<description> - URL:
<link> - Date:
<pubDate>or<dc:date>
Cron Setup
Vercel Cron Configuration
Configured invercel.json:
Cron Authentication
The cron endpoint requires a secret header:Manual vs Cron Execution
| Aspect | Manual (/run) | Cron (/cron) |
|---|---|---|
| Auth | Admin user token | CRON_SECRET header |
| Interval check | Bypassed (force) | Enforced |
| Error handling | Returns 500 | Logs to Sentry |
| Timeout | 5 minutes | 60 seconds |
Moderation Workflow
Moderation Queue
Events requiring review:Admin Dashboard
Manage queued events at/admin/ingestion/moderation:
- Approve: Publish event immediately
- Reject: Mark as spam/duplicate
- Edit & Approve: Fix issues then publish
- Bulk Actions: Approve/reject multiple events
Auto-Moderation Rules
Certain events are auto-moderated:Troubleshooting
Common Issues
“Service role credentials not configured”- Set
SUPABASE_SERVICE_ROLE_KEYenvironment variable - Restart application after setting
- Run:
UPDATE profiles SET is_admin = TRUE WHERE id = '<your_user_id>' - Get user ID from Supabase Dashboard → Authentication → Users
- Manual triggers bypass this automatically
- Reduce
fetch_interval_minutesin source config
- Check source date format matches expected pattern
- Add custom date parser in normalization config
Debug Mode
Enable detailed logging:- Source fetch URLs and responses
- Deduplication match details
- Normalization field mappings
- Quality score calculations
Related Documentation
- Event Ingestion Setup Guide - Full setup instructions
- Admin Dashboard - Web UI for managing ingestion
- Moderation Queue - Review pending events