Cron API Documentation

Base Path

/crons

Endpoints

Cron View Management

Get View List

GET /views

Get all cron task views.

Create View

POST /views

Request Body

{
  name: string,           // View name
  sorts?: Array<any>,     // Sort rules
  filters?: Array<any>,   // Filter rules
  filterRelation?: string // Filter relationship
}

Update View

PUT /views

Request Body

{
  id: number,            // View ID
  name: string,          // View name
  sorts?: Array<any>,    // Sort rules
  filters?: Array<any>,  // Filter rules
  filterRelation?: string // Filter relationship
}

Delete View

DELETE /views

Request Body

number[]  // Array of view IDs

Move View Position

PUT /views/move

Request Body

{
  fromIndex: number,  // Original position
  toIndex: number,    // Target position
  id: number         // View ID
}

Disable View

PUT /views/disable

Request Body

number[]  // Array of view IDs

Enable View

PUT /views/enable

Request Body

number[]  // Array of view IDs

Cron Task Management

Get Cron Task List

GET /

Get list of cron tasks.

Get Task Details

GET /detail

Get detailed information of specified task.

Create Cron Task

POST /

Request Body

{
  command: string,         // Command to execute
  schedule: string,        // Cron expression
  name?: string,          // Task name
  labels?: string[],      // Labels
  sub_id?: number,        // Sub-task ID
  extra_schedules?: any[], // Additional scheduling rules
  task_before?: string,   // Pre-task
  task_after?: string     // Post-task
}

Run Task

PUT /run

Request Body

number[]  // Array of task IDs

Stop Task

PUT /stop

Request Body

number[]  // Array of task IDs

Remove Labels

DELETE /labels

Request Body

{
  ids: number[],    // Array of task IDs
  labels: string[]  // Array of labels
}

Add Labels

POST /labels

Request Body

{
  ids: number[],    // Array of task IDs
  labels: string[]  // Array of labels
}

Disable Task

PUT /disable

Request Body

number[]  // Array of task IDs

Enable Task

PUT /enable

Request Body

number[]  // Array of task IDs

Get Task Log

GET /:id/log

Get execution log of specified task.

Update Task

PUT /

Request Body