Skip to content

Cron API Reference

All endpoints are on the public API (https://api.universalapi.co) and require authentication with a Bearer token (uapi_ut_* or your Cognito session token).

All responses use the standard envelope:

json
{
  "data": { ... },
  "requestId": "...",
  "rootRequestId": "...",
  "parentRequestId": null
}

Create Cron Job

POST /cron

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name for the cron job (e.g. daily-report)
agentIdstringYesUUID of the agent to invoke on each run
schedulestringYesrate(N unit) or cron(min hr dom mon dow yr) expression
scheduleTimezonestringNoIANA timezone for cron expressions (default: UTC)
inputMessagestringNoPrompt sent to the agent on each run
agentNamestringNoAgent display name (for reference in listings)

Example

bash
curl -X POST https://api.universalapi.co/cron \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "daily-report",
    "agentId": "agent-uuid",
    "schedule": "cron(0 9 * * ? *)",
    "scheduleTimezone": "America/New_York",
    "inputMessage": "Generate the daily report."
  }'

Response

json
{
  "data": {
    "cronId": "uuid",
    "name": "daily-report",
    "agentId": "agent-uuid",
    "schedule": "cron(0 9 * * ? *)",
    "scheduleTimezone": "America/New_York",
    "inputMessage": "Generate the daily report.",
    "status": "active",
    "consecutiveFailures": 0,
    "createdAt": "2026-06-11T12:00:00Z"
  }
}

Errors

StatusCause
400Missing name, agentId, or schedule; invalid schedule expression
400Cron job limit reached (20 per user)
401Missing or invalid Bearer token

List Cron Jobs

GET /cron

Returns all cron jobs for the authenticated user.

bash
curl https://api.universalapi.co/cron \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN"

Response

json
{
  "data": {
    "crons": [
      {
        "cronId": "uuid",
        "name": "daily-report",
        "agentId": "agent-uuid",
        "schedule": "cron(0 9 * * ? *)",
        "scheduleTimezone": "America/New_York",
        "status": "active",
        "lastRunAt": "2026-06-11T13:00:02Z",
        "lastRunStatus": "success",
        "lastRunError": "",
        "consecutiveFailures": 0
      }
    ],
    "count": 1
  }
}

Get Cron Job

GET /cron/{cronId}

Returns full details for a single cron job, including last run info and failure count.

bash
curl https://api.universalapi.co/cron/CRON_ID \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN"

Update Cron Job

PUT /cron/{cronId}

Only include fields you want to change. Updating schedule or scheduleTimezone rewrites the underlying EventBridge schedule. Setting status to active from paused or error resets consecutiveFailures to 0 and re-enables the schedule.

Request Body (all optional)

FieldTypeDescription
namestringNew display name
agentIdstringNew target agent UUID
schedulestringNew schedule expression
scheduleTimezonestringNew timezone
inputMessagestringNew prompt
statusstringactive (resume) or paused (pause)

Example — Pause

bash
curl -X PUT https://api.universalapi.co/cron/CRON_ID \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "paused"}'

Example — Change Schedule

bash
curl -X PUT https://api.universalapi.co/cron/CRON_ID \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schedule": "rate(6 hours)"}'

Delete Cron Job

DELETE /cron/{cronId}

Permanently deletes the cron job and its EventBridge schedule. This cannot be undone.

bash
curl -X DELETE https://api.universalapi.co/cron/CRON_ID \
  -H "Authorization: Bearer uapi_ut_YOUR_TOKEN"

Field Reference

FieldTypeDescription
cronIdstringUnique cron job ID
namestringDisplay name
agentIdstringTarget agent UUID
agentNamestringAgent display name (informational)
schedulestringEventBridge schedule expression
scheduleTimezonestringIANA timezone (cron expressions only)
inputMessagestringPrompt sent to agent each run
statusstringactive | paused | error
lastRunAtstringISO timestamp of last execution
lastRunStatusstringsuccess | error
lastRunErrorstringError message from last failed run
consecutiveFailuresnumberFailures since last success; 3 → auto-pause
createdAtstringISO creation timestamp

See Also

Universal API - The agentic entry point to the universe of APIs