POST
/
schedules
curl --request POST \
  --url https://api.mergent.co/v2/schedules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "4cf95241-fa19-47ef-8a67-71e483747649",
  "description": "Report billing to Stripe.",
  "queue": "default",
  "request": {
    "url": "https://example.com",
    "headers": {
      "Authorization": "8BOHec9yUJMJ4sJFqUuC5w==",
      "Content-Type": "application/json"
    },
    "body": "Hello, world!"
  },
  "cron": "* * * * *",
  "rrule": "FREQ=HOURLY",
  "dtstart": "2021-10-01T15:53:05Z",
  "paused": true
}'
{
  "id": "4cf95241-fa19-47ef-8a67-71e483747649",
  "name": "4cf95241-fa19-47ef-8a67-71e483747649",
  "description": "Report billing to Stripe.",
  "queue": "default",
  "request": {
    "url": "https://example.com",
    "headers": {
      "Authorization": "8BOHec9yUJMJ4sJFqUuC5w==",
      "Content-Type": "application/json"
    },
    "body": "Hello, world!"
  },
  "cron": "* * * * *",
  "rrule": "FREQ=HOURLY",
  "dtstart": "2021-10-01T15:53:05Z",
  "paused": true,
  "scheduled_for": "2021-10-01T15:53:05Z",
  "created_at": "2021-10-01T15:53:05Z"
}

Authorizations

Authorization
string
headerrequired

The Mergent API uses API keys to authenticate requests. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Body

application/json
name
string | null

The name of the schedule.

description
string | null

The description of the schedule.

queue
string
default: default

The name of the of the task queue.

request
object

The params for creating or updating a task request.

cron
string | null

A cron expression describing when the schedule should be invoked (UTC). Note: invocation n + 1 of a schedule will not begin until invocation n has completed successfully. You must pass either cron or rrule when creating a new schedule.

rrule
string | null

An iCal RRule expression describing when the schedule should be invoked (UTC). Note: invocation n + 1 of a schedule will not begin until invocation n has completed successfully. You must pass either cron or rrule when creating a new schedule.

dtstart
string | null

The ISO 8601 timestamp denoting the start of an RRULE schedule. When not set, it will be set to the current time, and the schedule will be invoked immediately. Ignored for cron-type schedules.

paused
boolean

A boolean indicating whether or not the schedule is paused.

Response

201 - application/json
id
string
required

The unique ID for the schedule.

name
string | null

The name of the schedule.

description
string | null

The description of the schedule.

queue
string
default: defaultrequired

The name of the of the task queue.

request
object
required

A task request.

cron
string | null

A cron expression describing when the schedule should be invoked (UTC). Note: invocation n + 1 of a schedule will not begin until invocation n has completed successfully. You must pass either cron or rrule when creating a new schedule.

rrule
string | null

An iCal RRule expression describing when the schedule should be invoked (UTC). Note: invocation n + 1 of a schedule will not begin until invocation n has completed successfully. You must pass either cron or rrule when creating a new schedule.

dtstart
string | null

The ISO 8601 timestamp denoting the start of an RRULE schedule. When not set, it will be set to the current time, and the schedule will be invoked immediately. Ignored for cron-type schedules.

paused
boolean
required

A boolean indicating whether or not the schedule is paused.

scheduled_for
string | null

The ISO 8601 timestamp for when the schedule is scheduled to be executed.

created_at
string
required

The ISO 8601 timestamp representing when the schedule was created.