API reference
Everything under /api/v1 is tenant-scoped and authenticated with the Thundera SSO session (cookie) or a bearer access token from auth.thundera.eu.
Machine-readable
The GitHub contract is also served as OpenAPI at /api/v1/openapi.json.
Conventions
- Errors:
{"error": {"code", "message", "trace_id"}}. Quotetrace_idwhen asking for support. - The tenant is always derived from your session, never from a request body.
- Unauthenticated calls to protected routes return
401. Network errors are not a revoked session: clients must not discard tokens on them. POST /api/v1/reviewsaccepts anIdempotency-Keyheader (max 200 chars); repeated calls return the same review.
Reviews
| Endpoint | Auth | Request | Response |
|---|---|---|---|
POST /api/v1/reviews | SSO | {repository, revision, files:[{path, content}]} + optional Idempotency-Key header | 201 Review Errors: 400 invalid review, 413 too large, 422 policy |
GET /api/v1/reviews | SSO | - | 200 {reviews: Review[]} Errors: 401 |
GET /api/v1/reviews/:id | SSO | - | 200 Review (findings, state) Errors: 401, 404 |
POST /api/v1/reviews/:id/cancel | SSO | - | 200 Review Errors: 404, 409 wrong state |
POST /api/v1/reviews/:id/retry | SSO | - | 200 Review Errors: 404, 409 wrong state |
POST /api/v1/reviews/from-github | SSO | {connection_id, pull_number} | 201 Review (bound to the PR head SHA, idempotent) Errors: 400, 404, 409, 502 |
POST /api/v1/reviews/from-bitbucket | SSO | {connectionId, pullNumber} | 201 Review Errors: 400, 404, 502 |
GitHub
| Endpoint | Auth | Request | Response |
|---|---|---|---|
GET /api/v1/connections/github | SSO | - | 200 {connections[]} Errors: 401 |
POST /api/v1/connections/github | SSO | {repository: 'owner/repo' or https://github.com/owner/repo URL} | 201 connection Errors: 400, 404, 502 |
POST /api/v1/connections/github/private | SSO | {repository} | 201 connection Errors: 409 GITHUB_INSTALLATION_REQUIRED, 503 GITHUB_APP_NOT_CONFIGURED |
GET /api/v1/connections/github/installation | SSO | - | 200 {installed, account_login, account_type} Errors: 401 |
GET /api/v1/connections/github/installation/repositories | SSO | - | 200 repositories visible to the installation Errors: 404 GITHUB_APP_NOT_INSTALLED, 503, 502 |
DELETE /api/v1/connections/github/installation | SSO | - | removes the recorded installation Errors: 401 |
POST /api/v1/connections/github/install-url | SSO | - | 201 {install_url, authorize_url, state, app_install_url} (single-use, tenant-bound state) Errors: 503 |
GET /api/v1/connections/github/callback | state | ?code&state (browser redirect from GitHub) | 302 /settings/connections?github=connected|not_installed|error |
GET /api/v1/connections/github/:id | SSO | - | 200 connection Errors: 404 |
DELETE /api/v1/connections/github/:id | SSO | - | 204 Errors: 404 |
GET /api/v1/connections/github/:id/pulls?page=N | SSO | - | 200 {pulls[], page, has_more} Errors: 404, 502 |
Bitbucket Cloud
| Endpoint | Auth | Request | Response |
|---|---|---|---|
GET /api/v1/connections/bitbucket | SSO | - | 200 {connections[]} Errors: 401 |
POST /api/v1/connections/bitbucket | SSO | {workspace, repository, authMethod:'basic'|'bearer', email (basic only), apiToken} | 201 connection Errors: 400 INVALID_BITBUCKET_INPUT, 401-mapped BITBUCKET_APP_PASSWORD_DEPRECATED / BITBUCKET_EMAIL_REQUIRED / BITBUCKET_CREDENTIALS_INVALID |
GET /api/v1/connections/bitbucket/:id | SSO | - | 200 connection Errors: 404 |
DELETE /api/v1/connections/bitbucket/:id | SSO | - | 204 Errors: 404 |
GET /api/v1/connections/bitbucket/:id/pulls | SSO | - | 200 pull requests Errors: 404, 502 |
Learnings and usage
| Endpoint | Auth | Request | Response |
|---|---|---|---|
GET /api/v1/learnings?connection_id= | SSO | - | 200 {learnings[]} (max 200) Errors: 400 |
POST /api/v1/learnings | SSO | {content (1-500 chars), connection_id?} | 201 learning Errors: 400 INVALID_LEARNING, 404 |
DELETE /api/v1/learnings/:id | SSO | - | 204 Errors: 404 |
GET /api/v1/usage | SSO | - | 200 {window_hours, tokens_used, token_budget, model_enabled, budget_exceeded} Errors: 401 |
Public and operational
| Endpoint | Auth | Request | Response |
|---|---|---|---|
GET /api/plans | none | - | 200 plan catalogue (proxy of the central billing catalogue, 60 s cache) |
GET /api/v1/openapi.json | none | - | 200 OpenAPI document |
GET /health | none | - | 200 {status:'ok'} (liveness) |
GET /ready | none | - | 200 when the database is reachable Errors: 503 |
POST /api/v1/webhooks/github/app | signature | GitHub App webhook (X-Hub-Signature-256) | 2xx Errors: 401 bad signature |
POST /api/v1/webhooks/github/:installation | signature | Installation webhook | 2xx Errors: 401 |
POST /api/v1/webhooks/bitbucket/:connectionId | signature | Bitbucket webhook | 2xx Errors: 401 |
Example
curl -X POST https://thundercode.thundera.eu/api/v1/reviews \
-H "Authorization: Bearer $THUNDERA_ACCESS_TOKEN" \
-H "Idempotency-Key: demo-1" -H "Content-Type: application/json" \
-d '{"repository":"acme/web","revision":"HEAD","files":[{"path":"a.ts","content":"const password = \"x\";"}]}'