{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Customer.io Export Integration","description":"Export job results from Treasure AI to Customer.io using the Customer.io Export Connector. Supports profile upsert/remove and segment management with automatic segment creation.","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"customerio-export-integration","__idx":0},"children":["Customer.io Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Customer.io Export Connector lets you push Treasure Data CDP query results into Customer.io to keep profiles and segments in sync after each workflow run. Use it when you need to activate CDP-unified customer data — such as high-value segments or behavioral attributes — in your Customer.io campaigns without a manual export step. The connector supports profile upsert and remove operations via the Tracking V2 API, and can add or remove customers from segments with automatic segment creation."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Profile Operations"]}," - Create, update, or remove customer profiles via Tracking V2 API."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Segment Management"]}," - Add or remove customers from segments with automatic segment creation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Multiple Identifiers"]}," - Support for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}," as customer identifiers."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Automatic Region Resolution"]}," - Dynamic endpoint discovery via Customer.io's Track Region API."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Batch Processing"]}," - Efficient bulk operations with configurable error handling."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Basic knowledge of Treasure AI"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Customer.io account with API access"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Valid Customer.io App API Key, Site ID, and API Key"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Authorized Treasure AI account access"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"requirements-limitations-and-behavior","__idx":2},"children":["Requirements, Limitations, and Behavior"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["At least one identifier (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},") must be present in each record"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}," as identifier requires enabling email identification in Customer.io workspace settings"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_relationships"]}," field is automatically excluded from attribute mapping"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Segments are automatically created if they don't exist when using segment operations"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Customer.io implements rate limiting; the connector handles retries with exponential backoff"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"static-ip-address-of-treasure-data-integration","__idx":3},"children":["Static IP Address of Treasure Data Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Please find the complete list of static IP addresses, organized by region, at the following ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["document"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-the-treasure-console-to-create-your-connection","__idx":4},"children":["Use the Treasure Console to Create Your Connection"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-new-connection","__idx":5},"children":["Create a New Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Treasure AI, you must create and configure the data connection, to be used during export, prior to running your query. As part of the data connection, you provide authentication to access Customer.io."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure Console"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/integrations-hub-catalog.39c5b3552b09bdc6ec9cfa10bc5f1c221f3ae989c21f29dea2c3dbf851975ff9.6e125f75.webp","alt":"Hub Catalog"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Search for and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Customer.io"]},". Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Authentication"]},"."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/create-authentication.8cd86a9f23ac421ee5793d859638d670461231b0eb0256b4945cf364a2a039d8.6e125f75.webp","alt":"Authentication"},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following dialog opens. Edit the parameters. Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},"."]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameters"},"children":["Parameters"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App API Key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Customer.io App API Key (required). Used for segment management operations. Generate this from your Customer.io account's API credentials section."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Site ID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Customer.io Site ID (required). Used as username for Tracking API authentication. Found in your Customer.io workspace settings."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Customer.io API Key (required). Used as password for Tracking API authentication. Generate this from your Customer.io account's API credentials section."]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a name for your connection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose to share the authentication with others or not."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-export-results-in-your-data-connection","__idx":6},"children":["Configure Export Results in Your Data Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In this step, you create or reuse a query. In the query, you configure the data connection."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-the-connection-by-specifying-the-parameters","__idx":7},"children":["Configure the Connection by Specifying the Parameters"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Queries"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the query that you plan to use to export data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export Results"]}," located at top of your query editor. The Choose Integration dialog opens."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You have two options when selecting a connection to use to export the results, using an existing connection or creating a new one."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"use-an-existing-connection","__idx":8},"children":["Use an Existing Connection"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Type the connection name in the search box to filter."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select your connection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Export Results dialog opens."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the following parameters and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/export_result_config.f78338c84a920bf6cb057c3d70d9f57014eb1942bfbb2ba6c931220e573fe377.6e125f75.webp","alt":"Export Result Config"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameters"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The target data type: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROFILES"]}," (profile operations) or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEGMENTS"]}," (segment membership operations)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Operation Mode (Profiles)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Profile operation mode: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UPSERT"]}," (create/update) or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REMOVE"]}," (delete). Only used when Data Type is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROFILES"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Operation Mode (Segments)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Segment operation mode: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ADD"]}," (add to segment) or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REMOVE"]}," (remove from segment). Only used when Data Type is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEGMENTS"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Segment Name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Target segment name (required when Data Type is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEGMENTS"]},"). Segment will be created if it doesn't exist"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ID Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Type of identifier: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},". Note: Using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}," requires enabling email identification in Customer.io workspace settings"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Skip Invalid Record"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip records that fail validation instead of aborting the job"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Skip Error Batch"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Continue processing on API batch errors instead of failing the job"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"create-a-new-customerio-connection","__idx":9},"children":["Create a New Customer.io Connection"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Integration"]}," and select Customer.io from ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}," dropdown."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Create Integration dialog opens."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]}," link to go to the Catalog page."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Complete the steps described previously in \"Create a new connection\"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter the required credentials for your new Customer.io connection."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"column-names-for-the-query","__idx":10},"children":["Column Names for the Query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Customer.io export connector understands and interprets the following columns and data types. You must modify alias column names to match with the following specified columns."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["At least one identifier (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},") must be present in your data."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following table describes the columns available for Customer.io export integration:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Column name"},"children":["Column name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["conditional"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer.io internal ID (highest priority identifier). Used when available for most reliable matching."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["conditional"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["External customer ID (medium priority). Used when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]}," not available."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["conditional"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer email address (lowest priority). Used when neither ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_id"]}," nor ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," available. Requires enabling email identification in Customer.io workspace settings."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Any other column"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["various"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["optional"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom attributes mapped directly to Customer.io customer attributes. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cio_relationships"]}," field is automatically excluded."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Identifier Logic"]},": The connector validates the presence of the identifier field specified by the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id_type"]}," configuration parameter. Records must contain the required identifier field to be processed successfully."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sample-queries","__idx":11},"children":["Sample Queries"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"profile-operations","__idx":12},"children":["Profile Operations"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- Profile upsert with 'id' identifier\nSELECT\n  customer_id AS id,\n  email_address AS email,\n  first_name,\n  last_name,\n  signup_date,\n  total_orders,\n  lifetime_value\nFROM customer_profiles\nWHERE TD_TIME_RANGE(time, TD_DATE_TRUNC('day', TD_SCHEDULER_TIME() - 86400, 'UTC'), NULL)\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"segment-operations","__idx":13},"children":["Segment Operations"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- Add customers to segment\nSELECT\n  customer_id AS id,\n  email_address AS email,\n  first_name,\n  last_name\nFROM high_value_segment\nWHERE TD_TIME_RANGE(time, TD_DATE_TRUNC('day', TD_SCHEDULER_TIME() - 86400, 'UTC'), NULL)\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-different-id-types","__idx":14},"children":["Using Different ID Types"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"-- Using Customer.io internal ID (cio_id)\nSELECT\n  cio_customer_id AS cio_id,\n  first_name,\n  last_name,\n  plan_type\nFROM customer_profiles\n\n-- Using email as identifier\nSELECT\n  email,\n  first_name,\n  last_name,\n  subscription_status\nFROM customer_profiles\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-schedule-query-export-jobs","__idx":15},"children":["(Optional) Schedule Query Export Jobs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data's scheduler feature supports periodic query execution to achieve high availability."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, if the cron schedule is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1 * 1'"]},", then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"scheduling-your-job-using-treasure-console","__idx":16},"children":["Scheduling your Job Using Treasure Console"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench > Queries"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a new query or select an existing query."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Next to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]},", select None."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the drop-down, select one of the following schedule options:"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Drop-down Value"},"children":["Drop-down Value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom cron..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Review ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#custom-cron-details"},"children":["Custom cron... details"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["@daily (midnight)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run once a day at midnight (00:00 am) in the specified time zone."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["@hourly (:00)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run every hour at 00 minutes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No schedule."]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"custom-cron-details","__idx":17},"children":["Custom cron... Details"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Cron Value"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cron Value"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 * * * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run once an hour."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 0 * * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run once a day at midnight."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 0 1 * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Run once a month at midnight on the morning of the first day of the month."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"\""]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create a job that has no scheduled run time."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":" *    *    *    *    *\n -    -    -    -    -\n |    |    |    |    |\n |    |    |    |    +----- day of week (0 - 6) (Sunday=0)\n |    |    |    +---------- month (1 - 12)\n |    |    +--------------- day of month (1 - 31)\n |    +-------------------- hour (0 - 23)\n +------------------------- min (0 - 59)\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following named entries can be used:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Day of Week: sun, mon, tue, wed, thu, fri, sat."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A single space is required between each field. The values for each field can be composed of:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"fixed-table"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"Field Value"},"children":["Field Value "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"Example"},"children":["Example "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"45%","data-label":"Example Description"},"children":["Example Description "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A single value, within the limits displayed above for each field."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A wildcard ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*'"]}," to indicate no restriction based on the field."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configures the schedule to run at midnight (00:00) on the first day of each month."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A range ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2-5'"]},", indicating the range of accepted values for the field."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1-10 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configures the schedule to run at midnight (00:00) on the first 10 days of each month."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A list of comma-separated values ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2,3,4,5'"]},", indicating the list of accepted values for the field."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1,11,21 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A periodicity indicator ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*/5'"]}," to express how often based on the field's valid range of values a schedule is allowed to run."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'30 */2 1 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 */5 * *'"]}," configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A comma-separated list of any of the above except the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*'"]}," wildcard is also supported ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2,*/5,8-10'"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 5,*/10,25 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(Optional) You can delay the start time of a query by enabling the Delay execution."]}]}]},"headings":[{"value":"Customer.io Export Integration","id":"customerio-export-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Requirements, Limitations, and Behavior","id":"requirements-limitations-and-behavior","depth":2},{"value":"Static IP Address of Treasure Data Integration","id":"static-ip-address-of-treasure-data-integration","depth":2},{"value":"Use the Treasure Console to Create Your Connection","id":"use-the-treasure-console-to-create-your-connection","depth":2},{"value":"Create a New Connection","id":"create-a-new-connection","depth":3},{"value":"Configure Export Results in Your Data Connection","id":"configure-export-results-in-your-data-connection","depth":3},{"value":"Configure the Connection by Specifying the Parameters","id":"configure-the-connection-by-specifying-the-parameters","depth":3},{"value":"Use an Existing Connection","id":"use-an-existing-connection","depth":4},{"value":"Create a New Customer.io Connection","id":"create-a-new-customerio-connection","depth":4},{"value":"Column Names for the Query","id":"column-names-for-the-query","depth":2},{"value":"Sample Queries","id":"sample-queries","depth":2},{"value":"Profile Operations","id":"profile-operations","depth":3},{"value":"Segment Operations","id":"segment-operations","depth":3},{"value":"Using Different ID Types","id":"using-different-id-types","depth":3},{"value":"(Optional) Schedule Query Export Jobs","id":"optional-schedule-query-export-jobs","depth":3},{"value":"Scheduling your Job Using Treasure Console","id":"scheduling-your-job-using-treasure-console","depth":4},{"value":"Custom cron... Details","id":"custom-cron-details","depth":4}],"frontmatter":{"seo":{"title":"Customer.io Export Integration","description":"Export job results from Treasure AI to Customer.io using the Customer.io Export Connector. Supports profile upsert/remove and segment management with automatic segment creation."}},"lastModified":"2026-09-17T02:26:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/customerio-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}