Skip to Content
InsurgeDocumentation

CRM sync

Check your HubSpot and Salesforce connections, read the sync log, and send a meeting to your CRMs again.

Developers
Markdown

When HubSpot or Salesforce is connected on the dashboard's Integrations page, Insurge sends each presentation meeting's brief to it once the brief is ready. These endpoints let your systems watch that happen and run it again. Connecting a CRM is done in the dashboard, not through the API: see HubSpot and Salesforce.

EndpointScope
GET /api/v1/integrations/statusintegrations:read
GET /api/v1/integrations/sync-logintegrations:read
POST /api/v1/integrations/sync/{meeting_id}integrations:write

Get connection status

GET /api/v1/integrations/status says which CRMs are connected. It never returns tokens or secrets.

Get connection status
curl 'https://api.insurgeai.com/api/v1/integrations/status' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
200 OK
{
  "hubspot": {
    "configured": true,
    "connected": true,
    "portal_id": "24681357",
    "instance_url": null,
    "connected_at": 1795862400.0,
    "updated_at": 1796115600.0
  },
  "salesforce": {
    "configured": false,
    "app": {
      "registered": false,
      "source": null
    },
    "connected": false
  }
}
NameTypeDescription
hubspot.configuredbooleanWhether HubSpot can be connected at all.
salesforce.configuredbooleanWhether a Salesforce app is available to connect with: your own registered one, or one Insurge provides.
salesforce.appobjectregistered (whether your own Salesforce app is saved), source (tenant for your own app, env for one Insurge provides, or null), and, when registered, client_id_hint (the first and last characters of your Consumer Key), login_url and updated_at.
connectedbooleanWhether that CRM is connected. When false, the connection fields below are left out.
portal_idstring | nullThe HubSpot account id, for HubSpot.
instance_urlstring | nullYour Salesforce org's address, for Salesforce.
connected_atnumberWhen it was connected, in Unix seconds.
updated_atnumberWhen the connection last changed, in Unix seconds.

Read the sync log

GET /api/v1/integrations/sync-log returns the newest sync attempts first, one entry per CRM per attempt.

NameTypeDescription
limitnumberHow many entries, 1 to 200.Default: 50
Read the sync log
curl 'https://api.insurgeai.com/api/v1/integrations/sync-log?limit=20' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
200 OK
{
  "log": [
    {
      "id": "0d2f4a6c8e1b4d3f5a7c9e2b4d6f8a1c",
      "tenant_id": "acme",
      "meeting_id": "9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c",
      "crm_type": "hubspot",
      "status": "success",
      "contact_id": "90817263",
      "engagement_id": "51627384",
      "error": null,
      "synced_at": 1796119658.5
    }
  ],
  "count": 1
}
NameTypeDescription
idstringThe entry's id.
meeting_idstringThe meeting that was synced.
crm_type'hubspot' | 'salesforce'Which CRM.
status'success' | 'partial' | 'error' | 'skipped'partial: synced, with warnings in error. error: the sync failed part way or entirely; error says why. skipped: the CRM was not connected at the time.
contact_idstring | nullThe contact in your CRM.
engagement_idstring | nullThe record this sync wrote: a note in HubSpot, a task in Salesforce.
errorstring | nullThe warnings or the reason, when there are any.
synced_atnumberWhen it ran, in Unix seconds.
tenant_idstringYour workspace's id.

Sync a meeting again

POST /api/v1/integrations/sync/{meeting_id} sends one meeting to every connected CRM now and waits for the result. It needs the integrations:write scope, which a new key doesn't have.

This writes to your CRM

It finds or creates the contact and writes the meeting's brief to it. Running it again for the same meeting updates the note or task it wrote last time rather than adding another. It works for any meeting in your workspace, including ones Insurge doesn't sync on its own.

NameTypeDescription
meeting_id requiredstringThe meeting's id.
Sync a meeting again
curl -X POST 'https://api.insurgeai.com/api/v1/integrations/sync/your_meeting_id' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
200 OK
{
  "synced": [
    "hubspot"
  ],
  "results": {
    "hubspot": {
      "success": true,
      "status": "success",
      "contact_id": "90817263",
      "created": false,
      "engagement_id": "51627384",
      "warnings": []
    }
  },
  "errors": []
}
NameTypeDescription
syncedstring[]The CRMs that were written to (success or partial).
resultsobjectOne entry per connected CRM. On success: success, status (success or partial), contact_id, created (whether the contact was new), engagement_id and warnings. On failure: success false and error, plus skipped true when the CRM was disconnected while it ran.
errorsstring[]One line per CRM that failed, such as "salesforce: …".

The answer is 200 even when a CRM failed: check errors. With no CRM connected, all three are empty. Each attempt is also written to the sync log.

StatusWhen
403The key doesn't have integrations:write.
404Meeting not found: <id>. No such meeting in this workspace, or it is a test meeting.

On this page