We use cookies to improve your experience. Read more about how we handle your data in our GDPR policy.

    Back to Genju
    API Docsv1
    Docs

    Keep Contacts in Sync with an External CRM

    Use the Contacts API and webhooks to maintain a two-way sync between Genju and your existing CRM.

    Overview

    This guide shows how to keep contacts in sync between Genju and an external system. You'll use the Contacts API for the initial import, and webhooks to keep things updated in real time.

    Initial import

    Loop through your external contacts and call `POST /contacts` for each one. Genju deduplicates automatically by email and phone — so it's safe to call this repeatedly.
    javascript
    for (const contact of externalContacts) {
      await genju.contacts.create({
        full_name: contact.name,
        email: contact.email,
        phone: contact.phone,
        source: 'crm-import',
        tags: ['imported']
      });
    }

    Real-time sync with webhooks

    Register webhooks for `contact.created` and `contact.updated` to push changes from Genju to your external system in real time.
    javascript
    await genju.webhooks.create({
      url: 'https://your-server.com/genju-sync',
      event: 'contact.updated'
    });