---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://vibe.sourcecraft.dev/portal/docs/en/sec-api-ref/Stop-Scan-Rest-Api/v1scansscanUuidstop-post.md
  - https://vibe.sourcecraft.dev/portal/docs/en/sec-api-ref/Stop-Scan-Rest-Api/v1scansscanUuidstop-post.md
  - https://vibe.sourcecraft.dev/portal/docs/ru/sec-api-ref/Stop-Scan-Rest-Api/v1scansscanUuidstop-post.md
  - href: https://vibe.sourcecraft.dev/portal/docs/en/sec-api-ref/Stop-Scan-Rest-Api/v1scansscanUuidstop-post.md
    type: text/markdown
    title: Markdown version
  - href: https://vibe.sourcecraft.dev/portal/docs/en/llms.txt?revision=r22261781
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://vibe.sourcecraft.dev/portal/docs/en/llms.txt?revision=r22261781

<div class="openapi">

# Request cancellation of a scan's CI run

<!-- markdownlint-disable-file -->

The backend resolves the stored CI run in the authorized repository and cancels it with the caller's token. Poll GET /v1/operations/{operationUuid} until done. Only scans linked to a CI run can be stopped. No request body is required.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://appsec.sourcecraft.tech/v1/scans/{scanUuid}/stop
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_scanUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

UUID of the scan to stop

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_gitRepo_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Repository identifier. Accepts either internal repository ID (e.g., 88769874964302633) or public UUID (e.g., 0199140f-4343-7c06-a7e3-b835c305b629). These values can be obtained from the getRepo API (fields: id and uuid).

_Pattern:_{.json-schema-reset .json-schema-assertion} `\S`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

## Responses

<div class="openapi__response__code__202">

## 202 Accepted

Scan stop operation

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operationUuid": "example",
  "type": "ACTIVITY_AI_SUGGESTION",
  "status": "IN_PROGRESS",
  "done": true,
  "gitRepo": "example",
  "createdAt": 0,
  "updatedAt": 0,
  "createdBy": "example",
  "entityUuid": "example",
  "createdEntityUuid": "example",
  "metadata": {
    "gitRepo": "example",
    "defectGroupUuid": "example",
    "jobId": "example",
    "linkUuid": "example",
    "activityUuid": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_createdAt_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Creation time in milliseconds since the Unix epoch
{.table-cell}
||
||

_createdBy_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_createdEntityUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

UUID of the generated report, suggestion activity or AI agent run, depending on type. May be allocated before completion; check status before using the result.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_done_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: boolean

True for both COMPLETED and FAILED; inspect status to distinguish success from failure
{.table-cell}
||
||

_entityUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

UUID of the source entity: a scan for report generation or a defect group for AI suggestion/fix

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_gitRepo_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Repository identifier stored with the operation; may be an ID, public UUID or a legacy identifier

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_metadata_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: object &#124; null

{% cut "**Any of 2 types**" %}{.json-schema-combinators data-marker=or}

- **Type**: [OperationAgentMetadataDto](#entity-OperationAgentMetadataDto)

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "gitRepo": "example",
    "defectGroupUuid": "example",
    "jobId": "example",
    "linkUuid": "example",
    "activityUuid": "example"
  }
  ```

  {% endcut %}

- **Type**: null

  _Example:_{.json-schema-reset .json-schema-example} `null`

{% endcut %}

Metadata of an AI fix, triage or audit job, when available

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "gitRepo": "example",
  "defectGroupUuid": "example",
  "jobId": "example",
  "linkUuid": "example",
  "activityUuid": "example"
}
```

{% endcut %}
{.table-cell}
||
||

_operationUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [OperationStatus](#entity-OperationStatus)

_Enum:_{.json-schema-reset .json-schema-value} `IN_PROGRESS`, `COMPLETED`, `FAILED`
{.table-cell}
||
||

_type_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [OperationType](#entity-OperationType)

_Enum:_{.json-schema-reset .json-schema-value} `ACTIVITY_AI_SUGGESTION`, `DEFECT_GROUPS_BATCH_PRIORITIZE`, `GENERATE_REPORT`, `TRIGGER_DEFECT_FIX`, `TRIGGER_AUDIT`, `GENERATE_SARIF_REPORT_ALL`, `GENERATE_SARIF_REPORT_SECRETS`, `GENERATE_SARIF_REPORT_SCA`, `GENERATE_SARIF_REPORT_SAST`, `GENERATE_SARIF_REPORT_DAST`, `AGENT_TRIAGE`, `STOP_SCAN`
{.table-cell}
||
||

_updatedAt_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Last update time in milliseconds since the Unix epoch
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### OperationType {#entity-OperationType}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `ACTIVITY_AI_SUGGESTION`, `DEFECT_GROUPS_BATCH_PRIORITIZE`, `GENERATE_REPORT`, `TRIGGER_DEFECT_FIX`, `TRIGGER_AUDIT`, `GENERATE_SARIF_REPORT_ALL`, `GENERATE_SARIF_REPORT_SECRETS`, `GENERATE_SARIF_REPORT_SCA`, `GENERATE_SARIF_REPORT_SAST`, `GENERATE_SARIF_REPORT_DAST`, `AGENT_TRIAGE`, `STOP_SCAN`

</div>

<div class="openapi-entity">

### OperationStatus {#entity-OperationStatus}

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `IN_PROGRESS`, `COMPLETED`, `FAILED`

</div>

<div class="openapi-entity">

### OperationAgentMetadataDto {#entity-OperationAgentMetadataDto}

#|
|| **Name** | **Description** ||
||

_defectGroupUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_gitRepo_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_jobId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

AI job ID; null while the agent job is still being started

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_linkUuid_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string &#124; null

UUID of the defect group's SOURCECRAFT_PR link, once reported by the fix agent

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_activityUuid_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string &#124; null

UUID of the accepted triage result activity; null until a result is saved

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "gitRepo": "example",
  "defectGroupUuid": "example",
  "jobId": "example",
  "linkUuid": "example",
  "activityUuid": "example"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Missing gitRepo or invalid scan UUID

</div>

<div class="openapi__response__code__401">

## 401 Unauthorized

Missing or invalid authorization header

</div>

<div class="openapi__response__code__403">

## 403 Forbidden

AppSec write permission denied

</div>

<div class="openapi__response__code__404">

## 404 Not Found

Repository or scan not found in this repository

</div>

<div class="openapi__response__code__409">

## 409 Conflict

The scan has no linked CI run

</div>

<div class="openapi__response__code__503">

## 503 Service Unavailable

CI could not accept cancellation

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.