Updated on 2026-02-12 GMT+08:00

Creating a Batch Task

Function

Create a batch task.

URI

POST /koodrive/ose/v1/jobs

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

Definition:

Access token. Token authentication is used to call KooDrive APIs. A token indicates the permission. When an API is called, the token is added to the request header to obtain the operation permission. For details about how to obtain an access token, see the corresponding developer guide. The format is Bearer+{access_token}.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

X-Traceid

No

String

Definition:

Service trace ID, which contains 58 bits.

Constraints:

N/A

Range:

The value contains 58 bits.

Default Value:

N/A

language

No

String

Definition:

Language code.

Constraints:

The value must comply with the internationalization specifications. For example, en_us indicates English (United States).

Range:

The value must comply with the internationalization specifications.

Default Value:

en-US

X-User-Id

Yes

String

Definition:

User ID on KooDrive, which is used for app authentication.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

X-Date

Yes

String

Definition:

Date, which is used for app authentication.

Constraints:

The format is yyyyMMDD'T'HHmmss'Z', for example, 20251103T070140Z.

Range:

The value must be within 15 minutes from the current time and cannot be later than the current time.

Default Value:

N/A

x-hw-share-folder-id

No

String

Definition:

ID of the shared folder. If this request header is passed, the current operation is performed in the shared folder.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

taskType

Yes

Integer

Definition:

Task type.

Constraints:

Enumerated values:

  • 1: batch replication

  • 2: batch deletion

  • 3: batch relocation

  • 4: batch restoration of recycle bin data

  • 5: cloud decompression (data files need to be loaded to the Singapore node for processing)

  • 6: package download (data files need to be loaded to the Singapore node for processing)

  • 7: recycle bin clearance

Range:

1–7

Default Value:

N/A

actionType

No

Integer

Definition:

Operation type, which is a subdivision of taskType.

Constraints:

Enumerated values:

This parameter is used only when taskType is set to 1, 2, or 3.

  • 101: replication and dumping

  • 201: logical deletion (moved to the recycle bin)

  • 202: permanent deletion

  • 301: common relocation

  • 501: compressed package preview

  • 502: full decompression

  • 503: partial decompression

  • 701: recycle bin clearance

Range:

N/A

Default Value:

N/A

taskInfo

Yes

CreateTaskInfoReq object

Task information.

dstContainerId

Yes

String

Definition:

Target space ID of a batch job.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

password

No

String

Definition:

Compressed package password.

This parameter is involved only when taskType is set to 5 (cloud decompression).

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 3 CreateTaskInfoReq

Parameter

Mandatory

Type

Description

fileInfo

Yes

Array of fileInfo objects

File/Directory ID (optional when taskType is set to 7).

newFilePath

No

String

New path of the file (optional when taskType is set to 7).

srcContainerId

Yes

String

Source space ID.

uncompressFilePaths

No

Array of strings

List of full paths of partially decompressed files in the compressed package.

Table 4 fileInfo

Parameter

Mandatory

Type

Description

fileId

No

String

File ID (optional for recycle bin clearance).

filePath

No

String

Full path of the file, including the file ID. (This parameter is mandatory for logical deletion, that is, moving the file to the recycle bin, which affects the restoration function.)

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

code

String

Error code.

msg

String

Error message.

data

String

Task ID.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

code

String

Response code.

msg

String

Response description.

Example Requests

Request for copying files.

POST /koodrive/ose/v1/jobs

Authorization:Bearer+10f88d07fa************44791e9ff
{
    "taskType":1 ,
    "actionType":101 ,
    "dstContainerId": "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4" ,
    "taskInfo": {
        "srcContainerId": "IAADfsBFCO6WtAtuA315074383680425b8aa9a130cba2d4",
        "newFilePath": "Fm9UdqBNTAQDos6l1xPlFnIqXJg2-UdqA" ,
        "fileInfo": [
            {
                "fileId": "FuZmQ66CF0DdpKRG1Y29Iwajbq04Nhwu3"  
            }
        ]
    }
}

Example Responses

Status code: 200

Basic response. Only the error code and error information are returned.

{
    "data": "1309243162258308352"
    "code": 0,
    "msg": "success"
}

Status Codes

Status Code

Description

200

Basic response. Only the error code and error information are returned.

400

Bad Request

401

Unauthorized

500

Internal Server Error