{
  "slug": "aggregate-zendesk-with-hubspot-deals",
  "title": "Aggregate zendesk tickets with hubspot deals",
  "metaDescription": "Aggregate zendesk tickets with hubspot deals. Zendesk open tickets and related HubSpot deal stage in. Merge Zendesk and HubSpot in one Retool call with.",
  "headline": "Support plus revenue context for agents",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 8,
  "clientPlatform": "Retool",
  "upstreamServices": [
    "Zendesk",
    "HubSpot"
  ],
  "searchIntentQuery": "aggregate zendesk tickets with hubspot deals",
  "directAnswerSummary": "Zendesk open tickets and related HubSpot deal stage in one Retool query. For \"aggregate zendesk tickets with hubspot deals\", store ZENDESK_API_TOKEN, HUBSPOT_ACCESS_TOKEN in Secret Vault, call https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json from a Worker, and let Retool hit only https://realcomposer.com/v1/workspace/aggregate-zendesk-with-hubspot-deals with an rc_live_ client token.",
  "problem": {
    "title": "Serial Zendesk and HubSpot calls slow Retool pages",
    "explanation": "Each extra Zendesk and HubSpot hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.",
    "risks": [
      "One slow upstream blocking an entire page",
      "Partial failures leaving UI in inconsistent states",
      "Duplicate auth refresh logic per service"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Create ZENDESK_API_TOKEN, HUBSPOT_ACCESS_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Use GET against https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json. 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": "Query from Retool",
      "description": "Call https://realcomposer.com/v1/workspace/aggregate-zendesk-with-hubspot-deals with a restricted rc_live_ client token. Retool never sends upstream secrets.",
      "codeSnippet": "// REST resource or JS query\nconst rows = await fetch('https://realcomposer.com/v1/workspace/aggregate-zendesk-with-hubspot-deals', {\n  headers: { Authorization: 'Bearer rc_live_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Aggregate zendesk tickets with hubspot deals",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "zendesk",
        "upstreamUrlTemplate": "https://{{secrets.ZENDESK_SUBDOMAIN}}.zendesk.com/api/v2/tickets.json",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.ZENDESK_API_TOKEN}}"
        },
        "timeoutMs": 3000
      },
      {
        "stepKey": "hubspot",
        "upstreamUrlTemplate": "https://api.hubapi.com/crm/v3/objects/deals?limit=10",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.HUBSPOT_ACCESS_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "zendesk.ticketId",
          "sourcePath": "tickets.0.id",
          "type": "number",
          "sourceStep": "zendesk"
        },
        {
          "targetPath": "zendesk.subject",
          "sourcePath": "tickets.0.subject",
          "type": "string",
          "sourceStep": "zendesk"
        },
        {
          "targetPath": "hubspot.contactId",
          "sourcePath": "id",
          "type": "string",
          "sourceStep": "hubspot"
        },
        {
          "targetPath": "hubspot.email",
          "sourcePath": "properties.email",
          "type": "string",
          "sourceStep": "hubspot"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_aggregat",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "aggregate-zendesk-with-hubspot-deals"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "zendesk_ticketId": "sample",
    "zendesk_subject": "sample",
    "hubspot_contactId": "sample",
    "hubspot_email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/aggregate-zendesk-with-hubspot-deals\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Is it safe to log Zendesk responses in Retool?",
      "answer": "Store ZENDESK_API_TOKEN, HUBSPOT_ACCESS_TOKEN for aggregate-zendesk-with-hubspot-deals. Retool never sees decrypted values."
    },
    {
      "question": "When does edge caching apply to this recipe?",
      "answer": "aggregate-zendesk-with-hubspot-deals vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Allowed origins on the aggregate-zendesk-with-hubspot-deals client token restrict which domains may call the edge URL."
    }
  ],
  "relatedRecipeSlugs": [
    "combine-intercom-and-zendesk-support-api",
    "stitch-hubspot-contact-with-stripe-history"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/aggregate-zendesk-with-hubspot-deals",
    "markdown": "https://realcomposer.com/recipes/aggregate-zendesk-with-hubspot-deals.md",
    "json": "https://realcomposer.com/recipes/aggregate-zendesk-with-hubspot-deals.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=aggregate-zendesk-with-hubspot-deals&via=agent"
  }
}