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 proper permissions.
HTTP request
POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/tenants/{tenantId}/accounts:batchDelete
If tenantId is 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 following IAM permission on the specified resource targetProjectId:
firebaseauth.users.delete
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.
Request body
The request body contains data with the following structure:
JSON representation
{"localIds": [string],"force": boolean}
Fields
localIds[]
string
Required. List of user IDs to be deleted.
force
boolean
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 the errors.
[[["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 API method facilitates the batch deletion of multiple user accounts, ignoring non-existent or duplicate accounts specified in the request.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful deletions return a response body, while errors for specific accounts are included in the same response; only disabled accounts will be deleted unless the \u003ccode\u003eforce\u003c/code\u003e field is \u003ccode\u003etrue\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe method uses a POST request to a specific URL, which includes parameters for \u003ccode\u003etargetProjectId\u003c/code\u003e and \u003ccode\u003etenantId\u003c/code\u003e, with \u003ccode\u003etargetProjectId\u003c/code\u003e being the ID of the project the accounts belong to and \u003ccode\u003etenantId\u003c/code\u003e the ID of the tenant, if applicable.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be in JSON format, including a list of user IDs (\u003ccode\u003elocalIds\u003c/code\u003e) to be deleted and an optional boolean \u003ccode\u003eforce\u003c/code\u003e field that will determine if it will delete non-disabled accounts.\u003c/p\u003e\n"],["\u003cp\u003eProper authorization is required, using a Google OAuth 2.0 credential with specified IAM permissions and one of three listed OAuth scopes.\u003c/p\u003e\n"]]],[],null,["# Method: projects.tenants.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}/tenants/{tenantId}/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)."]]