{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Integrations","type":"markdown"},"seo":{"title":"Klaviyo Export Integration","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"klaviyo-export-integration","__idx":0},"children":["Klaviyo Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Klaviyo is a digital marketing platform focused on email marketing automation for e-commerce businesses. Klaviyo offers an SMS and email marketing automation platform for e-commerce."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using this integration and TD"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can add profiles to a Klaviyo member list."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can remove profiles from Klaviyo member list"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can subscribe profiles to Email Marketing, Email & SMS Marketing, or SMS marketing & Transactional."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can import historical subscription status for profiles."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["You can unsubscribe profiles from Email Marketing, Email & SMS Marketing, or SMS marketing & Transactional."]}]},{"$$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 Data, including the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/quickstart"},"children":["TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Klaviyo account with a Private API access token."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"api-information","__idx":2},"children":["API Information"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data uses"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.klaviyo.com/en/reference/campaigns_api_overview"},"children":["Campaigns API"]}," to direct Klaviyo to send email messages. The documentation on the Request Body of this API can be very helpful in setting up your email templates on Klaviyo."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://developers.klaviyo.com/en/reference/profiles_api_overview"},"children":["Profiles API"]}," to send subscribe/unsubscribe profiles request to Klaviyo."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"requirements-and-limitations","__idx":3},"children":["Requirements and Limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To perform a \"Remove Profiles\" operation,\" your query must specify a profile_id column (case sensitive) whose data type is a string. If your query does not specify this column, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To perform an \"Add Profiles\" operation, your query must specify a column named email (case sensitive) whose data type is string. If your query does not specify this column, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To perform a \"Batch Consent\" operation, your query must specify email or phone number columns according to the subscription type you choose. If your query does not specify the required columns, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Before syncing SMS consent, ensure the target Klaviyo account has a provisioned sending number for the recipient's country. Klaviyo will not process SMS subscriptions for phone numbers from regions where a sending number is not active."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If your query specifies a column named phone_number (case sensitive), then data from this field must follow the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://help.klaviyo.com/hc/en-us/articles/360046055671-Accepted-Phone-Number-Formats-for-SMS-in-Klaviyo"},"children":["Accepted phone number formats for SMS in Klaviyo"]},". Otherwise, an error is returned, and the job fails."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"obtain-the-private-api-access-token-fromklaviyo-console","__idx":4},"children":["Obtain the Private API access token from Klaviyo Console"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log in to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.klaviyo.com/login"},"children":["Klaviyo Dashboard"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the Settings tab select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Private API Key"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Copy the Private API key and store it in a secure location."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-9-2_19-8-32.3c940e83c69573c651a7da50d75f3d29c1cea78773d0919014671f5cce866889.9d563c94.png","alt":""},"children":[]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"obtain-the-list-name-or-list-id-from-the-klaviyo-console","__idx":5},"children":["Obtain the List Name or List ID from the Klaviyo Console"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log in to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.klaviyo.com/login"},"children":["Klaviyo Dashboard"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the left-hand side of the Dashboard, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Lists & Segments"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["From the Lists & Segments page, select the link for your list name."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy the list_id from the URL of the list display page and store it in a secure location."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-the-treasure-console-to-create-your-connection","__idx":6},"children":["Use the Treasure Console to Create Your Connection"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"create-a-new-connection","__idx":7},"children":["Create a New Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In Treasure Data, you must create and configure the data connection prior to running your query. As part of the data connection, you provide authentication to access the integration."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure Console"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for Klaviyo and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Klaviyo Output Beta"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Authentication"]},"."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/klaviyo_out.0f1f332e2fc85584bcb180c9fa57797ba9cf1d0a8c104ef10e5135ca3b4a15f9.9d563c94.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter your Klaviyo Private API key."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},"."," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-9-2_19-14-14.07bfc65e3d181f1ab49f3dbe1216044dced2a2b71f29e03d716a3f93f0f71541.9d563c94.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter a name for your connection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"define-your-query","__idx":8},"children":["Define your Query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To perform an \"Add Profiles\" operation, your query must specify a column named email (case sensitive) whose data type is string. If your query does not specify this column, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To perform a \"Remove Profiles\" operation,\" your query must specify a profile_id column (case sensitive) whose data type is a string. If your query does not specify this column, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To perform a \"Subscribe/Unsubscribe Profiles\" operation, your query must specify email or phone number columns according to the subscription type you choose. If your query does not specify the required columns, then an error is returned, and the job fails."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Complete the instructions in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/creating-a-destination-integration"},"children":["Creating a Destination Integration"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to Data Workbench > Queries."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select a query for which you would like to export data."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run the query to validate the result set."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select Export Results."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use Existing Integration"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-9-2_19-23-5.c6b3eb8e8b76d7851851789359e57bca513b4d9131d3ba63d22498b710a4242e.9d563c94.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Define any additional Export Results details. In your export integration content review the integration parameters."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/screen-shot-2024-04-10-at-11.12.26.b5eae7fa5e71597f36ea8a08fe276329846e8678c14ec021c4260e197779ad5e.9d563c94.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run your query."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate that your data moved to the destination you specified."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integration Parameters for Klaviyo"]}]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Values"},"children":["Values"]},{"$$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":["Data operation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- Add profiles ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"- Remove profiles ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - Batch Consent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- Add or remove profiles from a Klaviyo list. Klaviyo's profile_id is required for the remove profiles operation. After removal, the profile will no longer receive marketing emails from this particular list. ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - Batch Consent is used to subscribe/unsubscribe profiles to a particular list"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Add to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- List ID ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - List Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Used to identify the Klaviyo list."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List ID or List Name value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- List ID or List Name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The List ID or List Name that profiles will be added to.   If the \"Add to\" parameter has been set to List Name, and the name specified here does not exist in Klaviyo then a new list will be created with these values."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Subscription Type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["- \"All - Marketing Only\" ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - \"Email - Marketing Only\" ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - \"SMS - Marketing Only\" ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," - \"SMS - Marketing + Transactional\""]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Select channels + subscription types. Require if Data Operations is Batch Consent."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skip Invalid Records"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True/False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If checked, executions move forward and invalid records are skipped."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stop on Batch Failure"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True/False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If checked, execution stops immediately when there is a batch failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wait Until The Operation Is Finished?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["True/False"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If checked, the Treasure Console will wait until the operation is finished on Klaviyo side before continuing.  If unchecked, the Treasure Console submits the task to Klaviyo and moves on."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The waiting time for operation completion"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Minimum: 300000 ms  (5 minutes)  Maximum: 86400000 ms (1 day)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The time in milliseconds that Treasure Console will wait for the operation to complete."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-query","__idx":9},"children":["Example Query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This query must include an email column."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"SELECT email, col_a, col_b, col_c\nFROM your_table;\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This query requires a profile_id column."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"SELECT profile_id FROM your_table;\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This query is for Batch Consent operation. email or phone_number column is required according to subscription type. consent_at is required for historical subscription."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"SELECT profile_id, email, phone_number, birth_day, consent_at\nFROM (\n  values ('profile id', 'example1@email.com', '+234243241', '2010-08-15', '2010-08-15T01:05:20'),\n         ('profile id', 'example2@email.com', '+234243242', '2010-01-15', '2010-08-15T01:05:20')\n) tbl (profile_id, email, phone_number, birth_day, consent_at)\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-schedule-query-export-jobs","__idx":10},"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":11},"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":12},"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":""},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cron Value"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"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."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"execute-the-query","__idx":13},"children":["Execute the Query"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["(Optional) You can delay the start time of a query by enabling the Delay execution."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"optionally-configure-export-results-in-workflow","__idx":14},"children":["Optionally Configure Export Results in Workflow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Within Treasure Workflow, you can specify the use of this data connector to export data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn more about ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/api#workflow-commands"},"children":["using workflows to export data with the TD Toolbelt"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-adding-profiles-by-list-id","__idx":15},"children":["Example Workflow for Adding Profiles by List ID"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: add\n    list_identify_type: id\n    list_value: id_value\n    wait_for_completion: true\n    waiting_time_for_completion_millis:3600000\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-adding-profiles-by-list-name","__idx":16},"children":["Example Workflow for Adding profiles by List Name"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: add\n    list_identify_type: name\n    list_value: name_value\n    wait_for_completion: true\n    waiting_time_for_completion_millis: 3600000\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-removing-profiles-by-list-id","__idx":17},"children":["Example Workflow for Removing Profiles by List ID"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: remove_profiles\n    list_identify_type: id\n    list_value: id_value\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-removing-profiles-by-list-name","__idx":18},"children":["Example Workflow for Removing Profiles by List Name"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: remove_profiles\n    list_identify_type: name\n    list_value: name_value\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-subscribing-profiles-by-list-name","__idx":19},"children":["Example Workflow for Subscribing Profiles by List Name"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: batch_consent\n    list_identify_type: name\n    list_value: name_value\n    consent_type: subscribed\n    subscription_type: all_marketing\n    historical_consent: false\n    skip_invalid_records: true\n    stop_on_batch_failure: false\n\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-workflow-for-unsubscribing-profiles-by-list-id","__idx":20},"children":["Example Workflow for Unsubscribing Profiles by List ID"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  td:\n    database: klaviyo_db\n+klaviyo_export_task:\n  td>: export_data.sql\n  database: ${td.database}\n  result_connection: new_created_klaviyo_auth\n  result_settings:\n    type: klaviyo\n    api_token: api_token\n    operation: batch_consent\n    list_identify_type: id\n    list_value: id_value\n    consent_type: unsubscribed\n    subscription_type: email_marketing_only\n    skip_invalid_records: true\n    stop_on_batch_failure: false\n","lang":"yaml"},"children":[]}]},"headings":[{"value":"Klaviyo Export Integration","id":"klaviyo-export-integration","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"API Information","id":"api-information","depth":2},{"value":"Requirements and Limitations","id":"requirements-and-limitations","depth":2},{"value":"Obtain the Private API access token from Klaviyo Console","id":"obtain-the-private-api-access-token-fromklaviyo-console","depth":2},{"value":"Obtain the List Name or List ID from the Klaviyo Console","id":"obtain-the-list-name-or-list-id-from-the-klaviyo-console","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":"Define your Query","id":"define-your-query","depth":3},{"value":"Example Query","id":"example-query","depth":2},{"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},{"value":"Execute the Query","id":"execute-the-query","depth":3},{"value":"Optionally Configure Export Results in Workflow","id":"optionally-configure-export-results-in-workflow","depth":2},{"value":"Example Workflow for Adding Profiles by List ID","id":"example-workflow-for-adding-profiles-by-list-id","depth":3},{"value":"Example Workflow for Adding profiles by List Name","id":"example-workflow-for-adding-profiles-by-list-name","depth":3},{"value":"Example Workflow for Removing Profiles by List ID","id":"example-workflow-for-removing-profiles-by-list-id","depth":3},{"value":"Example Workflow for Removing Profiles by List Name","id":"example-workflow-for-removing-profiles-by-list-name","depth":3},{"value":"Example Workflow for Subscribing Profiles by List Name","id":"example-workflow-for-subscribing-profiles-by-list-name","depth":3},{"value":"Example Workflow for Unsubscribing Profiles by List ID","id":"example-workflow-for-unsubscribing-profiles-by-list-id","depth":3}],"frontmatter":{"seo":{"title":"Klaviyo Export Integration"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/int/klaviyo-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}