> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macroscope.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get log export

> The workspace's S3 log export destination, streams and state

Returns the workspace's [S3 log export](https://docs.macroscope.com/s3-exports), as configured under **Log Export** in workspace settings: its destination, which streams it exports, and its state. The role ARN is always redacted; the full ARN is not available through the API. To set up an export or change its destination, use [Configure log export](https://docs.macroscope.com/api-reference/endpoint/configure-log-export.md). Returns `404` when no export is configured or the workspace does not have log export.

## Authorization

Requires an **Admin** API key, or an [OAuth sign-in](https://docs.macroscope.com/api-reference/mcp.md#permissions) with **Admin** access by a person who is a workspace admin. Read and Write keys get `403`, and a sign-in with Read or Write access gets an `insufficient_scope` challenge for `macroscope:admin`.

**Authorization** `string` *required*

`Bearer <key>`. See [Authentication](https://docs.macroscope.com/api#authentication).

## Path parameters

**workspaceType** `string` *required*

`GITHUB_ORGANIZATION` or `GITHUB_USER`.

**workspaceId** `string` *required*

Numeric GitHub ID of the organization or user.

## Response

**logExport** `LogExport`

**properties**

**destinationType** `string`

Destination type: `S3`.

**bucketName** `string`

S3 bucket name.

**bucketRegion** `string`

AWS region of the bucket.

**roleArnRedacted** `string`

IAM role ARN Macroscope assumes, with all but the last four characters of the role name replaced by bullets. A role name of four or fewer characters is replaced entirely.

**keyPrefix** `string`

Key prefix exports are written under. Omitted for the bucket root.

**exportFrequency** `string`

`hourly` or `daily`.

**exportCheckRunLogs** `boolean`

Whether check run logs are exported. Omitted when `false`.

**exportCodeReviewAnalytics** `boolean`

Whether code review analytics are exported. Omitted when `false`.

**exportActivityLogs** `boolean`

Whether user activity logs, the workspace audit log events, are exported. Omitted when `false`.

**enabled** `boolean`

Whether exports run. Omitted when `false`.

**nextExportAt** `string`

Next scheduled export boundary (RFC 3339).

**lastWindowEnd** `string`

End of the most recently exported window (RFC 3339). Omitted before the first export.

**lastFailureAt** `string`

When the most recent export failed (RFC 3339). Omitted when none has.

**lastFailureError** `string`

Why the most recent export failed. Omitted when none has.

**createdAt** `string`

When the export was configured (RFC 3339).

## Errors

<table>
  <colgroup>
    <col width="100" />

    <col width="698" />
  </colgroup>

  <thead>
    <tr>
      <th>HTTP</th>
      <th>Meaning</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`403`</td>
      <td>Your credential or your permissions do not allow managing the log export</td>
    </tr>

    <tr>
      <td>`404`</td>
      <td>No log export is configured, or the workspace does not have log export</td>
    </tr>
  </tbody>
</table>

See [Errors](https://docs.macroscope.com/api#errors) for the rest.

```bash cURL theme={null}
curl https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/logExport \
  -H "Authorization: Bearer $MACROSCOPE_API_KEY"
```

```json 200 theme={null}
{
  "logExport": {
    "destinationType": "S3",
    "bucketName": "acme-macroscope-logs",
    "bucketRegion": "us-east-1",
    "roleArnRedacted": "arn:aws:iam::123456789012:role/•••••••••••••port",
    "keyPrefix": "macroscope/",
    "exportFrequency": "hourly",
    "exportCheckRunLogs": true,
    "exportActivityLogs": true,
    "enabled": true,
    "nextExportAt": "2026-11-29T05:00:00Z",
    "lastWindowEnd": "2026-11-29T04:00:00Z",
    "createdAt": "2026-10-02T17:20:00Z"
  }
}
```

```json 401 theme={null}
{ "code": 16, "message": "unauthenticated" }
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.