OriginService

PATCH /v1/origin/repos/{ownerSlug}/{repoName}

Updates repository settings. Omitted fields are left unchanged; at least one settable field must be provided.

Provided settings are applied as independent groups in a fixed order: default branch, automatic head-branch deletion, visibility, then merge methods. When a group is rejected, groups earlier in that order have already been applied and remain applied; retrying with the rejected group corrected converges on the requested state.

Request

  • Base URL
    https://api.cursor.com
  • Auth
    HTTP bearer

Path parameters

ownerSlugstring required

Owning entity's unique slug.

repoNamestring required

Repo name, unique to the owner entity.

Request body

defaultBranchstring

New default branch. Must name an existing branch. Supported only on repositories that do not pull from or push to an upstream source; other repositories are rejected with a failed-precondition error.

allowMergeCommitboolean

Whether pull requests may land as merge commits. Must be provided together with allow_squash_merge; at least one of the two must be true. Providing one without the other is rejected as invalid.

allowSquashMergeboolean

Whether pull requests may land as squash merges. Must be provided together with allow_merge_commit; at least one of the two must be true. Providing one without the other is rejected as invalid.

deleteBranchOnMergeboolean

Whether the head branch is deleted automatically on merge. Supported only on repositories whose pull requests live on this API; repositories pulling from an upstream source are rejected with a failed-precondition error.

visibility'internal' | 'private'

New repository visibility, internal or private. Unspecified leaves the visibility unchanged.

Response

OK

idstring
namestring required

The repo name, unique to its owner. Required on create.

fullNamestring

"{owner.login}/{name}". Derived.

defaultBranchstring

Default branch name. Always set on responses. On create, omitting this field or leaving it empty defaults to "main".

createdAtstring date-time
updatedAtstring date-time
pushedAtstring date-time

Most-recent-push timestamp on any branch; absent until the first push.

cloneUrlstring

HTTPS URL for cloning the repository.

visibility'internal' | 'private'

Repository visibility, internal or private.

allowMergeCommitboolean

Whether pull requests may land as merge commits.

allowSquashMergeboolean

Whether pull requests may land as squash merges.

deleteBranchOnMergeboolean

Whether the head branch is deleted automatically on merge.

webUrlstring

Web URL for this repository on Cursor.

Changes

No recorded changes to this operation across all 1 revision of this API.