Skip to main content
Sets up the workspace’s S3 log export, or changes its destination or schedule, as Log Export in workspace settings does. 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. The audit log shows the role ARN redacted. Before saving, Macroscope verifies S3 access: it assumes the IAM role and writes a small validation object under the key prefix. If verification fails, nothing changes and an existing export keeps its destination. If the check cannot be completed, for example because S3 is temporarily unavailable or throttling, the request returns 503 and also changes nothing. Only an answer from AWS about the destination, such as access denied or a missing bucket, counts as a failed verification. The role must trust Macroscope’s export identity for this workspace, as described in S3 exports, and each workspace needs its own role.
Saving re-baselines the export schedule: data since the last export is not backfilled. Saving also resumes a paused export. To change only which streams are exported, or to pause the export, use Update log export.
Configuring needs an active subscription. Each workspace can make 5 configuration attempts per minute, shared with Log Export in workspace settings; further attempts return 429.

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 get 403, and a sign-in with Read or Write access gets an insufficient_scope challenge for macroscope:admin.
string
required
Bearer <key>. See Authentication.
string
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

string
required
GITHUB_ORGANIZATION or GITHUB_USER.
string
required
Numeric GitHub ID of the organization or user.

Body

string
required
S3 bucket name.
string
required
AWS region of the bucket, such as us-east-1.
string
required
ARN of the IAM role Macroscope assumes to write exports. Responses and the audit log show it redacted.
string
Key prefix to write exports under, ending in /. Omit or leave empty for the bucket root.
string
required
hourly or daily.
boolean
Whether user activity logs, the workspace audit log events, are exported. Omitted keeps the current value, or exports them when setting up a new export.
boolean
Whether check run logs are exported. Omitted keeps the current value, or exports them when setting up a new export.
boolean
Whether code review analytics are exported. Omitted keeps the current value, or exports them when setting up a new export. At least one stream must be on.

Response

LogExport
The log export as saved, in the same form as Get log export.

Errors

HTTPMeaning
400Invalid destination (bucket name, region, role ARN, key prefix or frequency), no stream on, S3 access verification failed, or the role is already used by another workspace. Nothing was changed
403Your credential or your permissions do not allow managing the log export, or the workspace has no active subscription
404The workspace does not have log export
409The log export changed while the destination was being verified. Read it again before retrying
429Too many configuration attempts for the workspace. Try again in a minute
503The destination could not be verified right now. Nothing was changed; try again in a few minutes
See Errors for the rest.