PUT
/
api
/
v1
/
workflow
/
public
/
scheduled
/
:schedule_id
curl --request PUT \
  --url https://api.gocobalt.io/api/v1/workflow/public/scheduled/:schedule_id \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "trigger_type": "<string>",
  "payload": {},
  "regex": "<string>",
  "currentDate": "<string>",
  "tz": "<string>",
  "endDate": "<string>",
  "startDate": "<string>",
  "interval_dates": [
    {}
  ]
}'
{
    "_id": "67becf62f29636d291eaadc0",
    "event_id": "67becf62f29636d291eaadbf",
    "workflow": "663c73e4608a784bacac384a",
    "linked_account_id": "tim-cook",
    "environment": "test",
    "org_id": "65c9ef72f4b95fce32e8ccf8",
    "cron_patten": "*/6 * * * *",
    "inactive": false,
    "registered_by_api": true,
    "options": {
        "currentDate": "2025-02-26",
        "endDate": "2025-02-28",
        "startDate": "2025-02-27",
        "tz": "Asia/Kolkata"
    },
    "trigger_type": "cron",
    "trigger_interval": [],
    "schedule_added_at": "2025-02-26T08:22:58.080Z",
    "updatedAt": "2025-02-26T08:22:58.080Z"
}

This API updates a cron schedule for a workflow using schedule ID.

Request description

Path Parameters

schedule_id
string
required

ID of the schedule to be updated.

Body

trigger_type
string
required

The type of schedule trigger you want to set. Options are either cron or interval.

Based on the trigger_type provided, Request Body differs.

payload
object
required

Event Payload to be sent during workflow execution. Required in both trigger types.

regex
string
required

Cron expression. For Eg: */6 * * * *. Required in cron trigger type.

currentDate
string
required

Date currently. for Eg: 2025-01-15. Required in cron trigger type.

tz
string
required

Time Zone for the cron job. For Eg: Asia/Kolkata. Required in cron trigger type.

endDate
string
required

End Date for the cron job. For Eg: 2025-01-19. Required in cron trigger type.

startDate
string
required

Start date of the cron job. for Eg: 2025-01-16. Required in cron trigger type.

interval_dates
array
required

The dates in which schedule needs to be executed.Required in interval trigger type.

Response description

_id
string

ID of the registered cron

event_id
string

Event ID

workflow
string

ID or Alias of the workflow

linked_account_id
string

Linked Account ID for which cron is registered

environment
string

Environment in which cron registered

org_id
string

Organization id

cron_pattern
string

Cron Pattern used for schedule register.

inactive
boolean

The schedule is inactive or not.

registered_by_api
boolean

Whether the cron is registered using API.

options
object

Cron body sent in the request

trigger_interval
array

Array of the interval dates for which the schedule is registered. It is empty if cron trigger_type is used.

schedule_added_at
string

Timestamp when schedule was added

updatedAt
string

Timestamp of schedule updation.

{
    "_id": "67becf62f29636d291eaadc0",
    "event_id": "67becf62f29636d291eaadbf",
    "workflow": "663c73e4608a784bacac384a",
    "linked_account_id": "tim-cook",
    "environment": "test",
    "org_id": "65c9ef72f4b95fce32e8ccf8",
    "cron_patten": "*/6 * * * *",
    "inactive": false,
    "registered_by_api": true,
    "options": {
        "currentDate": "2025-02-26",
        "endDate": "2025-02-28",
        "startDate": "2025-02-27",
        "tz": "Asia/Kolkata"
    },
    "trigger_type": "cron",
    "trigger_interval": [],
    "schedule_added_at": "2025-02-26T08:22:58.080Z",
    "updatedAt": "2025-02-26T08:22:58.080Z"
}