
Create an Origin Repo via the API
Create a repository under an owner with POST https://api.cursor.com/v1/origin/repos/{ownerSlug}. Official reference: Origin API → Create Repo.
Origin is in Early Beta and subject to change. Authenticate with a Cursor user access token that carries namespace:repositories:create. An installation token cannot create repos for a namespace. Availability: Early Beta per the API overview.
The owner must be eligible to write to Origin when you call Create Repo. A user owner needs Pro, Pro Student, Pro+, Ultra, or Start. A team owner needs an active paid team plan, must not be on Privacy Mode (Legacy), and must not have Origin turned off by a team admin. An ineligible owner returns FailedPrecondition (HTTP 400). Reading existing repositories does not carry this requirement.
Repository names are claimed case-insensitively. A name that differs only in case from a repository the owner already has is rejected, so widgets and Widgets cannot coexist in one namespace. The name you send is stored as you send it.
Cost: 10 points against the user principal budget.
Path parameters
| Param | Required | Meaning |
|---|---|---|
ownerSlug |
yes | Parent owner entity slug. Create Repo rejects the _ ID sentinel used on other repo paths. |
Request body
| Field | Required | Meaning |
|---|---|---|
name |
yes | Repo name, unique to its owner |
defaultBranch |
no | Default branch name; omitting it or leaving it empty defaults to main |
curl --request POST \
--url 'https://api.cursor.com/v1/origin/repos/OWNER_SLUG' \
--header 'Authorization: Bearer YOUR_USER_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "rocket",
"defaultBranch": "main"
}'
Response
The body returns the created repository: id (prefixed repo_), name, fullName, owner, defaultBranch, createdAt, updatedAt, pushedAt, cloneUrl, optional mirror, visibility, allowMergeCommit, allowSquashMerge, and deleteBranchOnMerge.
Store id and cloneUrl. The first push to a new repo can retarget its default branch: when that push only creates branches and none of them is the stored default, Origin sets the default to the created branch, or to main or master when the push creates several and one of those names is among them. Read the current value from Get Repo afterward.
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. Do not put a Cursor API key directly in the Origin Authorization header.
Base URL: https://api.cursor.com/v1/origin.