Updated on 2025-12-01 GMT+08:00

Executing a Custom Job

Function

This API is used to execute a custom job.

URI

POST /v1/documents/{document_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

document_id

Yes

String

Definition:

Job ID.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

version

No

String

Definition:

Job version. If this parameter is not transferred, the latest version is used by default.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

parameters

No

Array of parameters objects

Definition:

Global parameter.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

sys_tags

No

Array of sys_tags objects

Definition:

System tags.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

target_parameter_name

No

String

Definition:

Name of the parameter of the object to be executed in batches in rate control mode.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

targets

No

Array of targets objects

Definition:

Used together with target_parameter_name. Select the target_parameter_name parameter.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

document_type

No

String

Definition:

Type of the job to be executed.

Constraints:

N/A

Value range:

  • PRIVATE: private

  • PUBLIC: public

Default value:

N/A

description

No

String

Definition:

Execution description.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Table 3 parameters

Parameter

Mandatory

Type

Description

key

No

String

Definition:

Key of a job parameter.

Constraints:

N/A

Value range:

N/A. User-defined.

Default value:

N/A

value

No

String

Definition:

Parameter value.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Table 4 sys_tags

Parameter

Mandatory

Type

Description

key

No

String

Definition:

System tag key.

Constraints:

N/A

Value range:

N/A. User-defined.

Default value:

N/A

value

No

String

Definition:

System tag value.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Table 5 targets

Parameter

Mandatory

Type

Description

key

No

String

Definition:

Dimension of the execution target to be used as an instance. The options are InstanceValues and BatchValues.

Constraints:

N/A

Value range:

  • InstanceValues: instance mode

  • BatchValues: batch mode

Default value:

N/A

values

No

Array of strings

Definition:

Target instance to be executed, which is specified based on the global parameter specified by target_parameter_name.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

data

String

Definition:

Job ticket ID returned by the system when a job is executed.

Value range:

N/A.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

For details, see Error Codes.

error_msg

String

Definition:

Error description.

Value range:

For details, see Error Codes.

Example Requests

Execute a custom job.

POST https://{Endpoint}/v1/documents/{document_id}

{
  "version" : "v2",
  "parameters" : [ {
    "key" : "domain_id",
    "value" : "dc2d76541f754d68xxxxxxxxx"
  }, {
    "key" : "project_id",
    "value" : "e451729b938f491xxxxxxxxxxxxx"
  }, {
    "key" : "agency_urn",
    "value" : "iam::dc2d76541f754d68a4c8d150xxxxxx:agency:ServiceAgencyForCOC"
  } ]
}

Example Responses

Status code: 200

Request succeeded.

{
  "data" : "EX20250701210145012xxxxxx"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

The contained error information is returned.

For more status codes, see Status Codes.

Error Codes

See Error Codes.