Clone pipeline
- POST
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
Creates a new pipeline in the project
Request example
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"source_pipeline_id": 123,
"name": "Cloned Pipeline",
"identifier": "cloned-pipeline"
}'EXAMPLE RESPONSE
{
"url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/pipelines/620",
"html_url": "https://app.buddy.works/my-workspace/my-project/pipelines/pipeline/620",
"id": 620,
"identifier": "test",
"name": "Tests",
"definition_source": "LOCAL",
"git_config_ref": "NONE",
"refs": [
"refs/heads/main"
],
"events": [
{
"type": "PUSH",
"refs": [
":context",
"refs/heads/dev-*"
]
},
{
"type": "CREATE_REF",
"refs": [
"refs/heads/feature-*"
]
},
{
"type": "DELETE_REF",
"refs": [
"refs/heads/temp-*"
]
},
{
"type": "PULL_REQUEST",
"events": [
"assigned",
"unassigned"
],
"branches": [
"main",
"releases/*"
]
},
{
"type": "SCHEDULE",
"refs": [
"refs/heads/development"
],
"start_date": "2025-01-01T08:00:00Z",
"delay": 60
},
{
"type": "WEBHOOK",
"totp": true
},
{
"type": "PUBLISH_ARTIFACT_VERSION",
"artifacts": [
{
"identifier": "my-artifact",
"scope": "PROJECT"
},
{
"identifier": "shared-artifact",
"scope": "WORKSPACE"
}
]
},
{
"type": "CREATE_ARTIFACT_VERSION",
"artifacts": [
{
"identifier": "new-artifact:*",
"scope": "PROJECT"
}
]
},
{
"type": "DELETE_ARTIFACT_VERSION",
"artifacts": [
{
"identifier": "deprecated-artifact",
"scope": "ANY"
}
]
},
{
"type": "EMAIL",
"prefix": "deploy",
"whitelist": [
"admin@company.com",
"deploy@company.com"
]
},
{
"type": "SANDBOX_CREATED",
"targets": [
{
"type": "MATCH",
"filter": {
"identifier": "my-sandbox-*",
"scope": "ANY"
}
}
]
},
{
"type": "SANDBOX_DELETED",
"targets": [
{
"type": "MATCH",
"filter": {
"identifier": "*",
"scope": "ANY"
}
}
]
},
{
"type": "SANDBOX_TIMED_OUT",
"targets": [
{
"type": "MATCH",
"filter": {
"identifier": "staging-*",
"scope": "ANY",
"tags": [
"production"
]
}
}
]
}
],
"folder": "CI/CD",
"priority": "HIGH",
"disabled": false,
"disabled_reason": null,
"last_execution_status": "INITIAL",
"target_site_url": "https://example.com",
"execution_message_template": "test",
"create_date": "2025-10-02T07:20:53Z",
"always_from_scratch": true,
"ignore_fail_on_project_status": true,
"strict_context": false,
"skip_queued_runs": "NEVER",
"cancel_inprogress_runs": "NEVER",
"auto_clear_cache": true,
"paused": false,
"pause_on_repeated_failures": 3,
"fetch_all_refs": false,
"fetch_lfs": false,
"fail_on_prepare_env_warning": true,
"concurrent_pipeline_runs": true,
"clone_depth": 5,
"do_not_create_commit_status": true,
"stale": false,
"waiting_for_push": false,
"trigger_conditions": [
{
"trigger_condition": "ON_CHANGE_AT_PATH",
"trigger_condition_paths": [
"src/**/*",
"tests/**/*"
]
},
{
"trigger_condition": "VAR_IS",
"trigger_variable_key": "ENV",
"trigger_variable_value": "production"
},
{
"trigger_condition": "VAR_GREATER_THAN",
"trigger_variable_key": "BUILD_NUMBER",
"trigger_variable_value": "100"
},
{
"trigger_condition": "DATETIME",
"trigger_days": [
1,
2,
3,
4,
5
],
"trigger_hours": [
9,
10,
11,
14,
15,
16
],
"timezone": "Europe/Warsaw"
},
{
"trigger_condition": "SUCCESS_PIPELINE",
"trigger_project_name": "my-project",
"trigger_pipeline_name": "build"
},
{
"trigger_condition": "TRIGGERING_USER_IS",
"trigger_user": "admin@company.com"
},
{
"trigger_condition": "TRIGGERING_USER_IS_IN_GROUP",
"trigger_group": "DevOps Team"
},
{
"trigger_condition": "OR",
"trigger_operands": [
{
"trigger_condition": "VAR_IS",
"trigger_variable_key": "DEPLOY",
"trigger_variable_value": "true"
},
{
"trigger_condition": "TRIGGERING_USER_IS",
"trigger_user": "release-manager@company.com"
}
]
}
],
"resources": "LARGE",
"git_changeset_base": "LATEST_RUN_MATCHING_REF",
"filesystem_changeset_base": "CONTENTS",
"tags": [
"backend",
"testing"
],
"cpu": "ARM",
"description_required": false,
"project": {
"url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project",
"html_url": "https://app.buddy.works/my-workspace/my-project",
"name": "my-project",
"display_name": "My Project",
"status": "ACTIVE"
},
"creator": {
"url": "https://api.buddy.works/workspaces/my-workspace/members/123",
"html_url": "https://app.buddy.works/my-workspace/-/profile/123",
"id": 123,
"name": "John Doe",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/123/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/w/32/32/AVATAR.png?ts=1674644200000",
"email": "john.doe@company.com",
"admin": true,
"workspace_owner": true
},
"cache_scope": "PIPELINE",
"variables": [
{
"id": 1514,
"key": "my_var",
"value": "some_value",
"type": "VAR",
"description": ""
}
],
"environments": [
{
"identifier": "my_stage_env",
"tags": [
"myTag"
],
"scope": "ANY"
}
],
"artifacts": [
{
"identifier": "my-artifact",
"scope": "PROJECT"
},
{
"identifier": "shared-lib",
"scope": "WORKSPACE"
}
],
"permissions": {
"others": "DENIED",
"users": [
{
"id": 1,
"access_level": "READ_WRITE"
}
],
"groups": [
{
"id": 320,
"access_level": "READ_ONLY"
}
]
},
"manage_variables_by_yaml": false,
"manage_permissions_by_yaml": false,
"actions": []
}STATUS
201 Created