Template for a good new topic, formatted with Markdown:
-
ALM used (GitHub, Bitbucket Cloud, Azure DevOps)- Github
-
CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI)- Github actions
-
Repository language - Typescript
What we’re trying to do
We’ve adopted Scoped Organization Tokens (SOTs) for CI analysis and want to automate their rotation from a CI job (mint a new SOT → update our CI secret → revoke the old one). For that we need to call the SOT management API programmatically.
What works
- We created an SOT via the UI and it works correctly for analysis.
- Our service account
svc-dot-bothas Administer Organization. Its User Token works fine against the classic API — e.g.GET https://sonarcloud.io/api/permissions/users?organization=<organisation_key>&permission=adminreturns 200.
What doesn’t work
Calls to the management API are rejected at the edge regardless of the token:
-
GET https://api.sonarcloud.io/token-definitionswith the valid org-admin User Token asAuthorization: Bearer <token>returns403 {"message":"Forbidden"}(x-amzn-errortype: ForbiddenException). -
The exact same response is returned when no
Authorizationheader is sent — so the header appears to never be evaluated.Questions
- Is the
token-definitionsAPI supported for programmatic / server-to-server (CI) use, or is it currently intended only for the SonarCloud web UI? - If it is supported headlessly, what authentication does it require? (User Token as Bearer doesn’t work for us.) Is there an OAuth client-credentials flow, a specific token type or scope, or required headers we should be using?
- What is the correct base URL/host for these calls?
- Is access gated by plan tier or a feature/early-access flag that needs enabling for our organization?
- If programmatic access isn’t available today, is it on the roadmap, and what is the recommended way to automate SOT rotation for CI in the meantime?
- Is the