Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Customer.io

Customer.io

Customer messaging platform (App API, US region): transactional email, segments, people lookup and campaigns.

7 actions API key 6 read1 write Calls api.customer.io

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "customerio" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Find customers by emailreadcustomerio.find_customers_by_emailFind people by exact email address. Returns their ids, cio_ids and emails.
InputTypeDescription
emailstringRequiredEmail address to look up
TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.find_customers_by_email",
  input: {
    "email": "<email>"
  },
});
Get customer attributesreadcustomerio.get_customer_attributesGet a person's attributes, devices and unsubscribed state by id (default), email, phone or cio_id.
InputTypeDescription
customer_idstringRequiredThe person's identifier
id_typestringOptionalWhat customer_id is (default id)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.get_customer_attributes",
  input: {
    "customer_id": "<customer_id>"
  },
});
Get segment customer countreadcustomerio.get_segment_customer_countGet how many people are currently in a segment.
InputTypeDescription
segment_idintegerRequiredSegment id
TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.get_segment_customer_count",
  input: {
    "segment_id": 1
  },
});
List campaignsreadcustomerio.list_campaignsList campaigns (automations) with id, name, state (running, draft, stopped) and trigger type.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.list_campaigns",
  input: {},
});
List segmentsreadcustomerio.list_segmentsList all segments with id, name, type (dynamic or manual) and build state.

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.list_segments",
  input: {},
});
Search customersreadcustomerio.search_customersSearch people with an audience filter, e.g. {"attribute": {"field": "plan", "operator": "eq", "value": "premium"}} or a segment filter. Supports and/or/not groups.
InputTypeDescription
filterobjectRequiredAudience filter object, e.g. {"and": [{"segment": {"id": 4}}, {"attribute": {"field": "plan", "operator": "eq", "value": "premium"}}]}
limitintegerOptionalResults per page (max 1000, default 50)
startstringOptionalPagination token from a previous reply's next
TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.search_customers",
  input: {
    "filter": {}
  },
});
Send transactional emailwritecustomerio.send_transactional_emailSend a transactional email using a transactional message template (by id or trigger name) to a person, with Liquid data for the template.
InputTypeDescription
transactional_message_idinteger,stringRequiredTemplate id (number) or trigger name
tostringRequiredRecipient email address
identifiersobjectRequiredWho the message is for, e.g. {"email": "[email protected]"} or {"id": "123"}
message_dataobjectOptionalValues for Liquid placeholders, referenced as message_data.name
subjectstringOptionalOverride the subject
fromstringOptionalOverride the from address
TypeScript
await setu.execute({
  userId: "user_1",
  action: "customerio.send_transactional_email",
  input: {
    "transactional_message_id": "<transactional_message_id>",
    "to": "<to>",
    "identifiers": {}
  },
});