Exchange a code or refresh token for an access token
POST /oauth/token
application/x-www-form-urlencoded body: grant_type, client_id, client_secret (confidential clients), code, redirect_uri, code_verifier, refresh_token.
Authentication
Unauthenticated at the HTTP layer — this is one of the two OAuth endpoints.
Errors
See Errors for the full list of status codes this endpoint can return.
Samples
curl
curl -X POST "https://app.sparro.dk/api/v2/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&code=$CODE&redirect_uri=$REDIRECT_URI"