curl -X PATCH "https://api.a1base.com/v1/cron-jobs/{accountId}/update/550e8400-e29b-41d4-a716-446655440000" \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Daily Report",
    "schedule_config": {
      "repeat_type": "weeks",
      "repeat_every": 1,
      "time": "10:00",
      "days_of_week": ["1", "3", "5"],
      "end_type": "never"
    },
    "is_active": false
  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Updated Daily Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "schedule": "0 10 * * 1,3,5",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "is_active": false,
    "timezone": "America/New_York",
    "repeat_type": "weeks",
    "repeat_every": 1,
    "days_of_week": ["1", "3", "5"],
    "hours": 10,
    "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": null,
    "last_run_at": "2024-01-25T14:00:00Z",
    "consecutive_failures": 0,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-25T15:30:00Z"
  }
}
Update an existing cron job. All fields are optional - only provide the fields you want to update.

Path Parameters

accountId
string
required
Your A1Base account ID
cron_job_id
string
required
The unique identifier of the cron job to update (UUID format)

Request Body

All fields are optional. Only include the fields you want to update.
name
string
New name for the cron job
description
string
New description
endpoint_url
string
New URL to call
method
string
New HTTP method: GET, POST, PUT, DELETE
headers
object
New HTTP headers (replaces all existing headers)
body
string
New request body for POST/PUT methods
timezone
string
New timezone
schedule_config
object
New schedule configuration (replaces entire schedule)
retry_config
object
New retry configuration
callbacks
object
New webhook URLs
tags
array
New array of tags (replaces all existing tags)
is_active
boolean
Activate or deactivate the cron job

Response

Returns the updated cron job object with all current values.
curl -X PATCH "https://api.a1base.com/v1/cron-jobs/{accountId}/update/550e8400-e29b-41d4-a716-446655440000" \
  -H "X-API-Key: your-api-key" \
  -H "X-API-Secret: your-api-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Daily Report",
    "schedule_config": {
      "repeat_type": "weeks",
      "repeat_every": 1,
      "time": "10:00",
      "days_of_week": ["1", "3", "5"],
      "end_type": "never"
    },
    "is_active": false
  }'
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Updated Daily Report",
    "description": "Generate comprehensive sales report",
    "endpoint_url": "https://api.company.com/reports/daily",
    "schedule": "0 10 * * 1,3,5",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer report-token",
      "Content-Type": "application/json"
    },
    "body": "{\"report_type\": \"sales\", \"format\": \"pdf\"}",
    "is_active": false,
    "timezone": "America/New_York",
    "repeat_type": "weeks",
    "repeat_every": 1,
    "days_of_week": ["1", "3", "5"],
    "hours": 10,
    "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": null,
    "last_run_at": "2024-01-25T14:00:00Z",
    "consecutive_failures": 0,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-25T15:30:00Z"
  }
}

Common Update Scenarios

When updating schedule_config, provide the complete configuration object with all required fields for the schedule type, not just the fields you want to change.