# Get incident execution log

Returns download links for the execution log and artifacts of a failed [Playwright](https://betterstack.com/docs/uptime/playwright-monitor/) check, the same files the incident shows under **Logs** and **Artifacts**.

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v4/incidents/{incident_id}/execution-log"
method = "GET"

[[path_param]]
name = "incident_id"
description = "The ID of the incident."
required = true
type = "string"

[[query_param]]
name = "report_id"
description = "The ID of the report to return, from `reports`. Defaults to the newest report of the incident."
required = false
type = "integer"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''Returns the report's download links.'''
body = '''{
  "data": {
    "id": "123456789",
    "type": "execution_log",
    "attributes": {
      "report_id": 98765,
      "region": "eu-central-playwright",
      "recorded_at": "2026-11-12T09:41:07.512Z",
      "log_url": "https://...",
      "log_size_bytes": 18234,
      "urls_expire_at": "2026-11-12T10:45:00.000Z",
      "artifacts": [
        {
          "file_name": "log.txt",
          "url": "https://...",
          "size_bytes": 18234
        },
        {
          "file_name": "screenshot.png",
          "url": "https://...",
          "size_bytes": 254310
        }
      ],
      "reports": [
        {
          "report_id": 98765,
          "region": "eu-central-playwright",
          "recorded_at": "2026-11-12T09:41:07.512Z"
        },
        {
          "report_id": 98701,
          "region": "us-east-playwright",
          "recorded_at": "2026-11-12T09:36:05.104Z"
        }
      ]
    }
  }
}'''

[[response]]
status = 404
description = '''Returned when the incident isn't from a Playwright monitor, the newest or chosen report has no log, or `report_id` isn't one of the incident's reports.'''
body = '''{
  "errors": "There is no execution log for this incident."
}'''

[[response]]
status = 422
description = '''Returned when `report_id` isn't a positive integer.'''
body = '''{
  "errors": "Sorry, you misspelled some attributes",
  "invalid_attributes": {
    "report_id": "Must be a positive integer"
  }
}'''
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the incident."

[[param]]
name = "type"
type = "string"
description = "Always `execution_log`."

[[param]]
name = "attributes.report_id"
type = "integer"
description = "The ID of the returned report."

[[param]]
name = "attributes.region"
type = "string"
description = "The region the failed check ran from."

[[param]]
name = "attributes.recorded_at"
type = "string"
description = "When the report was recorded, in ISO 8601 format."

[[param]]
name = "attributes.log_url"
type = "string"
description = "The URL to download the execution log from. It expires at `urls_expire_at`."

[[param]]
name = "attributes.log_size_bytes"
type = "integer"
description = "The size of the execution log, in bytes."

[[param]]
name = "attributes.urls_expire_at"
type = "string"
description = "When the download URLs expire, one hour after the request, in ISO 8601 format. Request the endpoint again for fresh URLs."

[[param]]
name = "attributes.artifacts"
type = "array of objects"
description = "The files the check saved, like the log, screenshots and traces, in the order they were saved. Empty when there are none."

[[param]]
name = "attributes.artifacts[].file_name"
type = "string"
description = "The name of the file."

[[param]]
name = "attributes.artifacts[].url"
type = "string"
description = "The URL to download the file from. It expires at `urls_expire_at`."

[[param]]
name = "attributes.artifacts[].size_bytes"
type = "integer"
description = "The size of the file, in bytes."

[[param]]
name = "attributes.reports"
type = "array of objects"
description = "The incident's reports, newest first, up to 1,000. Pass a `report_id` from here to get an older report. A report of a run that failed before it saved any files has no log."

[[param]]
name = "attributes.reports[].report_id"
type = "integer"
description = "The ID of the report."

[[param]]
name = "attributes.reports[].region"
type = "string"
description = "The region the failed check ran from."

[[param]]
name = "attributes.reports[].recorded_at"
type = "string"
description = "When the report was recorded, in ISO 8601 format."
[/params]

#### Example cURL

[code-tabs]
```shell
[label Newest report]
curl --request GET \
  --url https://incidents.betterstack.com/api/v4/incidents/123456789/execution-log \
  --header "Authorization: Bearer $TOKEN"
```
```shell
[label Older report]
curl --request GET \
  --url "https://incidents.betterstack.com/api/v4/incidents/123456789/execution-log?report_id=98701" \
  --header "Authorization: Bearer $TOKEN"
```
[/code-tabs]
