Cursor Origin
The Cursor Origin API: Authentication, Grants and Acting as Users
Origin Apps sign a short-lived JWT with their own Ed25519 key, then trade it for an installation access token that calls the API. Grants set which principal holds which permission on a repository or namespace. An installation user token lets an app act as a namespace member, within permissions the installation and member share. The API is in Early Beta.

On this page
- How does an Origin App authenticate to the API?
- How do you use an Origin token with Git over HTTPS?
- What do Origin grants control?
- How do you change a grant through the API?
- How does an app act on behalf of a user?
- How do you confirm a user's Cursor identity?
- How do you mint and use an installation user token?
- What happens when minting fails or access ends?
How does an Origin App authenticate to the API?
An Origin App authenticates with an Ed25519 key pair that you generate yourself. You register only the public key at cursor.com/codebase/settings/apps, and Cursor stores only that half. Keep the private key in a secrets manager. An app can hold up to 10 active signing keys. REST requests go to the base URL https://api.cursor.com/v1/origin.
- 1Generate the pair locally with OpenSSL:
openssl genpkey -algorithm ED25519for the private key, thenopenssl pkey -puboutfor the public PEM. Register the public PEM. - 2Sign an app JWT with the private key. The header is
alg: EdDSAwithkidset to the app ID. The claims areiss(the app ID),audset toorigin-apps,iatandexp. Use a lifetime of approximately five minutes. - 3Send the JWT as
Authorization: Bearer APP_JWTfor app-level operations such as reading app metadata, managing installations, minting installation tokens and recovering webhook deliveries. - 4Call
POST /app/installations/{installationId}/access_tokenswith the app JWT. The installation token that comes back begins withoit_. - 5Use that installation token for repository-scoped operations, including pull requests, check-run writes and Git over HTTPS.
The private key only signs JWTs. The app JWT identifies the app and manages the app itself, and the installation token is the credential that reaches repositories. An installation token can't exceed the installation's approved scopes or repository access. You can narrow it further with fewer scopes or repositoryIds, and empty or omitted arrays inherit the complete installation grant.
A token expires at most 15 minutes after creation, and never later than the app JWT that requested it. So the five-minute JWT the docs recommend produces a token of at most five minutes. A job that needs the full 15 minutes has to sign its JWT with a later exp. Read expiresAt and mint a new token when it passes, instead of assuming a duration. Origin tokens are shorter-lived than GitHub App installation tokens, and an integration that reuses a token on GitHub's schedule fails once the token expires.
Don't put a Cursor API key directly in the Authorization header. For user-authenticated requests, the docs point to the Origin CLI: origin auth login for an interactive session, or CURSOR_API_KEY set to a personal user API key for a non-interactive one. The CLI exchanges the key for the short-lived user access token Origin accepts. App integrations use app JWTs and installation tokens instead.
This is covered hands-on in Cursor Compile 2026 — 1 short Unit, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How do you use an Origin token with Git over HTTPS?
Git over HTTPS takes the same installation token as the REST API, through HTTP Basic authentication instead of a Bearer header. The Git endpoint rejects Bearer credentials, which belong on the REST API. Whatever the operation, the token's grant must include the target repository.
- Username
x-access-token- Password
- The installation token
- Clone, fetch and pull
- Need
repository:contents:read - Push
- Needs
repository:contents:write
A push has two more conditions. On a mirrored repository, an installation token can clone, fetch and pull, but Origin rejects pushes with 403. The repository's owner must also be eligible to write to Origin.
The API reference defines that owner rule by plan. A personal owner must be on Pro, Pro Student, Pro+, Ultra or Start. A team owner needs an active paid team plan, can't be on Privacy Mode (Legacy)A Cursor data setting that blocks Grok Bot because the product requires cloud data storage. Press Enter for the full definition., and can't have Origin turned off by a team admin. Origin's overview lists Premium and Super among the plans with Origin, but this rule doesn't name them, so test a push to a repo that a Premium or Super account owns before a job depends on it.
Putting the token in the clone URL writes it to .git/config. The docs give two ways around that: rewrite the remote after the clone, or pass the token through Git's credential helper so it never enters the URL.
What do Origin grants control?
A grant binds one principal to one repository or namespace with one permission. The grants API lists the grants held directly on a resource, upserts the grant a principal holds and deletes it, so you can script access changes and review them as code. Writes reuse the access checks behind the Codebase permissions UI and record the same repository.access_changed and namespace.access_changed audit events.
Each grant names exactly one principal. A user must belong to the owner's organization. A group must be one the owner's team owns, or an active group in that team's organization.
- Principal
user- Field
user.id- Identifies
- A Cursor user, by the encoded
user_…id the organization API uses
- Principal
group- Field
group.id- Identifies
- A Cursor group, by its public
grp_…id (thepublicIdthe Organization API group routes return, not theg_…id those routes take)
- Principal
teamGroup- Field
teamGroup.kind- Identifies
- One of the owning team's built-in groups:
membersoradmins
| Principal | Field | Identifies |
|---|---|---|
user | user.id | A Cursor user, by the encoded user_… id the organization API uses |
group | group.id | A Cursor group, by its public grp_… id (the publicId the Organization API group routes return, not the g_… id those routes take) |
teamGroup | teamGroup.kind | One of the owning team's built-in groups: members or admins |
The three principal kinds a grant can name.
A team-group grant is the floor that every member of that built-in group holds on the resource. On a namespace, it is the team's namespace floor. On a repository, it is the team's per-repository override, and deleting it returns the repository to the namespace floor. The write endpoints answer a user or group that does not exist exactly like one outside the organization, so a response never confirms that a principal exists.
Repositories and namespaces use different permission ladders, and the values are not interchangeable. Both ladders map to the presets the Codebase permissions UI offers.
- Resource
- Repository
- Permission values
read,write,admin
- Resource
- Namespace
- Permission values
PERMISSION_READ,PERMISSION_CONTRIBUTOR,PERMISSION_WRITE,PERMISSION_ADMIN
| Resource | Permission values |
|---|---|
| Repository | read, write, admin |
| Namespace | PERMISSION_READ, PERMISSION_CONTRIBUTOR, PERMISSION_WRITE, PERMISSION_ADMIN |
On a namespace, the first three grant that level on its internal repositories, and PERMISSION_ADMIN administers the namespace itself.
How do you change a grant through the API?
Upsert is a POST that creates or replaces the grant a principal holds. Each principal holds one grant per resource. Repeating a request leaves the same grant in place, and a different permission replaces the earlier one. Delete names the principal in the request body and returns 204 No Content.
List responses report custom or PERMISSION_CUSTOM for a grant with a custom policy. The upsert endpoints reject those values with InvalidArgument (HTTP 400), because custom policies are outside the grants API. A namespace also keeps at least one admin: an upsert or delete that would leave it without one returns FailedPrecondition (HTTP 400).
Four scopes cover the grants API: repository:settings:read and repository:settings:write for repository grants, and namespace:settings:read and namespace:settings:write for namespace grants. App installations can hold all four, so a robot can call the API with an installation access token. User access tokens work too. Requesting a :write scope also grants the matching :read scope. List endpoints cost 1 point against the rate-limit budget, and writes cost 5.
How does an app act on behalf of a user?
It mints an installation user token. Origin Apps use these tokens to act on behalf of members of the namespace they are installed in. Each request is limited to the permissions that both the installation and the user hold.
- 1A workspace admin approves the
namespace:user_tokens:writescope for your app's installation. - 2Optionally, confirm the user's Cursor identity. Origin returns a signed receipt with their
user_…ID and the installation they confirmed for. - 3Sign an app JWT and mint an installation user token for the user's ID or email.
- 4Use the token with the REST API or Git over HTTPS until
expiresAt, then mint another.
To request namespace:user_tokens:write, add it to the scope parameter of the installation URL. For an existing installation, also send include_granted_scopes=true so the admin approves only the addition. The installation can then mint tokens for any active namespace member. The scope itself can't go in a token's scopes, and the other admin-approved scopes still cap each token's permissions.
Confirming the user is optional, because the admin's approval already covers every namespace member. Confirm a user when you want to link an account in your product to their Cursor account, or to verify an identity instead of trusting a typed email address.
How do you confirm a user's Cursor identity?
Open https://cursor.com/codebase/apps/user-confirmation in the user's browser. Pass redirect_uri, a random state value (strongly recommended), and either installation_id or client_id. The redirect_uri must exactly match an entry in the app's installationRedirectUris, though a loopback URI is accepted on any port.
Origin shows the app's name, icon and description, and lists what the app will receive: user ID, email, and namespace slug and ID. The page explains that confirmation shares identity and membership without granting repository access. Canceling sends no callback at all, so treat a missing callback as not confirmed.
On confirmation, Origin redirects to your callback with a confirmation_receipt JWT. The receipt proves the user's user_… ID, email and namespace membership at confirmation time. It grants no permissions, and Create Installation User Token neither accepts nor requires one. It expires five minutes after issuance, carries a unique jti, and is signed with the same keys as installation receipts.
- 1Resolve the signing key from the JWKS by the
kidheader. - 2Require
alg: EdDSAandtyp: origin-user-confirmation-receipt+jwt, which separates confirmation receipts from installation receipts and access tokens. - 3Validate the signature,
iss,audandexp. - 4Match the signed
stateto the value you sent. When the link named an installation, also matchinstallation_id. When it named your app, readinstallation_idfrom the receipt, because that is the installation to mint for.
Trust the signed state claim, not the query parameter, and reject the callback when any check fails. The JWKS lives at https://api.cursor.com/v1/origin/keys, advertised through the discovery document at /.well-known/openid-configuration. It is sent with Cache-Control: public, max-age=600, stale-if-error=600, and keys rotate weekly. Cache it for 10 minutes, and refresh it when a signature fails against every key you hold.
How do you mint and use an installation user token?
Minting is POST /v1/origin/app/installations/{installationId}/user_access_tokens with an app JWT. Set exactly one of userId or userEmail. If you confirmed the user, use the receipt's sub as userId. A userEmail must match exactly one active member of the installation's namespace.
Optional scopes and up to 50 repositoryIds narrow the token. You can't delegate namespace:user_tokens:write or any scope prefixed app: or installation:. With both limits set, minting succeeds only if the installation and the user each hold every requested scope on every listed repository. With fewer limits, Origin checks permissions on each request instead.
The token behaves like an installation token with a user attached. expiresAt is at most 15 minutes after minting and never later than the app JWT's exp. There is no refresh token, and each mint costs 1 point against the app JWT's rate limit.
Send the token as a Bearer credential, or as the Git password with the username x-access-token, and treat its contents as opaque. A request that doesn't fit the installation's approved scopes and repositories, the user's Origin grants and the token's limits returns 403. It returns 404 if the resource isn't visible.
Actor fields name the user and can include performedVia.app. On a comment, that field identifies the app that created the comment, but not an app that later edited or deleted it.
What happens when minting fails or access ends?
Each mint failure maps to a status code, and the code narrows the cause to a few possibilities. A 403 doesn't say which condition about the user failed: unknown users, non-members and emails that match several members all get the same 403.
- HTTP status
400- Cause
- Not exactly one of
userIdoruserEmail, an invalid ID or email, duplicate, malformed or non-delegable scopes, or duplicate repository IDs or more than 50
- HTTP status
401- Cause
- The app JWT is invalid or expired, or the installation does not exist, belongs to another app, or is suspended
- HTTP status
403- Cause
- The installation lacks
namespace:user_tokens:write, the requested limits exceed its grant, the user is not eligible, or a request with both limits includes a permission the installation or user lacks
- HTTP status
429- Cause
- The app JWT's rate limit is exhausted
- HTTP status
503- Cause
- Origin could not look up the user or sign the token; retry with backoff
| HTTP status | Cause |
|---|---|
400 | Not exactly one of userId or userEmail, an invalid ID or email, duplicate, malformed or non-delegable scopes, or duplicate repository IDs or more than 50 |
401 | The app JWT is invalid or expired, or the installation does not exist, belongs to another app, or is suspended |
403 | The installation lacks namespace:user_tokens:write, the requested limits exceed its grant, the user is not eligible, or a request with both limits includes a permission the installation or user lacks |
429 | The app JWT's rate limit is exhausted |
503 | Origin could not look up the user or sign the token; retry with backoff |
Individual tokens can't be revoked, so access ends through changes around the token.
- Uninstalling or deleting the app invalidates its user tokens before
expiresAt, and requests return401. - Closing the user's Cursor account does the same.
- Removing
namespace:user_tokens:writeor suspending the installation stops new mints, but tokens already issued run untilexpiresAt. - Changes to the installation's or the user's grants apply no later than
expiresAt.
The docs' security notes say to mint just in time, with the smallest scopes and repositoryIds the job needs. Treat tokens like passwords, and neither store nor log them. Key linked accounts on sub, not email, because the user_… ID is stable and an email can change. Verify an email address before you mint with userEmail, because a typed address can name a different member.
Use each receipt once: record its jti and reject repeats within its five-minute lifetime. A receipt is not a credential, so don't send it as a Bearer token. Don't log it either, since it contains the user's email.
A receipt describes membership only at confirmation time. Every mint rechecks membership, so a stored receipt doesn't let you mint for someone who left.
Frequently asked questions
What is the base URL of the Origin API?
Requests go to https://api.cursor.com/v1/origin, and the API is in Early Beta and subject to change.
How long does an Origin installation token last?
At most 15 minutes after creation, and never later than the app JWT that requested it. The docs recommend an app JWT lifetime of approximately five minutes, so read expiresAt and mint a new token when it passes.
How does Git over HTTPS authenticate to Origin?
With HTTP Basic authentication. Use x-access-token as the username and an installation token as the password. The Git endpoint rejects Bearer credentials, which belong on the REST API.
Does an app need a confirmation receipt to act as a user?
No. The admin's approval of namespace:user_tokens:write covers every namespace member, and Create Installation User Token neither accepts nor requires a receipt. Confirmation is for linking accounts or verifying identity instead of trusting a typed email.
Can you revoke a single Origin user token?
No. Individual tokens can't be revoked. Uninstalling or deleting the app, or closing the user's Cursor account, invalidates the tokens before they expire, and grant changes apply no later than each token's expiry.
Sources & last verified
- Cursor Docs: Origin API
- Cursor Docs: Acting on Behalf of Users
- Cursor Docs: Origin Grants API
- Cursor Docs: Origin API Authentication
- Cursor Docs: App JWT
- Cursor Docs: Create Installation User Token
- Cursor Docs: Origin overview and plan access
Cursor ships frequently. Facts verified against primary sources on October 28, 2026.