> ## 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 the status of a job



## OpenAPI

````yaml /openapi.yaml get /roster/status/{jobId}
openapi: 3.1.0
info:
  title: Automatic Rostering API
  version: 2.0.0
  description: >-
    Automatic Rostering acts as the modern intelligence layer for your workforce
    management product.
  license:
    name: Proprietary
servers:
  - url: https://api-stage.automaticrostering.visma.net
    description: Stage environment
  - url: https://api.automaticrostering.visma.net
    description: Production environment
security:
  - vismaConnectBearer: []
tags:
  - name: Roster
    description: Submit, monitor, stop, and fetch roster jobs.
  - name: Reason
    description: Configure integrator context used by Reasoning Engine capabilities.
paths:
  /roster/status/{jobId}:
    get:
      tags:
        - Roster
      summary: Get the status of a job
      operationId: getRosterStatus
      parameters:
        - $ref: '#/components/parameters/jobId'
        - $ref: '#/components/parameters/messageToken'
      responses:
        '200':
          $ref: '#/components/responses/RosterStatus'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    jobId:
      name: jobId
      in: path
      required: true
      description: Unique identifier for the roster job.
      schema:
        type: string
        format: uuid
    messageToken:
      name: messageToken
      in: query
      required: false
      description: >-
        Opaque token returned by the previous status response to retrieve new
        roster status messages.
      schema:
        type: string
        minLength: 1
  responses:
    RosterStatus:
      description: Response containing the current status of a roster job.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RosterStatusResponse'
    BadRequest:
      description: Request was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated user is not allowed to access the resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Server failed to process the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    RosterStatusResponse:
      type: object
      description: Response containing the current status of a roster job.
      additionalProperties: false
      required:
        - jobId
        - updatedAt
        - status
        - hasResult
        - messages
      properties:
        jobId:
          type: string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - starting
            - running
            - finished
            - error
            - stopped
        hasResult:
          type: boolean
        error:
          type: string
        metrics:
          $ref: '#/components/schemas/StatusMetrics'
          description: >-
            The current values of the status metrics requested when the job was
            started. Each requested metric is returned with its original scope.
            Values are null until the first metrics publication or when no
            matching rules exist.
        messages:
          $ref: '#/components/schemas/RosterStatusMessages'
          description: >-
            Generated roster status messages and continuation token for message
            polling.
    Error:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    StatusMetrics:
      type: array
      description: Current values for the requested metric selections.
      maxItems: 20
      items:
        $ref: '#/components/schemas/StatusMetric'
    RosterStatusMessages:
      type: object
      description: >-
        Generated roster status messages returned after the provided message
        token.
      additionalProperties: false
      required:
        - items
        - nextToken
      properties:
        items:
          type: array
          description: >-
            New generated roster status messages after the provided message
            token. Empty when messageToken is omitted or no new messages are
            available.
          items:
            $ref: '#/components/schemas/RosterStatusMessage'
        nextToken:
          type: string
          description: >-
            Continuation token to pass as messageToken on the next status
            request.
    StatusMetric:
      type: object
      description: The current value of one requested metric selection.
      additionalProperties: false
      required:
        - scope
        - value
      properties:
        scope:
          $ref: '#/components/schemas/MetricScope'
          description: The requested metric selection.
        value:
          type:
            - number
            - 'null'
          description: >-
            The current aggregate value, or null before the first metrics
            publication or when the selection has no value.
    RosterStatusMessage:
      type: object
      description: A generated partner-facing roster status message.
      additionalProperties: false
      required:
        - text
      properties:
        text:
          type: string
          description: Markdown message text.
    MetricScope:
      type: object
      description: Selects one metric, optionally limited to rules with a matching label.
      additionalProperties: false
      required:
        - metricKey
      properties:
        metricKey:
          $ref: '#/components/schemas/MetricKey'
          description: The metric to track.
        ruleLabel:
          type: string
          minLength: 1
          description: >-
            Limits the metric to rules whose labels include this exact,
            case-sensitive value.
    MetricKey:
      type: string
      description: >-
        A public enum that identifies one supported status metric by combining
        its domain and metric name.
      enum:
        - AVAILABILITY.WORKED_MINUTES
        - AVAILABILITY.ASSIGNMENTS
        - DEMAND.MISSING_MINUTES_TO_MIN
        - DEMAND.MISSING_MINUTES_TO_IDEAL
        - DEMAND.MISSING_SHIFTS_TO_MIN
        - DEMAND.MISSING_SHIFTS_TO_IDEAL
        - COOLDOWN.MISSING_DAYS
        - COOLDOWN.MISSING_MINUTES
        - COOLDOWN.VIOLATIONS
        - CONSECUTIVE.MIN_VIOLATIONS
        - PATTERN.DESIRED_COMPLETE_MATCHES
        - PATTERN.DESIRED_PARTIAL_MATCHES
        - PATTERN.DESIRED_INCOMPLETE_PERIODS
        - PATTERN.UNDESIRED_COMPLETE_PERIODS
        - UTILIZATION.TOTAL_MINUTES
        - UTILIZATION.MINUTES_BELOW_MIN
        - UTILIZATION.MINUTES_BELOW_IDEAL
        - UTILIZATION.MINUTES_ABOVE_IDEAL
        - UTILIZATION.ASSIGNMENTS_BELOW_MIN
        - UTILIZATION.ASSIGNMENTS_BELOW_IDEAL
        - UTILIZATION.ASSIGNMENTS_ABOVE_IDEAL
        - PERIOD_DISTRIBUTION.WORKED_PERIODS
        - PERIOD_DISTRIBUTION.MISSING_WORKED_PERIODS
        - PERIOD_DISTRIBUTION.EXCESSIVE_WORKED_PERIODS
        - PERIOD_DISTRIBUTION.MAX_CONSECUTIVE_VIOLATIONS
        - PERIOD_DISTRIBUTION.MIN_SURROUNDING_VIOLATIONS
        - PERIODIC_REST.CONTINUOUS_REST_VIOLATIONS
  securitySchemes:
    vismaConnectBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Include the access token in the Authorization header using the Bearer
        scheme.

````