Hello fellow developers,
I’m hoping someone in the community can shed some light on a very persistent issue I’m facing with the new Agent Platform Studio.
The Core Problem: I can create and see agents perfectly fine in the Agent Platform Studio web UI. However, any attempt to programmatically list these agents via any API results in an empty array [], completely blocking our CI/CD and automation efforts.
Our Troubleshooting Journey (What We’ve Tried):
We’ve been debugging this for a while and have gone down several rabbit holes. Here is a detailed summary of our steps to avoid redundant suggestions:
-
Initial Hypothesis: IAM Permissions. We started by ensuring our Service Account had all conceivable relevant roles:
Dialogflow API Reader,Discovery Engine Viewer, and finallyVertex AI User(roles/aiplatform.user). We have since verified withgcloud projects get-iam-policythat these roles are correctly applied. The issue is not IAM permissions. -
Second Hypothesis: Dialogflow CX API. Since the new platform has roots in Dialogflow, we tried to access the agents via the
dialogflow.googleapis.comAPI (v3).List agentsreturned an empty array.- We manually extracted the Agent ID from the UI’s URL (
.../edit/agent_XYZ) and tried toexportit. This finally gave us a useful error:SERVICE_DISABLED.
-
Third Hypothesis: Disabled API. We enabled the
dialogflow.googleapis.comAPI usinggcloud services enable. Theexportcall then changed fromSERVICE_DISABLEDto aNOT_FOUND (404)error, stating the agent “does not exist in the project.” This led us to believe we were using the wrong API entirely. -
Current Hypothesis: Vertex AI API. We are now certain these are Vertex AI resources. We are trying to list them via
aiplatform.googleapis.com.- The call
GET https://global-aiplatform.googleapis.com/v1beta1/projects/YOUR_PROJECT_ID/locations/global/agentsis the one that returns an empty list. We assumeglobalis the correct location because any other region (likeus-central1) returns a400 - AgentService not supported in this locationerror.
- The call
Conclusion:
We are stuck. It seems that agents created in the Agent Platform Studio are not correctly being registered with the list method of the Vertex AI API in the global location.
Has anyone else managed to successfully list agents created in the new platform via an API call? Is there a different API, a specific header, or a configuration step that we are missing?