---
title: "Rescan PR"
method: POST
path: "/api/v2/scans/rescanPR"
tags: ["Scans"]
---

# Rescan PR

`POST /api/v2/scans/rescanPR`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/scans/rescanPR`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Trigger a rescan of a PR/MR scan. Pass the ID of a previous PR scan and the system will re-fetch the pull request and create new scan(s). Supports GitHub PRs and GitLab MRs. Set `force` to true to bypass duplicate detection and run a full scan instead of incremental refresh, even if a scan for the current commit already exists.

## Request body

- RescanInput: Input for triggering a PR/MR rescan
  - `scanId` string, required: ID of a previous PR scan to rescan
  - `force` boolean: When true, bypasses duplicate detection and runs a full scan instead of incremental refresh, even if a scan for the current commit already exists
  - `organizationId` string: Organization ID (optional)

## Response `200`

Rescan result

- RescanResponse: Result of a PR/MR rescan request
  - `outcome` 'scans_created' | 'skipped_duplicate' | 'skipped_not_enabled' | 'skipped_no_targets' | 'closed' | 'error', required: The outcome of the rescan request
  - `message` string, required: Human-readable description of the outcome
  - `scanCount` number: Number of scans created (only present when outcome is scans_created)

## Other responses

- `400`: Error Response
- `401`: Error Response
- `404`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
