Guides

An iMessage API for Node.js CRM integrations

ZeroSettle supports Node.js CRM integrations through REST sends and signed reply webhooks. Use your CRM’s contact ID to route a test reply to the right HubSpot record.

Oil painting of lavender-blue mountains reflected in a lake

Connect a CRM record to an iMessage conversation

  1. Start with an opted-in contact. Have the CRM pass its contact ID and phone number in E.164 format to your Node.js service. Store that mapping before sending, so a fast reply can be matched.
  2. Send from your server. Call POST /api/imessage/send with a bearer token and a JSON body containing to and text. Store the returned message ID with the CRM record. Working Node.js send example.
  3. Verify and enqueue replies. Register your HTTPS endpoint. Verify X-ZeroSettle-Signature over the timestamp and raw request bytes within the documented 300-second window. For message.received, durably deduplicate on the message ID within your ZeroSettle account, then acknowledge the request. Node.js webhook verification example.

Write a reply event to a HubSpot contact

After matching message.handle to one contact, call this worker function with message.id and message.ts_ms. HubSpot notes support a timestamp, a note body and an association to the contact. This example records that a reply arrived while keeping its text in the messaging system. HubSpot Notes API. Prefer no code? The ZeroSettle iMessage app for HubSpot (Settings > CRM > HubSpot) logs direct messages on the contact for you.

async function logReply(contactId, message) {
          const token = process.env.HUBSPOT_ACCESS_TOKEN;
          const response = await fetch("https://api.hubapi.com/crm/v3/objects/notes", {
            method: "POST",
            headers: {
              Authorization: "Bearer " + token,
              "Content-Type": "application/json",
            },
            body: JSON.stringify({
              properties: {
                hs_timestamp: new Date(message.ts_ms).toISOString(),
                hs_note_body: "Text reply received. ZeroSettle message #" + message.id,
              },
              associations: [{
                to: { id: String(contactId) },
                types: [{
                  associationCategory: "HUBSPOT_DEFINED",
                  associationTypeId: 202,
                }],
              }],
            }),
          });
          if (!response.ok) throw new Error("HubSpot status " + response.status);
          return (await response.json()).id;
        }

Give the worker a HubSpot token authorized to create notes. Save the returned note ID with the event. If the CRM result is ambiguous after a timeout, reconcile the contact’s notes against the message ID before retrying the write. Queue unmatched or ambiguous phone numbers for review.

Test the handoff before enabling a live workflow

Reply to a test message from a phone you control. Check that the note lands on the right contact, a repeated event leaves one note, your own sends don’t trigger the inbound worker, and a STOP reply suppresses future messages. Pro is built for people who text you first. To text opted-in queues first, Growth starts at $199/month and reaches up to 500 opted-in new contacts a day as you add numbers. Book a 15-minute demo. ZeroSettle limits and compliance.

Written by Gabe Roeloffs, co-founder of ZeroSettle. We build ZeroSettle, an iMessage API: a real phone number on real iMessage, running on Apple hardware we operate for you, that your code texts customers from and hears back on through a bearer token and signed webhooks.

Connect your first iMessage conversation to your CRM

ZeroSettle Pro is $49/month for one dedicated iMessage number, with a REST API for sends and signed webhooks for replies.

30-day refund guarantee, no questions asked. Email team@zerosettle.io within 30 days of starting your subscription. We’ll refund every subscription payment you made during that period and cancel your subscription immediately. Credit packs are excluded. See the refund terms.

Compare ZeroSettle plans.