Update a schedule

PUT https://api.cronhooks.io/schedules/{id}

PARAMETERS

Name Required
id
schedules's id
Required
groupId
provide group's id
Optional
title
title of webhook schedule
Required
url
webhook url
Required
timezone
IANA Timezone
Required
method
Http method
Required
headers
{} Object
Optional
payload
{} Object or "" String
Optional
contentType
Content Type for recieving webhook
Required
isRecurring
Trigger webhook repeatedly or not
Required
runAt
Only applicable for non-recurring schedules
Required
sendCronhookObject
Send Cronhook schedule object along with provided payload
Required
sendFailureAlert
If false no alerts will be sent on any channel
Required
cronExpression
Only applicable for recurring schedules
Required
startsAt
Only applicable for recurring schedules
Optional
endsAt
Only applicable for recurring schedules
Optional
retryCount
Only applicable for ad-hoc schedules
Optional
retryIntervalSeconds
Only applicable for ad-hoc schedules
Optional
runAt, startsAt, endsAt must not contain timezone offset. Valid: 2019-03-04T17:10:00, Invalid: 2019-03-04T17:10:00+05, 2019-03-04T17:10:Z

REQUEST

curl https://api.cronhooks.io/schedules/3a0136ac-123f-c222-5b2d-ae5b0c5937a6 /
  -X PUT \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <YOUR_API_TOKEN>' \
  -d \
  '{
     "groupId": null | group_id,
     "title": "Send email to inactive users",
     "description": "Send email to inactive users",
     "url": "https://example.com/webhooks/inactive-email",
     "timezone": "asia/karachi",
     "method": "POST",
     "headers": {
       "additionalProp1": "string",
       "additionalProp2": "string",
       "additionalProp3": "string"
     },
     "payload": {
       "additionalProp1": "string",
       "additionalProp2": "string",
       "additionalProp3": "string"
     },
     "contentType": "application/json; charset=utf-8",
     "isRecurring": false,
     "cronExpression": "",
     "runAt": "2019-02-01T12:48:26.983", // if isRecurring => false
     "sendCronhookObject": true,
     "sendFailureAlert": true,
     "startsAt": "2023-02-01T13:00:00", // if isRecurring => true
     "endsAt": "2023-03-01T13:00:00" // if isRecurring => true
     "retryCount": "3", // if isRecurring => false
     "retryIntervalSeconds": "5" // if isRecurring => false
  }'

Response

{
  "id": "3a012d1f-fe83-4855-2860-84f8a85e154c",
  "groupId": "3a0136ac-123f-c222-5b2d-ae5b0c5937a6",
  "title": "Send email to inactive users",
  "description": "Send an email to users who are inactive for more than 60 days and offer a discount for upgrading subscriptions.",
  "url": "https://example.com/webhooks/inactive-email",
  "timezone": "asia/karachi",
  "method": "POST",
  "headers": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "payload": "{
      \"additionalProp1\": \"string\",
      \"additionalProp2\": \"string\",
      \"additionalProp3\": \"string\"
  }",
  "contentType": "application/json; charset=utf-8",
  "status": "scheduled",
  "errorMessage": "",
  "isRecurring": false,
  "cronExpression": "",
  "runAt": "2019-02-01T12:48:26.983",
  "sendCronhookObject": true,
  "sendFailureAlert": true,
  "startsAt": "2023-02-01T13:00:00",
  "endsAt": "2023-03-01T13:00:00",
  "retryCount": "3",
  "retryIntervalSeconds": "5",
  "creationTime": "2019-02-01T09:35:27.568Z",
  "lastModificationTime": "2019-02-01T09:35:27.568Z"
}