---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://sourcecraft.dev/portal/docs/en/sec-api-ref/Ai-Rest-Api/v1aiaudit-post.md?version=sourcecraft.dev
  - https://sourcecraft.dev/portal/docs/en/sec-api-ref/Ai-Rest-Api/v1aiaudit-post.md?version=sourcecraft.dev
  - https://sourcecraft.dev/portal/docs/ru/sec-api-ref/Ai-Rest-Api/v1aiaudit-post.md?version=sourcecraft.dev
  - href: https://sourcecraft.dev/portal/docs/en/sec-api-ref/Ai-Rest-Api/v1aiaudit-post.md?version=sourcecraft.dev
    type: text/markdown
    title: Markdown version
  - href: https://sourcecraft.dev/portal/docs/en/llms.txt?revision=de8783063d4606471485fa652148cd48b46abee3&version=sourcecraft.dev
    rel: describedby
---
> **Documentation capabilities:** Search, read sources, and browse this documentation: [agent guide](https://sourcecraft.dev/portal/docs/docs-api/agent/overview?project=dev-sourcecraft&lang=en&version=sourcecraft.dev).

> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt?revision=de8783063d4606471485fa652148cd48b46abee3&version=sourcecraft.dev

<div class="openapi">

# Start a repository AI audit or return its active operation

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

Poll GET /v1/operations/{operationUuid} with the same gitRepo.

## 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/ai/audit
```

</div>

</div>

</div>

### 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

Operation accepted

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operationUuid": "example"
}
```

{% endcut %}

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

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

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

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Missing or invalid repository identifier or request

</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, organization or requested defect group not found

</div>

<div class="openapi__response__code__409">

## 409 Conflict

Required neurocolleague or latest-scan findings missing

</div>

</div>

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