---
title: "Create a log entry for a specific execution (admin only)."
method: POST
path: "/api/v1/execution/{execution}/log"
---

# Create a log entry for a specific execution (admin only).

`POST /api/v1/execution/{execution}/log`

**Authentication**: JWT token required
**Authorization**: Admin level access required (ADMIN or SUPERADMIN)
**Purpose**: Manually add log entries for debugging, monitoring, or audit purposes

**Path Parameters**:
- `execution`: Execution ID (UUID format)

**Request Schema**:
```json
{
  "level": "INFO",
  "message": "Custom log message for execution monitoring",
  "details": {
    "component": "manual_logging",
    "admin_action": true,
    "timestamp": "2025-01-15T10:30:00Z"
  }
}
```

**Request Fields**:
- `level`: Log level - "DEBUG", "INFO", "WARNING", "ERROR" (required)
- `message`: Log message content (required, max 1000 characters)
- `details`: Additional structured data (optional JSON object)
- `timestamp`: Log timestamp (optional, defaults to current time)

**Success Response Schema**:
```json
{
  "data": {
    "id": "log-789",
    "execution_id": "abc123-def456",
    "timestamp": "2025-01-15T10:30:00Z",
    "level": "INFO",
    "message": "Custom log message for execution monitoring",
    "details": {
      "component": "manual_logging",
      "admin_action": true,
      "created_by": "admin-user-123"
    }
  }
}
```

**Use Cases**:
- Add administrative notes to execution logs
- Record manual interventions or troubleshooting steps
- Supplement automated logs with human observations
- Document resolution of execution issues

**Log Integration**:
- Manual logs appear alongside automated execution logs
- Preserved in execution log history
- Included in log exports and monitoring dashboards
- Tagged with creating admin user information

**Error Responses**:
- `401 Unauthorized`: JWT token required
- `403 Forbidden`: Admin access required
- `404 Not Found`: Execution does not exist
- `422 Unprocessable Entity`: Invalid request data or validation failed
- `500 Internal Server Error`: Log creation failed

## Path parameters

- `execution` string, required

## Request body

- object

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