Skip to content

Customer.io ​

Customer.io is a customer engagement platform that enables businesses to send automated messages across email, push, SMS, and more.

Bruin supports Customer.io as a source for Ingestr assets, and you can use it to ingest data from Customer.io into your data warehouse.

To set up a Customer.io connection, you need to have a Customer.io API key. For more information, please refer here

Follow the steps below to correctly set up Customer.io as a data source and run ingestion:

Configuration ​

Step 1: Add a connection to .bruin.yml file ​

To connect to Customer.io, you need to add a configuration item to the connections section of the .bruin.yml file. This configuration must comply with the following schema:

yaml
    connections:
      customerio:
        - name: "my_customerio"
          api_key: "YOUR_CUSTOMERIO_API_KEY"
          region: "us"
  • api_key: The API key used for authentication with the Customer.io API.
  • region: The region of your Customer.io account. Must be either us (default) or eu.

Step 2: Create an asset file for data ingestion ​

To ingest data from Customer.io, you need to create an asset configuration file. This file defines the data flow from the source to the destination. Create a YAML file (e.g., customerio_ingestion.yml) inside the assets folder and add the following content:

yaml
name: public.customerio
type: ingestr
connection: postgres

parameters:
  source_connection: my_customerio
  source_table: 'broadcasts'
  destination: postgres
  • name: The name of the asset.
  • type: Specifies the type of the asset. It will be always ingestr type for Customer.io.
  • connection: This is the destination connection.
  • source_connection: The name of the Customer.io connection defined in .bruin.yml.
  • source_table: The name of the data table in Customer.io you want to ingest. For example, broadcasts would ingest data related to broadcast campaigns.

Available Source Tables ​

TablePKInc KeyInc StrategyDetails
activitiesid–replaceRetrieves account activity log.
broadcastsidupdatedmergeRetrieves broadcast campaigns.
broadcast_actionsidupdatedmergeRetrieves actions for broadcasts.
broadcast_action_metrics:periodbroadcast_id, action_id, period, step_index–replaceRetrieves metrics for broadcast actions. Period: hours, days, weeks, months.
broadcast_messagesid–mergeRetrieves messages sent by broadcasts.
broadcast_metrics:periodbroadcast_id, period, step_index–replaceRetrieves metrics for all broadcasts. Period: hours, days, weeks, months.
campaignsidupdatedmergeRetrieves triggered campaigns.
campaign_actionsidupdatedmergeRetrieves actions for campaigns.
campaign_action_metrics:periodcampaign_id, action_id, period, step_index–replaceRetrieves metrics for campaign actions. Period: hours, days, weeks, months.
campaign_messagesid–mergeRetrieves messages/deliveries sent from campaigns.
campaign_metrics:periodcampaign_id, period, step_index–replaceRetrieves metrics for all campaigns. Period: hours, days, weeks, months.
collectionsidupdated_atmergeRetrieves data collections.
customerscio_id–replaceRetrieves all customers/people in the workspace.
customer_activitiesid–replaceRetrieves activities performed by each customer.
customer_attributescustomer_id–replaceRetrieves attributes for each customer.
customer_messagesid–mergeRetrieves messages sent to each customer.
customer_relationshipscustomer_id, object_type_id, object_id–replaceRetrieves object relationships for each customer.
exportsidupdated_atmergeRetrieves export jobs.
info_ip_addressesip–replaceRetrieves IP addresses used by Customer.io.
messagesid–mergeRetrieves sent messages.
newslettersidupdatedmergeRetrieves newsletters.
newsletter_metrics:periodnewsletter_id, period, step_index–replaceRetrieves metrics for all newsletters. Period: hours, days, weeks, months.
newsletter_test_groupsid–replaceRetrieves test groups for newsletters.
object_typesid–replaceRetrieves object types in the workspace.
objectsobject_type_id, object_id–replaceRetrieves all objects for each object type.
reporting_webhooksid–replaceRetrieves reporting webhooks.
segmentsidupdated_atmergeRetrieves customer segments.
sender_identitiesid–replaceRetrieves sender identities.
subscription_topicsid–replaceRetrieves subscription topics.
transactional_messagesid–replaceRetrieves transactional message templates.
workspacesid–replaceRetrieves workspaces in your account.

Step 3: Run asset to ingest data ​

bash
bruin run ingestr.customerio.asset.yml

As a result of this command, Bruin will ingest data from the given Customer.io table into your Postgres database.