API reference
API reference
Generated from the OpenAPI document the CorrConnect service itself serves, so it describes the code that runs. Download it as openapi.json.
Conventions
- Base URL. Every path is relative to your
CORRCONNECT_BASEaddress. Token, revoke, profile and activity routes are also served on the API host if your invitation names one. - Versions. Data routes live under
/v1. Changes insidev1add fields and values; see versioning. - Formats. JSON in and out, except
/oauth/tokenand/oauth/, which takerevoke-token application/bodies as OAuth requires.x-www-form-urlencoded - Auth. Data routes take a Bearer access token. App and webhook management takes the console session cookie, plus
OriginandX-CSRF-Tokenon changes. See accounts and apps. - Errors.
{"code", "message", "request_id", "details"?}, except the token endpoint's OAuth shape. See errors. - Caching. Responses under
/v1and/oauthare sent withCache-Control: no-store. - Browsers. There are no CORS headers, so browser JavaScript on another site can't call the API. Call it from your server or a native app.
- Request IDs. Every response has
X-Request-ID.
Samples
Every operation has a sample in cURL, JavaScript (Node.js 20 or later, run as an ES module), Python (with requests) and Swift (5.9 or later). They read these environment variables:
| Variable | Holds |
|---|---|
CORRCONNECT_BASE | Your CorrConnect address, for example https:// |
CLIENT_ID, REDIRECT_URI | Your app's client_id and one registered callback |
ACCESS_TOKEN, REFRESH_TOKEN | An athlete's tokens |
CODE, CODE_VERIFIER | A callback code and the PKCE verifier behind it |
CORRCONNECT_, CSRF_TOKEN | Your console session cookie (name=value) and its CSRF token |
APP_ID, SUBSCRIPTION_ID, ACTIVITY_ID | IDs used in paths |
All operations
| Operation | Endpoint | Group |
|---|---|---|
| Ask an athlete for access | GET /oauth/authorize | OAuth |
| Exchange a code or refresh a token | POST /oauth/token | OAuth |
| Revoke one token pair | POST /oauth/ | OAuth |
| End the whole grant | POST /oauth/revoke | OAuth |
| Get the athlete's subject | GET /v1/profile | Athlete data |
| List activities | GET /v1/activities | Athlete data |
| Get one activity | GET /v1/ | Athlete data |
| Create an account | POST /v1/ | Console session |
| Sign in | POST /v1/ | Console session |
| Get the session and a fresh CSRF token | GET /v1/account/me | Console session |
| Sign out | POST /v1/ | Console session |
| Register an app | POST /v1/ | Apps |
| List your apps | GET /v1/ | Apps |
| Delete an app | DELETE /v1/ | Apps |
| Create a webhook subscription | POST /v1/ | Webhook subscriptions |
| List webhook subscriptions | GET /v1/ | Webhook subscriptions |
| Send a test event | POST /v1/ | Webhook subscriptions |
| List recent deliveries | GET /v1/ | Webhook subscriptions |
| Turn a paused subscription back on | POST /v1/ | Webhook subscriptions |
| Delete a webhook subscription | DELETE /v1/ | Webhook subscriptions |
| Check the service is up | GET /healthz | Service |