> ## 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 job status

> Retrieve the current state of the specified job, like whether it is still running.



## OpenAPI

````yaml /v1/api-reference/openapi.no-deprecated.yml get /jobs/{id}
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}:
    get:
      tags:
        - Roster
      summary: Get job status
      description: >-
        Retrieve the current state of the specified job, like whether it is
        still running.
      parameters:
        - name: id
          in: path
          description: Job ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Job status retrieved successfully. Check payload body for status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/job_status'
        '404':
          description: Job with given ID not found
        '406':
          description: Defined Accept type is not supported
          content:
            text/plain:
              schema:
                type: string
              example: >-
                Supported Accept header values: application/json,
                application/xml
      security:
        - vismaConnectBearer: []
components:
  schemas:
    job_status:
      $schema: https://json-schema.org/draft/2020-12/schema
      title: Status of a job
      type: object
      required:
        - jobId
        - statusCode
        - duration
        - links
      properties:
        jobId:
          type: string
          description: Unique identifier for the job.
          example: 78f0bb4312a04d6f906bd6afe68afa61
        statusCode:
          type: string
          enum:
            - starting
            - running
            - stopped
            - error
          description: Current status of the job.
          example: stopped
        duration:
          type: number
          description: Duration of the job in seconds.
          example: 7274
        errorMessage:
          type: string
          description: >-
            Error message if the job failed. Only present if
            statusCode=="error".
          example: The job failed because of ...
        links:
          type: array
          items:
            type: object
            properties:
              rel:
                type: string
                description: The relationship type of the link.
                example: request
              href:
                type: string
                description: The URL for the linked resource.
                example: /jobs/78f0bb4312a04d6f906bd6afe68afa61/request
      example:
        jobId: 78f0bb4312a04d6f906bd6afe68afa61
        statusCode: stopped
        duration: 7274
        links:
          - rel: request
            href: /jobs/78f0bb4312a04d6f906bd6afe68afa61/request
          - rel: full_schedule
            href: /jobs/78f0bb4312a04d6f906bd6afe68afa61/result/?full_schedule=True
          - rel: statistics
            href: /jobs/78f0bb4312a04d6f906bd6afe68afa61/result/?full_schedule=False
  securitySchemes:
    vismaConnectBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Enter the token with the `Bearer: ` prefix. You can retrieve token from
        Visma connect.

````