OAuth2
Exchange an authorization code for an access token.
Token endpoint as defined by RFC 6749 §4.1.3.
Exchange an authorization code (obtained from the authorization endpoint) for a GitGuardian Personal Access Token (PAT). The request and response follow the OAuth 2.0 spec.
This endpoint does not require authentication: the client authenticates itself by submitting the client_id (and client_secret for confidential clients) in the request body.
post/v1/oauth/token
Request
- Base URLhttps://api.gitguardian.com
- URLhttps://api.gitguardian.com/v1/oauth/token
- Authnone required
Request body application/x-www-form-urlencoded
Example request
{
"grant_type": "authorization_code",
"code": "4/0Adeu5BWqv9oS...",
"redirect_uri": "https://app.example.com/callback",
"client_id": "gg_client_AbCdEf123456",
"client_secret": "gg_secret_AbCdEf123456",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"name": "My MCP client",
"lifetime": 30
}Response
Token successfully issued.
Example response
{
"access_token": "gg_pat_AbCdEf123456...",
"token_type": "Bearer",
"expires_in": 2592000,
"type": "personal_access_token",
"name": "My MCP client",
"account_id": 1234,
"expire_at": "2026-06-20T04:46:00+00:00",
"scope": [
"scan",
"incidents:read"
]
}Changes
No recorded changes to this operation across all 35 revisions of this API.