Get an AppSec operation

Reads any operation type, including AI suggestions, batch prioritization, fixes, audits and report generation. Returns status, completion state and source/result UUIDs. AI fix and audit operations also include job metadata when available. Supports operations stored under the repository ID, public UUID or the supplied legacy identifier. Requires permission to read AppSec results for the repository. A failed operation returns HTTP 200 with status FAILED and done=true.

Request

GET

https://appsec.sourcecraft.tech/v1/operations/{operationUuid}

Path parameters

Name

Description

operationUuid

Type: string

UUID of the operation to read

Example: ``

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: \S

Example: 0199140f-4343-7c06-a7e3-b835c305b629

Responses

200 OK

Current operation state

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: 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: 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: example

gitRepo

Type: string

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

Example: example

metadata

Type: object | null

Any of 2 types
  • Type: OperationAgentMetadataDto

    Example
    {
      "gitRepo": "example",
      "defectGroupUuid": "example",
      "jobId": "example",
      "linkUuid": "example",
      "activityUuid": "example"
    }
    
  • Type: null

    Example: null

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

Example
{
  "gitRepo": "example",
  "defectGroupUuid": "example",
  "jobId": "example",
  "linkUuid": "example",
  "activityUuid": "example"
}

operationUuid

Type: string

Example: example

status

Type: OperationStatus

Enum: IN_PROGRESS, COMPLETED, FAILED

type

Type: OperationType

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

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

OperationStatus

Type: string

Enum: IN_PROGRESS, COMPLETED, FAILED

OperationAgentMetadataDto

Name

Description

defectGroupUuid

Type: string | null

Example: example

gitRepo

Type: string

Example: example

jobId

Type: string | null

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

Example: example

linkUuid

Type: string | null

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

Example: example

activityUuid

Type: string | null

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

Example: example

Example
{
  "gitRepo": "example",
  "defectGroupUuid": "example",
  "jobId": "example",
  "linkUuid": "example",
  "activityUuid": "example"
}

400 Bad Request

Missing gitRepo or invalid operation UUID

401 Unauthorized

Missing or invalid authorization header

403 Forbidden

Permission denied

404 Not Found

Repository not found, or operation not found in this repository

Предыдущая
Следующая