curl -X GET "https://api.a1base.com/v1/cron-jobs/{accountId}/logs/550e8400-e29b-41d4-a716-446655440000?page=1&limit=20&status=failure" \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret"
{
  "data": [
    {
      "id": "exe_123456789",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-25T14:00:00Z",
      "status": "success",
      "response_code": 200,
      "response_body": "{\"message\": \"Report generated successfully\"}",
      "error_message": null
    },
    {
      "id": "exe_987654321",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-24T14:00:05Z",
      "status": "failure",
      "response_code": 500,
      "response_body": "{\"error\": \"Database connection failed\"}",
      "error_message": "Endpoint returned status code 500"
    },
    {
      "id": "exe_456789123",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-23T14:00:00Z",
      "status": "timeout",
      "response_code": null,
      "response_body": null,
      "error_message": "Request timed out after 30 seconds"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total_items": 3,
    "total_pages": 1
  }
}

Retrieve the execution history and logs for a specific cron job. This endpoint provides detailed information about past executions, including success/failure status, response codes, and error messages.

Path Parameters

accountId
string
required

Your A1Base account ID

cron_job_id
string
required

The unique identifier of the cron job (UUID format)

Query Parameters

page
integer
default:"1"

Page number for pagination (minimum: 1)

limit
integer
default:"50"

Number of items per page (minimum: 1, maximum: 100)

status
string

Filter by execution status: success, failure, error, timeout

start_date
string

Filter logs after this date (ISO 8601 format)

Example: 2024-01-01T00:00:00Z

end_date
string

Filter logs before this date (ISO 8601 format)

Example: 2024-01-31T23:59:59Z

Response

data
array

Array of execution log objects

pagination
object

Pagination information

curl -X GET "https://api.a1base.com/v1/cron-jobs/{accountId}/logs/550e8400-e29b-41d4-a716-446655440000?page=1&limit=20&status=failure" \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret"
{
  "data": [
    {
      "id": "exe_123456789",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-25T14:00:00Z",
      "status": "success",
      "response_code": 200,
      "response_body": "{\"message\": \"Report generated successfully\"}",
      "error_message": null
    },
    {
      "id": "exe_987654321",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-24T14:00:05Z",
      "status": "failure",
      "response_code": 500,
      "response_body": "{\"error\": \"Database connection failed\"}",
      "error_message": "Endpoint returned status code 500"
    },
    {
      "id": "exe_456789123",
      "cron_job_id": "550e8400-e29b-41d4-a716-446655440000",
      "executed_at": "2024-01-23T14:00:00Z",
      "status": "timeout",
      "response_code": null,
      "response_body": null,
      "error_message": "Request timed out after 30 seconds"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total_items": 3,
    "total_pages": 1
  }
}

Log Analysis Examples

Understanding Status Codes

success

The endpoint returned a 2xx status code

failure

The endpoint returned a 4xx or 5xx status code

error

Network error or invalid endpoint URL

timeout

The request exceeded the configured timeout

Best Practices

  1. Regular Monitoring: Check logs daily for critical jobs
  2. Set Up Alerts: Use failure callbacks to get notified immediately
  3. Analyze Patterns: Look for time-based failure patterns
  4. Export Important Logs: Download logs before they expire
  5. Calculate Metrics: Track success rates and response times

Log Retention

Execution logs are retained for 30 days. Export important logs if you need longer retention.