---
title: "Update an SSH command"
method: PUT
path: "/projects/{project_id}/commands/{id}"
tags: ["Ssh Commands"]
---

# Update an SSH command

`PUT /projects/{project_id}/commands/{id}`

## Request

- Base URL: `https://sg.deployhq.com`
- URL: `https://sg.deployhq.com/projects/{project_id}/commands/{id}`
- Auth: HTTP basic

Updates an existing SSH command's properties. Server assignments are only modified when server parameters are explicitly provided.

## Path parameters

- `project_id` string, required
- `id` string, required

## Request body

- CommandObject4
  - `command` object, required
    - `cback` string
    - `position` integer
    - `description` string
    - `command` string
    - `halt_on_error` boolean
    - `timing` string
    - `timeout` integer
    - `enabled` boolean

## Response `200`

Success

- Command
  - `identifier` string
  - `cback` string
  - `position` integer
  - `description` string
  - `command` string
  - `halt_on_error` boolean
  - `servers` object[]
    - `id` integer
    - `identifier` string
    - `name` string
    - `protocol_type` string
    - `server_path` string
    - `last_revision` string
    - `preferred_branch` string
    - `branch` string
    - `notify_email` string
    - `server_group_identifier` string, nullable
    - `auto_deploy` boolean
    - `environment` string
    - `enabled` boolean
    - `agent` string, nullable
    - `atomic` boolean
    - `atomic_strategy` string
    - `atomic_retention` integer
    - `use_compression` boolean
    - `use_accelerated_transfer` boolean
    - `use_parallel_upload` boolean
    - `root_path` string, nullable
    - `position` integer
    - `created_at` string
    - `updated_at` string
    - `connection_checked_at` string, nullable
    - `connection_error_message` string, nullable
    - `use_ssh_keys` boolean
    - `hostname` string
    - `username` string
    - `port` string
    - `host_key` string
  - `timing` string
  - `timeout` integer
  - `enabled` boolean

## Other responses

- `401`: You are not authorized to access this resource. You need to authenticate yourself first.
- `403`: You are not allowed to access this resource. You do not have the necessary permissions.
- `404`: The requested resource could not be found.
- `422`: Unprocessable Entity
- `500`: An unexpected error occurred on the server. The server was unable to process the request.

---

[API](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation.md) · [All operations](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/deployhq/apis/deployhq-api-interactive-documentation/revisions/830264ae58be?raw)
