BETA
Skip to content

Executions

Query execution history for a cron job. Each execution records the HTTP status, response body, duration, and error details.

Base URL: https://app.krafter.dev/api/v1

List Executions

Retrieve execution history for a specific job, ordered by most recent first.

GET /cron/jobs/:id/executions

Required scope: cron:read

Retention

The most recent 100 executions per job are retained. Older executions are deleted by a nightly cleanup at 04:00 UTC.

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Number of executions to return. Maximum 100.

Example Request

bash
curl "https://app.krafter.dev/api/v1/cron/jobs/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d/executions?limit=5" \
  -H "Authorization: Bearer kr_live_abc123def456"

Example Response

json
{
  "data": [
    {
      "id": "e1f2a3b4-c5d6-e7f8-a9b0-c1d2e3f4a5b6",
      "status": "success",
      "http_status": 200,
      "response_body": "{\"status\":\"ok\"}",
      "error": null,
      "attempt": 1,
      "duration_ms": 142,
      "started_at": "2025-01-15T10:10:00Z",
      "finished_at": "2025-01-15T10:10:00Z"
    },
    {
      "id": "f2a3b4c5-d6e7-f8a9-b0c1-d2e3f4a5b6c7",
      "status": "failed",
      "http_status": 500,
      "response_body": "{\"error\":\"Internal Server Error\"}",
      "error": "HTTP 500",
      "attempt": 3,
      "duration_ms": 1523,
      "started_at": "2025-01-15T10:05:00Z",
      "finished_at": "2025-01-15T10:05:01Z"
    }
  ]
}

Execution Status Reference

Timeouts and connection errors both produce status: "failed" with the error class captured in the error field (e.g. "%Mint.TransportError{reason: :timeout}"). HTTP status codes from the target endpoint are recorded in http_status; for connection-level errors (including timeouts) http_status is null.

StatusDescription
successThe HTTP request completed with a 2xx status code.
failedThe HTTP request returned a non-2xx status code, timed out, or a connection error occurred.

Response Fields

FieldTypeDescription
idstringUnique execution identifier.
statusstringExecution result: "success" or "failed".
http_statusinteger | nullHTTP status code from the target endpoint. null for connection-level errors (including timeouts).
response_bodystring | nullResponse body from the target endpoint (truncated to 2 KB; suffix ...[truncated] appended when truncation occurs). null for connection-level errors.
errorstring | nullError message (inspect-form of the underlying error class). null for successful executions.
attemptintegerAttempt number (1 for the first attempt, incremented on retries).
duration_msintegerTotal execution time in milliseconds.
started_atstringISO 8601 timestamp when the execution started.
finished_atstringISO 8601 timestamp when the execution completed.

Built by Krafter Studio