Important: It is not always possible to restore a deleted service account. Use this method only as a last resort.
After you delete a service account, IAM permanently removes the service account 30 days later. There is no way to restore a deleted service account that has been permanently removed.
HTTP request
POST https://iam.googleapis.com/v1/{name=projects/*/serviceAccounts/*}:undelete
As an alternative, you can use the - wildcard character instead of the project ID:
projects/-/serviceAccounts/{EMAIL_ADDRESS}
projects/-/serviceAccounts/{UNIQUE_ID}
When possible, avoid using the - wildcard character, because it can cause response messages to contain misleading error codes. For example, if you try to access the service account projects/-/serviceAccounts/fake@example.com, which does not exist, the response contains an HTTP 403 Forbidden error instead of a 404 Not
Found error.
Authorization requires the following IAM permission on the specified resource name:
iam.serviceAccounts.undelete
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
[[["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-05-21 UTC."],[[["\u003cp\u003eThis webpage details the process of restoring a deleted service account, with the caveat that it is not always possible and should be used as a last resort.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request to restore a service account is a \u003ccode\u003ePOST\u003c/code\u003e request to the URL \u003ccode\u003ehttps://iam.googleapis.com/v1/{name=projects/*/serviceAccounts/*}:undelete\u003c/code\u003e, and the request body must be empty.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ename\u003c/code\u003e path parameter is required and can accept various formats, including using wildcards, to specify the service account to restore.\u003c/p\u003e\n"],["\u003cp\u003eUpon a successful request, the response body will contain a \u003ccode\u003erestoredAccount\u003c/code\u003e field with metadata for the restored service account.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this operation requires either the \u003ccode\u003ehttps://www.googleapis.com/auth/iam\u003c/code\u003e or the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.serviceAccounts.undelete\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.UndeleteServiceAccountResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Examples](#examples)\n- [Try it!](#try-it)\n\nRestores a deleted [ServiceAccount](/iam/docs/reference/rest/v1/projects.serviceAccounts#ServiceAccount).\n\n**Important:** It is not always possible to restore a deleted service account. Use this method only as a last resort.\n\nAfter you delete a service account, IAM permanently removes the service account 30 days later. There is no way to restore a deleted service account that has been permanently removed.\n\n### HTTP request\n\n`POST https://iam.googleapis.com/v1/{name=projects/*/serviceAccounts/*}:undelete`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/iam`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]