You need to enable JavaScript to run this app.
Code Pipeline

Code Pipeline

Copy page
Download PDF
Trigger
CreateTrigger
Copy page
Download PDF
CreateTrigger
Create a trigger.​
API description​
Supported trigger types:​
  • Generic Webhook trigger: When Type is set to Webhook, the Webhook field in Configuration is required.​
  • Mirror source Webhook trigger: Type is CRWebhook. Webhook in Configuration and CR in Webhook are required.​
  • Scheduled trigger: Type must be set to Schedule, and Schedule in Configuration is required.​
Request description​
To achieve low latency, it is recommended that you select the service address corresponding to the region of your resources. For details, see Service address.​
  • Request method: POST​
  • Request URL: https://cp.cn-beijing.volcengineapi.com?Action=CreateTrigger&Version=2023-05-01​
Request parameters​
​
Parameter​
Type​
Required​
Sample Value​
Description​
Action​
String​
Yes​
CreateTrigger​
The API name. The name of the current API is CreateTrigger.​
Version​
String​
Yes​
2023-05-01​
The API version. The current version of the API is 2023-05-01.​
WorkspaceId​
String​
Yes​
7d494e18ee414936c3d189a311676****​
Workspace ID of the trigger.​
PipelineId​
String​
Yes​
0f7ca5a42f4ce414933cfd116****​
Pipeline ID of the trigger​
Name​
String​
Yes​
Webhook-demo-update​
Trigger name​
Type​
String​
Yes​
Webhook​
Trigger type​
  • Webhook: General webhook trigger​
  • Schedule: Scheduled trigger​
  • CRWebhook: Image source Webhook trigger​
Configuration​
Yes​
-​
Trigger configuration.​
Description​
String​
no​
Description​
Trigger description.​
Parameters​
Array of TriggerParameter​
no​
-​
Pipeline variables used when the pipeline is triggered by a trigger.​
Resources​
Array of TriggerResource​
no​
-​
The code source used when the pipeline is triggered by a trigger.​
​
TriggerConfiguration​
​
Parameter​
Type​
Required​
Sample Value​
Description​
Schedule​
no​
-​
Timed trigger configuration.​
Webhook​
no​
-​
Configuration of webhook triggers.​
​
ScheduleConfiguration​
​
Parameter​
Type​
Required​
Sample Value​
Description​
ScheduleConfig​
String​
Yes​
44 17 * * 1​
Configure the scheduled trigger time using Crontab expressions. For configuration instructions, refer to the official documentation. Crontab expressions use the UTC +8 time zone by default.​
​
WebhookConfiguration​
​
Parameter​
Type​
Required​
Sample Value​
Description​
Git​
no​
-​
The Webhook configuration for the code source trigger.​
CR​
no​
-​
The image source trigger webhook configuration​
URL​
String​
Yes​
https://cp.volces.com/v2/webhook/scm/eQKcyKfa702maKXrR_VoJi****​
The webhook URL can be generated using the CreatePipelineWebhookURL API.​
​
GitWebhookConfiguration​
​
Parameter​
Type​
Required​
Sample Value​
Description​
ResourceId​
String​
Yes​
c3e06107e5edcb4fb5329d9b****​
Associated code source ID.​
Filters​
Array of WebhookEventFilter​
no​
-​
Trigger events and filters supported by the code source trigger If no configuration is set, all events will trigger pipeline execution by default.​
​
WebhookEventFilter​
​
Parameter​
Type​
Required​
Sample Value​
Description​
EventType​
String​
Yes​
Push​
Trigger event types:​
  • Push: Code push​
  • Create a tag​
  • After the pull request is merged​
Config​
Object of WebhookEventConfig​
no​
-​
Trigger event configuration, used for secondary filtering of trigger events that meet the criteria.​
​
WebhookEventConfig​
​
Parameter​
Type​
Required​
Sample Value​
Description​
References​
Array of String​
no​
["main" ]​
Filtered branches or tags.​
  • Push and PRMerged events support specifying filtered branches.​
  • The CreateTag event supports specifying TAGs for filtering.​
​
CRWebhookConfiguration​
​
Parameter​
Type​
Required​
Sample Value​
Description​
Filter​
no​
-​
Supported trigger actions and trigger conditions for image source triggers. By default, if no configuration is set, all events trigger the pipeline to run.​
​
CRWebhookEventFilter​
​
Parameter​
Type​
Required​
Sample Value​
Description​
CREventType​
String​
no​
CRPush​
Trigger actions​
  • CRPush: Push images​
Condition​
String​
no​
"volcregion":"xxx"​
Trigger conditions are used to further filter trigger events. Supports regular expressions.​
​
TriggerParameter​
​
Parameter​
Type​
Required​
Sample Value​
Description​
Key​
String​
Yes​
key​
The dynamic variable Key.​
Value​
String​
Yes​
value​
Dynamic variable Value​
​
TriggerResource​
​
Parameter​
Type​
Required​
Sample Value​
Description​
ResourceId​
String​
Yes​
60cb460122422352a334****​
Code source ID.​
Reference​
String​
Yes​
master​
Code reference for pipeline execution: can be a Commit ID, tag, or branch.​
​
Sample requests​
​
POST https://cp.cn-beijing.volcengineapi.com?Action=CreateTrigger&Version=2023-05-01 HTTP/1.1​
Content-Type: application/json​
{​
"WorkspaceId": "7d494e18ee414936c3d189a311676****",​
"PipelineId": "0f7ca5a42f4ce414933cfd116****",​
"Name": "Webhook-demo",​
"Type": "Webhook",​
"Configuration": {​
"Webhook": {​
"URL": "https://cp.volces.com/v2/webhook/scm/FkLuvVzsxl2zVyQtbutMYnGBi3HYEmK9ZPofERuN1TJ1FbdFztPrsG7rMrWRmQ70****"​
}​
},​
"Parameters": [​
{​
"Key": "demo_key",​
"Value": "demo_val"​
}​
]​
}​
​
Response parameters​
​
Parameter​
Type​
Sample Value​
Description​
Id​
String​
007a85e4ac034eb790b096705694****​
Trigger ID​
​
Sample response​
​
HTTP/1.1 200 OK​
Content-Type: application/json​
{​
"ResponseMetadata": {​
"RequestId": "202404071710430739950998FB2847****",​
"Action": "CreateTrigger",​
"Version": "2023-05-01",​
"Service": "cp",​
"Region": "cn-beijing"​
},​
"Result": {​
"Id": "007a85e4ac034eb790b096705694****"​
}​
}​
​
Error code​
Currently, this API does not have independent error codes. If an exception is returned when calling the API, refer to public error codes for troubleshooting.​
Last updated: 2025.09.10 17:37:28