DescribeScans

Updated at:
Copy as MD

Queries the scan tasks in a project with pagination.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-codesec:DescribeScans

get

*All Resource

*

None None

Request syntax

GET /v1/projects/{projectId}/scans HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

projectId

integer

Yes

The project ID.

111

Request parameters

Parameter

Type

Required

Description

Example

maxResults

integer

No

The number of entries per page. Default value: 20. Maximum value: 100.

10

nextToken

string

No

The pagination token. To query the first page, leave this parameter empty or do not specify it. To query the next page, pass the nextToken value returned in the previous response without modification. If the nextToken value in the response is empty, the last page is returned.

eyJ0IjoiMjAyNi0wNy0xNlQwNzo1MzozOC4wMjFaIiwiaSI6MTAwMDQ0OH0

status

string

No

The task status. Valid values:

  • running: Running.

  • completed: Completed.

  • failed: Failed.

completed

taskName

string

No

The task name.

name

query

string

No

The keyword for fuzzy search by project name or prompt.

name

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

Id of the request

9A1F403F-0A85-5578-8B7C-55E3E9408659

items

array<object>

The task list.

array<object>

The task information.

id

integer

The task ID.

934

projectId

integer

The project ID.

1234567

kind

string

The task type. Valid values:

  • full: Full.

  • incremental: Incremental.

full

status

string

The task status. Valid values:

  • running: Running.

  • completed: Completed.

  • failed: Failed.

  • canceling: Canceling.

  • canceled: Canceled.

completed

codeBundleId

integer

The code bundle ID.

11

engineSnapshot

object

The supported types.

sast

boolean

Indicates whether SAST is supported.

true

sca

boolean

Indicates whether SCA is supported.

true

taskName

string

The task name.

1648622222394847-ha-cn-lm64p7tby01_dsl_kb_video_1773817008236_full

createdAt

string

The creation time.

2026-07-28T03:36:31.573Z

updatedAt

string

The update time.

2026-07-28T03:36:31.573Z

startedAt

string

The start time.

2026-07-28T03:36:31.573Z

finishedAt

string

The scan end time.

2026-07-28T03:36:31.573Z

createdBy

string

The user ID of the task creator.

11111

scanMetrics

object

The scan result statistics information.

linesOfCode

integer

The number of lines of code.

11

fileCount

integer

The number of files.

459

tokenTotal

integer

[Deprecated].

1

credit

number

The number of credits consumed by the task.

1.25

scanProgress

integer

The task progress.

100

workerId

string

[Deprecated].

1

currentPhase

string

The current scan phase. Valid values:

  • threat_model: Threat modeling.

  • discovery: Vulnerability discovery.

  • panel: Vulnerability review.

  • adversarial: Adversarial verification.

  • finalize: Report generation.

finalize

totalCount

integer

The total number of entries.

2

maxResults

integer

The page size.

10

nextToken

string

The pagination token. An empty value indicates that the last page is returned.

eyJ0IjoiMjAyNi0wNy0xNlQwNzo1MzozOC4wMjFaIiwiaSI6MTAwMDQ0OH0

Examples

Success response

JSON format

{
  "requestId": "9A1F403F-0A85-5578-8B7C-55E3E9408659",
  "items": [
    {
      "id": 934,
      "projectId": 1234567,
      "kind": "full",
      "status": "completed",
      "codeBundleId": 11,
      "engineSnapshot": {
        "sast": true,
        "sca": true
      },
      "taskName": "1648622222394847-ha-cn-lm64p7tby01_dsl_kb_video_1773817008236_full",
      "createdAt": "2026-07-28T03:36:31.573Z",
      "updatedAt": "2026-07-28T03:36:31.573Z",
      "startedAt": "2026-07-28T03:36:31.573Z",
      "finishedAt": "2026-07-28T03:36:31.573Z",
      "createdBy": "11111",
      "scanMetrics": {
        "linesOfCode": 11,
        "fileCount": 459,
        "tokenTotal": 1,
        "credit": 1.25
      },
      "scanProgress": 100,
      "workerId": "1",
      "currentPhase": "finalize"
    }
  ],
  "totalCount": 2,
  "maxResults": 10,
  "nextToken": "eyJ0IjoiMjAyNi0wNy0xNlQwNzo1MzozOC4wMjFaIiwiaSI6MTAwMDQ0OH0"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.%s Invalid parameter:%s. Invalid parameter:%s.
400 NotFound.%s The resource does not exist. The resource does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.