curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/logExport \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"exportCodeReviewAnalytics": true}'
{
"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",
"exportCodeReviewAnalytics": true
}
}
{ "code": 16, "message": "unauthenticated" }
API
Update log export
Turn the S3 log export or its streams on or off
curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/logExport \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"exportCodeReviewAnalytics": true}'
{
"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",
"exportCodeReviewAnalytics": true
}
}
{ "code": 16, "message": "unauthenticated" }
Turns the configured S3 log export, or any of its streams, on or off. Send only the switches to change; an omitted switch is unchanged. Each attempt, including a refused or invalid one, is recorded in the workspace audit log with its outcome and the API key, or the person and connected app, that made it. Requests rejected before they reach the operation, such as malformed requests, invalid credentials and rate-limited requests, may have no entry.
All named switches change together or not at all. At least one stream must stay on; to stop exporting entirely, turn
See Errors for the rest.
enabled off or delete the export. Setting enabled to true needs an active subscription. Setting a stream to true needs one too, unless the same request sets enabled to false. Turning things off never needs one. To change the destination or schedule, use Configure log export.
Authorization
Requires an Admin API key, or an OAuth sign-in with Admin access by a person who is a workspace admin. Read and Write keys get403, and a sign-in with Read or Write access gets an insufficient_scope challenge for macroscope:admin.
Bearer <key>. See Authentication.How your client identifies the source of the request in the workspace audit log. Use
human or agent. Macroscope records the client’s value without verifying it. Other values are treated as unspecified.Path parameters
Body
Name at least one switch.Response
The log export after the change, in the same form as Get log export.
Errors
| HTTP | Meaning |
|---|---|
400 | No switch was named, or the change would turn off every stream |
403 | Your credential or your permissions do not allow managing the log export, or enabled, or a stream without enabled set to false, was set to true without an active subscription |
404 | No log export is configured, or the workspace does not have log export |
curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/logExport \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"exportCodeReviewAnalytics": true}'
{
"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",
"exportCodeReviewAnalytics": true
}
}
{ "code": 16, "message": "unauthenticated" }