Mailchimp · Arazzo Workflow

Mailchimp Upsert Audience Member

Version 1.0.0

Find a member by email and update them, otherwise add them to the audience.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CampaignsEmail MarketingMarketing AutomationNewslettersTransactional EmailAudience ManagementSMSE-CommerceWebhookMarketing AnalyticsArazzoWorkflows

Provider

mailchimp

Workflows

upsert-member
Upsert a subscriber into an audience by email address.
Searches for an existing member by email; updates the matched member or adds a new one when none is found.
3 steps inputs: emailAddress, listId, mergeFields, status outputs: addedMemberId, updatedMemberId
1
findMember
Search the audience for an existing member whose email matches the supplied address.
2
updateMember
Patch the matched member with the supplied merge fields and status.
3
addMember
Add a new member to the audience when no existing match was found.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Mailchimp Upsert Audience Member
  summary: Find a member by email and update them, otherwise add them to the audience.
  description: >-
    A find-then-act subscriber sync. The workflow searches the audience for an
    existing member by email and branches: when a match is found it patches the
    existing member with the supplied fields, and when no match is found it adds
    a new member to the audience. This mirrors a classic upsert so the same
    payload can be applied whether or not the contact already exists.
    Authentication uses HTTP Basic auth with any username and your Mailchimp
    API key as the password.
  version: 1.0.0
sourceDescriptions:
- name: listsApi
  url: ../openapi/mailchimp-lists-api-openapi.yml
  type: openapi
- name: searchmembersApi
  url: ../openapi/mailchimp-searchmembers-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-member
  summary: Upsert a subscriber into an audience by email address.
  description: >-
    Searches for an existing member by email; updates the matched member or
    adds a new one when none is found.
  inputs:
    type: object
    required:
    - listId
    - emailAddress
    properties:
      listId:
        type: string
        description: The unique id for the audience/list.
      emailAddress:
        type: string
        description: Email address used to find or create the member.
      status:
        type: string
        description: Status to use when adding a new member.
        default: subscribed
      mergeFields:
        type: object
        description: Merge field values keyed by merge tag to write to the member.
  steps:
  - stepId: findMember
    description: >-
      Search the audience for an existing member whose email matches the
      supplied address.
    operationId: getSearchMembers
    parameters:
    - name: query
      in: query
      value: $inputs.emailAddress
    - name: list_id
      in: query
      value: $inputs.listId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedHash: $response.body#/exact_matches/members/0/id
    onSuccess:
    - name: memberExists
      type: goto
      stepId: updateMember
      criteria:
      - context: $response.body
        condition: $.exact_matches.members.length > 0
        type: jsonpath
    - name: memberMissing
      type: goto
      stepId: addMember
      criteria:
      - context: $response.body
        condition: $.exact_matches.members.length == 0
        type: jsonpath
  - stepId: updateMember
    description: Patch the matched member with the supplied merge fields and status.
    operationId: patchListsIdMembersId
    parameters:
    - name: list_id
      in: path
      value: $inputs.listId
    - name: subscriber_hash
      in: path
      value: $steps.findMember.outputs.matchedHash
    requestBody:
      contentType: application/json
      payload:
        email_address: $inputs.emailAddress
        merge_fields: $inputs.mergeFields
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      memberId: $response.body#/id
      memberStatus: $response.body#/status
    onSuccess:
    - name: done
      type: end
  - stepId: addMember
    description: Add a new member to the audience when no existing match was found.
    operationId: postListsIdMembers
    parameters:
    - name: list_id
      in: path
      value: $inputs.listId
    requestBody:
      contentType: application/json
      payload:
        email_address: $inputs.emailAddress
        status: $inputs.status
        merge_fields: $inputs.mergeFields
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      memberId: $response.body#/id
      memberStatus: $response.body#/status
  outputs:
    updatedMemberId: $steps.updateMember.outputs.memberId
    addedMemberId: $steps.addMember.outputs.memberId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/mailchimp-upsert-member-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.