API / detach-origin-repo-mirror-via-api

API

Detach an Origin repo mirror via the Migration API

Permanently disconnect a mirrored repository from its upstream source with DELETE https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}/mirror. Official reference: Origin Migration API → Detach Repo Mirror.

Origin is in Early Beta and subject to change. Call these endpoints from a migration script you run as a Cursor user, not from an Origin App. Sign in with origin auth login, or pass a Cursor API key through origin api. Availability: Early Beta per the API overview.

Required scope: repository:mirror:delete (Admin user policy). You must also administer the repository on its upstream GitHub source. An Origin App cannot call this endpoint.

After detach, the repository keeps its current contents and becomes a native Origin repository. Syncing stops in both directions, and the mirror's deploy credential is deleted. Detaching is not reversible through this API.

Path parameters

Param Required Meaning
ownerSlug yes Owning entity's unique slug.
repoName yes Repo name, unique to the owner entity.
curl --request DELETE \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME/mirror' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'

Response

Successful requests return 204 No Content with an empty body.

Edge cases

Condition Result
Repository never had a mirror FailedPrecondition (HTTP 400)
Already detached Succeeds without effect (idempotent)

UI equivalent: Settings → General → Detach from GitHub under Danger Zone on a mirrored repo at cursor.com/codebase. Your GitHub repository is not deleted or modified by detach.