Create target

View as Markdown
  • POST
  • /workspaces
  • /:workspace
  • /targets

Create a new deployment target

Request

REQUIRED SCOPES
TARGET_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

BODY PARAMETERS
typerequiredstring enum
The type of the target
Allowed enum:
SSH,
FTP,
GIT,
MATCH,
EC2,
DIGITAL_OCEAN,
VULTR,
UPCLOUD,
GKE,
EKS,
AKS,
DOKS,
K8S_CLUSTER,
MYSQL,
POSTGRESQL,
PROJECT_REPO,
MONGO,
MSSQL,
RDS_MSSQL,
CLICKHOUSE,
RDS_MYSQL,
RDS_POSTGRESQL,
SANDBOX
idstring
The ID of the target
identifierrequiredstring
A human-readable ID. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end).
namestring
The name of the target
projectShortProjectView
Short representation of a project
pipelineShortPipelineView
Short representation of a pipeline
environmentShortEnvironmentView
permissionsPermissionsView
Access permissions configuration
pipelines_access_levelstring enum
Pipelines access level for this target
Allowed enum:
DENIED,
READ_ONLY,
USE_ONLY,
BLIND,
RUN_ONLY,
READ_WRITE,
MANAGE,
DEFAULT,
ALLOWED,
STAGE,
COMMIT
allowed_pipelinesAllowedPipelineView[]
List of specific pipelines allowed to use this target
sandboxes_access_levelstring enum
Sandboxes access level for this target
Allowed enum:
DENIED,
READ_ONLY,
USE_ONLY,
BLIND,
RUN_ONLY,
READ_WRITE,
MANAGE,
DEFAULT,
ALLOWED,
STAGE,
COMMIT
allowed_sandboxesAllowedSandboxView[]
List of specific sandboxes allowed to use this target
allowed_environmentsAllowedEnvironmentView[]
List of environments whose sandboxes are allowed to use this target. A rule for a specific sandbox takes precedence over an environment rule.
disabledboolean
Indicates if this target is disabled (default: false)
tagsstring[]
The list of tags associated with the target

Constraints: Unique items required

use_asUseAsView
Defines how the target can be used (as deployment target, proxy, or both)
notestring
Note for this resource
agent_notestring
YAML note for AI agents operating on this resource
Hint
On top of these properties every target has a set of properties unique to its type. You can read how to define each type in separate articles below.

Last modified on Nov 26, 2026

Request example

CURL
curl -X POST "https://api.buddy.works/workspaces/:workspace/targets" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json"
EXAMPLE RESPONSE
{
  "url": "https://api.buddy.works/workspaces/my-workspace/targets/tg-12345",
  "html_url": "https://app.buddy.works/targets/tg-12345",
  "id": "tg-12345",
  "identifier": "production-web-server",
  "name": "Production Web Server",
  "type": "SSH",
  "host": "web.example.com",
  "port": "22",
  "path": "/var/www/html",
  "auth": {
    "method": "SSH_KEY",
    "username": "deploy",
    "asset": "production-ssh-key"
  },
  "tags": [
    "production",
    "web",
    "deploy"
  ],
  "pipelinesAccessLevel": "DENIED",
  "allowedPipelines": [
    {
      "project": "my-project",
      "pipeline": "deploy-pipeline"
    },
    {
      "project": "my-project",
      "pipeline": "hotfix-pipeline"
    }
  ],
  "permissions": {
    "others": "READ_ONLY",
    "users": [
      {
        "id": 42,
        "access_level": "USE_ONLY"
      }
    ],
    "groups": []
  },
  "note": "Notes about this resource",
  "agent_note": "my_custom_field: note for agent"
}
STATUS
201 Created