Batch deletes multiple accounts. For accounts that fail to be deleted, error info is contained in the response. The method ignores accounts that do not exist or are duplicated in the request.
This method requires a Google OAuth 2.0 credential with properpermissions.
HTTP request
POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/accounts:batchDelete
IftenantIdis specified, the ID of the Google Cloud project that the Identity Platform tenant belongs to. Otherwise, the ID of the Google Cloud project that accounts belong to.
Authorization requires the followingIAMpermission on the specified resourcetargetProjectId:
firebaseauth.users.delete
Request body
The request body contains data with the following structure:
Whether to force deleting accounts that are not in disabled state. If false, only disabled accounts will be deleted, and accounts that are not disabled will be added to theerrors.
tenantId
string
If the accounts belong to an Identity Platform tenant, the ID of the tenant. If the accounts belong to a default Identity Platform project, the field is not needed.
[[["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-30 UTC."],[[["\u003cp\u003eThis method enables the batch deletion of multiple user accounts, with error details provided for accounts that fail to be deleted.\u003c/p\u003e\n"],["\u003cp\u003eThe request uses a \u003ccode\u003ePOST\u003c/code\u003e method to a specific URL, including a required \u003ccode\u003etargetProjectId\u003c/code\u003e path parameter, and requires specific IAM permissions such as \u003ccode\u003efirebaseauth.users.delete\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be in JSON format, and must contain the list of user IDs to be deleted through the \u003ccode\u003elocalIds\u003c/code\u003e field, with the option to delete accounts that are not disabled through the \u003ccode\u003eforce\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eThe method ignores any accounts that do not exist or are duplicated in the request.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization for this operation requires a Google OAuth 2.0 credential and one of the specified OAuth scopes, including \u003ccode\u003ehttps://www.googleapis.com/auth/identitytoolkit\u003c/code\u003e, \u003ccode\u003ehttps://www.googleapis.com/auth/firebase\u003c/code\u003e, or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.accounts.batchDelete\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nBatch deletes multiple accounts. For accounts that fail to be deleted, error info is contained in the response. The method ignores accounts that do not exist or are duplicated in the request.\n\nThis method requires a Google OAuth 2.0 credential with proper [permissions](https://cloud.google.com/identity-platform/docs/access-control).\n\n### HTTP request\n\n`POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/accounts:batchDelete`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [BatchDeleteAccountsResponse](/identity-platform/docs/reference/rest/v1/BatchDeleteAccountsResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/identitytoolkit`\n- `\n https://www.googleapis.com/auth/firebase`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]