Last updated on 15th September 2026

Update a global build command via API

This method updates an existing global build command template. Because the command is shared, changes apply to every project it is linked to.

Tip: You can explore and test this endpoint interactively using our OpenAPI documentation.

URL

/global_build_commands/:identifier

HTTP Method

PATCH

Supported Parameters

  • description - A description of the build command
  • command - The command to run during the build pipeline
  • halt_on_error - Whether the deployment should stop if the command fails
  • template_name - The name of a predefined build command template to base this command on
  • watch_files - A comma-separated list of file patterns that should trigger this command

Example cURL Request

curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user your-email@example.com:your-api-key \
-X PATCH \
-d '{
  "build_command": {
    "command": "npm ci --production"
  }
}' \
https://test.deployhq.com/global_build_commands/df8966fe-e161-4517-98e2-24f79102dd62

Example Response

{
  "identifier": "df8966fe-e161-4517-98e2-24f79102dd62",
  "description": "Install dependencies",
  "command": "npm ci --production",
  "halt_on_error": true,
  "source": "global"
}

Error Responses

If the update is invalid, the endpoint responds with 422 Unprocessable Entity and a list of the validation errors:

{
  "errors": [
    "Command cannot contain sudo"
  ]
}

Other responses you may receive:

  • 401 Unauthorized - the email address or API key is missing or incorrect
  • 403 Forbidden - your user is not an account administrator
  • 404 Not Found - no global build command matches the supplied identifier