- [HTTP request](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#body.request_body)
- [Response body](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#body.aspect)
- [InstancesTruncateLogRequest](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#InstancesTruncateLogRequest)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#InstancesTruncateLogRequest.SCHEMA_REPRESENTATION)
- [TruncateLogContext](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#TruncateLogContext)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#TruncateLogContext.SCHEMA_REPRESENTATION)
- [Examples](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#examples)
- [Try it!](https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#try-it)

Truncate MySQL general and slow query log tables MySQL only.

### HTTP request

`POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog`

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

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` Project ID of the Cloud SQL project. |
| `instance` | `string` Cloud SQL instance ID. This does not include the project ID. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#InstancesTruncateLogRequest`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudsql`
- `
  https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/sqlservice.admin`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## InstancesTruncateLogRequest

Instance truncate log request.

| JSON representation |
|---|
| ``` { "truncateLogContext": { object (`https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#TruncateLogContext`) } } ``` |

| Fields ||
|---|---|
| `truncateLogContext` | ``object (`https://docs.cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/truncateLog#TruncateLogContext`)`` Contains details about the truncate log operation. |

## TruncateLogContext

Database Instance truncate log context.

| JSON representation |
|---|
| ``` { "kind": string, "logType": string } ``` |

| Fields ||
|---|---|
| `kind` | `string` This is always `sql#truncateLogContext`. |
| `logType` | `string` The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and `MYSQL_SLOW_TABLE`. |