Powershell Command

  • POST
  • /workspaces
  • /:workspace
  • /projects
  • /:project_name
  • /pipelines
  • /:pipeline_id
  • /actions

Request

URL PARAMETERS
workspacerequiredstring
The workspace name.
pipeline_idrequiredinteger
The numerical ID of the desired pipeline.
project_namerequiredstring
The name ID of the project.
POST PARAMETERS
namerequiredstring
The name of the action.
typerequiredstring
Defines the type of the action. Should be set to POWERSHELL.
targetsrequiredstring
Define a target (server) for your deployments using the following paramters
commandrequiredstring[]
The array of commands invoked on the remote server.
run_as_scriptboolean
If set to true, commands are executed as a regular script. If set to false, the commands will be executed one by one, in non-interactive mode.
working_directorystring
The absolute or relative path on the remote server.
execute_every_commandboolean
If set to true all commands will be executed regardless of the result of the previous command.
regionstring
Defines the source region of EC2 addresses. Required for EC2 target. (Avaible only for EC2 target).

Last modified on Jan 19, 2026

Request example

curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "Deploy PowerShell Scripts to Windows Server", "type": "POWERSHELL", "working_directory": "C:\\Deployment\\Scripts", "commands": [ "Write-Host \"Starting deployment at $(Get-Date)\"", "$services = Get-Service | Where-Object {$_.Name -like \"MyApp*\"}", "Stop-Service $services -Force", "Copy-Item -Path .\\* -Destination C:\\Apps\\MyApp -Recurse -Force", "Start-Service $services", "Get-Service $services | Format-Table Name, Status" ], "targets": [ { "type": "SSH", "identifier": "prod_win_server", "host": "10.0.1.50", "port": "22", "auth": { "method": "PASSWORD", "username": "deploy_user", "password": "$DEPLOY_PASSWORD" } } ], "run_as_script": true, "execute_every_command": false }'

Response

EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/my-workspace/projects/web-app/pipelines/12345/actions/789456", "html_url": "https://app.buddy.works/my-workspace/web-app/pipelines/pipeline/12345/action/789456/edit", "id": 789456, "name": "Deploy PowerShell Scripts to Windows Server", "type": "POWERSHELL", "trigger_time": "ON_EVERY_EXECUTION", "last_execution_status": "INITIAL", "disabled": false, "working_directory": "C:\\Deployment\\Scripts", "commands": [ "Write-Host \"Starting deployment at $(Get-Date)\"", "$services = Get-Service | Where-Object {$_.Name -like \"MyApp*\"}", "Stop-Service $services -Force", "Copy-Item -Path .\\* -Destination C:\\Apps\\MyApp -Recurse -Force", "Start-Service $services", "Get-Service $services | Format-Table Name, Status" ], "targets": [ { "type": "SSH", "identifier": "prod_win_server", "host": "10.0.1.50", "port": "22", "auth": { "method": "PASSWORD", "username": "deploy_user", "password": "secure!Fa+KZiUPt454/V0I/rzVow==.NTxejOG4XOsR8a5u8PLhVw==" } } ], "pipeline": { "url": "https://api.buddy.works/workspaces/my-workspace/projects/web-app/pipelines/12345", "html_url": "https://app.buddy.works/my-workspace/web-app/pipelines/pipeline/12345", "id": 12345, "name": "Production Deployment", "on": "EVENT", "definition_source": "LOCAL", "git_config_ref": "NONE", "events": [ { "type": "PUSH", "refs": [ "refs/heads/master" ] } ], "priority": "NORMAL", "disabled": false, "last_execution_status": "SUCCESSFUL", "always_from_scratch": false, "ignore_fail_on_project_status": false, "no_skip_to_most_recent": false, "terminate_stale_runs": false, "auto_clear_cache": false, "fetch_all_refs": false, "fail_on_prepare_env_warning": true, "concurrent_pipeline_runs": false, "do_not_create_commit_status": false, "stale": false, "waiting_for_push": false, "resources": "DEFAULT", "git_changeset_base": "LATEST_RUN", "filesystem_changeset_base": "DATE_MODIFIED", "cpu": "X64", "description_required": false }, "ignore_errors": false, "run_as_script": true, "shell": "POWERSHELL", "run_next": "WAIT_ON_SUCCESS", "execute_every_command": false }
STATUS
201 Created