curl -X POST https://api.a1base.com/v1/cron-jobs/{accountId}/create \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Sales Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "timezone": "America/New_York",
    "schedule_config": {
      "repeat_type": "days",
      "repeat_every": 1,
      "time": "09:00",
      "end_type": "never"
    },
    "retry_config": {
      "max_retries": 3,
      "retry_delay_seconds": 300,
      "timeout_seconds": 30
    },
    "callbacks": {
      "success_url": "https://webhooks.company.com/cron-success",
      "failure_url": "https://webhooks.company.com/cron-failure"
    },
    "tags": ["reports", "daily", "sales"],
    "is_active": true
  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Daily Sales Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "schedule": "0 9 * * *",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "is_active": true,
    "timezone": "America/New_York",
    "repeat_type": "days",
    "repeat_every": 1,
    "days_of_week": null,
    "hours": 9,
    "minutes": 0,
    "end_type": "never",
    "end_date": null,
    "end_occurrences": null,
    "max_retries": 3,
    "retry_delay_seconds": 300,
    "timeout_seconds": 30,
    "success_callback_url": "https://webhooks.company.com/cron-success",
    "failure_callback_url": "https://webhooks.company.com/cron-failure",
    "tags": ["reports", "daily", "sales"],
    "next_run_at": "2024-01-26T14:00:00Z",
    "last_run_at": null,
    "consecutive_failures": 0,
    "created_at": "2024-01-25T10:30:00Z",
    "updated_at": "2024-01-25T10:30:00Z"
  }
}

Create a new scheduled task that will execute HTTP requests at specified intervals.

Path Parameters

accountId
string
required

Your A1Base account ID

Request Body

name
string
required

A descriptive name for your cron job

description
string

Detailed description of what this cron job does

endpoint_url
string
required

The URL to call when the cron job executes. Must be a valid HTTP/HTTPS URL.

method
string
required

HTTP method to use: GET, POST, PUT, DELETE

headers
object

HTTP headers to include with each request. Common headers include Authorization, Content-Type, etc.

Example:

{
  "Authorization": "Bearer your-token",
  "Content-Type": "application/json"
}
body
string

Request body for POST/PUT methods. Must be a string (JSON string if sending JSON).

timezone
string
required

Timezone for schedule execution (e.g., “America/New_York”, “UTC”, “Europe/London”)

schedule_config
object
required

Schedule configuration object

retry_config
object

Retry configuration for failed requests

callbacks
object

Webhook URLs for execution notifications

tags
array

Array of tags for organization and filtering

is_active
boolean
default:"true"

Whether the cron job should start active

Response

Returns the created cron job object with generated ID and calculated next run time.

curl -X POST https://api.a1base.com/v1/cron-jobs/{accountId}/create \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Sales Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "timezone": "America/New_York",
    "schedule_config": {
      "repeat_type": "days",
      "repeat_every": 1,
      "time": "09:00",
      "end_type": "never"
    },
    "retry_config": {
      "max_retries": 3,
      "retry_delay_seconds": 300,
      "timeout_seconds": 30
    },
    "callbacks": {
      "success_url": "https://webhooks.company.com/cron-success",
      "failure_url": "https://webhooks.company.com/cron-failure"
    },
    "tags": ["reports", "daily", "sales"],
    "is_active": true
  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Daily Sales Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "schedule": "0 9 * * *",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "is_active": true,
    "timezone": "America/New_York",
    "repeat_type": "days",
    "repeat_every": 1,
    "days_of_week": null,
    "hours": 9,
    "minutes": 0,
    "end_type": "never",
    "end_date": null,
    "end_occurrences": null,
    "max_retries": 3,
    "retry_delay_seconds": 300,
    "timeout_seconds": 30,
    "success_callback_url": "https://webhooks.company.com/cron-success",
    "failure_callback_url": "https://webhooks.company.com/cron-failure",
    "tags": ["reports", "daily", "sales"],
    "next_run_at": "2024-01-26T14:00:00Z",
    "last_run_at": null,
    "consecutive_failures": 0,
    "created_at": "2024-01-25T10:30:00Z",
    "updated_at": "2024-01-25T10:30:00Z"
  }
}

Common Schedule Examples