Skip to main content

Adding Jobs to Schedules via the API

  • August 28, 2025
  • 2 replies
  • 73 views

AndreaDowning
Forum|alt.badge.img

The OpCon API allows users to programmatically add jobs to schedules, enabling dynamic automation and integration with external systems. This guide provides a step-by-step overview of how to use the API to add jobs to schedules, including required fields and example requests.

 

Required Information

To add a job to a schedule using the API, you will need the following information:

  • Schedule name or ID
  • Job name or ID
  • Frequency and instance details
  • Any instance properties or overrides
  • Authentication token with appropriate permissions

Example Request

Below is an example of a POST request to the /scheduleactions endpoint to add a job to a schedule:

POST /api/scheduleactions HTTP/1.1
Host: your-opcon-server
Authorization: Token your-auth-token
Content-Type: application/json

{
  "scheduleName": "DailyProcessing",
  "action": "AddJob",
  "jobName": "DataImportJob",
  "frequency": "Daily",
  "instanceProperties": [
    {
      "name": "InputFile",
      "value": "data_2024_01_01.csv"
    }
  ]
}

Tips

  • Ensure the job and schedule names are spelled correctly and exist in the system.
  • Use the Swagger interface to test your request before deploying it in production.
  • Check the API response for success confirmation or error messages.
  • Use instance properties to customize job behavior for specific runs.

     

2 replies

  • November 26, 2025

Hi Andrea,

Are you sure it's /api/schedule-actions?

and not /api/scheduleactions?

And the "AddJob" action? Does it exist? How do I find the list of possible actions?

 


AutomationWizard
Forum|alt.badge.img

Hi Andrea,

Are you sure it's /api/schedule-actions?

and not /api/scheduleactions?

And the "AddJob" action? Does it exist? How do I find the list of possible actions?

 

You are correct, it should be “/api/scheduleActions” and that has been updated.

As far as a list of available actions, here they are compared to the normal event syntax:
 

        "JOB:ADD"          {"addjobs"}

        "SCHEDULE:RELEASE"    {"release"}

        "SCHEDULE:HOLD"       {"hold"}

        "SCHEDULE:START"      {"start"}

        "SCHEDULE:CANCEL"     {"close"}

        "JOB:HOLD"            {"holdjobs"}

        "JOB:CANCEL"          {"cancelJobs"}

        "JOB:SKIP"            {"skipJobs"}

        "JOB:KILL"            {"killJobs"}

        "JOB:START"           {"startJobs"}

        "JOB:RESTART"         {"restartJobs"}

        "JOB:FORCERESTART"    {"forceRestartJobs"}

        "JOB:RESTARTHLD"      {"restartJobsOnHold"}

        "JOB:RELEASE"         {"releaseJobs"}

        "JOB:GOOD"            {"markJobsFinishedOk"}

        "JOB:BAD"             {"markJobsFailed"}

        "JOB:FIXED"           {"markjobsfixed"}

        "JOB:UNDERREVIEW"     {"markjobsunderreview"}