latestOpenAPI 3.0.3GitGuardian2026-08-201871515.0 MB

511b067cdcb1

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

Response

Token successfully issued.

access_tokenstring required

The issued personal access token. Use it in the Authorization: Token <access_token> header for subsequent calls to the GitGuardian API.

token_type'Bearer' required
expires_ininteger nullable

Seconds until the access token expires. null if the token never expires.

typestring required

GitGuardian token type.

namestring required

Token name.

account_idinteger required

ID of the GitGuardian workspace the token belongs to.

expire_atstring date-time nullable

Expiration date of the token (null if it never expires).

scopestring[] required

Scopes granted to the token.

keystring required

Raw token value (legacy alias of access_token, kept for backwards compatibility).

expire_at_downsizedboolean required

true if the requested lifetime was capped by a workspace policy and the token expires earlier than requested.

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"
  ]
}