{
  "slug": "merge-salesforce-with-hubspot-api",
  "title": "Merge salesforce contacts with hubspot crm one api",
  "metaTitle": "Merge salesforce contacts with - RealComposer",
  "metaDescription": "Merge salesforce contacts with hubspot crm one api. Merge Salesforce and HubSpot in one Frontend / Web call with parallel Worker steps.",
  "headline": "Unified CRM contact for sales dashboards",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 10,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Salesforce",
    "HubSpot"
  ],
  "searchIntentQuery": "merge salesforce contacts with hubspot crm one api",
  "directAnswerSummary": "Parallel fetch Salesforce Contact and HubSpot CRM contact into one JSON object. For \"merge salesforce contacts with hubspot crm one api\", store SALESFORCE_ACCESS_TOKEN, HUBSPOT_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let Frontend / Web hit only https://realcomposer.com/v1/workspace/merge-salesforce-with-hubspot-api with an rc_live_ client token.",
  "problem": {
    "title": "Waterfall latency from multiple Salesforce and HubSpot requests",
    "explanation": "Frontend / Web widgets often await Salesforce and HubSpot sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.",
    "risks": [
      "Race conditions between parallel manual fetches",
      "Higher mobile data usage from redundant JSON",
      "Timeouts when any upstream exceeds cellular RTT"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Store SALESFORCE_ACCESS_TOKEN, HUBSPOT_ACCESS_TOKEN in the vault. Frontend / Web never embeds the raw secret, only a revocable rc_live_ client token."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Use GET against https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache)."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Call https://realcomposer.com/v1/workspace/merge-salesforce-with-hubspot-api with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/merge-salesforce-with-hubspot-api', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Merge salesforce contacts with hubspot crm one api",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "salesforce",
        "upstreamUrlTemplate": "https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.SALESFORCE_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      },
      {
        "stepKey": "hubspot",
        "upstreamUrlTemplate": "https://api.hubapi.com/crm/v3/objects/contacts/{{query.contactId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.HUBSPOT_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "salesforce.contactId",
          "sourcePath": "Id",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "salesforce.email",
          "sourcePath": "Email",
          "type": "string",
          "sourceStep": "salesforce"
        },
        {
          "targetPath": "hubspot.contactId",
          "sourcePath": "id",
          "type": "string",
          "sourceStep": "hubspot"
        },
        {
          "targetPath": "hubspot.email",
          "sourcePath": "properties.email",
          "type": "string",
          "sourceStep": "hubspot"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_merge-sa",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "merge-salesforce-with-hubspot-api"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "salesforce_contactId": "sample",
    "salesforce_email": "sample",
    "hubspot_contactId": "sample",
    "hubspot_email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/merge-salesforce-with-hubspot-api\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Is it safe to log Salesforce responses in Frontend / Web?",
      "answer": "Use scoped tokens where the vendor allows them on merge-salesforce-with-hubspot-api. Admin keys stay {{secrets.*}} references only."
    },
    {
      "question": "When does edge caching apply to this recipe?",
      "answer": "merge-salesforce-with-hubspot-api keeps cache TTL at 0 because it uses POST upstream calls or per-user responses. Add ids to query strings before enabling GET cache."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Upstream steps in merge-salesforce-with-hubspot-api honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "stitch-hubspot-contact-with-stripe-history",
    "hubspot-api-client-proxy"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/merge-salesforce-with-hubspot-api",
    "markdown": "https://realcomposer.com/recipes/merge-salesforce-with-hubspot-api.md",
    "json": "https://realcomposer.com/recipes/merge-salesforce-with-hubspot-api.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=merge-salesforce-with-hubspot-api&via=agent"
  }
}