{
  "slug": "reduce-intercom-conversation-payload",
  "title": "Intercom conversation api payload reduce size",
  "metaDescription": "Intercom conversation api payload reduce size. Map conversation id state and latest snippet for list U. Map only UI fields from Intercom before React.",
  "headline": "Inbox previews without full message graphs",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 7,
  "clientPlatform": "React",
  "upstreamServices": [
    "Intercom"
  ],
  "searchIntentQuery": "intercom conversation api payload reduce size",
  "directAnswerSummary": "Map conversation id state and latest snippet for list UIs. For \"intercom conversation api payload reduce size\", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/reduce-intercom-conversation-payload with an rc_live_ client token.",
  "problem": {
    "title": "Intercom JSON bloat on React",
    "explanation": "Oversized Intercom payloads inflate parse time and mobile data charges for React users.",
    "risks": [
      "Main-thread JSON parse stalls on low-end phones",
      "Accidentally exposing PII fields to the client",
      "Downstream components re-render on unused keys"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Create INTERCOM_ACCESS_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Use GET against https://api.intercom.io/contacts. 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 React",
      "description": "Allowed origins on the token should list every React host that calls this URL.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/reduce-intercom-conversation-payload', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});\nconst data = await res.json();"
    }
  ],
  "pipelineConfig": {
    "name": "Intercom conversation api payload reduce size",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "intercom",
        "upstreamUrlTemplate": "https://api.intercom.io/contacts",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.INTERCOM_ACCESS_TOKEN}}",
          "Accept": "application/json"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "contactId",
          "sourcePath": "data.0.id",
          "type": "string",
          "sourceStep": "intercom"
        },
        {
          "targetPath": "email",
          "sourcePath": "data.0.email",
          "type": "string",
          "sourceStep": "intercom"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_reduce-i",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "reduce-intercom-conversation-payload"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "contactId": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/reduce-intercom-conversation-payload\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "What should React store instead of Intercom secrets?",
      "answer": "Yes for reduce-intercom-conversation-payload. Ship only an rc_live_ client token in React; RealComposer injects INTERCOM_ACCESS_TOKEN on https://api.intercom.io/contacts."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "Cache key for reduce-intercom-conversation-payload: internal edge-cache path plus sorted query. Identical params hit; vary userId per user."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for reduce-intercom-conversation-payload anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "slim-notion-block-children-payload",
    "filter-unnecessary-fields-rest-api"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/reduce-intercom-conversation-payload",
    "markdown": "https://realcomposer.com/recipes/reduce-intercom-conversation-payload.md",
    "json": "https://realcomposer.com/recipes/reduce-intercom-conversation-payload.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=reduce-intercom-conversation-payload&via=agent"
  }
}