To answer your questions:
Is there a supported way to access Dialogflow CX Analytics programmatically from outside Google Cloud (for example, using service account credentials)?
No, there is no official, publicly documented API for directly accessing the aggregated analytics metrics shown in the Dialogflow CX console. The request URL you found is using v3alpha1 that can only be used by allowlisted projects.
Can I get the same analytics data from BigQuery instead, and if so, how do I set that up?
Yes, exporting Dialogflow CX interaction logs to Google BigQuery is the recommended and supported method. This provides raw, detailed conversation data (including full request/response JSONs) for custom analysis.
See this link for more details on how to set up.
Is there any configuration I need to adjust (like permissions) to make this work?
Yes, here are the permission you need:
For Dialogflow CX to export: The Dialogflow CX service agent needs the Dialogflow Service Agent
role (roles/dialogflow.serviceAgent
).
For your external application to query BigQuery: Your service account needs BigQuery Data Viewer
and BigQuery Job User
roles. Ensure billing is enabled for your project.
You may also try using a different version of the Dialogflow CX API since v3alpha1 only works in allowlisted projects.