---
title: "Returns the versions of a job."
method: GET
path: "/api/v1/orchestrator/jobs/{id}/versions"
tags: ["Orchestrator"]
---

# Returns the versions of a job.

`GET /api/v1/orchestrator/jobs/{id}/versions`

Returns the versions of a job.

## Path parameters

- `id` string, required

## Query parameters

- `namespace` string
- `limit` integer
- `next_token` string
- `reverse` boolean
- `order_by` string

## Response `200`

OK

- ApimodelsListJobVersionsResponse
  - `Items` ModelsJob[]
    - `Constraints` ModelsLabelSelectorRequirement[] — Constraints is a selector which must be true for the compute node to run this job.
      - `Key` string — key is the label key that the selector applies to.
      - `Operator` '!' | '=' | '==' | 'in' | '!=' | 'notin' | 'exists' | 'gt' | 'lt'
      - `Values` string[] — values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or KeyNotInImap, the values array must be empty. This array is replaced during a strategic
    - `Count` integer — Count is the number of replicas that should be scheduled. For batch and service jobs: - If not present in JSON, defaults to 1 - If explicitly set to 0, means stop all executions - If > 0, specifies exact number of replicas For daemon and ops jobs: - Values of 0 or 1 are ignored (job runs on all matching nodes) - Values > 1 are invalid and will cause validation to fail
    - `CreateTime` integer
    - `ID` string — ID is a unique identifier assigned to this job. It helps to distinguish jobs with the same name after they have been deleted and re-created. The ID is generated by the server and should not be set directly by the client.
    - `Labels` object — Labels is used to associate arbitrary labels with this job, which can be used for filtering. key=value
    - `Meta` object — Meta is used to associate arbitrary metadata with this job.
    - `ModifyTime` integer
    - `Name` string — Name is the logical name of the job used to refer to it. Submitting a job with the same name as an existing job will result in an update to the existing job.
    - `Namespace` string — Namespace is the namespace this job is running in.
    - `Priority` integer — Priority defines the scheduling priority of this job.
    - `Revision` integer — Revision is a per-job monotonically increasing revision number that is incremented on each update to the job's state or specification
    - `State` ModelsStateModelsJobStateType
      - `Details` object — Details is a map of additional details about the state.
      - `Message` string — Message is a human readable message describing the state.
      - `StateType` 0 | 1 | 2 | 3 | 4 | 5 | 6
    - `Tasks` ModelsTask[]
      - `Engine` ModelsSpecConfig
        - `Params` object — Params is a map of the config params
        - `Type` string — Type of the config
      - `Env` object — Map of environment variables to be used by the driver. Values can be: - Direct value: "debug-mode" - Host env var: "env:HOST_VAR"
      - `InputSources` ModelsInputSource[] — InputSources is a list of remote artifacts to be downloaded before running the task and mounted into the task.
        - `Alias` string — Alias is an optional reference to this input source that can be used for dynamic linking to this input. (e.g. dynamic import in wasm by alias)
        - `Source` ModelsSpecConfig
          - `Params` object — Params is a map of the config params
          - `Type` string — Type of the config
        - `Target` string — Target is the path where the artifact should be mounted on
      - `Meta` object — Meta is used to associate arbitrary metadata with this task.
      - `Name` string — Name of the task
      - `Network` ModelsNetworkConfig
        - `Domains` string[]
        - `Ports` ModelsPort[]
          - `HostNetwork` string — HostNetwork specifies which network interface to bind to. If empty, defaults to "0.0.0.0" (all interfaces). Can be set to "127.0.0.1" to only allow local connections.
          - `Name` string — Name is a required identifier for this port mapping. It will be used to create environment variables to inform the task about its allocated ports.
          - `Static` integer — Static is the host port to use. If not specified, a port will be auto-allocated from the compute node's port range
          - `Target` integer — Target is the port inside the task/container that should be exposed. Only valid for Bridge network mode. If not specified in Bridge mode, it will default to the same value as the host port.
        - `Type` 0 | 1 | 2 | 3 | 4 | 5
      - `Publisher` ModelsSpecConfig
        - `Params` object — Params is a map of the config params
        - `Type` string — Type of the config
      - `Resources` ModelsResourcesConfig
        - `CPU` string — CPU https://github.com/BTBurke/k8sresource string
        - `Disk` string — Memory github.com/dustin/go-humanize string
        - `GPU` string
        - `Memory` string — Memory github.com/dustin/go-humanize string
      - `ResultPaths` ModelsResultPath[] — ResultPaths is a list of task volumes to be included in the task's published result
        - `Name` string — Name
        - `Path` string — The path to the file/dir
      - `Timeouts` ModelsTimeoutConfig
        - `ExecutionTimeout` integer — ExecutionTimeout is the maximum amount of time a task is allowed to run in seconds. Zero means no timeout, such as for a daemon task.
        - `QueueTimeout` integer — QueueTimeout is the maximum amount of time a task is allowed to wait in the orchestrator queue in seconds before being scheduled. Zero means no timeout.
        - `TotalTimeout` integer — TotalTimeout is the maximum amount of time a task is allowed to complete in seconds. This includes the time spent in the queue, the time spent executing and the time spent retrying. Zero means no timeout.
    - `Type` string — Type is the type of job this is, e.g. "daemon" or "batch".
    - `Version` integer — Version is a per-job monotonically increasing version number that is incremented on each job specification update.
  - `NextToken` string

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

[API](https://skmtc.net/bacalhau-project/apis/bacalhau-api.md) · [All operations](https://skmtc.net/bacalhau-project/apis/bacalhau-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bacalhau-project/bacalhau-api/versions/9470ca2a198b/schema)
