get
https://example.com/api/v2/stream/agent_ask//status
Polls an agent turn's status without holding the SSE stream open
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Returns where a turn has got to, without holding a stream open.
This is for clients that cannot consume SSE — a serverless function that would time out, a webhook worker, a batch job. Fire agent_ask, keep the threadResponseId from the init frame, disconnect, then poll here until the turn settles and read it with Get a turn's result.
Basic Usage
GET /v2/projects/../stream/agent_ask/7/status{
"threadResponseId": 7,
"threadId": 5,
"status": "FINISHED"
}Status values
| Status | Meaning |
|---|---|
NOT_STARTED | The turn is provisioning or still running. Keep polling. |
FINISHED | The turn completed. Read it with Get a turn's result. |
FAILED | The turn errored. The error event is in the result. |
INTERRUPTED | The turn was cancelled, or the client disconnected mid-turn. |
Polling pattern
// 1. Start the turn and read only the init frame, then close the connection.
const { threadResponseId } = await startTurnAndReadInit({
projectId: 1,
question: 'Which 5 states have the most customers?',
});
// 2. Poll until the turn settles.
let status = 'NOT_STARTED';
while (status === 'NOT_STARTED') {
await sleep(2000);
({ status } = await getStatus(threadResponseId));
}
// 3. Read the whole turn back.
const { events } = await getResult(threadResponseId);The API key is authorized against the project that owns the turn, so you do not pass a project id here.
