data_query
Run a data query against a connected marketing platform.
Use discovery tools first to get valid values for ds_id, accounts, fields, and settings.
Most parameters depend on the source configuration from data_source_discovery.
Returns a schedule_id — pass to get_async_query_results immediately.
get_async_query_results
Retrieve results from a data_query using its schedule_id.
Call immediately after data_query returns. Keep polling until status is 'completed' or failed.
data_source_discovery
Discover available data sources or get a specific source's configuration.
Without ds_id: lists all sources with IDs and auth status.
With ds_id: returns full config — always call with ds_id after picking a source.
CONFIG RESPONSE (ds_id provided):
- has_account_list: whether accounts_discovery is needed
- has_fields: whether field_discovery is needed
- has_report_type_selection: whether a report type should be selected
- is_date_range_required: whether date range is needed for queries
- report_types: available report types with their specific settings
- report_types[].is_free_text_account_required: if true, a free-text identifier is needed
(e.g. page alias, URL, profile name) — pass as ds_accounts in data_query
- common_settings: settings that apply to all queries for this data source
- account_labels: how accounts are labeled for this data source
accounts_discovery
Discover connected accounts for a data source.
Only call if data_source_discovery config shows has_account_list=true.
RETURNS: account_id, account_name, group_name, ds_user, ds_user_display_name
field_discovery
Discover available fields (metrics and dimensions) for a data source.
Only call if data_source_discovery config shows has_fields=true.
If has_report_type_selection=true, each field belongs to one or more report types.
All fields in a single data query must share a common report type.
RETURNS: metrics, dimensions, monetary_fields, currency_fields.
When querying monetary fields, include a currency field to know the currency.
get_today
Get current UTC date and time. Use before data_query with custom date ranges
to resolve relative date references (e.g. "last month") into specific dates.