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 primaryPhone within 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:

  1. Normalize phone numbers - Use E.164 format when possible

  2. Remove duplicates - Same phone = same contact in Gomobile

  3. Validate required fields - At minimum, primaryPhone

  4. Map your fields - Match your data to Gomobile fields

  5. 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)

mail

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:

  1. Export contacts with specific criteria from your CRM

  2. Create or update audience in Gomobile

  3. Add matching contacts to the audience

  4. Run campaigns against the audience

  5. 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:

  1. Option A: Soft delete in Gomobile (preserves history)

  2. Option B: Remove from active audiences (keeps contact but excludes from campaigns)

  3. 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:

  1. Paginate through all contacts

  2. Collect into local storage

  3. Transform as needed

  4. Export to your format (CSV, Excel, etc.)

Best practices summary

  1. Use upsert for imports - Handles both create and update

  2. Batch your requests - 100-500 contacts per request

  3. Normalize phone numbers - Consistent format prevents duplicates

  4. Define attributes first - Create before importing data

  5. Segment with audiences - Don't try to filter at call time

  6. Sync regularly - Keep Gomobile in sync with your source systems

  7. Monitor data quality - Regular cleanup prevents issues

Next steps

Last updated