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
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.
| Input | Type | Description | |
|---|---|---|---|
email | string | Required | Email address to look up |
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.
| Input | Type | Description | |
|---|---|---|---|
customer_id | string | Required | The person's identifier |
id_type | string | Optional | What customer_id is (default id) |
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.
| Input | Type | Description | |
|---|---|---|---|
segment_id | integer | Required | Segment id |
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.
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.
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.
| Input | Type | Description | |
|---|---|---|---|
filter | object | Required | Audience filter object, e.g. {"and": [{"segment": {"id": 4}}, {"attribute": {"field": "plan", "operator": "eq", "value": "premium"}}]} |
limit | integer | Optional | Results per page (max 1000, default 50) |
start | string | Optional | Pagination token from a previous reply's next |
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.
| Input | Type | Description | |
|---|---|---|---|
transactional_message_id | integer,string | Required | Template id (number) or trigger name |
to | string | Required | Recipient email address |
identifiers | object | Required | Who the message is for, e.g. {"email": "[email protected]"} or {"id": "123"} |
message_data | object | Optional | Values for Liquid placeholders, referenced as message_data.name |
subject | string | Optional | Override the subject |
from | string | Optional | Override the from address |
await setu.execute({
userId: "user_1",
action: "customerio.send_transactional_email",
input: {
"transactional_message_id": "<transactional_message_id>",
"to": "<to>",
"identifiers": {}
},
});