List Agents" API call returns empty array for Vertex AI agents created in Agent Platform Studio

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:

  1. Initial Hypothesis: IAM Permissions. We started by ensuring our Service Account had all conceivable relevant roles: Dialogflow API Reader, Discovery Engine Viewer, and finally Vertex AI User (roles/aiplatform.user). We have since verified with gcloud projects get-iam-policy that these roles are correctly applied. The issue is not IAM permissions.

  2. Second Hypothesis: Dialogflow CX API. Since the new platform has roots in Dialogflow, we tried to access the agents via the dialogflow.googleapis.com API (v3).

    • List agents returned an empty array.
    • We manually extracted the Agent ID from the UI’s URL (.../edit/agent_XYZ) and tried to export it. This finally gave us a useful error: SERVICE_DISABLED.
  3. Third Hypothesis: Disabled API. We enabled the dialogflow.googleapis.com API using gcloud services enable. The export call then changed from SERVICE_DISABLED to a NOT_FOUND (404) error, stating the agent “does not exist in the project.” This led us to believe we were using the wrong API entirely.

  4. 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/agents is the one that returns an empty list. We assume global is the correct location because any other region (like us-central1) returns a 400 - AgentService not supported in this location error.

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?

1 Like