Stay organized with collections
Save and categorize content based on your preferences.
Some methods of the Dialogflow API return a long-running operation.
These methods are asynchronous,
and the operation may not be completed when the method returns a response.
You can check on the status or cancel operations.
Get an operation status
The following shows how to poll an operation's status.
If you have many operations to check,
you should rate limit your calls or
use the list method instead.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThe Dialogflow API uses long-running operations for asynchronous tasks, which may not be completed when the method returns.\u003c/p\u003e\n"],["\u003cp\u003eYou can check the status of an operation by calling the \u003ccode\u003eget\u003c/code\u003e method of the \u003ccode\u003eOperations\u003c/code\u003e type, using the operation's ID.\u003c/p\u003e\n"],["\u003cp\u003eWhen checking many operations, it is recommended to either rate limit calls or use the \u003ccode\u003elist\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eTo interact with the API, you'll need to replace placeholders like \u003ccode\u003ePROJECT_ID\u003c/code\u003e, \u003ccode\u003eOPERATION_ID\u003c/code\u003e, and \u003ccode\u003eAPI_VERSION\u003c/code\u003e in the provided request examples.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elist\u003c/code\u003e and \u003ccode\u003ecancel\u003c/code\u003e methods of the \u003ccode\u003eOperations\u003c/code\u003e type allow for listing and canceling operations, but \u003ccode\u003elist\u003c/code\u003e may contain irrelevant results.\u003c/p\u003e\n"]]],[],null,["# Long-running operations\n\nSome methods of the Dialogflow API return a long-running operation.\nThese methods are asynchronous,\nand the operation may not be completed when the method returns a response.\nYou can check on the status or cancel operations.\n\nGet an operation status\n-----------------------\n\nThe following shows how to poll an operation's status.\nIf you have many operations to check,\nyou should rate limit your calls or\nuse the [list](#list) method instead. \n\n### REST\n\nCall the `get` method for the\n[`Operations`](/dialogflow/docs/reference/common-types#operations)\ntype.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your GCP project ID\n- \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: your operation ID\n- \u003cvar translate=\"no\"\u003eAPI_VERSION\u003c/var\u003e: either `v2` or `v2beta1`\n\n\nHTTP method and URL:\n\n```\nGET https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: PROJECT_ID\" \\\n \"https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\"\n```\n\n#### PowerShell (Windows)\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\"; \"x-goog-user-project\" = \"PROJECT_ID\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://dialogflow.googleapis.com/API_VERSION/projects/my-gcp-project/operations/OPERATION_ID\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"name\": \"projects/PROJECT_ID/operations/some-operation-name-OPERATION_ID\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.dialogflow.API_VERSION.SomeOperationType\",\n \"state\": \"DONE\"\n },\n \"done\": true,\n ...\n}\n```\n\nWhen the operation has completed,\na `state` value of `SUCCESSFUL` is returned.\n\n\u003cbr /\u003e\n\nList and cancel operations\n--------------------------\n\nIn addition to getting a specific operation,\nyou can list and cancel operations.\nSee the `list` and `cancel` methods for the\n[`Operations`](/dialogflow/docs/reference/common-types#operations)\ntype.\n\nThe `list` results may contain operations unrelated to your current task,\nso be sure to filter the results."]]