I am currently testing the Glean Agent REST API (Beta) and am encountering blocking issues with both the agents/runs/wait and agents/runs/stream endpoints. Despite following the documentation, I am unable to successfully execute an agent run via the API.
Here are the details for the two distinct errors I am seeing:
1. Issue with /runs/wait Endpoint
https://developers.glean.com/api/client-api/agents/create-and-wait-run
When attempting to create a run and wait for the response, the request fails with a server-side error.
- Endpoint:
POST https://{instance-name}-be.glean.com/rest/api/v1/agents/runs/wait - Status Code:
500 Internal Server Error - Error Message:
Something went wrong on my end, so I couldn't generate a response. Let's try that again, and if it keeps happening, reach out to your admin for help.
2. Issue with /runs/stream Endpoint
https://developers.glean.com/api/client-api/agents/create-and-stream-run
When attempting to use the streaming endpoint for the same agent, I receive a 404 status code accompanied by a permissions error message. This is unexpected as 404 usually implies "Not Found," but the body suggests an authorization issue.
- Endpoint:
POST https://{instance-name}-be.glean.com/rest/api/v1/agents/runs/stream - Status Code:
404 Not Found - Error Message:
Not enough user permissions
Context:
- Agent Status: The agent is published and works as expected in the Glean web UI.
- Auth: I am using a Bearer token that should have valid access.
Could you please investigate these endpoints? The combination of a 500 on the wait endpoint and a 404/Permission error on the stream endpoint suggests a potential backend configuration issue with the Beta API.
Requesting a resolution ASAP as this is blocking our integration.
Thanks!