---
title: "Retrieve AWS Batch (CloudWatch) logs for a specific execution."
method: GET
path: "/api/v1/execution/{execution}/batch-logs"
---

# Retrieve AWS Batch (CloudWatch) logs for a specific execution.

`GET /api/v1/execution/{execution}/batch-logs`

**Authentication**: JWT token required
**Access**: Restricted to ADMIN and SUPERADMIN users only
**Purpose**: Provides CloudWatch container logs for Batch-based
  script executions, analogous to the Docker logs endpoint.

**Path Parameters**:
- `execution`: The ID of the execution to retrieve logs for.

**Success Response Schema**:
```json
{
  "data": [
    {
      "id": 0,
      "created_at": "2025-08-04T10:30:00.123Z",
      "text": "Log message from the container",
      "job_name": "extract"
    }
  ]
}
```

**Response Fields**:
- `id`: A sequential identifier for the log line (for ordering).
- `created_at`: The timestamp of the log entry (ISO 8601 format).
- `text`: The content of the log line.
- `job_name`: The Batch job step name that produced this log line.

**Error Responses**:
- `401 Unauthorized`: JWT token required.
- `403 Forbidden`: Insufficient privileges (ADMIN+ required).
- `404 Not Found`: The specified execution or its logs do not exist.
- `500 Internal Server Error`: Failed to retrieve logs due to a server-side
  issue.

## Path parameters

- `execution` string, required

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
