# Payload shapes — captured from a live test org (2026-08-17) Captured against a live TPM test org (namespaced install, org apiVersion `68.0`). **API version note:** `v64.0` (assumed in the original SKILL.md draft) returns `DOWNGRADE_VERSION_ERROR` on `GET /tableau/visualizations/{id}` in this org — "uses features that aren't available in this version of the API." The initial capture pass used `v68.0` (the org's own apiVersion at the time). **Per standing instruction, `scripts/clone-tpe-dashboards.js` and SKILL.md now pin every call to `v67.0` instead of resolving the org's own apiVersion** — the `v68.0` examples below reflect the original discovery capture and remain valid shape references, but the driver script itself always sends `v67.0`. ## How to find the real artifact ids — don't guess names, walk the app's asset list `GET /services/data/v68.0/app-framework/apps?templateSourceId=sfdc_internal__Trade_Promotion_Effectiveness` returns the installed TPE_Analytics app(s) (`applicationStatus: "SuccessStatus"`). Each app object has an `assetUrl` (`/services/data/v68.0/app-framework/apps/{appId}/assets`). GET that — it returns every asset the install created, typed and named: ```json {"appId":"...", "assets":[ {"id":"1zB...","type":"Dataspace", ...}, {"id":"1zB...","type":"Workspace","templateAssetSourceName":"Trade_Promotion_Effectiveness_Analytics", ...}, {"id":"1zB...","type":"SemanticModel","templateAssetSourceName":"Trade_Promotion_Management_Analytics", ...}, {"id":"1zB...","type":"SemanticModel","templateAssetSourceName":"Extended_Trade_Promotion_Management_Analytics","assetIdOrName":"2SMVW000000BkJT4A0","assetIdOrName2":"Extended_Trade_Promotion_Managemen_4a9"}, {"id":"1zB...","type":"Visualization","templateAssetSourceName":"Promotion_Performance_Measures","assetIdOrName":"1AKVW000004YvHl4AK", ...}, {"id":"1zB...","type":"Visualization","templateAssetSourceName":"Tactic_Performance_Measures", ...}, {"id":"1zB...","type":"Dashboard","templateAssetSourceName":"PromotionAnalysis","assetIdOrName":"0TrVW0000004Fi10AE", ...}, {"id":"1zB...","type":"Dashboard","templateAssetSourceName":"TacticAnalysis","assetIdOrName":"0TrVW0000004Fi20AE", ...}, ... 17 more Visualization assets ... ]} ``` Each asset's `assetIdOrName` is the real record Id to `GET` directly (e.g. `/tableau/visualizations/{assetIdOrName}`, `/tableau/dashboards/{assetIdOrName}`, or `/ssot/semantic/models/{assetIdOrName}`). This is the authoritative way for Phase 0 to resolve "which Extended SDM / which base dashboards / which base visualizations" for a given org — never hardcode an id or api-name across orgs. ## Extended TPM Analytics SDM — GET the whole model, not per-parameter `GET /services/data/v68.0/ssot/semantic/models/{modelId}` (e.g. `2SMVW000000BkJT4A0`) returns the **entire model** in one response — there is no working single-parameter GET confirmed; read the whole model and index into `semanticParameters[]` / `semanticCalculatedMeasurements[]` by `apiName`. Top-level keys of interest: `apiName`, `semanticParameters`, `semanticCalculatedMeasurements`, `semanticCalculatedDimensions`, `semanticDataObjects`, `semanticMetrics`, `semanticRelationships`. ### `semanticParameters[]` — exactly 5 entries in the base Extended model, one per slot ```json { "allowedValues": [ {"displayName": "Actual Gross Profit", "value": "PATP"}, {"displayName": "Actual Gross Revenue", "value": "TARE"}, {"displayName": "Actual Incr. Gross Revenue", "value": "PAIR"}, {"displayName": "Actual Non-Promo Spend", "value": "PATL"}, {"displayName": "Actual Profit Margin %", "value": "PAPM"}, {"displayName": "Actual Total Promo Spend", "value": "PAPS"}, {"displayName": "Actual Total Volume", "value": "TAVO"}, {"displayName": "LE Gross Profit", "value": "PLTP"}, {"displayName": "LE Gross Revenue", "value": "PLTR"}, {"displayName": "LE Incr. Gross Revenue", "value": "PLIR"}, {"displayName": "LE Non-Promo Spend", "value": "PLTL"}, {"displayName": "LE Total Promo Spend", "value": "PLPS"}, {"displayName": "LE Total Volume", "value": "PLTV"} ], "apiName": "Promotion_Measure_1_prm", "baseModelApiName": "Trade_Promotion_Management_Analyti_4a9", "dataType": "Text", "defaultValue": "Actual Total Promo Spend", "id": "1DOVW000000pMdP4AU", "label": "Promotion Measure 1", "type": "List", "values": [] } ``` **Corrected understanding — this is NOT a single measure-code field to overwrite.** A slot parameter is a **List** parameter whose `allowedValues` is the full menu of KPI measure codes the end user can pick at runtime (`value` = 4-char measure code, `displayName` = label shown in the UI), and `defaultValue` is which `displayName` is preselected. The 13 entries above already cover the base model's standard KPIs — these are **not customer input**, they're what ships. **What "customer measure code + display name" actually means for this skill:** the customer is either (a) picking a **different existing** `allowedValues` entry as the new default (a pure `defaultValue` swap, no new entry needed), or (b) introducing a **genuinely new** KPI not in the base 13, which requires **appending** a new `{displayName, value}` entry to `allowedValues` *and* setting `defaultValue` to that new `displayName`. Either way, the underlying `value` (measure code) must resolve against real data already reachable from the semantic model (the `Measure_Definition` dimension referenced by the calculated measurement below) — this skill does not create that underlying data; it assumes `setup-rtr-datacloud-export`/data-kit setup already populated it. Never guess whether a code is "new" — check it against the base `allowedValues` first. ### `semanticCalculatedMeasurements[]` — the field a visualization actually references Each slot has a matching calculated measurement (`Promotion_Measure_1_value`, `Promotion_Measure_2_value`, `Promotion_Measure_3_value`, and presumably `Tactic_Measure_1_value`, `Tactic_Measure_2_value` on the Tactic side — confirm both dashboards' sets during a real run): ```json { "aggregationType": "Sum", "apiName": "Promotion_Measure_1_value", "baseModelApiName": "Trade_Promotion_Management_Analyti_4a9", "dataType": "Number", "directionality": "Up", "expression": "IF [Parameters].[Promotion_Measure_1_prm] == [Measure_Definition].[Measure_Code] THEN [Promotion_Product_Measure].[Measure_Value]\nELSE null\nEND", "id": "1DOVW000000pMct4AE", "isOverrideBase": false, "isQueryable": "Queryable", "isVisible": true, "label": "Promotion Measure 1", "level": "Row", "sentiment": "SentimentTypeUpIsGood", "shouldTreatNullsAsZeros": false, "totalAggregationType": "Sum" } ``` **This is the critical corrected finding versus the original SKILL.md draft: visualizations and dashboard `parameter` widgets reference the *parameter* directly by `apiName` (`Promotion_Measure_1_prm`), but visualizations reference the *calculated measurement* by `apiName` (`Promotion_Measure_1_value`) — two different artifacts, two different apiNames, linked to each other only through the measurement's `expression` string** (`[Parameters].[Promotion_Measure_1_prm]`). **Cloning a slot means cloning BOTH the parameter and its calculated measurement** — the cloned measurement's `expression` must be rewritten to reference the cloned parameter's new apiName, not the base one. Create endpoints (unverified against a live POST in this pass — confirm request-body shape matches the GET shape above before relying on it, per SKILL.md Phase 0 Rules): - `POST /services/data/v68.0/ssot/semantic/models/{modelApiName}/parameters` - `POST /services/data/v68.0/ssot/semantic/models/{modelApiName}/calculated-measurements` ## Visualization — `GET /services/data/v68.0/tableau/visualizations/{id}` Top-level keys: `createdBy`, `createdDate`, `dataSource`, `description`, `fields`, `id`, `interactions`, `label`, `lastModifiedBy`, `lastModifiedDate`, `name`, `permissions`, `sourceVersion`, `templateSource`, `view`, `visualSpecification`, `workspace`. - `dataSource.name` — the semantic model's apiName (`Extended_Trade_Promotion_Managemen_4a9`). Stays the same for a customer clone (same Extended model, not a new one). - `fields.{F1..Fn}` — each field entry may have a `fieldName` pointing at a calculated measurement apiName (e.g. `"fieldName": "Promotion_Measure_1_value"`) plus a `label` that's a cosmetic string literally embedding the *parameter's* **label** (not its apiName), e.g. `"<[Parameters].[Promotion Measure 1]>"` (stored HTML-double-escaped as `"&lt;[Parameters].[Promotion Measure 1]&gt;"`). **Confirmed live this must be updated, not left as-is — see the `Cust5` section below.** An apiName-only string replace never touches this text (it contains no apiName substring), so it silently keeps showing the base parameter's label after a clone unless the parameter's label is *also* replaced inside the `[Parameters].[