Help Center/ ServiceStage/ API Reference/ Historical APIs/ Managing Pipelines/ Creating a Pipeline Trigger Policy
Updated on 2026-04-10 GMT+08:00

Creating a Pipeline Trigger Policy

Function

This API is used to create a pipeline trigger policy.

URI

POST /cpepipeline/v2/pipelines/{pipeline_id}/hooks

Table 1 Path parameter

Parameter

Mandatory

Type

Description

pipeline_id

Yes

String

Pipeline ID. See Querying the Pipeline List.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

hooks

No

Array of objects

Trigger policy. For details, see Table 4.

strategy_type

Yes

Integer

Trigger type.

Table 4 hooks

Parameter

Mandatory

Type

Description

scheduler

No

String

Trigger cycle.

timezone_operator

No

String

Time zone operator.

timezone_hour

No

Integer

Time zone offset.

Response

Table 5 Response parameter

Parameter

Type

Description

[Array elements]

Array of objects

Execution record. For details, see Table 6.

Table 6 hooks

Parameter

Type

Description

schedule

Array of objects

Trigger cycle.

timezone_operator

String

Time zone operator.

timezone_hour

String

Time zone offset.

Example Request

{
    "strategy_type": 1,
    "hooks": [
        {
            "schedule": "59 46 21 21 7 ? 2025",
            "timezone_operator": "+",
            "timezone_hour": 8
        }
    ]
}

Example Response

[
    {
        "schedule": "59 46 21 21 7 ? 2025",
        "timezone_operator": "+",
        "timezone_hour": 8.0
    }
]

Status Codes

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Codes

See ServiceStage Error Codes.