Skip to main content
Updates the settings named in updateMask for one repository. For example, you can turn on pull request summaries or change the Approvability mode. If any setting is invalid or you lack permission to change it, the whole update fails.
Changes take effect immediately for the repository and are recorded in the workspace audit log.
Read the repository’s current settings before updating. If someone saves the settings in the meantime, the update returns 409 Conflict. Read them again, check that your change still applies, and retry with the new version.

Permissions

Check editableFields in the Get repository settings response to see which settings you can change. Each setting requires both the credential level and repository access shown below. Macroscope checks repository permissions for each setting.
  • With OAuth sign-in, you need both the approved level and permission to change the setting. A Macroscope workspace admin has Admin on the workspace’s repositories. GitHub repository admin access alone gives Write.
  • A Write or Admin API key has the corresponding access on each repository Macroscope tracks in its workspace.
To set a Policy Repo, you also need read access to the source repository in the same workspace. Features such as Approvability must be enabled for the workspace. To change defaults for new repositories, open Settings → Repos and select Defaults.

Authorization

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.
string
required
Repository ID, as returned in repositoryId by other endpoints. 1 to 128 characters.

Body

Send a JSON body of up to 256 KiB. A larger body returns 413.
string
required
Version returned by Get repository settings, as a decimal string.
string
required
Comma-separated names of the settings to change, as they appear in settings, for example "prSummaryEnabled,approvabilityMode". Between 1 and 21 names, each at most once.
RepoSettingValues
New values for the fields in updateMask. To clear correctnessMaxRunsPerPr, correctnessMaxFileSizeBytes, policyRepoId, or releaseRefPatterns, name it in the mask and omit its value. All other named fields need a value. The two Correctness limits must be at least 1 when set. See RepoSettingValues for field values.

Response

RepoSettings
The repository’s settings and version after the update, in the same form as Get repository settings.

Audit log

Each successful change is recorded in the workspace audit log with the API key or the signed-in person and connected app, the client’s User-Agent, and any reported X-Macroscope-Initiation. Denied 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

HTTPMeaning
400Invalid body: an unknown or repeated name in updateMask, a value without its name, a cleared setting that cannot be cleared, or a value out of range
403Your credential’s level or your access does not allow one of the named settings, or the feature it belongs to is unavailable
404The repository is unknown or you cannot read it
409The settings changed after version was read. Nothing was changed
413Body larger than 256 KiB
These examples turn on pull request summaries. The response shows selected settings returned to a Write key.