Importing contacts
Bulk upsert
The upsert endpoint is your primary tool for bulk imports:- 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
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,
primaryPhone - Map 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:| Your field | Gomobile field |
|---|---|
| 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
- Premium Customers
- Standard Customers
- Trial Users
- Casablanca Region
- Rabat Region
- Southern Morocco
- 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
- Review contact engagement metrics
- Archive inactive contacts
- Validate custom attribute values
Handling duplicates
Duplicates usually happen when phone formats differ:- Normalize phone formats before import
- Use consistent format throughout
- 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
- 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:Syncing with external systems
CRM integration pattern
- 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: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.