Secrets
Retrieve a secret value
Changed onRetrieve the information, including its clear text value, of a secret by its ID.
Access requires the token to see at least one incident linked to the secret, private or public.
Prerequisites:
- A Manager has turned on "Enable API endpoints to retrieve detected secrets and occurrence content in clear text" in the workspace settings, under Security. On SaaS, this setting also requires the IP allowlist to be enabled.
- A Personal Access Token (PAT) with the secrets:read scope. Service account tokens are refused.
get/v1/secrets/{secret_id}
Request
- Base URLhttps://api.gitguardian.com
- URLhttps://api.gitguardian.com/v1/secrets/{secret_id}
- AuthHTTP bearer
Path parameters
secret_idinteger required
The ID of the secret to retrieve
Headers
X-Privacy-Mode'true' | 'false'
When set to true, sensitive values in the response are obfuscated (replaced with <GG>OBFUSCATED</GG>). Useful for sharing API responses without exposing sensitive data.
Response
Secret details
Example response
{
"id": 37,
"detector": {
"name": "slack_bot_token",
"display_name": "Slack Bot Token",
"nature": "specific",
"family": "token",
"category": "messaging_system",
"detector_group_name": "slackbot_token",
"detector_group_display_name": "Slack Bot Token"
},
"matches": {
"apikey": "sk-xxxxxxxxxxxxxxxx"
}
}Changes
- info
the endpoint scheme security
api-keywas added to the API - info
added the non-success response with the status
- info
- info
api tag
Internal Secret Incidentsremoved
- info