Read every workspace setting of AxiTrace and change data collection, cookie consent, attribution, the reporting timezone, lead sources and Product Labels rules through REST API v1 and MCP tools.

Workspace settings through REST API and MCP

Read the settings of a workspace as its Settings pages show them, and change the ones that shape your reports: dataLayer tracking, Do Not Track, cookie consent, the attribution model, IP fallback attribution, the reporting timezone, the sources that count as leads and the Product Labels rules. Every change goes through the same services and checks as the Settings pages, and every answer shows the setting before and after the change.

Access

  • Reading needs the settings:read scope.
  • Changing needs the settings:write scope and a role that may edit the workspace settings (the owner, or a team member or agency with edit rights); otherwise a change answers 403 workspace_read_only. Demo workspaces are read-only.
  • Both scopes are opt-in: on the consent page they are extra boxes you must tick, and on the personal access token form they start unticked. Connections and tokens made before they existed do not carry them; reconnect, or create a new token, to add them.

Authentication, envelopes, errors and rate limits follow the REST API v1 reference; full schemas are in the OpenAPI document. Fraud Detection settings and IP blocks have their own scope, see Fraud Actions API and MCP.

Operations

RESTMCP toolScopeWhat it does
GET .../settingsget_workspace_settingssettings:readEvery section, or one with ?section=: general, tracking, privacy, collection, attribution, fraud, leads, product_labels.
PATCH .../settings/collectionupdate_collection_settingssettings:writedataLayer tracking and its name, Do Not Track, cookie consent and forwarding of events without a consent state.
PATCH .../settings/attributionupdate_attribution_settingssettings:writeThe default attribution model and IP fallback attribution with its lookback window.
PATCH .../settings/generalupdate_general_settingssettings:writeThe reporting timezone.
PATCH .../settings/leadsupdate_lead_source_settingssettings:writeThe complete list of the sources that count as leads.
POST .../product-labels/rule-setssave_product_label_rulessettings:writeSaves the Product Labels rule set of one slot.
POST .../product-labels/templates/applyapply_product_label_templatesettings:writeSets up Product Labels from a starter template.
POST .../product-labels/refreshrefresh_product_labelssettings:writeRecalculates every product label now.

Every REST path starts with /api/v1/workspaces/{workspace_id}. Who changed a setting is never returned, and times are in UTC.

Reading the settings

curl -H "Authorization: Bearer $TOKEN" \
  "https://axitrace.com/api/v1/workspaces/$WORKSPACE/settings?section=attribution"
{
  "data": {
    "workspace_id": "7a2b3c4d-0000-4000-8000-000000000011",
    "sections": {
      "attribution": {
        "model": "last_click",
        "model_label": "Last click",
        "model_updated_at": "2026-10-02T08:15:00+00:00",
        "ip_fallback_enabled": true,
        "ip_fallback_lookback_days": 7,
        "ip_fallback_lookback_days_min": 1,
        "ip_fallback_lookback_days_max": 30,
        "ip_fallback_updated_at": null
      }
    }
  }
}
  • general: name, type, default and reporting currency, and the timezone (null until chosen; reports then use UTC).
  • tracking: the public SDK key and the store domains with their default and verified flags.
  • privacy: respect_dnt, consent_required and forward_when_consent_unknown, see Cookie consent.
  • collection: datalayer_auto_tracking, datalayer_name (null for the default dataLayer) and who set it: scan, manual or platform.
  • attribution: the model every report credits orders with (first_click, last_click or data_driven) and IP fallback attribution, see Attribution models.
  • fraud: whether the plan includes Fraud Detection, the sensitivity, the click limit, refund claims and Google Ads Auto Exclusion.
  • leads: every lead source with its key, kind, state (enabled, disabled or not_set_up) and label.
  • product_labels: the rule set of each custom label slot 0 to 4 with its number of rules.

Changing a section

Send only the fields to change; the others keep their values. The one exception is leads, whose enabled_sources is the complete list: read it first and send it back with your change. A body that breaks a rule answers 422 validation_failed and changes nothing.

curl -X PATCH -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  "https://axitrace.com/api/v1/workspaces/$WORKSPACE/settings/attribution" \
  -d '{"model": "data_driven"}'
{
  "data": {
    "workspace_id": "7a2b3c4d-0000-4000-8000-000000000011",
    "section": "attribution",
    "changed": true,
    "before": { "attribution": { "model": "last_click", "ip_fallback_enabled": true, "ip_fallback_lookback_days": 7 } },
    "after": { "attribution": { "model": "data_driven", "ip_fallback_enabled": true, "ip_fallback_lookback_days": 7 } },
    "warnings": []
  }
}
SectionFieldsWhat to know before changing it
collectiondatalayer_auto_tracking, datalayer_name, respect_dnt, consent_required, forward_when_consent_unknown, forward_unknown_confirmedReading the dataLayer on a store whose integration already reports purchases can count them twice. With consent required, events without consent are not forwarded to ad platforms. On a Shopify or IdoSell store, forward_when_consent_unknown stays off unless forward_unknown_confirmed is true. The answer says in sdk_config_pushed whether the tracking script picked up the change.
attributionmodel, ip_fallback_enabled, ip_fallback_lookback_days (1 to 30)Every model is stored, so switching back is instant and nothing is recomputed. Switching IP fallback on, or widening its window, backfills past orders.
generaltimezone (an IANA name such as Europe/Warsaw)Reports count days in this timezone. After a change the stored daily reports are rebuilt, so figures can look incomplete for a short while. A timezone set here is never overwritten by a connected store or ad platform.
leadsenabled_sources: the source keys from the leads sectionA source left out is switched off and its leads are no longer listed; a source switched on shows up to 90 days of its history at once. The answer adds sources_enabled and sources_disabled.

Product Labels rules

How rule sets work is explained in the Product Labels API and MCP reference, which also lists the read-only operations. Try a change with POST .../product-labels/preview before saving it.

  • Save a rule set: POST .../product-labels/rule-sets with {"rule_set": {...}}, the same JSON the preview takes and the rule sets list returns (slot, enabled, rules, default_label, anti_flap_days). Enabling a slot whose custom label your catalog already uses is refused unless confirm_slot_collision is true.
  • Apply a starter template: POST .../product-labels/templates/apply with {"template": "bestsellers"}, "unprofitable" or "zombies". The template is saved, enabled, in the lowest free slot; it is refused when all five slots hold an enabled rule set.
  • Refresh now: POST .../product-labels/refresh recalculates every label from the enabled rule sets instead of waiting for the daily refresh, and answers success and assignments_written. Merchant Center reads the new labels the next time it fetches the product feed.
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  "https://axitrace.com/api/v1/workspaces/$WORKSPACE/product-labels/templates/apply" \
  -d '{"template": "bestsellers"}'

Errors

  • 403 insufficient_scope: the token does not carry settings:read or settings:write.
  • 403 workspace_read_only: the role may not edit the workspace settings, or the workspace is a demo.
  • 403 plan_required: the plan does not include the API, or does not include Product Labels.
  • 404 workspace_not_found: the workspace does not exist or the token does not cover it.
  • 422 validation_failed: a field is unknown or out of range; errors names every field to fix and nothing was saved.