Reference · Tools

Customer.io

Interact with the Customer.io marketing automation platform to manage customers, track events, retrieve campaign data and metrics, and manage segment membership.

Action Communication v1

The Customer.io node manages customer profiles, tracks behavioural events, reads campaign details and metrics, and adds or removes people from manual segments. The credential's region setting decides whether calls go to the Global or EU tracking host. A typical build is upserting a customer on signup, then tracking each meaningful action as an event that campaigns can react to.

Node type
Action
Parameters
28
Outputs
Output, Error
Credentials
Customer.io API

Customer.io

Marketing automation — manage customers, track events, campaigns, and segments in Customer.io.

Overview

Customer.io is a marketing automation platform. This tool supports: creating/updating/deleting customers via the Tracking API, tracking customer and anonymous events, retrieving campaign details and metrics via the App API, and adding/removing customers from manual segments. The region setting on the credential determines which tracking hostname is used (Global or EU).

Category: Communication
Tool Name: customer_io
Version: 1

Appearance: Icon: lucide-Users | Color: #4BC2DF

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Customer.io API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Campaigncampaign
Customercustomer
Eventevent
Segmentsegment

Operations

ResourceOperationValueDescription
CampaignGetgetRetrieve a single campaign’s details
CampaignGet ManygetAllRetrieve every campaign in the workspace
CampaignGet MetricsgetMetricsRetrieve a campaign’s delivery metrics over time
CustomerCreate or UpdateupsertCreate a customer, or update them if the ID already exists
CustomerDeletedeleteDelete a customer
EventTracktrackTrack an event against a known customer
EventTrack AnonymoustrackAnonymousTrack an event with no customer attached
SegmentAdd CustomeraddAdd customers to a manual segment
SegmentRemove CustomerremoveRemove customers from a manual segment

Parameters

Campaign: Get Many takes no parameters of its own — see All Operations.

Campaign: Get

ParameterTypeRequiredDefaultDescription
Campaign IDnumberYes0The unique identifier for the campaign. Supports expressions.

Campaign: Get Metrics

ParameterTypeRequiredDefaultDescription
Campaign IDnumberYes0The unique identifier for the campaign. Supports expressions.
PeriodoptionsNodaysSpecify the metric period.
Options: hours, days, weeks, months
JSON ParametersbooleanNofalseWhether to supply the additional fields as raw JSON instead of the structured field list.
Additional Fields (additionalFieldsJson)jsonNoAdditional fields as raw JSON object. (shown when JSON Parameters is true)
Additional Fields (additionalFields)collectionNo{}Additional fields in structured form. (shown when JSON Parameters is false)
— StepsnumberNo0Number of time periods to return. Max: 24 hours, 45 days, 12 weeks, 120 months.
— TypeoptionsNoemptySpecify the metric type.
Options: email, empty (no type filter — return the campaign’s combined metrics), push, slack, twilio, urbanAirship, webhook

Customer: Create or Update

ParameterTypeRequiredDefaultDescription
IDstringYesThe unique identifier for the customer. Supports expressions.
JSON ParametersbooleanNofalseWhether to supply the additional fields as raw JSON instead of the structured field list.
Additional Fields (additionalFieldsJson)jsonNoAdditional customer fields as raw JSON. (shown when JSON Parameters is true)
Additional Fields (additionalFields)collectionNo{}Additional customer fields in structured form. (shown when JSON Parameters is false)
— Custom PropertiesfixedCollectionNo{}Your own attributes on the customer profile. Add one entry per property.
— — KeystringYesProperty name.
— — ValuestringYesProperty value.
— EmailstringNoThe email address of the customer.
— Created AtdateTimeNoThe date/time the customer was created. Will be converted to UNIX timestamp (seconds).

Customer: Delete

ParameterTypeRequiredDefaultDescription
IDstringYesThe unique identifier for the customer. Supports expressions.

Event: Track

ParameterTypeRequiredDefaultDescription
Customer IDstringYesThe unique identifier for the customer. Supports expressions.
Event NamestringNoThe name of the event to track. A value is required for the call to succeed.
JSON ParametersbooleanNofalseWhether to supply the additional fields as raw JSON instead of the structured field list.
Additional Fields (additionalFieldsJson)jsonNoAdditional event fields as raw JSON. (shown when JSON Parameters is true)
Additional Fields (additionalFields)collectionNo{}Additional event fields in structured form. (shown when JSON Parameters is false)
— Custom AttributesfixedCollectionNo{}Custom key-value attributes for the event.
— — KeystringYesAttribute name.
— — ValuestringYesAttribute value.
— TypestringNoUsed to change event type. For Page View events, set to “page”.

Event: Track Anonymous

ParameterTypeRequiredDefaultDescription
Event NamestringYesThe name of the event to track. Supports expressions.
JSON ParametersbooleanNofalseWhether to supply the additional fields as raw JSON instead of the structured field list.
Additional Fields (additionalFieldsJson)jsonNoAdditional event fields as raw JSON. (shown when JSON Parameters is true)
Additional Fields (additionalFields)collectionNo{}Additional event fields in structured form. (shown when JSON Parameters is false)
— Custom AttributesfixedCollectionNo{}Custom key-value attributes for the event.
— — KeystringYesAttribute name.
— — ValuestringYesAttribute value.

Segment: Add Customer

ParameterTypeRequiredDefaultDescription
Segment IDnumberYes0The unique identifier of the manual segment. Supports expressions.
Customer IDsstringYesComma-separated list of customer IDs to add to or remove from the segment.

Segment: Remove Customer

ParameterTypeRequiredDefaultDescription
Segment IDnumberYes0The unique identifier of the manual segment. Supports expressions.
Customer IDsstringYesComma-separated list of customer IDs to add to or remove from the segment.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

The response is merged into the item JSON — the incoming fields pass through and binary data is forwarded.

Resource / OperationOutput
Campaign / getOne item carrying the campaign record
Campaign / getAllOne item per campaign in the workspace
Campaign / getMetricsOne item carrying the metric series for the campaign
Customer / upsertOne item with id plus the profile fields that were written — email, created_at (a UNIX timestamp in seconds) and data holding your custom properties. Customer.io returns an empty body on success, so the node reports back what it stored
Customer / deletesuccess: true
Event / tracksuccess: true
Event / trackAnonymoussuccess: true
Segment / addsuccess: true
Segment / removesuccess: true

Reference a field downstream by expression, e.g. {{ $json.id }}.

Usage Examples

  • Create or update a customer in Customer.io
  • Track a customer event in Customer.io
  • Get all campaigns from Customer.io
  • Add a customer to a segment in Customer.io
  • Delete a customer from Customer.io

Example Configuration

Get one campaign:

{
  "type": "customer_io",
  "parameters": {
    "resource": "campaign",
    "operation": "get",
    "campaignId": 123
  }
}

List every campaign:

{
  "type": "customer_io",
  "parameters": {
    "resource": "campaign",
    "operation": "getAll"
  }
}

Get five days of email metrics for a campaign:

{
  "type": "customer_io",
  "parameters": {
    "resource": "campaign",
    "operation": "getMetrics",
    "campaignId": 456,
    "period": "days",
    "jsonParameters": false,
    "additionalFields": {
      "steps": 5,
      "type": "email"
    }
  }
}

The same request with the additional fields supplied as raw JSON:

{
  "type": "customer_io",
  "parameters": {
    "resource": "campaign",
    "operation": "getMetrics",
    "campaignId": 456,
    "period": "weeks",
    "jsonParameters": true,
    "additionalFieldsJson": "{\"steps\": 10, \"type\": \"push\"}"
  }
}

Create or update a customer with custom properties:

{
  "type": "customer_io",
  "parameters": {
    "resource": "customer",
    "operation": "upsert",
    "id": "{{ $json.userId }}",
    "jsonParameters": false,
    "additionalFields": {
      "email": "john.doe@example.com",
      "createdAt": "2024-01-15T10:30:00Z",
      "customProperties": {
        "customProperty": [
          { "key": "subscription", "value": "premium" },
          { "key": "region", "value": "us-west" }
        ]
      }
    }
  }
}

Delete a customer:

{
  "type": "customer_io",
  "parameters": {
    "resource": "customer",
    "operation": "delete",
    "id": "user123"
  }
}

Track a purchase against a known customer:

{
  "type": "customer_io",
  "parameters": {
    "resource": "event",
    "operation": "track",
    "customerId": "{{ $json.userId }}",
    "eventName": "purchase_completed",
    "jsonParameters": false,
    "additionalFields": {
      "customAttributes": {
        "customAttribute": [
          { "key": "amount", "value": "99.99" },
          { "key": "currency", "value": "USD" }
        ]
      }
    }
  }
}

Track an event with no customer attached:

{
  "type": "customer_io",
  "parameters": {
    "resource": "event",
    "operation": "trackAnonymous",
    "eventName": "newsletter_signup",
    "jsonParameters": false,
    "additionalFields": {
      "customAttributes": {
        "customAttribute": [
          { "key": "source", "value": "homepage" }
        ]
      }
    }
  }
}

Add several customers to a manual segment in one call:

{
  "type": "customer_io",
  "parameters": {
    "resource": "segment",
    "operation": "add",
    "segmentId": 789,
    "customerIds": "user123,user456,user789"
  }
}

Remove a customer from a segment:

{
  "type": "customer_io",
  "parameters": {
    "resource": "segment",
    "operation": "remove",
    "segmentId": 789,
    "customerIds": "user456"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Use Customer.io to manage customers, track events, view campaigns, and manage segment membership in the Customer.io marketing automation platform.

Notes

  • Create or Update is an upsert. The ID you pass is the customer’s identifier in Customer.io — a new profile is created if it does not exist, and merged into if it does.
  • Event Name must be set on Event: Track, even though the field is not marked required in the editor; the call fails without it.
  • Additional Fields as raw JSON must be a JSON string, not an object — for example "{\"steps\": 10}". Anything that is not valid JSON is skipped rather than sent.
  • Custom Properties and Custom Attributes use their group key. The entries go under customProperties.customProperty and customAttributes.customAttribute respectively, each a { "key": …, "value": … } object.
  • Created At is converted to a UNIX timestamp in seconds before it is sent.
  • Segments must be manual. Add Customer and Remove Customer only apply to manual segments; membership of a data-driven segment is computed by Customer.io and cannot be edited here.
  • Customer IDs is one comma-separated string, so a single node run can move a whole batch of customers in or out of a segment.

Choosing between the two Additional Fields inputs

  • Leave JSON Parameters off to pick fields from the structured list — the editor validates them and shows you what each one does.
  • Turn it on to build the whole field object with an expression, which is the right choice when the shape is decided at run time.

Frequently asked questions

Does Create or Update overwrite an existing customer?

It is an upsert. The ID you pass is the customer's identifier in Customer.io — a profile is created if none exists and merged into if one does, so you can call it repeatedly without duplicating people.

Why does Event: Track fail without an obvious reason?

Event Name is required even though the editor does not mark it as such. The call fails without it, which is the most common cause of a Track step erroring immediately.

Why is my raw-JSON additional-fields value being skipped?

It has to be a JSON string, not an object — for example `"{\"steps\": 10}"`. Anything that is not valid JSON is dropped rather than sent, so nothing errors and the field simply never arrives.

Can I add someone to any segment?

Only manual segments. Membership of a data-driven segment is computed by Customer.io from its own rules and cannot be edited through the API. Customer IDs is a single comma-separated string, so one run can move a whole batch.

Build with the Customer.io node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Customer.io API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.