Get a secret scanning alert
Gets a single secret scanning alert detected in an eligible repository.
The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
The security alert number.
The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the number field in the response from the GET /repos/{owner}/{repo}/code-scanning/alerts operation.
Query Parameters
Section titled “ Query Parameters ”A boolean value representing whether or not to hide literal secrets in the results.
Responses
Section titled “ Responses ”Response
object
The security alert number.
The time that the alert was created in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
The time that the alert was last updated in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
The REST API URL of the alert resource.
The GitHub URL of the alert resource.
The REST API URL of the code locations for this alert.
Sets the state of the secret scanning alert. You must provide resolution when you set the state to resolved.
Required when the state is resolved. The reason for resolving the alert.
The time that the alert was resolved in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
A GitHub user.
object
An optional comment to resolve an alert.
The type of secret that secret scanning detected.
User-friendly name for the detected secret, matching the secret_type.
For a list of built-in patterns, see “Supported secret scanning patterns.”
The provider of the secret that was detected.
The slug identifier for the provider of the secret that was detected. Use this value for filtering by provider with the providers or exclude_providers parameters.
The secret that was detected.
Whether push protection was bypassed for the detected secret.
A GitHub user.
object
The time that push protection was bypassed in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
A GitHub user.
object
An optional comment when reviewing a push protection bypass.
An optional comment when requesting a push protection bypass.
The URL to a push protection bypass request.
The token status as of the latest validity check.
Whether the detected secret was publicly leaked.
Whether the detected secret was found in multiple repositories under the same organization or enterprise.
A boolean value representing whether or not alert is base64 encoded
Represents a ‘commit’ secret scanning location type. This location type shows that a secret was detected inside a commit to a repository.
object
The file path in the repository
Line number at which the secret starts in the file
Line number at which the secret ends in the file
The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII
The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII
SHA-1 hash ID of the associated blob
The API URL to get the associated blob resource
SHA-1 hash ID of the associated commit
The API URL to get the associated commit resource
The GitHub URL to get the associated commit resource.
Represents a ‘wiki_commit’ secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki.
object
The file path of the wiki page
Line number at which the secret starts in the file
Line number at which the secret ends in the file
The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII.
The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII.
SHA-1 hash ID of the associated blob
The GitHub URL to get the associated wiki page
SHA-1 hash ID of the associated commit
The GitHub URL to get the associated wiki commit
Represents an ‘issue_title’ secret scanning location type. This location type shows that a secret was detected in the title of an issue.
object
The API URL to get the issue where the secret was detected.
The GitHub URL for the issue where the secret was detected.
Represents an ‘issue_body’ secret scanning location type. This location type shows that a secret was detected in the body of an issue.
object
The API URL to get the issue where the secret was detected.
The GitHub URL for the issue where the secret was detected.
Represents an ‘issue_comment’ secret scanning location type. This location type shows that a secret was detected in a comment on an issue.
object
The API URL to get the issue comment where the secret was detected.
The GitHub URL for the issue comment where the secret was detected.
Represents a ‘discussion_title’ secret scanning location type. This location type shows that a secret was detected in the title of a discussion.
object
The URL to the discussion where the secret was detected.
Represents a ‘discussion_body’ secret scanning location type. This location type shows that a secret was detected in the body of a discussion.
object
The URL to the discussion where the secret was detected.
Represents a ‘discussion_comment’ secret scanning location type. This location type shows that a secret was detected in a comment on a discussion.
object
The API URL to get the discussion comment where the secret was detected.
Represents a ‘pull_request_title’ secret scanning location type. This location type shows that a secret was detected in the title of a pull request.
object
The API URL to get the pull request where the secret was detected.
The GitHub URL for the pull request where the secret was detected.
Represents a ‘pull_request_body’ secret scanning location type. This location type shows that a secret was detected in the body of a pull request.
object
The API URL to get the pull request where the secret was detected.
The GitHub URL for the pull request where the secret was detected.
Represents a ‘pull_request_comment’ secret scanning location type. This location type shows that a secret was detected in a comment on a pull request.
object
The API URL to get the pull request comment where the secret was detected.
The GitHub URL for the pull request comment where the secret was detected.
Represents a ‘pull_request_review’ secret scanning location type. This location type shows that a secret was detected in a review on a pull request.
object
The API URL to get the pull request review where the secret was detected.
The GitHub URL for the pull request review where the secret was detected.
Represents a ‘pull_request_review_comment’ secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request.
object
The API URL to get the pull request review comment where the secret was detected.
The GitHub URL for the pull request review comment where the secret was detected.
A boolean value representing whether or not the token in the alert was detected in more than one location.
A GitHub user.
object
An optional comment from the closure request author.
An optional comment from the closure request reviewer.
A GitHub user.
object
A list of metadata key/value pairs associated with the secret scanning alert.
object
The metadata key.
The metadata value.
Examples
{ "number": 42, "created_at": "2020-11-06T18:18:30Z", "url": "https://api.github.com/repos/owner/private-repo/secret-scanning/alerts/42", "html_url": "https://github.com/owner/private-repo/security/secret-scanning/42", "locations_url": "https://api.github.com/repos/owner/private-repo/secret-scanning/alerts/42/locations", "state": "open", "resolution": null, "resolved_at": null, "resolved_by": null, "secret_type": "mailchimp_api_key", "secret_type_display_name": "Mailchimp API Key", "secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2", "push_protection_bypassed_by": null, "push_protection_bypassed": false, "push_protection_bypassed_at": null, "push_protection_bypass_request_reviewer": null, "push_protection_bypass_request_reviewer_comment": null, "push_protection_bypass_request_comment": null, "push_protection_bypass_request_html_url": null, "resolution_comment": null, "validity": "unknown", "publicly_leaked": false, "multi_repo": false, "metadata": [ { "key": "owner_email", "value": "owner@example.com" } ]}Not modified
Repository is public, or secret scanning is disabled for the repository, or the resource is not found
Service unavailable
object
Example generated
{ "code": "example", "message": "example", "documentation_url": "example"}