Operations
Get operation
Read an operation’s status and result. Optionally wait for it to finish.
GET
Returns the operation at once, or, with
wait, holds the request until the operation finishes or wait seconds pass, whichever comes first. A long-poll with wait=20 replaces about ten short polls and never runs past the 29-second request limit.
Every endpoint that starts long-running work returns an operation. Its type says what the work is:
Authentication
Send an API key, or an OAuth access token, as a bearer token in theAuthorization header. A token needs the read scope of the operation’s type, from the table above, such as sessions:read for a question. Without it the call returns 403 with "error": "insufficient_scope" and a WWW-Authenticate header naming the scope.
Path parameters
Query parameters
Seconds to wait for the operation to finish, from
0 to 20. The response comes back as soon as it finishes. When your organisation already has many requests waiting, the response comes back at once; ask again after poll_after_seconds.true answers an operation that is still queued or running with 202 Accepted, a Location header and a
Retry-After header in seconds. Location is the operation’s Get operation
URL, with respond_async=true. Poll it until the response is not 202; that response is the finished operation.
A succeeded operation is a 200. A failed or cancelled one is a 422 with the operation as its body, so an
automation’s step fails instead of passing on a result that is not there. Power Automate and Logic Apps follow
this pattern by themselves. Pass true to turn it on. A value that is not a boolean is a 400, and a call that
starts work then starts nothing.Response
Returns200 with the operation, whether or not it has finished, unless respond_async is true: then a running operation is a 202 and a failed or cancelled one a 422. queued and running mean ask again after poll_after_seconds. When status is succeeded, result holds the fields the table above lists for the operation’s type. For a question, that is its question_id, session_id, status, answer, reason and attachments (file ids).
resource.id is null until the work has created its resource, such as the session a draft runs in. Numbers in result and progress are JSON numbers. A finished operation keeps its last progress.