Hi Cursor team,
I’m trying to use the Team Admin API to pull our spend/usage data programmatically, and every API key I generate is rejected.
What I did:
- Generated an Admin API key from the team’s dashboard settings, scope admin:* (“Admin” — the only option available to me).
- Call the API using HTTP Basic Auth with the key as the username and an empty password: Authorization: Basic base64(API_KEY + “:”) — exactly as documented at Admin API | Cursor Docs.
What’s failing:
Every request — including the simplest one, GET /teams/members — returns:
401 Unauthorized
{“code”:“error”,“message”:“Invalid Team API Key”}
This happens immediately on a freshly generated key, and happened again after I revoked it and generated a second one. Same result both times.
I’ve already ruled out the known encoding pitfall (I saw the forum thread about btoa(KEY+‘:’) — our implementation already does exactly that, byte for byte; I re-verified it directly against the live API before writing this). The error we get is the distinct “Invalid Team API Key” message, not a generic auth-parsing failure, which suggests Cursor’s server is evaluating and rejecting the key itself rather than failing to parse the header.
My question: Is Admin API access actually enabled for our team’s plan? Or is there a role requirement (e.g., only the team owner, not an admin, can generate a working key) that isn’t surfaced by the key-creation UI?
Key prefix for reference: crsr…6bb5 (not sharing the full key)
Timestamps of both failed attempts: [fill in]
Thanks for your help.