> ## 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.

# Update workspace settings

> Change a workspace's product and reporting settings

Updates the workspace settings named in `updateMask`. For example, you can turn on web search, move the weekly reporting boundary or replace the list of excluded commit authors. The update is all or nothing: if any named setting is invalid or you cannot change it, the request fails and nothing is changed.

> [!WARNING]
>
> Changes apply to the whole workspace and are recorded in the workspace audit log. Saving `productOverview` starts workspace onboarding, which processes the workspace's history and uses credits. Productivity visibility, external contributors, web search and Slack thread follow-up decide who can see or do what in the workspace, and changes to them normally apply to access right away.

Read the [current settings](https://docs.macroscope.com/api-reference/endpoint/get-workspace-settings.md) before updating. If any setting the `etag` covers changes in the meantime, including in the Macroscope app, the update returns `409 Conflict`. Read the settings again, check that your change still applies, and retry with the new `etag`.

## Effects of each setting

| Setting | Effect of a change |
| - | - |
| `productOverview` | Needs an active subscription. Every save starts workspace onboarding, which processes the workspace's history and uses credits. The first Product Overview also turns on [Status](https://docs.macroscope.com/status.md): commit summaries are turned on for the workspace's repositories and for the defaults new repositories start with. |
| `customAgentInstructions` | Applies to later conversations with the Macroscope agent. |
| `timezone`, `reportingBoundaryWeekday`, `reportingBoundaryHour` | Moves the boundaries of reporting periods. Effort statistics already computed for the workspace and its contributors are discarded and recalculated for the new boundaries, so they can be missing or incomplete until the recalculation finishes. Saving the value a setting already has does not trigger a recalculation. |
| `productivityVisibility`, `productivityVisibilityTeamId` | Changes who can see [Productivity](https://docs.macroscope.com/productivity.md) pages. |
| `includeExternalContributorsInProductivity`, `includeExternalContributorsInSummaries` | Changes whose work counts in productivity statistics, or in commit summaries and reports. |
| `excludedCommitAuthors` | Replaces the whole list. Authors left out of the new list are no longer excluded. |
| `webSearchEnabled`, `slackThreadFollowEnabled` | Changes what the Macroscope agent can do. |

`inferenceResidency` is read-only through the API. This operation does not change team enablement, digest subscriptions, the administrative contact, the log export or delegated admins; see [Endpoints](https://docs.macroscope.com/api#endpoints) for the operations that do.

## Permissions

Check `editableFields` in the [Get workspace settings](https://docs.macroscope.com/api-reference/endpoint/get-workspace-settings.md) response to see which settings you can change. Connections already approved at Write or Admin need no new approval.

| Credential | Can change |
| - | - |
| **Admin** API key | Every setting this operation accepts, when the feature it belongs to is available. `productOverview` also needs an active subscription. This applies to every Admin key, including existing ones. |
| **Read** or **Write** API key | None. The request returns `403`. |
| [OAuth sign-in](https://docs.macroscope.com/api-reference/mcp.md#permissions) with **Write** access | `customAgentInstructions`, which any workspace member can change in the Macroscope app. Naming any other setting refuses the whole update: with an `insufficient_scope` challenge for `macroscope:admin` if Admin access would allow every setting named, otherwise `403`. |
| OAuth sign-in with **Admin** access | Also `productOverview`, which any workspace member can change once the workspace has one. Every other setting this operation accepts, and the first `productOverview`, requires you to be a workspace admin. |
| OAuth sign-in with **Read** access | None. The request returns an `insufficient_scope` challenge for `macroscope:write`. |

An Admin key changes these settings as the key, not as the person who created it. It does not make the key a workspace admin: workspace administration this API does not offer, such as creating API keys or managing billing, still requires a workspace admin.

## Authorization

**Authorization** `string` *required*

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

**X-Macroscope-Initiation** `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

**workspaceType** `string` *required*

`GITHUB_ORGANIZATION` or `GITHUB_USER`.

**workspaceId** `string` *required*

Numeric GitHub ID of the organization or user.

## Body

Send a JSON body of up to 256 KiB. A larger body returns `413`.

**etag** `string` *required*

The `etag` returned by [Get workspace settings](https://docs.macroscope.com/api-reference/endpoint/get-workspace-settings.md). 1 to 128 characters.

**updateMask** `string` *required*

Comma-separated names of the settings to change, as they appear in `settings`, for example `"webSearchEnabled,timezone"`. Between 1 and 13 names, each at most once. Naming `inferenceResidency`, or a setting you cannot change, returns `403`.

**settings** `WorkspaceSettingValues`

New values for the fields in `updateMask`. Give a value for each named setting, except `productivityVisibilityTeamId`, which is removed when named without a value. `productOverview` must not be blank. `excludedCommitAuthors` takes the complete new list, up to 1,000 authors, each at most once; a `name` is 1 to 256 bytes and not blank, and an empty list removes every exclusion. A value for a setting not named in `updateMask` returns `400`. `timezone` must be an IANA timezone name. `customAgentInstructions` is at most 20,000 bytes, `reportingBoundaryWeekday` is `0` to `6` and `reportingBoundaryHour` is `0` to `23`. See [WorkspaceSettingValues](https://docs.macroscope.com/api-reference/endpoint/get-workspace-settings.md#workspacesettingvalues) for field values.

## Response

**settings** `WorkspaceSettings`

The workspace's settings and new `etag` after the update, in the same form as [Get workspace settings](https://docs.macroscope.com/api-reference/endpoint/get-workspace-settings.md).

## Audit log

Each successful change is recorded in the workspace audit log with the API key or person that made it, the client's `User-Agent`, and any reported `X-Macroscope-Initiation`. For signed-in clients, the entry names the person and the connected app. Custom Agent Instructions are recorded by length, not content. Refused, invalid and stale updates can also appear there. Requests rejected before admission, such as malformed requests, invalid credentials, workspace mismatches and rate-limited requests, may have no audit entry.

## Errors

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

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

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

  <tbody>
    <tr>
      <td>`400`</td>
      <td>Invalid body: an unknown or repeated name in `updateMask`, a value without its name, a missing value for a named setting, an unknown timezone, or a value out of range</td>
    </tr>

    <tr>
      <td>`403`</td>
      <td>Your credential or your permissions do not allow one of the named settings, the setting is read-only, the feature it belongs to is unavailable, or `productOverview` was named without an active subscription. Nothing was changed</td>
    </tr>

    <tr>
      <td>`404`</td>
      <td>The workspace is unknown or inactive</td>
    </tr>

    <tr>
      <td>`409`</td>
      <td>A setting changed after `etag` was read. Nothing was changed</td>
    </tr>

    <tr>
      <td>`413`</td>
      <td>Body larger than 256 KiB</td>
    </tr>
  </tbody>
</table>

These examples turn on web search with an Admin key.

```bash cURL theme={null}
url="https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/settings"
auth="Authorization: Bearer $MACROSCOPE_API_KEY"

etag=$(curl -fsS "$url" -H "$auth" | jq -er '.settings.etag') &&
curl -sS -X PATCH "$url" \
  -H "$auth" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg etag "$etag" '{etag: $etag, updateMask: "webSearchEnabled", settings: {webSearchEnabled: true}}')"
```

```python Python theme={null}
import os, requests

url = "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/settings"
headers = {"Authorization": f"Bearer {os.environ['MACROSCOPE_API_KEY']}"}
current = requests.get(url, headers=headers)
current.raise_for_status()

updated = requests.patch(url, headers=headers, json={
    "etag": current.json()["settings"]["etag"],
    "updateMask": "webSearchEnabled",
    "settings": {"webSearchEnabled": True},
})
updated.raise_for_status()
print(updated.json())
```

```javascript JavaScript theme={null}
const url = "https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/settings";
const headers = { Authorization: `Bearer ${process.env.MACROSCOPE_API_KEY}` };
const current = await fetch(url, { headers });
if (!current.ok) throw new Error(`GET failed (${current.status})`);
const { settings } = await current.json();

const updated = await fetch(url, {
  method: "PATCH",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({
    etag: settings.etag,
    updateMask: "webSearchEnabled",
    settings: { webSearchEnabled: true }
  })
});
if (!updated.ok) throw new Error(`PATCH failed (${updated.status})`);
console.log(await updated.json());
```

```json 200 theme={null}
{
  "settings": {
    "etag": "Hk8vQz2LmN5rTb0xWc7pYs3d",
    "values": {
      "productOverview": "Acme builds billing software for small businesses.",
      "customAgentInstructions": "Answer in short bullet points.",
      "timezone": "America/Los_Angeles",
      "reportingBoundaryWeekday": 5,
      "reportingBoundaryHour": 18,
      "productivityVisibility": "PRODUCTIVITY_VISIBILITY_TEAM",
      "productivityVisibilityTeamId": "4567890",
      "includeExternalContributorsInProductivity": false,
      "includeExternalContributorsInSummaries": true,
      "excludedCommitAuthors": {
        "authors": [
          {
            "githubUserId": "49699333"
          },
          {
            "name": "release-bot"
          }
        ]
      },
      "webSearchEnabled": true,
      "slackThreadFollowEnabled": false,
      "inferenceResidency": "INFERENCE_RESIDENCY_GLOBAL"
    },
    "editableFields": "productOverview,customAgentInstructions,timezone,reportingBoundaryWeekday,reportingBoundaryHour,productivityVisibility,productivityVisibilityTeamId,includeExternalContributorsInProductivity,includeExternalContributorsInSummaries,excludedCommitAuthors,webSearchEnabled,slackThreadFollowEnabled"
  }
}
```

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


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