Listing all servers via API
This method will return a list of all servers which are configured for your project.
Tip: You can explore and test this endpoint interactively using our OpenAPI documentation.
URL
/projects/<project>/servers
Replace <project> with either the permalink or identifier of the project.
HTTP Method
GET
Supported Parameters
None
Example cURL request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
https://test.deployhq.com/projects/project/servers
Example JSON
[
{
"id": 1,
"identifier": "b68b6f98-abec-4c6a-830b-aadc62b2ecc7",
"name": "Production",
"protocol_type": "ssh",
"server_path": "/tmp",
"last_revision": null,
"preferred_branch": "devel",
"branch": "",
"notify_email": "",
"server_group_identifier": null,
"auto_deploy": false,
"environment": "",
"enabled": true,
"hostname": "127.0.0.1",
"port": "22",
"username": "root",
"use_ssh_keys": true,
"host_key": "....",
"url": "https://test.deployhq.com/projects/my-project/servers/b68b6f98-abec-4c6a-830b-aadc62b2ecc7"
},
{
"id": 2,
"identifier": "c79c7f09-bcfd-5d7b-941c-bbed73c3fdd8",
"name": "Staging",
"protocol_type": "ssh",
"server_path": "/var/www",
"last_revision": null,
"preferred_branch": "devel",
"branch": "",
"notify_email": "",
"server_group_identifier": null,
"auto_deploy": true,
"environment": "staging",
"enabled": true,
"hostname": "127.0.0.1",
"port": "22",
"username": "root",
"use_ssh_keys": true,
"host_key": "....",
"url": "https://test.deployhq.com/projects/my-project/servers/c79c7f09-bcfd-5d7b-941c-bbed73c3fdd8"
}
]