Updated on 2026-09-01 GMT+08:00

Batch Deleting Training Jobs

Function

This API is used to delete multiple training jobs from ModelArts at a time.

This API applies to the following scenario: When you need to delete multiple completed or unnecessary training jobs, you can use this API to batch delete them instead of calling the deletion API to delete them one by one. Before using this API, ensure that the training jobs to be deleted exist, belong to the same workspace, and you have the permission to delete training jobs. After the deletion is complete, the training job is permanently removed from the platform, and related resources and configurations are cleared. If the number of jobs to be deleted exceeds 100, the jobs do not exist, the jobs do not belong to the same workspace, or you do not have the operation permission, the API will return an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /v2/{project_id}/training-jobs/batch-delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of BatchDeleteJobItem objects

Definition: List of training jobs to be deleted.

Constraints: The list can contain a maximum of 100 elements, and all jobs must belong to the same workspace.

Range: N/A

Table 3 BatchDeleteJobItem

Parameter

Mandatory

Type

Description

kind

Yes

String

Definition: Type of a training job.

Range:

  • job

  • edge_job

  • mrs_job

  • hetero_job

  • autosearch_job

  • diag_job

  • visualization_job

  • federated_pool_job

metadata

Yes

BatchDeleteJobMetadata object

Metadata of training jobs to be batch deleted.

Table 4 BatchDeleteJobMetadata

Parameter

Mandatory

Type

Description

id

Yes

String

Definition: ID of a training job. The value is in UUID format.

Constraints: N/A

Range: a string of 32 characters, including letters, digits, and hyphens (-).

Default Value: N/A

Response Parameters

Status code: 202

No Content

None

Example Requests

Delete two training jobs at a time.

POST https://{endpoint}/v2/{project_id}/training-jobs/batch-delete

{
  "jobs" : [ {
    "kind" : "job",
    "metadata" : {
      "id" : "3faf5c03-aaa1-4cbe-879d-24b05d997347"
    }
  }, {
    "kind" : "job",
    "metadata" : {
      "id" : "4a0b6d14-bb22-5cf9-980e-35c16e00845f"
    }
  } ]
}

Example Responses

Status code: 202

No Content

""

Status Codes

Status Code

Description

202

No Content

Error Codes

See Error Codes.