---
title: "List locations for a secret scanning alert"
method: GET
path: "/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
tags: ["secret-scanning"]
---

# List locations for a secret scanning alert

`GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations`

Lists all locations for a given secret scanning alert for 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.

## Path parameters

- `owner` string, required
- `repo` string, required
- `alert_number` integer, required — The security alert number.

## Query parameters

- `page` integer
- `per_page` integer

## Response `200`

Response

- SecretScanningLocation[] — List of locations where the secret was detected
  - `type` 'commit' | 'wiki_commit' | 'issue_title' | 'issue_body' | 'issue_comment' | 'discussion_title' | 'discussion_body' | 'discussion_comment' | 'pull_request_title' | 'pull_request_body' | 'pull_request_comment' | 'pull_request_review' | 'pull_request_review_comment' — The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found.
  - `details` union
    - SecretScanningLocationCommit — Represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository.
      - `path` string, required — The file path in the repository
      - `start_line` number, required — Line number at which the secret starts in the file
      - `end_line` number, required — Line number at which the secret ends in the file
      - `start_column` number, required — The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII
      - `end_column` number, required — The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII
      - `blob_sha` string, required — SHA-1 hash ID of the associated blob
      - `blob_url` string, required — The API URL to get the associated blob resource
      - `commit_sha` string, required — SHA-1 hash ID of the associated commit
      - `commit_url` string, required — The API URL to get the associated commit resource
      - `html_url` string, uri — The GitHub URL to get the associated commit resource.
    - SecretScanningLocationWikiCommit — Represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki.
      - `path` string, required — The file path of the wiki page
      - `start_line` number, required — Line number at which the secret starts in the file
      - `end_line` number, required — Line number at which the secret ends in the file
      - `start_column` number, required — The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII.
      - `end_column` number, required — The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII.
      - `blob_sha` string, required — SHA-1 hash ID of the associated blob
      - `page_url` string, required — The GitHub URL to get the associated wiki page
      - `commit_sha` string, required — SHA-1 hash ID of the associated commit
      - `commit_url` string, required — The GitHub URL to get the associated wiki commit
    - SecretScanningLocationIssueTitle — Represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue.
      - `issue_title_url` string, uri, required — The API URL to get the issue where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the issue where the secret was detected.
    - SecretScanningLocationIssueBody — Represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue.
      - `issue_body_url` string, uri, required — The API URL to get the issue where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the issue where the secret was detected.
    - SecretScanningLocationIssueComment — Represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue.
      - `issue_comment_url` string, uri, required — The API URL to get the issue comment where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the issue comment where the secret was detected.
    - SecretScanningLocationDiscussionTitle — Represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion.
      - `discussion_title_url` string, uri, required — The URL to the discussion where the secret was detected.
    - SecretScanningLocationDiscussionBody — Represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion.
      - `discussion_body_url` string, uri, required — The URL to the discussion where the secret was detected.
    - SecretScanningLocationDiscussionComment — Represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion.
      - `discussion_comment_url` string, uri, required — The API URL to get the discussion comment where the secret was detected.
    - SecretScanningLocationPullRequestTitle — 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.
      - `pull_request_title_url` string, uri, required — The API URL to get the pull request where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the pull request where the secret was detected.
    - SecretScanningLocationPullRequestBody — 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.
      - `pull_request_body_url` string, uri, required — The API URL to get the pull request where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the pull request where the secret was detected.
    - SecretScanningLocationPullRequestComment — 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.
      - `pull_request_comment_url` string, uri, required — The API URL to get the pull request comment where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the pull request comment where the secret was detected.
    - SecretScanningLocationPullRequestReview — 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.
      - `pull_request_review_url` string, uri, required — The API URL to get the pull request review where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the pull request review where the secret was detected.
    - SecretScanningLocationPullRequestReviewComment — 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.
      - `pull_request_review_comment_url` string, uri, required — The API URL to get the pull request review comment where the secret was detected.
      - `html_url` string, uri — The GitHub URL for the pull request review comment where the secret was detected.

## Other responses

- `404` — Repository is public, or secret scanning is disabled for the repository, or the resource is not found
- `503` — Service unavailable

---

[API](https://skmtc.net/github/apis/github-v3-rest-api.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api/versions/a367f7028301/schema)
