Integration Guide
This guide provides detailed instructions for setting up and configuring data source integrations.
Overview
Section titled “Overview”The platform supports multiple integration types for ingesting lead data:
- API — REST API integrations
- SFTP — File-based integrations via SFTP
- Email — Email-based data delivery (IMAP)
- Webhook — Real-time webhook endpoints
- CSV — Manual CSV file uploads
API integrations
Section titled “API integrations”Supported providers
Section titled “Supported providers”- LeadPost API — Website visitor identification
- Buyer Intent Providers — Bombora, 6sense, etc.
- Custom APIs — Any REST API with JSON responses
Configuration
Section titled “Configuration”-
Navigate to Settings > Integrations > Add Integration
-
Select API as the integration type
-
Enter configuration:
-
Base URL — API endpoint base URL (e.g.
https://api.leadpost.com/v1) -
API Key — Authentication key (found in provider dashboard; keep secure, never commit to code)
-
Authentication Type:
- Bearer Token —
Authorization: Bearer {token} - Basic Auth —
Authorization: Basic {base64} - Header — Custom header (e.g.
X-API-Key)
- Bearer Token —
-
Headers (optional) — Additional headers as JSON:
{ "Content-Type": "application/json", "Accept": "application/json" }
-
-
Set Sync Frequency:
- Hourly — For real-time data (LeadPost)
- Daily — For daily updates (Buyer Intent)
- Weekly — For weekly batches
- Manual — Trigger manually
-
Click Test Connection to verify
-
Click Create Integration
LeadPost API setup
Section titled “LeadPost API setup”Prerequisites: LeadPost account, API key from LeadPost dashboard
Type: APIName: LeadPost APIBase URL: https://api.leadpost.com/v1API Key: [Your LeadPost API Key]Auth Type: Bearer TokenSync Frequency: HourlyData mapping — the LeadPost worker automatically maps fields:
visitor_email→emailcompany_name→companyNamephone→phonelocation→city,state,zipCode
Buyer Intent provider setup
Section titled “Buyer Intent provider setup”Prerequisites: Buyer Intent Provider account (Bombora, 6sense, etc.), API credentials
Type: APIName: Buyer Intent ProviderBase URL: https://api.provider.com/v1API Key: [Your API Key]Auth Type: Bearer TokenSync Frequency: DailyData mapping:
- Intent topics mapped to
intentTopicsarray - Intent scores mapped to
intentScore - Company data mapped to firmographic fields
Custom API integration
Section titled “Custom API integration”For custom APIs, you may need to create a custom worker:
- Create worker in
workers/ingestion/custom-api.ts - Implement data fetching and mapping
- Create sync endpoint in
src/pages/api/integrations/custom/sync.ts - Add sync button in integrations UI
SFTP integrations
Section titled “SFTP integrations”Configuration
Section titled “Configuration”- Navigate to Settings > Integrations > Add Integration
- Select SFTP as the integration type
- Enter configuration:
- Host — SFTP server hostname (e.g.
sftp.example.com) - Port — SFTP port (default: 22)
- Username — SFTP username
- Password — SFTP password (consider using SSH keys for better security)
- Remote Path — Path to files on SFTP server (e.g.
/data/leads/)
- Host — SFTP server hostname (e.g.
- Set Sync Frequency — Daily, Weekly, or Manual
- Click Test Connection to verify
- Click Create Integration
File format
Section titled “File format”SFTP integrations expect CSV or JSON files.
CSV format:
email,first_name,last_name,company_name,phone,city,state,zip_codejohn@example.com,John,Doe,Acme Corp,555-1234,San Francisco,CA,94102JSON format:
[{ "email": "john@example.com", "firstName": "John", "lastName": "Doe", "companyName": "Acme Corp", "phone": "555-1234", "city": "San Francisco", "state": "CA", "zipCode": "94102" }]Security best practices
Section titled “Security best practices”- Use SSH keys instead of passwords when possible
- Restrict SFTP user to read-only access
- Use separate credentials for each integration
- Rotate credentials regularly
Email integrations
Section titled “Email integrations”Configuration
Section titled “Configuration”- Navigate to Settings > Integrations > Add Integration
- Select Email as the integration type
- Enter configuration:
- Email Address — Email account to monitor (e.g.
leads@example.com) - Password — Email account password (use app-specific password for Gmail)
- IMAP Host — IMAP server hostname (Gmail:
imap.gmail.com, Outlook:outlook.office365.com) - IMAP Port — IMAP port (default: 993 for SSL)
- Email Address — Email account to monitor (e.g.
- Set Sync Frequency — Hourly, Daily, or Manual
- Click Test Connection to verify
- Click Create Integration
Email format
Section titled “Email format”Emails should contain CSV or JSON attachments:
- Subject Line — Used for metadata (optional)
- Attachment — CSV or JSON file with lead data
- Body — Can contain metadata or be ignored
Gmail setup
Section titled “Gmail setup”For Gmail, use an app-specific password:
- Go to Google Account settings
- Enable 2-factor authentication
- Generate app-specific password
- Use app password in integration config
Webhook integrations
Section titled “Webhook integrations”Configuration
Section titled “Configuration”- Navigate to Settings > Integrations > Add Integration
- Select Webhook as the integration type
- Configuration is auto-generated:
- Webhook URL — Auto-generated unique URL
- Webhook Secret — Auto-generated secret for verification
- Copy the webhook URL and secret
- Configure the external system to send data to the webhook URL
- Include the secret in webhook requests (header:
X-Webhook-Secret)
Webhook endpoint
Section titled “Webhook endpoint”Webhook URL format:
https://yourdomain.com/api/integrations/webhook/{webhookId}Webhook payload
Section titled “Webhook payload”Expected JSON payload:
{ "leads": [{ "email": "john@example.com", "firstName": "John", "lastName": "Doe", "companyName": "Acme Corp", "phone": "555-1234", "city": "San Francisco", "state": "CA", "zipCode": "94102" }] }Security
Section titled “Security”- Webhook secret is required for verification
- Include secret in
X-Webhook-Secretheader - Use HTTPS for webhook URLs
- Validate payload structure
CSV import
Section titled “CSV import”Manual import
Section titled “Manual import”- Navigate to Leads > Import CSV
- Upload CSV file (max 10 MB)
- Review column mapping (auto-detected)
- Choose auto-process option
- Click Import
CSV format
Section titled “CSV format”Required columns: email (or company_name if B2B)
Optional columns:
first_name,last_namephonecompany_name,domaincity,state,zip_codeindustry,company_sizeintent_topics(comma-separated)intent_score
Column mapping
Section titled “Column mapping”The system auto-detects common column names:
email,e-mail,Email Addressfirst_name,firstName,First Namecompany_name,companyName,Company
You can manually adjust mappings if needed.
Testing integrations
Section titled “Testing integrations”Test connection
Section titled “Test connection”Use the Test Connection button to verify:
- API credentials are valid
- SFTP connection works
- Email credentials are correct
- Webhook endpoint is accessible
Manual sync
Section titled “Manual sync”For API integrations, use the Sync button to:
- Trigger immediate data sync
- Test integration without waiting for schedule
- Verify data is being imported correctly
Monitoring
Section titled “Monitoring”Check integration status:
- Last Sync — When last sync occurred
- Status — Success, In Progress, or Failed
- Error Count — Number of failed syncs
- Records Imported — Number of leads imported
Troubleshooting
Section titled “Troubleshooting”API integration issues
Section titled “API integration issues”Problem: Connection test fails
- Verify API key is correct
- Check base URL is correct
- Verify authentication type matches provider
- Check network connectivity
Problem: No data imported
- Check API endpoint returns data
- Verify data format matches expected schema
- Check integration logs for errors
- Verify sync frequency is set correctly
SFTP integration issues
Section titled “SFTP integration issues”Problem: Connection timeout
- Verify host and port are correct
- Check firewall allows SFTP connections
- Verify credentials are correct
- Test connection with an SFTP client
Problem: Files not found
- Verify remote path is correct
- Check file permissions on SFTP server
- Ensure files match expected format
- Check sync frequency
Email integration issues
Section titled “Email integration issues”Problem: Cannot connect to IMAP
- Verify IMAP host and port are correct
- Check email credentials
- For Gmail, use app-specific password
- Verify IMAP is enabled in email account
Problem: No emails processed
- Check email account has new emails
- Verify email format matches expected
- Check attachment format (CSV/JSON)
- Review integration logs
Webhook integration issues
Section titled “Webhook integration issues”Problem: Webhook not receiving data
- Verify webhook URL is correct
- Check external system is sending to correct URL
- Verify webhook secret is included
- Check webhook endpoint logs
Problem: Data not processing
- Verify payload format matches expected
- Check webhook secret is correct
- Review webhook endpoint logs
- Verify data validation passes
Best practices
Section titled “Best practices”Security
Section titled “Security”- Use strong credentials — Strong passwords for all integrations
- Rotate credentials — Regularly rotate API keys and passwords
- Limit access — Use read-only credentials when possible
- Monitor access — Review integration logs regularly
Performance
Section titled “Performance”- Sync frequency — Set appropriate sync frequency (not too frequent)
- Batch size — Process data in batches for large imports
- Error handling — Implement retry logic for transient failures
- Monitoring — Monitor sync performance and errors
Data quality
Section titled “Data quality”- Validation — Validate data before import
- Normalization — Normalize data format (email, phone, addresses)
- Deduplication — Let the system handle duplicate detection
- Error handling — Review and fix data errors promptly
Integration examples
Section titled “Integration examples”LeadPost API
Section titled “LeadPost API”{ "type": "api", "name": "LeadPost API", "config": { "baseUrl": "https://api.leadpost.com/v1", "apiKey": "your-api-key", "authType": "bearer" }, "syncFrequency": "hourly" }SFTP integration
Section titled “SFTP integration”{ "type": "sftp", "name": "Partner SFTP", "config": { "host": "sftp.partner.com", "port": 22, "username": "leads_user", "password": "secure-password", "remotePath": "/data/leads/" }, "syncFrequency": "daily" }Webhook integration
Section titled “Webhook integration”{ "type": "webhook", "name": "Partner Webhook", "config": { "webhookUrl": "https://yourdomain.com/api/integrations/webhook/abc123", "webhookSecret": "secret-key-here" }, "syncFrequency": "manual" }Support
Section titled “Support”For integration issues:
- Check integration logs
- Review error messages
- Test connection manually
- Contact integration provider support
- Review platform documentation