Hookbase
Docs
GuideAPI ReferenceIntegrationsUse CasesCLIMCP
Getting StartedSDK ReferencePortal ComponentsAPI Reference
Get Started

API Reference

OverviewAPI ExplorerAuthenticationAPI Keys

Core Endpoints

SourcesDestinationsRoutesEventsDeliveriesTransformsFiltersSchemasWebhook IngestAnalytics

Development Tools

TunnelsCron JobsCron GroupsScheduled Sends

Administration

Custom DomainsAudit LogsNotification ChannelsObservability ExportHealth & Status
DocsReceiveAPICron

Cron Jobs API

Schedule recurring HTTP requests to run automatically.

Endpoints

MethodPathDescription
GET/api/cronList cron jobs
POST/api/cronCreate cron job
GET/api/cron/{id}Get cron job
PATCH/api/cron/{id}Update cron job
DELETE/api/cron/{id}Delete cron job
POST/api/cron/{id}/triggerTrigger job manually
GET/api/cron/{id}/executionsGet execution history

Cron Job Object

{
  "id": "cj_abc123",
  "name": "Hourly Sync",
  "description": "Sync data every hour",
  "cronExpression": "0 * * * *",
  "timezone": "UTC",
  "url": "https://api.example.com/sync",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer xxx",
    "Content-Type": "application/json"
  },
  "payload": "{\"full\": false}",
  "timeoutMs": 30000,
  "isActive": true,
  "lastRunAt": "2024-01-15T10:00:00Z",
  "nextRunAt": "2024-01-15T11:00:00Z",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-15T10:00:00Z"
}

Execution Object

{
  "id": "exec_xyz789",
  "cronJobId": "cj_abc123",
  "status": "success",
  "responseStatus": 200,
  "responseBody": "{\"ok\": true}",
  "errorMessage": null,
  "latencyMs": 245,
  "startedAt": "2024-01-15T10:00:00Z",
  "completedAt": "2024-01-15T10:00:00Z"
}

List Cron Jobs

GET /api/cron

Example

curl https://api.hookbase.app/api/organizations/org_123/cron \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "cronJobs": [
    {
      "id": "cj_abc123",
      "name": "Hourly Sync",
      "cronExpression": "0 * * * *",
      "url": "https://api.example.com/sync",
      "method": "POST",
      "isActive": true,
      "lastRunAt": "2024-01-15T10:00:00Z",
      "nextRunAt": "2024-01-15T11:00:00Z"
    }
  ]
}

Create Cron Job

POST /api/cron

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name
cronExpressionstringYes5-field cron expression
urlstringYesTarget URL to call
descriptionstringNoOptional description
timezonestringNoTimezone (default: UTC)
methodstringNoHTTP method (default: POST)
headersobjectNoCustom HTTP headers
payloadstringNoRequest body
timeoutMsnumberNoTimeout in ms (default: 30000)

Cron Expression Format

Standard 5-field cron expression: minute hour day month weekday

FieldRangeSpecial Characters
Minute0-59*, */n, ,, -
Hour0-23*, */n, ,, -
Day of Month1-31*, */n, ,, -
Month1-12*, */n, ,, -
Day of Week0-6*, */n, ,, -

Example

curl -X POST https://api.hookbase.app/api/organizations/org_123/cron \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Cleanup",
    "cronExpression": "0 3 * * *",
    "timezone": "America/New_York",
    "url": "https://api.example.com/cleanup",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer api-key-here"
    },
    "payload": "{\"older_than_days\": 30}",
    "timeoutMs": 60000
  }'

Response

{
  "cronJob": {
    "id": "cj_def456",
    "name": "Daily Cleanup",
    "cronExpression": "0 3 * * *",
    "url": "https://api.example.com/cleanup",
    "nextRunAt": "2024-01-16 03:00:00"
  }
}

Get Cron Job

GET /api/cron/{id}

Example

curl https://api.hookbase.app/api/organizations/org_123/cron/cj_abc123 \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "cronJob": {
    "id": "cj_abc123",
    "name": "Hourly Sync",
    "description": "Sync data every hour",
    "cronExpression": "0 * * * *",
    "timezone": "UTC",
    "url": "https://api.example.com/sync",
    "method": "POST",
    "headers": "{\"Authorization\":\"Bearer xxx\"}",
    "payload": "{\"full\": false}",
    "timeoutMs": 30000,
    "isActive": true,
    "lastRunAt": "2024-01-15T10:00:00Z",
    "nextRunAt": "2024-01-15T11:00:00Z",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-15T10:00:00Z"
  }
}

Update Cron Job

PATCH /api/cron/{id}

Request Body

All fields are optional. Only provided fields are updated.

FieldTypeDescription
namestringDisplay name
descriptionstringOptional description
cronExpressionstring5-field cron expression
timezonestringTimezone
urlstringTarget URL
methodstringHTTP method
headersobjectCustom HTTP headers
payloadstringRequest body
timeoutMsnumberTimeout in milliseconds
isActivebooleanEnable/disable the job

Example

curl -X PATCH https://api.hookbase.app/api/organizations/org_123/cron/cj_abc123 \
  -H "Authorization: Bearer whr_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "cronExpression": "*/30 * * * *",
    "isActive": false
  }'

Response

{
  "success": true
}

Delete Cron Job

DELETE /api/cron/{id}

Warning

Deleting a cron job also deletes all its execution history.

Example

curl -X DELETE https://api.hookbase.app/api/organizations/org_123/cron/cj_abc123 \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "success": true
}

Trigger Job Manually

Execute a cron job immediately, regardless of its schedule.

POST /api/cron/{id}/trigger

Example

curl -X POST https://api.hookbase.app/api/organizations/org_123/cron/cj_abc123/trigger \
  -H "Authorization: Bearer whr_your_api_key"

Response (Success)

{
  "execution": {
    "id": "exec_xyz789",
    "status": "success",
    "responseStatus": 200,
    "latencyMs": 245
  }
}

Response (Failure)

{
  "execution": {
    "id": "exec_abc456",
    "status": "failed",
    "error": "Connection timeout",
    "latencyMs": 30000
  }
}

Get Execution History

GET /api/cron/{id}/executions

Query Parameters

ParameterTypeDescription
limitnumberNumber of executions to return (default: 20)

Example

curl "https://api.hookbase.app/api/organizations/org_123/cron/cj_abc123/executions?limit=10" \
  -H "Authorization: Bearer whr_your_api_key"

Response

{
  "executions": [
    {
      "id": "exec_xyz789",
      "cron_job_id": "cj_abc123",
      "status": "success",
      "response_status": 200,
      "response_body": "{\"ok\": true}",
      "error_message": null,
      "latency_ms": 245,
      "started_at": "2024-01-15T10:00:00Z",
      "completed_at": "2024-01-15T10:00:00Z"
    },
    {
      "id": "exec_abc456",
      "cron_job_id": "cj_abc123",
      "status": "failed",
      "response_status": null,
      "response_body": null,
      "error_message": "Connection timeout",
      "latency_ms": 30000,
      "started_at": "2024-01-15T09:00:00Z",
      "completed_at": "2024-01-15T09:00:30Z"
    }
  ]
}

Execution Status Values

StatusDescription
runningJob is currently executing
successCompleted with HTTP 2xx response
failedFailed due to error, timeout, or non-2xx response

Error Responses

400 Bad Request

Invalid cron expression:

{
  "error": "Invalid cron expression"
}

Invalid URL:

{
  "error": "Invalid URL"
}

Missing required fields:

{
  "error": "Name, cron expression, and URL are required"
}

404 Not Found

Cron job not found:

{
  "error": "Cron job not found"
}

Rate Limits

  • Jobs execute no more frequently than once per minute
  • Maximum timeout per execution: 60 seconds
  • Response body stored in execution logs: 10KB max
PreviousTunnelsNextCron Groups

On this page

EndpointsCron Job ObjectExecution ObjectList Cron JobsExampleResponseCreate Cron JobRequest BodyCron Expression FormatExampleResponseGet Cron JobExampleResponseUpdate Cron JobRequest BodyExampleResponseDelete Cron JobExampleResponseTrigger Job ManuallyExampleResponse (Success)Response (Failure)Get Execution HistoryQuery ParametersExampleResponseExecution Status ValuesError Responses400 Bad Request404 Not FoundRate Limits