API / get-origin-repo-via-api

API

Get an Origin Repo via the API

Fetch one repository by owner slug and name with GET https://api.cursor.com/v1/origin/repos/{ownerSlug}/{repoName}. Official reference: Origin API → Get Repo.

Origin is in Early Beta and subject to change. Authenticate with an installation access token or a Cursor user access token. Installation tokens need repository:metadata:read (added automatically on install). Availability: Early Beta per the API overview.

Cost: 1 point against the principal budget for this read.

Owner slug and repository name resolve case-insensitively. Responses return the stored casing. You can also address by stable ID: send _ as the owner slug and the repository ID as the name (GET /v1/origin/repos/_/REPO_ID). A malformed ID returns 400. A 404 never distinguishes a missing repo from one your credential cannot reach.

Path parameters

Param Required Meaning
ownerSlug yes Owning entity slug, or _ when using the repository ID form
repoName yes Repo name unique to the owner, or the repository ID when ownerSlug is _
curl --request GET \
  --url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG/REPO_NAME' \
  --header 'Authorization: Bearer YOUR_ORIGIN_TOKEN'

Response

The body returns id, name, fullName, owner (slug, id, optional type), defaultBranch, createdAt, updatedAt, pushedAt, cloneUrl, optional mirror (source, sourceId, status), visibility, allowMergeCommit, allowSquashMerge, and deleteBranchOnMerge.

cloneUrl is output-only. Use it for Git HTTPS with an installation token (x-access-token as username, oit_… as password). List App Installation Repositories returns sparse summaries; call Get Repo when you need full timestamps and cloneUrl.

On a mirrored repository, mirror is present once the initial sync is ready. Treat write 403s as authoritative rather than branching only on mirror.status — a mirror mid-transition can report outbound and still reject writes until it is a stable outbound mirror.

For interactive or scripted user calls, prefer origin api after origin auth login (or CURSOR_API_KEY) so the CLI exchanges a personal user API key for a short-lived user access token. App integrations should mint installation tokens just in time. Do not put a Cursor API key directly in the Origin Authorization header.

Base URL: https://api.cursor.com/v1/origin.