Create
- POST
- /workspaces
- /:workspace
- /targets
Creates a new target in the project.
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" }
STATUS201 Created
LIMITSX-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999