Cron Jobs
Cron Jobs API
API reference for managing scheduled tasks
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API reference for managing scheduled tasks
Authorization: Bearer YOUR_API_KEY
https://api.a1base.com/v1
POST /cron-jobs
| Parameter | Type | Required | Description |
|---|---|---|---|
endpoint_url | string | Yes | The URL to be called when the cron job executes |
frequency | string | Yes | Frequency of execution (daily, weekly, monthly, custom) |
time | string | Yes | Time of execution in 24-hour format (HH:MM) |
timezone | string | Yes | Timezone for the execution time (e.g., America/Los_Angeles) |
method | string | Yes | HTTP method to use (GET, POST, PUT, DELETE) |
headers | object | No | HTTP headers to include with the request |
body | object | No | Request body for POST/PUT methods |
day_of_week | integer | No | Day of week for weekly jobs (0-6, where 0 is Sunday) |
day_of_month | integer | No | Day of month for monthly jobs (1-31) |
custom_schedule | string | No | Cron expression for custom schedules |
{
"endpoint_url": "https://api.example.com/webhook",
"frequency": "daily",
"time": "09:00",
"timezone": "America/New_York",
"method": "POST",
"headers": {
"Authorization": "Bearer token123",
"Content-Type": "application/json"
},
"body": {
"action": "daily_update",
"params": {
"user_id": "all"
}
}
}
{
"id": "crn_123456789",
"endpoint_url": "https://api.example.com/webhook",
"frequency": "daily",
"time": "09:00",
"timezone": "America/New_York",
"method": "POST",
"headers": {
"Authorization": "Bearer token123",
"Content-Type": "application/json"
},
"body": {
"action": "daily_update",
"params": {
"user_id": "all"
}
},
"status": "active",
"created_at": "2023-05-20T15:30:45Z",
"next_execution": "2023-05-21T09:00:00-04:00"
}
GET /cron-jobs
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status (active, paused) |
limit | integer | No | Maximum number of records to return (default: 20, max: 100) |
offset | integer | No | Number of records to skip (for pagination) |
{
"data": [
{
"id": "crn_123456789",
"endpoint_url": "https://api.example.com/webhook",
"frequency": "daily",
"time": "09:00",
"timezone": "America/New_York",
"method": "POST",
"status": "active",
"created_at": "2023-05-20T15:30:45Z",
"next_execution": "2023-05-21T09:00:00-04:00"
},
{
"id": "crn_987654321",
"endpoint_url": "https://api.example.com/weekly-report",
"frequency": "weekly",
"time": "07:00",
"day_of_week": 1,
"timezone": "America/Los_Angeles",
"method": "GET",
"status": "paused",
"created_at": "2023-05-15T10:20:30Z",
"next_execution": null
}
],
"meta": {
"total": 2,
"limit": 20,
"offset": 0
}
}
GET /cron-jobs/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
{
"id": "crn_123456789",
"endpoint_url": "https://api.example.com/webhook",
"frequency": "daily",
"time": "09:00",
"timezone": "America/New_York",
"method": "POST",
"headers": {
"Authorization": "Bearer token123",
"Content-Type": "application/json"
},
"body": {
"action": "daily_update",
"params": {
"user_id": "all"
}
},
"status": "active",
"created_at": "2023-05-20T15:30:45Z",
"next_execution": "2023-05-21T09:00:00-04:00",
"last_execution": {
"timestamp": "2023-05-20T09:00:00-04:00",
"status": "success",
"response_code": 200,
"response_time_ms": 245
}
}
PATCH /cron-jobs/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
{
"time": "10:30",
"headers": {
"Authorization": "Bearer new_token456",
"Content-Type": "application/json"
}
}
{
"id": "crn_123456789",
"endpoint_url": "https://api.example.com/webhook",
"frequency": "daily",
"time": "10:30",
"timezone": "America/New_York",
"method": "POST",
"headers": {
"Authorization": "Bearer new_token456",
"Content-Type": "application/json"
},
"body": {
"action": "daily_update",
"params": {
"user_id": "all"
}
},
"status": "active",
"created_at": "2023-05-20T15:30:45Z",
"updated_at": "2023-05-20T16:45:12Z",
"next_execution": "2023-05-21T10:30:00-04:00"
}
POST /cron-jobs/{id}/pause
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
{
"id": "crn_123456789",
"status": "paused",
"next_execution": null
}
POST /cron-jobs/{id}/resume
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
{
"id": "crn_123456789",
"status": "active",
"next_execution": "2023-05-21T10:30:00-04:00"
}
DELETE /cron-jobs/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
{
"id": "crn_123456789",
"deleted": true
}
GET /cron-jobs/{id}/executions
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The ID of the cron job |
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by execution status (success, failed) |
limit | integer | No | Maximum number of records to return (default: 20, max: 100) |
offset | integer | No | Number of records to skip (for pagination) |
{
"data": [
{
"id": "exe_987654321",
"cron_job_id": "crn_123456789",
"timestamp": "2023-05-20T09:00:00-04:00",
"status": "success",
"response_code": 200,
"response_time_ms": 245,
"response_body": {
"status": "processed",
"message": "Daily update successfully triggered"
}
},
{
"id": "exe_876543210",
"cron_job_id": "crn_123456789",
"timestamp": "2023-05-19T09:00:00-04:00",
"status": "failed",
"response_code": 500,
"response_time_ms": 1245,
"error": "Internal server error at destination"
}
],
"meta": {
"total": 2,
"limit": 20,
"offset": 0
}
}
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Authentication failed |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource does not exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
{
"error": {
"code": "validation_error",
"message": "Invalid frequency value",
"details": {
"frequency": ["Must be one of: daily, weekly, monthly, custom"]
}
}
}
