Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to determine the completion status of asynchronous
methods. These methods return a long-running
operation that provides
information about the progress of the operation and its final status.
The following methods return a long-running operation:
CreateKey
UpdateKey
DeleteKey
UndeleteKey
When you make a request to one of these methods, on success, the method returns
an operation identifier in the name field, which represents ongoing work on
the server, for example:
To poll an operation, we recommended that you repeatedly invoke the
operations.get method with a 10-second backoff until the response includes
"done": true:
[[["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-25 UTC."],[[["\u003cp\u003eAsynchronous methods, such as \u003ccode\u003eCreateKey\u003c/code\u003e, \u003ccode\u003eUpdateKey\u003c/code\u003e, \u003ccode\u003eDeleteKey\u003c/code\u003e, and \u003ccode\u003eUndeleteKey\u003c/code\u003e, return a long-running operation.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful request, these methods provide an operation identifier in the \u003ccode\u003ename\u003c/code\u003e field, indicating ongoing server-side work.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eoperations.get\u003c/code\u003e method, using the operation identifier from the \u003ccode\u003ename\u003c/code\u003e field, allows you to check the status of the operation.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to repeatedly use the \u003ccode\u003eoperations.get\u003c/code\u003e method with a 10-second backoff until the response shows \u003ccode\u003e"done": true\u003c/code\u003e, indicating completion.\u003c/p\u003e\n"]]],[],null,["# Polling long-running operations\n\nThis page describes how to determine the completion status of asynchronous\nmethods. These methods return a long-running\n[operation](/api-keys/docs/reference/rest/v2/operations) that provides\ninformation about the progress of the operation and its final status.\n\nThe following methods return a long-running operation:\n\n- `CreateKey`\n- `UpdateKey`\n- `DeleteKey`\n- `UndeleteKey`\n\nWhen you make a request to one of these methods, on success, the method returns\nan operation identifier in the `name` field, which represents ongoing work on\nthe server, for example: \n\n```text\n{\n \"name\": \"operations/akmf.6573437d-47c1-42c4-b817-0562f514f6ff\"\n}\n```\n\nTo check the status of the operation, use the\n[`operations.get`](/api-keys/docs/reference/rest/v2/operations/get) method\nwith the value from the `name` field: \n\n```text\n gcurl https://apikeys.googleapis.com/v2/operations/akmf.6573437d-47c1-42c4-b817-0562f514f6ff\n```\n\nTo poll an operation, we recommended that you repeatedly invoke the\n`operations.get` method with a 10-second backoff until the response includes\n`\"done\": true`: \n\n```carbon\n{\n \"name\": \"operations/akmf.6573437d-47c1-42c4-b817-0562f514f6ff\",\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.api.apikeys.v2.Key\",\n \"name\": \"projects/103621867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2\",\n \"keyString\": \"----REDACTED----\",\n \"createTime\": \"2019-02-04T23:56:28.531Z\",\n \"uid\": \"b7ff1f9f-8275-410a-94dd-3855ee9b5dd2\",\n \"updateTime\": \"2019-02-04T23:56:28.531Z\",\n \"restrictions\": {\n \"browserKeyRestrictions\": {\n }\n },\n \"etag\": \"k0bsYGkIvSxDVwNxyw49NQ==\"\n }\n}\n```"]]