Start AI prioritization for the selected defect groups
Each accepted request starts a new operation, even for the same groups. Overlapping requests can process the same groups concurrently. Poll GET /v1/operations/{operationUuid} with the same gitRepo.
Request
POST
https://appsec.sourcecraft.tech/v1/ai/prioritize
Query parameters
|
Name |
Description |
|
gitRepo |
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: Example: `` |
Body
application/json
{
"defectGroupPublicIds": [
0
]
}
|
Name |
Description |
|
defectGroupPublicIds |
Type: integer[] Public defect group numbers in the selected repository Min items: Example
|
Responses
202 Accepted
Operation accepted
Body
application/json
{
"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"
}
}
|
Name |
Description |
|
createdAt |
Type: integer Creation time in milliseconds since the Unix epoch |
|
createdBy |
Type: string Example: |
|
createdEntityUuid |
Type: string | 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: |
|
done |
Type: boolean True for both COMPLETED and FAILED; inspect status to distinguish success from failure |
|
entityUuid |
Type: string | null UUID of the source entity: a scan for report generation or a defect group for AI suggestion/fix Example: |
|
gitRepo |
Type: string Repository identifier stored with the operation; may be an ID, public UUID or a legacy identifier Example: |
|
metadata |
Type: object | null Any of 2 types
Metadata of an AI fix, triage or audit job, when available Example
|
|
operationUuid |
Type: string Example: |
|
status |
Type: OperationStatus Enum: |
|
type |
Type: OperationType Enum: |
|
updatedAt |
Type: integer Last update time in milliseconds since the Unix epoch |
OperationType
Type: string
Enum: 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, CREATE_SCA_RESCAN
OperationStatus
Type: string
Enum: IN_PROGRESS, COMPLETED, FAILED
OperationAgentMetadataDto
|
Name |
Description |
|
defectGroupUuid |
Type: string | null Example: |
|
gitRepo |
Type: string Example: |
|
jobId |
Type: string | null AI job ID; null while the agent job is still being started Example: |
|
linkUuid |
Type: string | null UUID of the defect group's SOURCECRAFT_PR link, once reported by the fix agent Example: |
|
activityUuid |
Type: string | null UUID of the accepted triage result activity; null until a result is saved Example: |
Example
{
"gitRepo": "example",
"defectGroupUuid": "example",
"jobId": "example",
"linkUuid": "example",
"activityUuid": "example"
}
400 Bad Request
Missing or invalid repository identifier or request
401 Unauthorized
Missing or invalid authorization header
403 Forbidden
AppSec write permission denied
404 Not Found
Repository, organization or requested defect group not found
409 Conflict
Required neurocolleague or latest-scan findings missing