- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.LegacyExportAuditLastWeekAsCsvV2Response.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#body.aspect_1)
- [AuditSettingsRequestTypeEnum](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#AuditSettingsRequestTypeEnum)
- [ApiFile](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#ApiFile)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#ApiFile.SCHEMA_REPRESENTATION)

**Full name**: projects.locations.instances.legacySoarAudit.legacyExportAuditLastWeekAsCsvV2

Exports the audit logs for the last week as a CSV file for download. The export can be filtered by specific user names and categorized by either audit counts or operation distribution.

### HTTP request

`POST https://{endpoint}/v1alpha/{instance}/legacySoarAudit:legacyExportAuditLastWeekAsCsvV2`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/chronicle/docs/reference/rest#rest_endpoints).

### Path parameters

| Parameters ||
|---|---|
| `instance` | `string` Required. The name of the parent resource, which is the SecOps instance. Format: `projects/{project}/locations/{location}/instances/{instance}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "auditType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#AuditSettingsRequestTypeEnum`), "usersNames": [ string ] } ``` |

| Fields ||
|---|---|
| `auditType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#AuditSettingsRequestTypeEnum`)`` Optional. The type of the audit request. |
| `usersNames[]` | `string` Optional. The users names to export. |

### Response body

Response message for LegacySoarAuditService.LegacyExportAuditLastWeekAsCsvV2.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "payload": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#ApiFile`) } } ``` |

| Fields ||
|---|---|
| `payload` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacySoarAudit/legacyExportAuditLastWeekAsCsvV2#ApiFile`)`` Required. The ApiFile response. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/chronicle`

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `instance` resource:

- `chronicle.legacySoarAudits.legacySoarAudit`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## AuditSettingsRequestTypeEnum

Enum that represents the type of the audit settings request.

| Enums ||
|---|---|
| `GROUP` | Group. |
| `COUNT` | Count. |

## ApiFile

Message that represents a file.

| JSON representation |
|---|
| ``` { "fileName": string, "blob": string } ``` |

| Fields ||
|---|---|
| `fileName` | `string` Optional. File name. |
| `blob` | `string (https://developers.google.com/discovery/v1/type-format format)` File blob. A base64-encoded string. |