Skedulo Job scheduling API

The Job scheduling API from Skedulo — 3 operation(s) for job scheduling.

OpenAPI Specification

skedulo-job-scheduling-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Authentication Admin Job scheduling API
  description: Skedulo Authentication API
  version: 1.0.0
servers:
- url: https://api.skedulo.com/auth
- url: https://api.uk.skedulo.com/auth
- url: https://api.ca.skedulo.com/auth
- url: https://api.au.skedulo.com/auth
tags:
- name: Job scheduling
paths:
  /schedules/jobs/existing:
    post:
      summary: Create recurring schedule from an existing job
      description: Fields and Child relationships can be specified (e.g., giving created jobs the same job tags or allocations). By default, required Job fields like Region ID and duration will be propagated even if not specified.
      tags:
      - Job scheduling
      operationId: createRecurringScheduleFromExistingJob
      responses:
        '200':
          description: Recurring jobs created
          content:
            application/json:
              schema:
                type: object
                required:
                - result
                properties:
                  result:
                    type: string
                    description: ID of the created Recurring Schedule
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - jobId
              - pattern
              - fieldsToPropagate
              properties:
                jobId:
                  type: string
                pattern:
                  $ref: '#/components/schemas/RecurrencePattern'
                fieldsToPropagate:
                  $ref: '#/components/schemas/FieldSpec'
                recurFrom:
                  type: string
                  format: date-time
                  example: '2017-05-17T03:30:00Z'
                  description: Overrides the start time used to generate the jobs. This value is required if the base job does not have a start/end time, and the base job will be updated to have start/end of the first generated interval. If the base job already has a start/end time, its start/end will not be modified.
        required: true
  /schedules/jobs/preview:
    post:
      summary: Preview job recurring schedule
      description: Preview the intervals that will be generated for a given recurrence pattern and job details.
      tags:
      - Job scheduling
      operationId: preview
      responses:
        '200':
          description: Successful result
          content:
            application/json:
              schema:
                type: object
                required:
                - result
                properties:
                  result:
                    description: An array of intervals (start/end) in ISO-8061 format (without millisecond part).
                    type: array
                    items:
                      type: object
                      required:
                      - start
                      - end
                      properties:
                        start:
                          type: string
                          format: date-time
                          example: '2017-05-17T03:30:00Z'
                        end:
                          type: string
                          format: date-time
                          example: '2017-05-17T04:30:00Z'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - pattern
              - baseJob
              properties:
                pattern:
                  $ref: '#/components/schemas/RecurrencePattern'
                baseJob:
                  $ref: '#/components/schemas/BaseJob'
        required: true
  /schedules/jobs:
    post:
      summary: Create a recurring schedule
      description: Create a recurring schedule from a base job and pattern
      tags:
      - Job scheduling
      operationId: createRecurringSchedule
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                type: object
                required:
                - result
                properties:
                  result:
                    description: ID of the created recurring schedule
                    type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - baseJob
              - pattern
              properties:
                baseJob:
                  $ref: '#/components/schemas/BaseJob'
                pattern:
                  $ref: '#/components/schemas/RecurrencePattern'
        required: true
    put:
      summary: Update jobs in a recurring schedule
      description: Updates the fields and attached objects of jobs in a recurring schedule, where the jobs start at or after the provided timestamp. Arrays of attached 'HasMany' objects can be provided along with the fields to be updated. In this case, all existing attached objects of the same type on future jobs will be deleted and replaced with the provided objects. Job IDs may be explicitly excluded - this allows the caller to prevent modifying the job that they are currently displaying. Jobs that are Locked, In Progress, Completed or Cancelled will not be updated.
      tags:
      - Job scheduling
      operationId: updateJobs
      responses:
        '200':
          description: jobs successfully updated
          content:
            application/json:
              schema:
                type: object
                required:
                - result
                properties:
                  result:
                    description: A list of the jobs that were updated with their fields and 'HasMany' object lists. May be an empty array if no jobs were updated due to filtering.
                    type: array
                    items:
                      type: object
                      example:
                      - UID: a0L28000000Ton5EAC
                        Start: '2019-05-27T05:00:00.000Z'
                        Duration: 15
                        Description: new description
                        JobTasks:
                        - Seq: 1
                          Name: Task 1
                          Completed: false
                        - Seq: 2
                          Name: Task 2
                          Completed: false
      requestBody:
        description: Information about how the jobs will be updated.
        content:
          application/json:
            schema:
              type: object
              required:
              - recurringScheduleId
              - from
              - jobFields
              properties:
                recurringScheduleId:
                  type: string
                from:
                  type: string
                  format: date-time
                  description: Only apply changes to jobs that start at or after this instant in time.
                  example: '2017-05-17T03:30:00Z'
                start:
                  type: string
                  description: Start time for the jobs. For each job the clock time will be adjusted to match this time. The job date will remain the same as before. If this parameter is not provided, job schedules will not be updated.
                  format: time
                  example: '15:00'
                excludeJobIds:
                  type: array
                  description: A list of job IDs that should not be updated.
                  items:
                    type: string
                duration:
                  type: number
                  description: The new duration for each job in minutes. Must be provided along with 'start' if updating job schedule.
                  example: 15
                jobFields:
                  type: object
                  additionalProperties: true
                  description: The fields and values that should be updated on the jobs. Lists of attached 'HasMany' objects can be provided as arrays (e.g., 'JobTasks'). All existing attached objects on future jobs will be deleted and replaced with the provided objects. Any unsupported fields provided (e.g., notifyBy) will not be modified. All custom fields given in this object will be updated.
                  example:
                    Description: new description
                    JobTasks:
                    - Seq: 1
                      Name: Task 1
                      Completed: false
                    - Seq: 2
                      Name: Task 2
                      Completed: false
components:
  schemas:
    RecurrencePattern:
      type: object
      required:
      - type
      - step
      - ackAllJobs
      properties:
        type:
          type: string
          enum:
          - dates_only
          - rule
          description: If the type is 'dates_only', Only 'includeDates' will be used to generate job times.
        endOn:
          description: Date the pattern should end on. If using this, do not provide endAfterNumberOccurrences.
          type: string
          format: date
          example: '2020-05-13'
        endAfterNumberOccurrences:
          description: 'Number of occurrence to generate. If using this, do not provide endOn.

            Note: when repeatMode is ''weekly'', this value means the number of week periods to generate the intervals from,

            so when endAfterNumberOccurrences = 4, only the next 4 weeks will be checked (some weeks may not generated an interval due

            to other rules, leading to less than 4 intervals being generated in total).'
          type: number
          example: 5
        repeatMode:
          description: How occurrences are repeated
          type: string
          enum:
          - daily
          - weekly
          - monthly_nth_day
          - yearly
        step:
          description: How many days/months/years between each generated interval. For example, with repeatMode = 'daily' and step = 1, an interval will be generated every day.
          type: number
        skipOnWeekDays:
          description: Days of the week to skip. If an interval falls on this day of the week, it will be skipped.
          type: array
          items:
            type: string
            enum:
            - mon
            - tue
            - wed
            - thu
            - fri
            - sat
            - sun
          example:
          - mon
          - tue
        repeatOnWeekDays:
          description: The days of week intervals can occur on. Only applies when repeatMode = 'weekly'.
          type: array
          items:
            type: string
            enum:
            - mon
            - tue
            - wed
            - thu
            - fri
            - sat
            - sun
        skipHolidays:
          type: boolean
          description: Whether to skip holidays when generating future jobs (Considers both regional and global holidays).
          default: false
        ackAllJobs:
          description: If true, job allocations for each job will need to be acknowledged by the resource.
          type: boolean
        excludeDates:
          description: A list of dates a recurring job cannot occur on.
          type: array
          items:
            type: string
            format: date
        includeDates:
          description: A list of dates the job will occur on. This is in addition to all dates generated by the rule and ignores any dates listed in excludeDates.
          type: array
          items:
            type: string
            format: date
    FieldSpec:
      type: object
      required:
      - fields
      properties:
        fields:
          type: array
          items:
            type: string
            description: Field names
          example:
          - Description
          - RegionId
          - Duration
          - Address
          - AccountId
          - ContactId
          - CanBeDeclined
        children:
          type: array
          items:
            $ref: '#/components/schemas/FieldSpec'
    BaseJob:
      type: object
      description: 'The base job field that will be used to create the recurring schedule. Child objects (e.g., has-many relationship such as JobTags) can also be included -- they will be create and linked with their parent job.

        Only certain default job fields (see example) are be replicated across the created jobs.

        To replicate a custom field, lookup or child objects, they need to specified in the baseJob object too (see example).

        '
      required:
      - Start
      - Duration
      - RegionId
      properties:
        Start:
          type: string
          format: date-time
          description: Start time of the job which is also the base time / date where the pattern starts generating new jobs from. All generated jobs will have the same clock time as the base job (For example if the first job is at 3pm, all future jobs will occur at 3pm as well).
        Duration:
          type: number
        RegionId:
          type: string
          description: RegionId is used to obtain holidays associated with the region, which are used to avoid creating jobs on regional or global holidays.
      example:
        Start: '2017-12-23T00:00:00Z'
        RegionId: a0J28000000TXd3EAG
        Duration: 30
        AccountId: 0051I000000hycRQAQ
        Address: 170 Smith Road
        CanBeDeclined: true
        ContactId: 0051I000000hhcRQAQ
        Description: description of the job
        GeoLatitude: 100
        GeoLongitude: 100
        LocationId: 0051I000000hycRQAQ
        Locked: false
        NotesComments: a comment on the job
        Type: Installation
        Urgency: Urgent
        Quantity: 2
        MyCustomText: hello world
        JobTags:
        - TagId: a0B0K00000XR5bPUAT
          Required: true
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT