Try the MCP server for Google Analytics. Install from
GitHub, and see the
announcement for more details.
Method: accounts.delete
Stay organized with collections
Save and categorize content based on your preferences.
Marks target Account as soft-deleted (ie: "trashed") and returns it.
This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI.
If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772
Returns an error if the target is not found.
HTTP request
DELETE https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
name |
string
Required. The name of the Account to soft-delete. Format: accounts/{account} Example: "accounts/100"
|
Request body
The request body must be empty.
Response body
If successful, the response body is an empty JSON object.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/analytics.edit
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-14 UTC.
[null,null,["Last updated 2025-01-14 UTC."],[[["\u003cp\u003eMarks an account as soft-deleted, effectively sending it to the trash but allowing for restoration before permanent deletion.\u003c/p\u003e\n"],["\u003cp\u003ePermanently deletes the account and all associated resources after a certain expiration time if not restored.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003eanalytics.edit\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eUses a \u003ccode\u003eDELETE\u003c/code\u003e request to the specified endpoint with the account ID as a path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should be empty, and a successful operation will return an empty response body.\u003c/p\u003e\n"]]],["This API endpoint soft-deletes an account by its name using a `DELETE` request to `https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*}`. The `name` path parameter (e.g., \"accounts/100\") is required. The request body must be empty. Upon successful deletion, it returns an empty JSON object. The operation is irreversible via the API, requiring UI restoration before a certain time to prevent permanent data loss. It needs `https://www.googleapis.com/auth/analytics.edit` authorization. An error is returned if the target account is not found.\n"],null,["# Method: accounts.delete\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nMarks target Account as soft-deleted (ie: \"trashed\") and returns it.\n\nThis API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI.\n\nIf the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. \u003chttps://support.google.com/analytics/answer/6154772\u003e\n\nReturns an error if the target is not found.\n\n### HTTP request\n\n`DELETE https://analyticsadmin.googleapis.com/v1beta/{name=accounts/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The name of the Account to soft-delete. Format: accounts/{account} Example: \"accounts/100\" |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/analytics.edit`"]]