task_schedulers

Create task scheduler with job

Changed on

Create task scheduler with a job (action(job) request should be sent via request also. Example: We want client report to be job which will be run * multiple times, we should send the same parameters in the request as we would send if we wanted to get report, see example

post/api/v1/task_schedulers

Request

Headers

X-API-SECRETstring
Example:password

The API secret as defined by the .env variable API_SECRET. Only needed for self hosted users, and only applicable on the login route.

X-Requested-Withstring required
Example:XMLHttpRequest

Used to send the XMLHttpRequest header

Request body

pausedboolean

The scheduler paused state

repeat_everystring

Accepted values (DAY,WEEK,MONTH,3MONTHS,YEAR)

start_frominteger

Timestamp when we should start the scheduler, default is today

jobstring

Job, we can find list of available jobs in Scheduler model

date_rangestring

The string representation of the date range of data to be returned

date_keystring

The date column to search between.

start_datestring

The start date to search between

end_datestring

The end date to search between

report_keysstring[]

Example request

{
  "repeat_every": "DAY",
  "start_from": 1652898504,
  "job": "create_credit_report",
  "date_range": "last7",
  "date_key": "created_at",
  "start_date": "2022-10-31",
  "end_date": "2022-10-31",
  "report_keys": [
    "['name','date']"
  ]
}

Response

success

Changes

    • breaking

      api path removed without deprecation

    • info

      endpoint added

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status