Create

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

Creates a new target in the project.

Request

REQUIRED SCOPES
WORKSPACE, TARGET_ADD
URL PARAMETERS
workspacerequired string
The workspace name.
POST PARAMETERS
namerequired string
The name of the target
identifierrequired string
Readable ID for target. It can consist of uppercase and lowercase letters, numbers, and underscores. It must start with a letter. If not provided, the same one will be set as the generated hash_id.
typerequired String
The type of the target. Possible values: FTP, SSH, MATCH, UPCLOUD, VULTR, DIGITAL_OCEAN, GIT.
hostrequired string
The host for the connection.
authrequired auth
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).
permissionsPipelinePermissions
Define to set permissions for the pipeline.
portstring
Port for the connection.
pathstring
Path on the server defined in the target.
integrationstring
Required when type is UPCLOUD, VULTR, and DIGITAL_OCEAN. 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.
proxystring
Define a SSH proxy server using the following parameters (available only for SSH targets).

Last modified on May 27, 2025

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=="
  }
}'
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" }
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999