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
The unique identifier of the cron job (UUID format)
Query Parameters
Page number for pagination (minimum: 1)
Number of items per page (minimum: 1, maximum: 100)
Filter by execution status: success, failure, error, timeout
Filter logs after this date (ISO 8601 format) Example: 2024-01-01T00:00:00Z
Filter logs before this date (ISO 8601 format) Example: 2024-01-31T23:59:59Z
Response
Array of execution log objects Show Execution Log Object
Unique identifier for the execution
ID of the cron job that was executed
ISO 8601 timestamp of when the job was executed
Execution status: success, failure, error, timeout
HTTP response code from the endpoint (null for timeouts)
Response body from the endpoint (truncated to 1KB)
Error message if the execution failed
Pagination information Total number of log entries
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
GET /v1/cron-jobs/{accountId}/logs/{cron_job_id}?status=failure & limit = 10
Shows the 10 most recent failed executions.
GET /v1/cron-jobs/{accountId}/logs/{cron_job_id}?start_date=2024-01-25T00:00:00Z & end_date = 2024-01-25T23:59:59Z
Get all executions for a specific day to calculate success rate.
GET /v1/cron-jobs/{accountId}/logs/{cron_job_id}?status=timeout
Find all executions that timed out to identify performance issues.
GET /v1/cron-jobs/{accountId}/logs/{cron_job_id}?status=error & limit = 50
Analyze error patterns to improve reliability.
Understanding Status Codes
The endpoint returned a 2xx status code
The endpoint returned a 4xx or 5xx status code
Network error or invalid endpoint URL
The request exceeded the configured timeout
Best Practices
Regular Monitoring : Check logs daily for critical jobs
Set Up Alerts : Use failure callbacks to get notified immediately
Analyze Patterns : Look for time-based failure patterns
Export Important Logs : Download logs before they expire
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.