# Method: query.removeActivity

- [HTTP request](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#body.response_body)
- [Authorization scopes](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#body.aspect)
- [UserActivity](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity.SCHEMA_REPRESENTATION)
- [QueryActivity](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity)
  - [JSON representation](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#try-it)

Provides functionality to remove logged activity for a user.

**Note:** This API requires a standard end user account to execute. A service account can't perform Remove Activity requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/workspace/cloud-search/docs/guides/delegation/).

### HTTP request

`POST https://cloudsearch.googleapis.com/v1/query:removeActivity`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "userActivity": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity`) }, "requestOptions": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/RequestOptions`) } } ``` |

| Fields ||
|---|---|
| `userActivity` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity`)`` User Activity containing the data to be deleted. |
| `requestOptions` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/RequestOptions`)`` Request options, such as the search application and clientId. |

### Response body

If successful, the response body is empty.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud_search.query`
- `https://www.googleapis.com/auth/cloud_search`

For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent).

## UserActivity

User's single or bulk query activity. This can be a logging query or deletion query.

| JSON representation |
|---|
| ``` { "queryActivity": { object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity`) } } ``` |

| Fields ||
|---|---|
| Union field `activity`. `activity` can be only one of the following: ||
| `queryActivity` | ``object (`https://developers.google.com/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity`)`` Contains data which needs to be logged/removed. |

## QueryActivity

Details about a user's query activity.

| JSON representation |
|---|
| ``` { "query": string } ``` |

| Fields ||
|---|---|
| `query` | `string` User input query to be logged/removed. |