> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automaticrostering.visma.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Get result

> Retrieve the current best roster created by the solver for the specified job.



## OpenAPI

````yaml /v1/api-reference/openapi.no-deprecated.yml get /jobs/{id}/result
openapi: 3.1.0
info:
  title: Automatic Rostering
  description: API for the automatic creation of rosters.
  version: json_alpha
servers:
  - url: https://api.optimization-rostering.stag.visma.net
    description: Stage (dev) environment
  - url: https://api.optimization-rostering.prod.visma.net
    description: Production environment
security: []
tags:
  - name: Roster
    description: Endpoints for starting, stopping, and retrieving scheduling jobs
  - name: Analyze
    description: Endpoint for analyzing job requests
paths:
  /jobs/{id}/result:
    get:
      tags:
        - Roster
      summary: Get result
      description: >-
        Retrieve the current best roster created by the solver for the specified
        job.
      parameters:
        - name: id
          in: path
          description: Job ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Returns the result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response'
        '404':
          description: Job with given ID not found
      security:
        - vismaConnectBearer: []
components:
  schemas:
    response:
      $schema: https://json-schema.org/draft/2020-12/schema
      title: Schedule response
      type: object
      description: >-
        Schedule response body containing all information about the solver
        result
      properties:
        jobInfo:
          $ref: '#/components/schemas/jobInfo'
        roster:
          $ref: '#/components/schemas/roster'
      $defs:
        roster:
          type: object
          description: >-
            The created roster, including relevant information on the demand
            fulfillment and employee assignments.
          properties:
            demandFulfillment:
              $ref: '#/components/schemas/demandFulfillment'
            employeeRosters:
              type: array
              description: List of rosters for each employee in the created roster.
              items:
                properties:
                  employeeId:
                    description: Identifier of the employee.
                    type: string
                  summary:
                    $ref: '#/components/schemas/employeeSummary'
                    description: >-
                      Aggregated information on the assigned shifts for this
                      employee.
                  assignments:
                    type: array
                    description: >-
                      List of assignments for the employee in the created
                      roster.
                    items:
                      $ref: '#/components/schemas/assignment'
        demandFulfillment:
          type: object
          description: Information on the demand fulfillment in the created roster.
          properties:
            shiftDemand:
              $ref: '#/components/schemas/shiftDemandFulfillment'
            timeDemand:
              $ref: '#/components/schemas/timeDemandFulfillment'
        shiftDemandFulfillment:
          type: object
          description: Information on the demand fulfillment for shift-based demand.
          properties:
            min:
              $ref: '#/components/schemas/shiftDemandLevelFulfillment'
              description: The demand and assigned shifts for the minimum demand level.
            ideal:
              $ref: '#/components/schemas/shiftDemandLevelFulfillment'
              description: The demand and assigned shifts for the ideal demand level.
            max:
              $ref: '#/components/schemas/shiftDemandLevelFulfillment'
              description: The demand and assigned shifts for the maximum demand level.
        shiftDemandLevelFulfillment:
          type: object
          properties:
            demand:
              type: integer
              description: Total demand in number of shifts for the planning period.
            assigned:
              type: integer
              description: >-
                Total assigned shifts for the planning period. Counts all
                assignments up to the demand level.
        timeDemandFulfillment:
          type: object
          description: Information on the demand fulfillment for time-based demand.
          properties:
            min:
              $ref: '#/components/schemas/timeDemandLevelFulfillment'
              description: The demand and assigned hours for the minimum demand level.
            ideal:
              $ref: '#/components/schemas/timeDemandLevelFulfillment'
              description: The demand and assigned hours for the ideal demand level.
            max:
              $ref: '#/components/schemas/timeDemandLevelFulfillment'
              description: The demand and assigned hours for the maximum demand level.
        timeDemandLevelFulfillment:
          type: object
          properties:
            demand:
              type: number
              description: Total demand in hours for the planning period.
            assigned:
              type: number
              description: >-
                Total assigned hours for the planning period. Counts all hours
                up to the demand level.
        employeeSummary:
          type: object
          properties:
            hoursAssigned:
              type: number
              description: Number of hours assigned to this employee.
            hoursAdjusted:
              type: number
              description: >-
                Number of hours assigned to this employee (adjusted for workload
                factors, breaks, etc.).
        assignment:
          type: object
          properties:
            day:
              $ref: '#/components/schemas/day'
              description: Day on which the assignment takes place.
            shiftId:
              description: Identifier of the shift the employee is assigned to.
              type: string
            roleId:
              description: Identifier of the role used by the employee to work the shift.
              type: string
            assignmentType:
              description: Describes how the assignment was created.
              type: string
              enum:
                - LOCKED
                - PREASSIGNED
                - ASSIGNED
        demandTargetPlannedHours:
          type: object
          required:
            - target
            - planned
          properties:
            target:
              type: number
              description: The total target hours.
            planned:
              type: number
              description: The total planned hours.
    jobInfo:
      type: object
      description: Details about the job that the solver will solve.
      required:
        - id
        - organisationId
        - scheduleType
        - demandType
        - planningHorizon
      properties:
        id:
          $ref: '#/components/schemas/rosterId'
        organisationId:
          $ref: '#/components/schemas/organisationId'
        scheduleType:
          description: Type of schedule that the solver should create.
          type: string
          enum:
            - CALENDAR
            - RECURRING
        demandType:
          $ref: '#/components/schemas/demandType'
        planningHorizon:
          $ref: '#/components/schemas/planningHorizon'
    roster:
      type: object
      description: >-
        The created roster, including relevant information on the demand
        fulfillment and employee assignments.
      properties:
        demandFulfillment:
          $ref: '#/components/schemas/demandFulfillment'
        employeeRosters:
          type: array
          description: List of rosters for each employee in the created roster.
          items:
            properties:
              employeeId:
                description: Identifier of the employee.
                type: string
              summary:
                $ref: '#/components/schemas/employeeSummary'
                description: >-
                  Aggregated information on the assigned shifts for this
                  employee.
              assignments:
                type: array
                description: List of assignments for the employee in the created roster.
                items:
                  $ref: '#/components/schemas/assignment'
    rosterId:
      type: string
      description: Identifier for this roster.
    organisationId:
      type: string
      description: Identifier for the organisation/user that has requested this roster.
    demandType:
      description: Type of demand that will be used in this job.
      type: string
      enum:
        - SHIFT_DEMAND
        - TIME_DEMAND
    planningHorizon:
      type: object
      description: >-
        Specifies the planning horizon for which a roster will be created. The
        required properties depend on the chosen scheduleType.
      required:
        - startDate
      properties:
        startDate:
          $ref: '#/components/schemas/date'
          description: >-
            Format YYYY-MM-DD. The start date of the planning horizon. The
            solver will only schedule shifts for days within the planning
            horizon. If you need to include locked shifts outside the period for
            which you have demands, the planning horizon should be extended to
            include these days. For RECURRING jobs, this must be the first
            Monday of the first week.
        endDate:
          $ref: '#/components/schemas/date'
          description: >-
            Format YYYY-MM-DD. Only required for CALENDAR jobs. The end date of
            the planning horizon. The solver will only schedule shifts for days
            within the planning horizon. If you need to include locked shifts
            outside the period for which you have demands, the planning horizon
            should be extended to include these days.
        nrOfWeeks:
          minimum: 1
          type: integer
          description: >-
            Only required for RECURRING jobs. The number of weeks in the
            planning horizon.
        fteStartDay:
          $ref: '#/components/schemas/scheduleDay'
          description: >-
            The start day of the period where FTE is counted. Any work planned
            outside this period will not be counted towards FTE.
        fteEndDay:
          $ref: '#/components/schemas/scheduleDay'
          description: >-
            The end day of the period where FTE is counted. Any work planned
            outside this period will not be counted towards FTE.
    demandFulfillment:
      type: object
      description: Information on the demand fulfillment in the created roster.
      properties:
        shiftDemand:
          $ref: '#/components/schemas/shiftDemandFulfillment'
        timeDemand:
          $ref: '#/components/schemas/timeDemandFulfillment'
    employeeSummary:
      type: object
      properties:
        hoursAssigned:
          type: number
          description: Number of hours assigned to this employee.
        hoursAdjusted:
          type: number
          description: >-
            Number of hours assigned to this employee (adjusted for workload
            factors, breaks, etc.).
    assignment:
      type: object
      properties:
        day:
          $ref: '#/components/schemas/day'
          description: Day on which the assignment takes place.
        shiftId:
          description: Identifier of the shift the employee is assigned to.
          type: string
        roleId:
          description: Identifier of the role used by the employee to work the shift.
          type: string
        assignmentType:
          description: Describes how the assignment was created.
          type: string
          enum:
            - LOCKED
            - PREASSIGNED
            - ASSIGNED
    date:
      type:
        - string
        - 'null'
      format: date
      description: >-
        Date is specified in ISO8601 format YYYY-MM-DD. Can only be used when
        schedule type is CALENDAR.
    scheduleDay:
      type: object
      description: >-
        Defines a day in the planning horizon. If the schedule type is
        RECURRING, then dayIndex must be specified, and if the schedule type is
        CALENDAR, then date must be specified.
      minProperties: 1
      maxProperties: 1
      properties:
        dayIndex:
          $ref: '#/components/schemas/dayIndex'
        date:
          $ref: '#/components/schemas/date'
    shiftDemandFulfillment:
      type: object
      description: Information on the demand fulfillment for shift-based demand.
      properties:
        min:
          $ref: '#/components/schemas/shiftDemandLevelFulfillment'
          description: The demand and assigned shifts for the minimum demand level.
        ideal:
          $ref: '#/components/schemas/shiftDemandLevelFulfillment'
          description: The demand and assigned shifts for the ideal demand level.
        max:
          $ref: '#/components/schemas/shiftDemandLevelFulfillment'
          description: The demand and assigned shifts for the maximum demand level.
    timeDemandFulfillment:
      type: object
      description: Information on the demand fulfillment for time-based demand.
      properties:
        min:
          $ref: '#/components/schemas/timeDemandLevelFulfillment'
          description: The demand and assigned hours for the minimum demand level.
        ideal:
          $ref: '#/components/schemas/timeDemandLevelFulfillment'
          description: The demand and assigned hours for the ideal demand level.
        max:
          $ref: '#/components/schemas/timeDemandLevelFulfillment'
          description: The demand and assigned hours for the maximum demand level.
    day:
      description: >-
        Describes one day in the schedule. Can be defined as a date (in CALENDAR
        payloads) or as a day index (in RECURRING payloads).
      type: object
      minProperties: 1
      maxProperties: 1
      properties:
        date:
          $ref: '#/components/schemas/date'
        dayIndex:
          $ref: '#/components/schemas/dayIndex'
    dayIndex:
      type:
        - integer
        - 'null'
      description: >-
        Day index relative to the first day of the period (starts at 0). Can
        only be used when schedule type is RECURRING.
      minimum: 0
    shiftDemandLevelFulfillment:
      type: object
      properties:
        demand:
          type: integer
          description: Total demand in number of shifts for the planning period.
        assigned:
          type: integer
          description: >-
            Total assigned shifts for the planning period. Counts all
            assignments up to the demand level.
    timeDemandLevelFulfillment:
      type: object
      properties:
        demand:
          type: number
          description: Total demand in hours for the planning period.
        assigned:
          type: number
          description: >-
            Total assigned hours for the planning period. Counts all hours up to
            the demand level.
  securitySchemes:
    vismaConnectBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Enter the token with the `Bearer: ` prefix. You can retrieve token from
        Visma connect.

````