Managing Contacts at Scale
As your contact database grows, you need strategies for importing, organizing, and maintaining data quality. This guide covers techniques for working with thousands of contacts.
Importing contacts
Bulk upsert
The upsert endpoint is your primary tool for bulk imports:
curl -X POST https://api.gomobile.io/contact/upsert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": [
{ "primaryPhone": "+212612345678", "firstName": "Ahmed", ... },
{ "primaryPhone": "+212612345679", "firstName": "Fatima", ... }
]
}'Key behaviors:
New contacts (phone not found) → Created
Existing contacts (phone matches) → Updated
Matching is by
primaryPhonewithin your organization
Batch size
For large imports, batch your requests:
Recommended batch size: 100-500 contacts per request
Maximum: 1000 contacts per request (varies by plan)
Rate limiting: 10 requests per second
Example batching logic:
Preparing your data
Before importing:
Normalize phone numbers - Use E.164 format when possible
Remove duplicates - Same phone = same contact in Gomobile
Validate required fields - At minimum,
primaryPhoneMap your fields - Match your data to Gomobile fields
Define custom attributes first - Create them before importing data that uses them
Field mapping
Map your source data to Gomobile fields:
mobile
primaryPhone
name
fullName (or split into firstName/lastName)
primaryEmail
balance
customAttributes.account_balance
Organizing with audiences
Audience strategies
By campaign type:
Payment Reminders Q1
New Customer Welcome
Feedback Survey March
By customer segment:
Premium Customers
Standard Customers
Trial Users
By geography:
Casablanca Region
Rabat Region
Southern Morocco
By engagement level:
Active (last 30 days)
At Risk (60-90 days)
Inactive (90+ days)
Dynamic segmentation
While Gomobile doesn't have automatic segmentation, you can simulate it:
Export contacts with specific criteria from your CRM
Create or update audience in Gomobile
Add matching contacts to the audience
Run campaigns against the audience
Repeat periodically to refresh
Audience refresh workflow
Maintaining data quality
Regular cleanup tasks
Weekly:
Remove bounced/invalid phone numbers
Update changed contact information
Merge duplicates
Monthly:
Review contact engagement metrics
Archive inactive contacts
Validate custom attribute values
Handling duplicates
Duplicates usually happen when phone formats differ:
Prevention:
Normalize phone formats before import
Use consistent format throughout
Resolution:
Export contacts with similar phones
Decide which to keep
Delete duplicates (soft delete preserves history)
Update references if needed
Invalid phone numbers
Signs of invalid numbers:
Calls immediately fail
"Number not in service" errors
Consistent "no answer" across all attempts
Handling:
Flag contacts with repeated failures
Review and remove invalid numbers
Consider verification services for new data
Custom attributes at scale
Defining a schema
Plan your custom attributes before importing:
Bulk updating attributes
Use upsert to update attribute values in bulk:
Only specified attributes are updated—others remain unchanged.
Syncing with external systems
CRM integration pattern
Sync frequency depends on your use case:
Real-time: Webhook on CRM changes
Hourly: Scheduled job for active campaigns
Daily: Overnight batch for general sync
Handling deletes
When contacts are deleted in your source system:
Option A: Soft delete in Gomobile (preserves history)
Option B: Remove from active audiences (keeps contact but excludes from campaigns)
Option C: Flag with a custom attribute (e.g.,
is_active: false)
Search and filtering
Pagination best practices
Always paginate large result sets:
Use the meta response to know when you're done:
Efficient searching
Use specific searches instead of loading all contacts:
Data export
For compliance or analysis, you might need to export data:
Paginate through all contacts
Collect into local storage
Transform as needed
Export to your format (CSV, Excel, etc.)
Best practices summary
Use upsert for imports - Handles both create and update
Batch your requests - 100-500 contacts per request
Normalize phone numbers - Consistent format prevents duplicates
Define attributes first - Create before importing data
Segment with audiences - Don't try to filter at call time
Sync regularly - Keep Gomobile in sync with your source systems
Monitor data quality - Regular cleanup prevents issues
Next steps
Audiences - Grouping contacts
Custom Attributes - Extending contact data
Building Your First Campaign - Using your contacts
Last updated

