Ellipse Gradient for Header

Treasure Data Integration Guide

Connect Treasure Data CDP with enterprise applications through REST and query APIs, asynchronous jobs, bulk data exchange, SDK-based collection, and governed Martini workflows.

Treasure Data integration options at a glance

Treasure Data supports REST APIs for databases, tables, queries, jobs, and data operations, alongside asynchronous query execution, bulk ingestion, file-based import and export, and product-specific event collection through SDKs. API-key authentication, regional endpoints, and permission-controlled access are central to the integration model. Webhook-style notifications may be available for selected features but are not universal across Treasure Data objects. Martini can consume these APIs, schedule incremental workflows, poll query jobs, process large files, transform profiles and events, expose governed APIs, and route results to enterprise applications or analytical platforms.

Integration pointSupported by Treasure Data?Common use casesHow Martini supports it
REST APIsYesManage or inspect databases and tables, submit data operations, execute queries, retrieve results, and access other Treasure Data platform capabilities.Martini can consume Treasure Data REST endpoints, map request and response payloads, expose a governed API façade, and orchestrate downstream workflows.
Query and analytics APIsYesRun SQL or saved queries, prepare audiences, perform data quality checks, and produce scheduled or incremental extracts.Martini can submit a query, capture its job identifier, poll status with bounded timeouts, retrieve results, and route failures separately.
Bulk, asynchronous, and batch APIsYesIngest large event, profile, or transaction datasets and process analytical workloads without row-by-row requests.Martini can schedule batch workflows, prepare payloads or files, invoke bulk operations, and reconcile accepted and rejected counts.
File import and exportLimitedMove large datasets using supported CSV, JSON, or other Treasure Data-compatible file formats and import or export paths.Martini can prepare, validate, transform, and process files, while invoking the applicable Treasure Data import or export operation.
Events and SDK-based collectionYesCollect application, web, mobile, or server-side behavioral events through Treasure Data product-specific collection mechanisms and SDKs.Martini can receive upstream events, normalize and enrich them, forward them to a supported Treasure Data ingestion endpoint, and replay failed events.
Webhooks and outbound callbacksLimitedReceive feature-specific notifications, activation callbacks, or outbound HTTP callbacks where the selected Treasure Data product provides them.Martini can expose a REST endpoint and trigger a workflow, but scheduled queries or polling should be used when notifications are unavailable or incomplete.
Database and analytics accessLimitedAccess analytical data through Treasure Data query and job APIs; direct driver access depends on the enabled query engine and account configuration.Martini can use the preferred API-based query workflow and can use configured database connectivity only after the deployed Treasure Data environment is verified.
AuthenticationYesAuthenticate core API requests with permission-controlled API keys, commonly supplied through the TD-API-KEY header, and target the correct regional endpoint.Martini can store regional URLs and API keys in environment configuration or secrets and apply them to reusable API workflows.

How Treasure Data exposes data and business events

Treasure Data REST APIs

Treasure Data provides REST APIs for administration, databases, tables, data operations, queries, jobs, and other platform capabilities. These APIs are the primary custom integration mechanism documented for enterprise applications.

Martini implementation pattern

Martini implementation pattern: Martini consumes the regional Treasure Data REST API using a least-privileged API key, maps request and response structures, and orchestrates the calls within reusable workflows or exposed APIs. Secrets and regional hosts remain environment-specific.

Implementation sequence

Load the regional Treasure Data API URL and API key from secure configuration
Validate the requested database, table, query, or operation
Call the appropriate Treasure Data REST endpoint
Transform the response into the consuming system's model
Persist relevant identifiers and workflow status
Route authorization, validation, and transient failures separately

Treasure Data Query APIs

Treasure Data supports asynchronous SQL or saved-query execution. A request returns a job identifier, after which the caller checks status and retrieves or exports the result when processing completes.

Martini implementation pattern

Martini implementation pattern: A scheduled or API-triggered workflow submits a bounded query, records the job identifier, polls at a controlled interval, and processes the result only after a successful completion state. Timeouts, failed jobs, and duplicate submissions are handled explicitly.

Implementation sequence

Build an incremental or date-windowed query
Submit the query and capture the job identifier
Poll the job using a bounded interval and timeout
Handle queued, running, successful, and failed states
Retrieve or export the completed result
Map and deliver the result to the target system

Treasure Data Bulk and File Exchange

Treasure Data supports bulk and batch ingestion, with file-based import and export relevant to large event, profile, and transaction datasets. Exact formats, limits, and paths depend on the deployed ingestion product.

Martini implementation pattern

Martini implementation pattern: Martini prepares or receives a file, validates format and schema, invokes the applicable Treasure Data import or export mechanism, and records file, job, and reconciliation metadata. Large datasets are processed without assuming that all data fits in one response.

Implementation sequence

Create or receive the source file in a supported format
Validate required columns, types, partitions, and identifiers
Invoke the applicable Treasure Data import or export operation
Track the file or job identifier
Process accepted and rejected results
Store reconciliation counts and the completed watermark

Treasure Data Events and Callbacks

Treasure Data supports product-specific event collection and SDK-based ingestion. Outbound callbacks or notifications may be available for selected features, but webhooks are not universal across databases, tables, profiles, queries, audiences, or jobs.

Martini implementation pattern

Martini implementation pattern: Martini exposes a secured REST endpoint when the selected Treasure Data feature provides an outbound callback, or receives events from an upstream application before normalizing and forwarding them to Treasure Data. For reliable synchronization, scheduled queries and polling remain preferred where callbacks are not confirmed.

Implementation sequence

Confirm that the selected Treasure Data feature provides the required callback or event-in
Receive the event through a secured Martini API when applicable
Validate the payload and deduplicate using an event identifier
Enrich and map the event to the Treasure Data ingestion model
Forward the event or route it to a durable retry path
Record delivery status and replay failures safely

Common Treasure Data integration patterns

Pattern 1: Synchronize CRM activity to Treasure Data customer profiles

When to use this pattern

Use this pattern when Salesforce or HubSpot customer and activity data must be unified with Treasure Data profiles and behavioral data. Incremental extraction reduces load while identity, consent, and duplicate rules protect profile quality.

Integration direction
Salesforce or HubSpot
Martini
Treasure Data
Example Mapping
Treasure Data FieldCanonical FieldTarget Field
external_idcustomerIdCustomer profile identifier
emailemailAddressCustomer profile email
lastModifiedDatesourceUpdatedAtProfile or event timestamp
activityTypeeventNameBehavioral event name
Martini implementation pattern

A scheduled or event-assisted Martini workflow retrieves changed Accounts, Contacts, Leads, Companies, or activities, normalizes identifiers and timestamps, validates consent fields, and submits profile or event data through the applicable Treasure Data API or bulk path. The workflow stores a watermark, rejects invalid identities, and retries only transient failures.

Martini capabilities used
  • workflows
  • API consumption
  • scheduled triggers
  • data mapping
  • business rules
  • error handling

Pattern 2: Export Treasure Data audiences to an activation platform

When to use this pattern

Use this pattern when a completed Treasure Data query or audience must be delivered to Braze, Salesforce, Marketo, or Google Ads. It is appropriate for scheduled activation with suppression, versioning, and delivery reconciliation.

Integration direction
Treasure Data
Martini
Braze or Salesforce Marketing Cloud
Example Mapping
Treasure Data FieldCanonical FieldTarget Field
customer_idprofileIdExternal user identifier
emailemailAddressEmail address
audience_namesegmentNameAudience or segment name
consent_statusmarketingConsentSubscription or consent state
Martini implementation pattern

Martini submits or invokes a Treasure Data query, polls the asynchronous job, retrieves the result in pages or through an export, applies suppression and consent rules, and maps identifiers to the activation platform. A deterministic audience run identifier supports idempotent delivery and reconciliation.

Martini capabilities used
  • workflows
  • API consumption
  • asynchronous orchestration
  • mapping and transformation
  • business rules
  • retry handling

Pattern 3: Exchange analytical data with Snowflake or Amazon S3

When to use this pattern

Use this pattern for scheduled or batch movement of curated customer, behavioral, or transaction datasets between Treasure Data and an analytical platform. It is suited to large volumes where file or query-result processing is preferable to row-level requests.

Integration direction
Treasure Data
Martini
Snowflake or Amazon S3
Example Mapping
Treasure Data FieldCanonical FieldTarget Field
event_timeeventTimestampEVENT_TIMESTAMP
customer_idcustomerIdCUSTOMER_ID
event_typeeventNameEVENT_TYPE
attributeseventAttributesATTRIBUTES_JSON
Martini implementation pattern

A Martini workflow submits an incremental Treasure Data query, waits for completion, retrieves or exports the result, validates file or response structure, and loads the target platform. It records partitions, row counts, watermarks, and rejected data, with bounded retries for transient failures.

Martini capabilities used
  • scheduled workflows
  • query API consumption
  • file processing
  • data mapping
  • database connectivity
  • monitoring

Pattern 4: Route application events through a Treasure Data gateway

When to use this pattern

Use this pattern when applications need a governed endpoint that validates, enriches, and forwards events to Treasure Data rather than integrating separately with the CDP ingestion service.

Integration direction
Application
Martini
Treasure Data
Example Mapping
Treasure Data FieldCanonical FieldTarget Field
event_ideventIdEvent identifier
user_idcustomerIdCustomer profile identifier
occurred_ateventTimestampEvent timestamp
propertieseventAttributesEvent attributes
Martini implementation pattern

Martini exposes a secured API, validates payloads and required identifiers, enriches events with account or consent context, applies routing rules, and forwards normalized events to a supported Treasure Data ingestion endpoint. Duplicate event IDs, back-pressure, and failed deliveries are handled through durable status and replay controls.

Martini capabilities used
  • API exposure
  • workflows
  • JSON handling
  • data validation
  • business rules
  • error handling

Applications commonly integrated with Treasure Data

Treasure Data is commonly positioned between customer-facing applications, marketing platforms, activation destinations, and analytical data platforms. The following are practical integration examples; exact destination availability and operations depend on the Treasure Data edition, enabled products, account permissions, and configuration.

Application Scenario Direction Martini Pattern
Salesforce Unify Accounts, Contacts, Leads, campaign activity, and sales interactions with Treasure Data customer profiles, and export audiences for sales or marketing use. Salesforce → Martini → Treasure Data Martini can retrieve Salesforce data, normalize identifiers and timestamps, apply consent and deduplication rules, and submit profile or event data through the appropriate Treasure Data API or bulk ingestion path. Scheduled reconciliation can track watermarks and rejected records.
HubSpot Consolidate Contacts, Companies, and marketing engagement data for customer profiling, segmentation, and downstream activation. HubSpot → Martini → Treasure Data A Martini workflow can consume HubSpot APIs, map contact and company attributes to Treasure Data structures, enrich events, and use incremental extraction with validation and retry handling.
Marketo Combine marketing activity and lead data with broader behavioral information, then return segments or scores for campaign targeting. Marketo → Martini → Treasure Data Martini can orchestrate scheduled or event-assisted exchanges, transform lead and activity payloads, enforce field and consent rules, and deliver audience or scoring results through configured Treasure Data and Marketo endpoints.
Braze Send Treasure Data audiences or profile attributes to Braze for personalized engagement and campaign activation. Treasure Data → Martini → Braze Martini can submit a Treasure Data query, poll the asynchronous job, retrieve audience results, map profile attributes to Braze payloads, and perform idempotent, monitored uploads.
ServiceNow Combine customer, account, or service interaction data with Treasure Data customer profiles and analytics. ServiceNow → Martini → Treasure Data Martini can consume ServiceNow APIs, validate and map service interaction data, apply privacy and enrichment rules, and write events or profile-related data to Treasure Data using scheduled workflows.
Snowflake Exchange curated customer and behavioral datasets between Treasure Data and an enterprise warehouse. Treasure Data → Martini → Snowflake Martini can coordinate Treasure Data query jobs and result exports, process files or paginated results, transform schemas, and load Snowflake using configured database connectivity and reconciliation controls.
Amazon S3 Use object storage as a staging location for large Treasure Data exports, imports, and durable file exchange. Treasure Data → Martini → Amazon S3 Martini can prepare or process supported CSV or JSON files, invoke the applicable Treasure Data import or export operation, and track file-level status, counts, and failures.
Google Ads Activate customer audiences or conversion-related datasets for advertising use where the configured Treasure Data destination supports the required operation. Treasure Data → Martini → Google Ads Martini can retrieve a validated Treasure Data audience extract, apply suppression and consent rules, transform identifiers, and submit the result through the configured Google Ads integration while recording delivery outcomes.

How to build a Treasure Data integration in Martini

Objective

Configure the Treasure Data regional API host and least-privileged API key without embedding secrets in workflows or mappings.

Instructions in Martini

  • Create environment configuration for the regional Treasure Data base URL
  • Store the TD-API-KEY value in Martini secrets or secure configuration
  • Confirm database, table, query, and ingestion permissions
  • Test authentication and regional routing with a low-risk API operation

Objective

Select a schedule, upstream API request, application event, or feature-specific callback based on the synchronization requirement.

Instructions in Martini

  • Use a scheduler for exports, reconciliation, and incremental extraction
  • Use an API trigger for governed event submission or on-demand queries
  • Use a webhook trigger only when the selected Treasure Data feature provides an outbound callback
  • Define the source watermark or event identifier

Objective

Read source data or submit a Treasure Data query while accounting for pagination, incremental windows, and asynchronous execution.

Instructions in Martini

  • Submit a bounded query or call the required REST endpoint
  • Capture job identifiers and request metadata
  • Poll asynchronous jobs with a maximum interval and timeout
  • Retrieve pages, files, or exports without assuming a single complete response

Objective

Coordinate calls, status checks, branching, and durable progress tracking in a maintainable Martini workflow.

Instructions in Martini

  • Separate submission, polling, result retrieval, and delivery stages
  • Branch successful, failed, timed-out, and validation outcomes
  • Persist watermarks, job identifiers, and reconciliation metadata
  • Use reusable workflow logic for common Treasure Data operations

Objective

Convert source payloads into Treasure Data tables, customer profiles, audiences, or event structures, and convert query output for downstream systems.

Instructions in Martini

  • Normalize identifiers, timestamps, and regional formats
  • Map source attributes to the target schema
  • Transform CSV, JSON, or query-result structures as required
  • Validate required fields, types, partition values, and consent attributes

Objective

Apply identity, consent, suppression, deduplication, and incremental-processing rules before writing or activating data.

Instructions in Martini

  • Reject malformed or unauthorized payloads
  • Use deterministic keys where available
  • Handle late-arriving data and clock skew
  • Avoid copying attributes that are not required by the target workflow

Common Treasure Data data objects used in integrations

ObjectTypical UseCommon target systemsMartini handling
DatabasesLogical containers for Treasure Data datasets and tables.Data warehouses, lakehouses, reporting platforms, and operational data services.Martini can list, inspect, or provision databases where permitted and use database identifiers as workflow configuration.
TablesSchemas and data collections containing customer, event, transaction, or analytical data.Salesforce, Snowflake, Amazon S3, marketing platforms, and downstream APIs.Martini maps source fields to table structures, validates schema and partition requirements, and processes large results incrementally.
JobsAsynchronous executions for SQL queries, result exports, and other platform operations.Activation destinations, warehouses, file stores, and monitoring systems.Martini stores the job identifier, polls status, applies timeout and retry rules, and routes successful or failed jobs appropriately.
QueriesSQL or saved-query definitions for processing, aggregating, validating, and preparing data.Audience platforms, warehouses, CRM systems, and reporting services.Martini submits parameterized or date-windowed queries, tracks watermarks, and transforms returned results for target systems.
Customer profilesUnified customer records containing identifiers, attributes, and behavioral information in the CDP layer.Salesforce, HubSpot, Braze, Marketo, and advertising destinations.Martini applies identity, consent, normalization, and deduplication rules before profile synchronization or activation.
AudiencesSegmented groups of customer profiles used for analysis and activation.Braze, Salesforce, Google Ads, Marketo, and other configured destinations.Martini retrieves audience results from completed jobs, applies suppression rules, maps identifiers, and performs monitored delivery.

Authentication and security considerations

API keys and permissions

Treasure Data core APIs primarily use API keys supplied through the TD-API-KEY request header. Use a dedicated least-privileged key appropriate to the workflow rather than a master key whenever possible.

Regional endpoints

Store the Treasure Data regional API base URL in environment configuration. API calls, query operations, and ingestion requests should target the correct account region.

Secrets and privacy

  • Store API keys and regional URLs in Martini secrets or secure environment configuration.
  • Restrict access according to key owner, account, database, and operation permissions.
  • Define consent, retention, deletion, suppression, and access-control requirements before moving customer or behavioral data.
  • Use API exposure controls when Martini acts as an event gateway or API façade.

Operational considerations for Treasure Data integrations

Asynchronous jobs

Queries and exports may complete asynchronously. Persist job identifiers, poll with bounded intervals, apply timeouts, and distinguish queued, running, successful, and failed states.

Scale and pagination

Do not assume that one API response contains all data. Use pagination, incremental watermarks, bulk ingestion, or file exchange for large results and avoid loading complete datasets into memory.

Retries and idempotency

Use exponential backoff and a maximum retry count for transient failures and throttling. Do not retry authorization or validation errors as transient failures. Use deterministic event or record keys and reconciliation controls to limit duplicates.

Schema and query management

Validate new nullable fields, type changes, renamed attributes, nested JSON, partition requirements, and destination restrictions. Restrict query date ranges and selected columns to reduce cost and operational load.

Monitoring and testing

Track source counts, accepted and rejected records, job identifiers, query status, watermarks, throttling, schema failures, and downstream delivery totals. Test representative payloads, failed jobs, duplicate events, expired keys, and regional configuration before production rollout.

Why use Martini instead of scripts or point-to-point integrations?

Orchestration beyond scripts

Scripts can call Treasure Data APIs, but enterprise integrations also require asynchronous job coordination, incremental extraction, mapping, consent rules, retries, reconciliation, monitoring, and controlled deployment. Martini provides a workflow model for these concerns.

Reusable integration assets

Martini can centralize Treasure Data authentication, regional configuration, query submission, job polling, file processing, and error handling in reusable workflows and APIs rather than duplicating logic across point-to-point scripts.

Controlled change and operations

Schema validation, business rules, environment-specific secrets, bounded retries, and operational status make integrations easier to test, troubleshoot, and maintain as Treasure Data tables, profiles, audiences, and destinations evolve.

  • Consume REST and query APIs through governed workflows.
  • Expose APIs for upstream applications that need a controlled Treasure Data interface.
  • Transform JSON, query results, and files between Treasure Data and enterprise systems.
  • Monitor asynchronous jobs, watermarks, delivery counts, and failures.

Frequently asked questions

How can Treasure Data be integrated with enterprise systems?

Treasure Data can be integrated through its REST APIs, asynchronous query and job APIs, bulk and batch ingestion, file import and export, and product-specific event collection or SDK mechanisms. Feature-specific outbound callbacks may also be available, but they should not be assumed for every Treasure Data object or state change.

Can Martini integrate with Treasure Data?

Yes. Martini can consume Treasure Data REST and query APIs, submit and monitor asynchronous jobs, process bulk files, transform customer and event data, expose APIs for upstream applications, and route results to enterprise systems. A Martini-native Treasure Data connector is not documented in the supplied sources.

Do I need a connector to integrate Treasure Data with Martini?

No. A dedicated Treasure Data connector is not required. Martini can use Treasure Data's confirmed native integration mechanisms, including REST and query APIs, API-key authentication, bulk ingestion, file exchange, SDK-compatible event endpoints, and feature-specific callbacks where available.

Is there any extra Lonti cost to integrate Treasure Data with Martini?

Lonti does not charge an additional per-connector or per-vendor fee to integrate Treasure Data. The integration is subject to the provisioned capacity of the Martini environment. Separate costs may apply from Treasure Data, cloud infrastructure, or other third-party systems based on subscription, usage, and deployment model.

Which Treasure Data integration methods should enterprise teams use?

REST APIs and query APIs are the primary custom integration methods. Use asynchronous jobs for analytical queries, bulk or file-based processing for large datasets, and scheduled incremental extraction for reliable synchronization. SDK-based event collection and feature-specific callbacks can be used when the enabled Treasure Data product supports them.

Does Treasure Data provide webhooks or event callbacks?

Treasure Data supports event collection and may provide notifications, activation callbacks, or outbound HTTP callbacks for selected features. It does not have confirmed universal webhooks for every database, table, customer profile, query, audience, or job change, so scheduled queries and job polling may be more predictable.

How does Martini synchronize large Treasure Data datasets?

Martini can submit asynchronous queries, poll job status, retrieve paginated or exported results, process supported files, and load downstream systems in batches. Incremental timestamps, ingestion watermarks, partitioning, reconciliation counts, and bounded retries help avoid repeated full-history transfers.

Can Martini expose an API façade for Treasure Data?

Yes. Martini can expose a governed API for internal applications to submit events, request Treasure Data-derived data, or initiate controlled operations. The façade can centralize authentication, validation, mapping, business rules, rate controls, and error handling while keeping Treasure Data credentials and regional endpoints protected.