Add pipeline
- POST
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
Creates a new pipeline in the project
Examples
Example: Create minimal pipeline
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Deploy to production",
"trigger_condition": "ALWAYS"
}'Example: Create pipeline with full configuration
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Tests",
"identifier": "test",
"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",
"start_date": "2025-01-01T08:00:00.000Z",
"delay": 60,
"refs": [
"refs/heads/development"
]
},
{
"type": "WEBHOOK",
"totp": true
},
{
"type": "PUBLISH_PACKAGE_VERSION",
"packages": [
{
"identifier": "my-package",
"scope": "PROJECT"
},
{
"identifier": "shared-package",
"scope": "WORKSPACE"
}
]
},
{
"type": "CREATE_PACKAGE_VERSION",
"packages": [
{
"identifier": "new-package:*",
"scope": "PROJECT"
}
]
},
{
"type": "DELETE_PACKAGE_VERSION",
"packages": [
{
"identifier": "deprecated-package",
"scope": "ANY"
}
]
},
{
"type": "EMAIL",
"prefix": "deploy",
"whitelist": [
"admin@company.com",
"deploy@company.com"
]
}
],
"folder": "CI/CD",
"priority": "HIGH",
"disabled": false,
"disabled_reason": null,
"target_site_url": "https://example.com",
"execution_message_template": "test",
"always_from_scratch": true,
"ignore_fail_on_project_status": true,
"no_skip_to_most_recent": true,
"terminate_stale_runs": false,
"cache_scope": "WORKSPACE",
"auto_clear_cache": true,
"pause_on_repeated_failures": 3,
"fetch_all_refs": false,
"fail_on_prepare_env_warning": true,
"concurrent_pipeline_runs": true,
"clone_depth": 5,
"do_not_create_commit_status": true,
"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"
}
]
}
],
"variables": [
{
"key": "my_var",
"value": "some_value"
}
],
"resources": "LARGE",
"git_changeset_base": "LATEST_RUN_MATCHING_REF",
"filesystem_changeset_base": "CONTENTS",
"tags": [
"backend",
"testing"
],
"cpu": "ARM",
"description_required": false,
"manage_variables_by_yaml": false,
"manage_permissions_by_yaml": false,
"environments": [
{
"type": "STAGE",
"identifier": "my_stage_env",
"tags": [
"myTag"
]
}
],
"packages": [
{
"identifier": "my-package",
"scope": "PROJECT"
},
{
"identifier": "shared-lib",
"scope": "WORKSPACE"
}
],
"permissions": {
"others": "DENIED",
"users": [
{
"id": 1,
"access_level": "READ_WRITE"
}
],
"groups": [
{
"id": 320,
"access_level": "READ_ONLY"
}
]
},
"paused": false
}'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_PACKAGE_VERSION", "packages": [ { "identifier": "my-package", "scope": "PROJECT" }, { "identifier": "shared-package", "scope": "WORKSPACE" } ] }, { "type": "CREATE_PACKAGE_VERSION", "packages": [ { "identifier": "new-package:*", "scope": "PROJECT" } ] }, { "type": "DELETE_PACKAGE_VERSION", "packages": [ { "identifier": "deprecated-package", "scope": "ANY" } ] }, { "type": "EMAIL", "prefix": "deploy", "whitelist": [ "admin@company.com", "deploy@company.com" ] } ], "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, "no_skip_to_most_recent": true, "terminate_stale_runs": false, "auto_clear_cache": true, "paused": false, "pause_on_repeated_failures": 3, "fetch_all_refs": 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" } ], "packages": [ { "identifier": "my-package", "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": [] }
STATUS201 Created