---
title: "Retrieve system status logs for monitoring and diagnostics."
method: GET
path: "/api/v1/status"
---

# Retrieve system status logs for monitoring and diagnostics.

`GET /api/v1/status`

**Authentication**: JWT token required
**Access**: Restricted to ADMIN and SUPERADMIN users only
**Purpose**: Monitor system health, track events, and diagnose issues

**Query Parameters**:
- `start_date`: Filter logs from this date onwards (ISO 8601 format)
- `end_date`: Filter logs up to this date (ISO 8601 format)
- `sort`: Sort field (prefix with '-' for descending, e.g., '-timestamp')
- `page`: Page number for pagination (default: 1)
- `per_page`: Items per page (1-10000, default: 100)

**Response Schema**:
```json
{
  "data": [
    {
      "id": 123,
      "timestamp": "2025-01-15T10:30:00Z",
      "executions_pending": 2,
      "executions_ready": 2,
      "executions_running": 3,
      "executions_finished": 8,
      "executions_failed": 1,
      "executions_cancelled": 0
    },
    {
      "id": 124,
      "timestamp": "2025-01-15T10:35:00Z",
      "executions_pending": 3,
      "executions_ready": 5,
      "executions_running": 3,
      "executions_finished": 12,
      "executions_failed": 2,
      "executions_cancelled": 1
    }
  ],
  "page": 1,
  "per_page": 100,
  "total": 1547
}
```

**Status Log Fields**:
- `id`: Unique identifier for the status log entry
- `timestamp`: When the status was recorded (ISO 8601 format)
- `executions_pending`: Number of executions queued to start (PENDING state)
- `executions_ready`: Number of executions in READY state
- `executions_running`: Number of currently running executions
- `executions_finished`: Number of executions that finished
- `executions_failed`: Number of executions that failed
- `executions_cancelled`: Number of executions that were cancelled

**Monitoring Metrics**:
- Track execution queue length and processing status
- Monitor execution completion and failure rates
- Identify trends in script execution success/failure rates
- System health indicators for capacity planning
- Event-driven status tracking provides real-time execution state

**Date Filtering Examples**:
- `?start_date=2025-01-15T00:00:00Z` - Logs from January 15th onwards
- `?end_date=2025-01-15T23:59:59Z` - Logs up to end of January 15th
- `?start_date=2025-01-10T00:00:00Z&end_date=2025-01-15T23:59:59Z` - Logs
  within date range

**Sorting Examples**:
- `?sort=timestamp` - Chronological order (oldest first)
- `?sort=-timestamp` - Reverse chronological (newest first, default)
- `?sort=level` - Sort by severity level

**Pagination Examples**:
- `?page=1&per_page=50` - First 50 entries
- `?page=2&per_page=100` - Next 100 entries
- Default pagination: 100 items per page

**Use Cases**:
- Monitor execution queue length and processing capacity
- Track system growth (users and scripts over time)
- Analyze execution success rates and failure patterns
- Capacity planning based on execution activity trends
- Performance monitoring and bottleneck identification

**Error Responses**:
- `401 Unauthorized`: JWT token required
- `403 Forbidden`: Insufficient privileges (ADMIN+ required)
- `500 Internal Server Error`: Failed to retrieve status logs

## 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)
