Updated on 2025-10-24 GMT+08:00

Executing a Custom Job

Function

This API is used to execute a custom job.

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, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    coc:document:execute

    Write

    document *

    -

    -

    -

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.

  • PRIVATE

  • PUBLIC

  • PRIVATE

  • PUBLIC

Constraints:

N/A.

Value range:

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:

Parameter key.

Constraints:

N/A.

Value range:

N/A.

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.

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 instant. The options are InstanceValues and BatchValues.

Constraints:

N/A.

Value range:

N/A.

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.