Create

  • POST
  • /workspaces
  • /:workspace
  • /targets

Creates a new target in the project.

Request

REQUIRED SCOPES
TARGET_ADD
URL PARAMETERS
workspacerequiredstring
The workspace name.
POST PARAMETERS
namerequiredstring
The name of the target
identifierrequiredstring
Readable ID for target. It can consist of uppercase and lowercase letters, numbers, and underscores. It must start with a letter.
typerequiredString
The type of the target. Possible values: FTP, SSH, MATCH, UPCLOUD, VULTR, DIGITAL_OCEAN, GIT, EC2.
hostrequiredstring
The host for the connection.
authrequiredauth
Authentication details.
repositorystring
The URL to the Git repository. Required when target type is GIT.
projectproject
Set this if you want to add the target to a project. Must contain field name (string).
pipelinepipeline
Set this if you want to add the target to a pipeline. Must contain field id (integer).
environmentenvironment
Set this if you want to add the target to an environment. Must contain field id (string).
permissionsTargetPermissions
Define to set permissions for the target.
all_pipelines_allowedboolean
Defines whether all pipelines are allowed to use the target.
allowed_pipelinesPipeline[]
Defines an object with the property id for pipelines that can use this target.
portstring
Port for the connection.
pathstring
Path on the server defined in the target.
integrationstring
Required when type is UPCLOUD, VULTR, DIGITAL_OCEAN and EC2 . Identifier of the integration.
secureboolean
Determines whether the transfer is FTP or FTPS. A value of true will set it to FTPS, while false will set it to FTP.
disabledboolean
When set to true the target is disabled. By default it is set to false.
tagsstring[]
A list of tags associated with the target.
regionstring
Defines the source region of EC2 addresses. Required for EC2 target. (Avaible only for EC2 target).
proxystring
Define a SSH proxy server using the following parameters (available only for SSH targets).

Last modified on Jan 27, 2026

Request example

curl -X POST "https://api.buddy.works/workspaces/:workspace/targets" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "identifier": "stage_env", "name": "Staging environment", "type": "SSH", "tags": [ "staging", "tag1" ], "host": "192.168.0.100", "port": "22", "path": "/var/www/stage", "auth": { "method": "PASSWORD", "username": "deploy_user", "password": "!encrypted sYCq9qPo23==.asd4t6+vev==" }, "permissions": { "others": "DENIED", "users": [ { "id": 1, "access_level": "MANAGE" } ], "groups": [ { "id": 2, "access_level": "USE_ONLY" } ] }, "all_pipelines_allowed": false, "allowed_pipelines": [ { "id": 1 } ] }'

Response

EXAMPLE RESPONSE
{ "url": "https://api.buddy.works/workspaces/buddy/targets/tg-nd2oxobzr7p2r", "html_url": "https://app.buddy.works/buddy/targets/tg-nd2oxobzr7p2r/edit", "id": "tg-nd2oxobzr7p2r", "identifier": "stage_env", "permissions": { "others": "USE_ONLY", "users": [ { "id": 5, "access_level": "MANAGE" } ] }, "tags": [ "tag1", "staging" ], "name": "Staging environment", "host": "192.168.0.100", "port": "22", "path": "/var/www/stage", "auth": { "method": "PASSWORD", "username": "deploy_user", "password": "!encrypted 3PA3jdHEb0WutNZNaGFXvWMSh0oAD0CxLkUzSq0cKCxPYPxtmIL3dQlFMAjvbcvL.hLyKo3tOxlgpSTieglJTJw==" }, "type": "SSH", "all_pipelines_allowed": false, "allowed_pipelines": [ { "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/1", "html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/1", "id": 1, "name": "Deploy Pipeline" } ] }
STATUS
201 Created