View individual deployment logs via API
Each deployment has a number of "steps", which contain a subset of logs, such as the transferring_files step, which will contain a list of all file operations in the deployment.
URL
/projects/<project>/deployments/<deployment-identifier>/steps/<step-identifier>/logs
Replace <project> with either the permalink or identifier of the project, <deployment-identifier> with the identifier of the deployment, and <step-identifier> with the identifier of the step.
The step identifier can be located within the deployment_steps hash when looking at a deployment through the /projects/<project>/deployments/<deployment-identifier> endpoint.
HTTP Method
GET
Supported Parameters
| Parameter | Type | Description |
|---|---|---|
before |
Integer | Return log entries with an ID less than this value (for pagination) |
download |
Boolean | Set to true to download the logs as a plain text file |
Example cURL Request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
https://atech.deployhq.com/projects/react-project/deployments/b5d0d157-674c-4bdd-ac7b-89ae83a9c275/steps/53b01afd-3c36-4acc-96b9-7fa968aa1f98/logs
Example Response
[
{
"id": 260520775,
"step": "53b01afd-3c36-4acc-96b9-7fa968aa1f98",
"message": "Uploading build/service-worker.js",
"detail": "htdocs/service-worker.js",
"type": "info"
},
{
"id": 260519065,
"step": "53b01afd-3c36-4acc-96b9-7fa968aa1f98",
"message": "Uploading build/static/media/logo.5d5d9eef.svg",
"detail": "htdocs/static/media/logo.5d5d9eef.svg",
"type": "info"
},
{
"id": 260518921,
"step": "53b01afd-3c36-4acc-96b9-7fa968aa1f98",
"message": "Uploading build/static/css/main.cacbacc7.css",
"detail": "htdocs/static/css/main.cacbacc7.css",
"type": "info"
}
]
Each log entry contains:
| Field | Type | Description |
|---|---|---|
id |
Integer | Unique identifier for the log entry |
step |
String | The identifier of the deployment step this log belongs to |
message |
String | The log message |
detail |
String | Additional detail (e.g. remote path, command output as HTML) |
type |
String | The log type (e.g. info, command, error) |