Rajat Hans
11/21/2025, 11:32 AMkapa.ai
11/21/2025, 11:33 AMbash curl $HOST_URL/api/v1/actions/dataSources/<data-source-id>/uploadNotification -X POST \ -H "Authorization: Bearer $API_TOKEN" or python from gooddata_sdk import GoodDataSdk sdk = GoodDataSdk.create(host, token) sdk.catalog_data_source.register_upload_notification(data_source_id="<data-source-id>") [[Invalidate cache API](https://www.gooddata.com/docs/cloud/api-and-sdk/api/gooddata-cn-oapi-all-raw-schema.json); [Python register_upload_notification](https://www.gooddata.com/docs/python-sdk/latest/data/data-source/register_upload_notification/); [Reload cached data](https://www.gooddata.com/docs/cloud/connect-data/cache-management/reload-cached-data/)] ### Step 2 – Warm up cache by executing AFM To warm up cache you must execute queries. The available API for this is the AFM “computeReport” / result pair: 1. Execute endpoint – triggers computation and populates FlexCache: bash curl $HOST_URL/api/v1/actions/workspaces/<workspace_id>/execution/afm/execute \ -H 'Authorization: Bearer $API_TOKEN' \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "resultSpec": { ... }, "execution": { ... }, "settings": {} }' This is POST /api/v1/actions/workspaces/{workspaceId}/execution/afm/execute. [[AFM example](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/#example); [computeReport method](https://www.gooddata.com/docs/cloud/api-and-sdk/api/gooddata-cn-oapi-all-raw-schema.json); [Access raw data](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/); [FlexCache – final query results](https://www.gooddata.com/docs/cloud/connect-data/cache-management/#flexcache)] 2. Result endpoint – fetches the computed data by resultId (also uses / populates cache). [[Access raw data](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/); [FlexCache – final query results](https://www.gooddata.com/docs/cloud/connect-data/cache-management/#flexcache)] ### How to mirror an insight’s query The sources here do not document an API that, given an insight ID, returns its AFM, so I cannot show a supported “execute insight by ID” REST call. The documented options are: - Use GoodData.UI hooks / components (useInsightDataView, ExecuteInsight, etc.) to execute an existing Analytical Designer visualization in a React app (which also warms the cache). [[Create custom visualizations](https://www.gooddata.com/docs/gooddata-ui/latest/learn/visualize_data/create_custom_visualizations/)] - Use the AFM API directly with a manually constructed AFM that matches the insight’s definition. [[Access raw data](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/)] In short: - Invalidate cache: POST /api/v1/actions/dataSources/{dataSourceId}/uploadNotification. - Warm cache: execute AFM queries via POST /api/v1/actions/workspaces/{workspaceId}/execution/afm/execute (or via GoodData.UI executions for your insights).Rajat Hans
11/21/2025, 11:45 AMRajat Hans
11/21/2025, 11:47 AMkapa.ai
11/21/2025, 11:47 AMkapa.ai
11/21/2025, 11:47 AMPOST /insights/{insightId}/execute). The documented computation APIs all work with AFM executions, not with insight IDs. [[Access raw data](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/)] What you can do based on the docs you shared: 1. Execute AFM directly to warm cache Use the AFM execute endpoint (this is what fills FlexCache): [[Access raw data – example](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/#example); [FlexCache](https://www.gooddata.com/docs/cloud/connect-data/cache-management/#flexcache)] bash curl $HOST_URL/api/v1/actions/workspaces/<workspace_id>/execution/afm/execute \ -H 'Authorization: Bearer $API_TOKEN' \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "resultSpec": { ... }, "execution": { ... }, "settings": {} }' In Python SDK this is compute_report(workspace_id, afm_execution). [[compute_report](https://github.com/gooddata/gooddata-python-sdk/blob/master/gooddata-api-client/docs/ActionsApi.md)] 2. But you must already have the AFM for each insight The sources you provided do not describe any API like “get AFM by insight ID” or “execute insight by ID”, nor a way to transform an insight ID into an AFM payload on the server side. They only show: - How to run AFM (compute_report / /execution/afm/execute) [[Access raw data](https://www.gooddata.com/docs/cloud/api-and-sdk/api/access_raw_data_through_api/)] - How to debug AFM / SQL (explain_afm / explainAFM) [[explain_afm](https://github.com/gooddata/gooddata-python-sdk/blob/master/gooddata-api-client/docs/ActionsApi.md); [explainAFM](https://www.gooddata.com/docs/cloud/api-and-sdk/api/gooddata-cn-oapi-all-raw-schema.json)] - How to inspect an existing execution result by resultId (retrieve_execution_metadata) [[retrieve_execution_metadata](https://github.com/gooddata/gooddata-python-sdk/blob/master/gooddata-api-client/docs/ActionsApi.md); [retrieveExecutionMetadata](https://www.gooddata.com/docs/cloud/api-and-sdk/api/gooddata-cn-oapi-all-raw-schema.json)] Because of that, with only a list of insight IDs, the knowledge sources do not describe a supported way to: - Resolve those IDs to AFM definitions via REST, and then - Call /execution/afm/execute for each. So, within the scope of the provided documentation: - You can warm up cache only by executing AFM queries (or opening the insights in UI / GoodData.UI, which triggers those AFMs behind the scenes). [[FlexCache](https://www.gooddata.com/docs/cloud/connect-data/cache-management/#flexcache); [Reload cached data](https://www.gooddata.com/docs/cloud/connect-data/cache-management/reload-cached-data/)] - There is no documented API here to go from “insight ID → AFM” or “insight ID → execute” that you could use directly with just a list of IDs. If you need to proceed purely by API, you would need an additional, insight-related endpoint or SDK helper to load each insight definition and convert it to AFM, but this is not covered in the materials you shared.Rajat Hans
11/21/2025, 12:05 PMMichal Hauzírek
11/21/2025, 12:11 PM