Update automatic deployment settings via API
This method allows you to enable or disable automatic deployments for individual servers and server groups within a project.
Tip: You can explore and test this endpoint interactively using our OpenAPI documentation.
URL
/projects/<project>/auto_deployments
Replace <project> with either the permalink or identifier of the project.
HTTP Method
POST
Supported Parameters
| Parameter | Type | Description |
|---|---|---|
deployables |
Hash | A hash of deployable identifiers mapped to their settings. Each entry should contain an auto_deploy boolean. |
You can update multiple servers and server groups in a single request by including multiple entries in the deployables hash.
Example cURL Request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
-X POST \
-d '{"deployables":{"79c6a008-c7fa-4648-82fc-692f546d6c76":{"auto_deploy":true},"49d23a7d-322e-4714-81d4-a159dca5c2a7":{"auto_deploy":false}}}' \
https://test.deployhq.com/projects/my-project/auto_deployments
Example Response
{
"deployables": [
{
"identifier": "79c6a008-c7fa-4648-82fc-692f546d6c76",
"name": "Production Server",
"type": "server",
"auto_deploy": true,
"preferred_branch": "main"
},
{
"identifier": "49d23a7d-322e-4714-81d4-a159dca5c2a7",
"name": "Staging Group",
"type": "server_group",
"auto_deploy": false,
"preferred_branch": "develop"
}
]
}
The response includes the updated state of all servers and server groups in the project, not just the ones that were changed.