{
  "slug": "trim-mailchimp-campaign-stats-json",
  "title": "Mailchimp campaign stats trim for analytics card",
  "metaTitle": "Mailchimp campaign stats trim for - RealComposer",
  "metaDescription": "Mailchimp campaign stats trim for analytics card. Opens clicks and send time without full report trees.. Map only UI fields from Mailchimp before.",
  "headline": "Ops dashboards with KPI fields only",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 7,
  "clientPlatform": "Retool",
  "upstreamServices": [
    "Mailchimp"
  ],
  "searchIntentQuery": "mailchimp campaign stats trim for analytics card",
  "directAnswerSummary": "Opens clicks and send time without full report trees. For \"mailchimp campaign stats trim for analytics card\", store MAILCHIMP_BASIC_AUTH in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let Retool hit only https://realcomposer.com/v1/workspace/trim-mailchimp-campaign-stats-json with an rc_live_ client token.",
  "problem": {
    "title": "Mailchimp JSON bloat on Retool",
    "explanation": "Oversized Mailchimp payloads inflate parse time and mobile data charges for Retool 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": "Store upstream credentials in Secret Vault",
      "description": "Create MAILCHIMP_BASIC_AUTH vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Configure headersTemplate to inject vault secrets, target https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10, and Map only the UI fields in output mapping so clients never download audit or nested blobs."
    },
    {
      "stepNumber": 3,
      "title": "Query from Retool",
      "description": "Allowed origins on the token should list every Retool host that calls this URL.",
      "codeSnippet": "// REST resource or JS query\nconst rows = await fetch('https://realcomposer.com/v1/workspace/trim-mailchimp-campaign-stats-json', {\n  headers: { Authorization: 'Bearer rc_live_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Mailchimp campaign stats trim for analytics card",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "mailchimp",
        "upstreamUrlTemplate": "https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Basic {{secrets.MAILCHIMP_BASIC_AUTH}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "memberId",
          "sourcePath": "members.0.id",
          "type": "string",
          "sourceStep": "mailchimp"
        },
        {
          "targetPath": "email",
          "sourcePath": "members.0.email_address",
          "type": "string",
          "sourceStep": "mailchimp"
        },
        {
          "targetPath": "status",
          "sourcePath": "members.0.status",
          "type": "string",
          "sourceStep": "mailchimp"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_trim-mai",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "trim-mailchimp-campaign-stats-json"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "memberId": "sample",
    "email": "sample",
    "status": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/trim-mailchimp-campaign-stats-json\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Is it safe to log Mailchimp responses in Retool?",
      "answer": "Yes for trim-mailchimp-campaign-stats-json. Ship only an rc_live_ client token in Retool; RealComposer injects MAILCHIMP_BASIC_AUTH on https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "trim-mailchimp-campaign-stats-json POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard."
    },
    {
      "question": "Can I restrict which domains call this pipeline?",
      "answer": "Upstream steps in trim-mailchimp-campaign-stats-json honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "trim-sendgrid-activity-api",
    "filter-unnecessary-fields-rest-api"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/trim-mailchimp-campaign-stats-json",
    "markdown": "https://realcomposer.com/recipes/trim-mailchimp-campaign-stats-json.md",
    "json": "https://realcomposer.com/recipes/trim-mailchimp-campaign-stats-json.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=trim-mailchimp-campaign-stats-json&via=agent"
  }
}