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

# Get Job Runs

> Get all JobRuns for a Job.



## OpenAPI

````yaml get /{workspaceId}/projects/{projectName}/jobs/{jobId}/runs
openapi: 3.1.0
info:
  title: Intuned Client
  version: 0.0.2
  description: Programmatically trigger automations, manage Jobs, and handle AuthSessions.
  termsOfService: https://intuned.ai/terms
  contact:
    email: founders@intunedhq.com
servers:
  - url: https://app.intuned.io/api/v1/workspace
    description: Base URL for Intuned API.
security:
  - api_key: []
tags:
  - name: projects.jobs
    description: Project Jobs API
  - name: projects.jobs.runs
    description: Project JobRuns API
  - name: projects.runs
    description: Run APIs
  - name: projects.authSessions
    description: Manage AuthSessions
  - name: projects.authSessions.validate
    description: Validate AuthSession
  - name: projects.authSessions.create
    description: Create AuthSession
  - name: projects.authSessions.update
    description: Update AuthSession
externalDocs:
  description: Find out more about Intuned
  url: https://intunedhq.com/docs/
paths:
  /{workspaceId}/projects/{projectName}/jobs/{jobId}/runs:
    get:
      tags:
        - projects.jobs.runs
      summary: Get Job Runs
      description: Get all JobRuns for a Job.
      operationId: getJobRuns
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          description: >-
            Your workspace ID. [How to find
            it](/main/03-how-to/manage/manage-workspace#how-to-get-your-workspace-id)?
          example: 123e4567-e89b-12d3-a456-426614174000
          in: path
          name: workspaceId
          x-speakeasy-globals-hidden: true
        - schema:
            type: string
          required: true
          description: The name you assigned when creating the Project.
          example: my-project
          in: path
          name: projectName
        - schema:
            type: string
          required: true
          description: The ID you assigned when creating the Job.
          example: my-sample-job
          in: path
          name: jobId
        - schema:
            type: string
            description: Number of items per page (defaults to 10)
            example: '10'
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            description: Page number for pagination (defaults to 0)
            example: '0'
          required: false
          name: pageNumber
          in: query
        - schema:
            type: string
            description: >-
              Sorting parameter in format 'column,order/column2,order2'. Order
              can be 'asc' or 'desc'
            example: start_time,desc/status,asc
          required: false
          name: sortBy
          in: query
      responses:
        '200':
          description: Array of JobRuns with pagination info.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobRuns:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier for the JobRun (jr_...).
                          example: jr_abc123def456ghi789xyz
                        start_time:
                          type: string
                          description: Timestamp when the JobRun started.
                          example: '2024-01-01T00:00:00Z'
                        end_time:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Timestamp when the job run ended (null if still
                            running)
                          example: '2024-01-01T00:30:00Z'
                        workspace_id:
                          type: string
                          format: uuid
                          description: UUID of the workspace this JobRun belongs to.
                          example: 123e4567-e89b-12d3-a456-426614174000
                        project_id:
                          type: string
                          format: uuid
                          description: UUID of the project this JobRun belongs to.
                          example: 123e4567-e89b-12d3-a456-426614174000
                        job_id:
                          type: string
                          description: ID of the job this run belongs to
                          example: job-123e4567-e89b-12d3
                        created_at:
                          type: string
                          description: Timestamp when the JobRun was created.
                          example: '2024-01-01T00:00:00Z'
                        updated_at:
                          type: string
                          description: Timestamp when the JobRun was last updated.
                          example: '2024-01-01T00:00:00Z'
                        type:
                          type: string
                          enum:
                            - MANUAL
                            - SCHEDULED
                          description: Type of the JobRun.
                          example: SCHEDULED
                        status:
                          type: string
                          enum:
                            - CANCELED
                            - PENDING
                            - PAUSED
                            - PAUSING
                            - RESUMING
                            - SUCCESS
                            - FAILURE
                            - TERMINATED
                            - COMPLETED
                          description: Current status of the JobRun.
                          example: SUCCESS
                        payloads:
                          type:
                            - integer
                            - 'null'
                          description: Total number of payloads in the JobRun.
                          example: 100
                        successful_runs:
                          type:
                            - integer
                            - 'null'
                          description: Number of successful API calls in the JobRun.
                          example: 95
                        failed_runs:
                          type:
                            - integer
                            - 'null'
                          description: Number of failed API calls in the JobRun.
                          example: 5
                        error:
                          type:
                            - object
                            - 'null'
                          properties:
                            message:
                              type: string
                              description: Error message describing the failure
                              example: An error occurred while executing the job
                            code:
                              type: string
                              enum:
                                - internal-server-error
                                - insufficient-resource-credits
                              description: >-
                                Optional error code for more specific error
                                identification
                              example: internal-server-error
                            details: {}
                            category:
                              type: string
                              enum:
                                - billing
                                - infrastructure
                            correlationId:
                              type: string
                              description: Optional correlation ID for tracking the error
                              example: 123e4567-e89b-12d3-a456-426614174000
                            retirable:
                              type: boolean
                              default: false
                            doc_url:
                              type: string
                              description: Optional documentation URL for more information
                              example: https://intunedhq.com/docs/main/support/errors
                          required:
                            - message
                            - code
                            - category
                          description: >-
                            Error information if the job run failed, stored as
                            JSONB
                        reason:
                          type:
                            - object
                            - 'null'
                          properties:
                            type:
                              type: string
                              enum:
                                - terminated
                                - user-request
                                - auth-session-not-found
                                - auth-session-invalid-mid-job
                                - auth-session-validate-dependency-failed
                                - auth-session-locked
                                - another-job-run-active
                                - insufficient-resource-credits
                                - s3-sink-error
                            message:
                              type: string
                            details: {}
                            doc_url:
                              type: string
                              description: Optional documentation URL for more information
                              example: >-
                                https://intunedhq.com/docs/main/support/reasons#no-valid-output-received
                          required:
                            - type
                            - message
                          description: Reason for JobRun state change., stored as JSONB
                        job_configuration_snapshot:
                          type: object
                          properties:
                            configuration:
                              type: object
                              properties:
                                retry:
                                  type: object
                                  properties:
                                    maximumAttempts:
                                      type: integer
                                      minimum: 1
                                      default: 3
                                      description: >-
                                        Maximum number of attempts to retry the
                                        run in case of failure
                                      example: 3
                                  description: >-
                                    The retry policy of the job. Configure how
                                    many retries and the delay between them for
                                    each payload.
                                  example:
                                    maximumAttempts: 3
                                maxConcurrentRequests:
                                  type: number
                                  minimum: 1
                                  maximum: 25
                                  description: >-
                                    The batch size of payloads to execute. This
                                    does not guarantee that the payloads will be
                                    executed at the same time.
                                requestTimeout:
                                  type: integer
                                  default: 600
                                  description: >-
                                    Timeout for the API request in seconds.
                                    Default is 10 minutes (600 seconds).
                                  example: 600
                                proxy:
                                  type: string
                                  format: uri
                                  description: >-
                                    Proxy URL for the job to use when making API
                                    calls
                                  example: >-
                                    http://username:password@proxy.example.com:8080
                              description: Job configuration settings
                            sink:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - webhook
                                    url:
                                      type: string
                                      description: >-
                                        The URL to which the webhook will send
                                        the data.
                                      example: https://example.com/webhook
                                    headers:
                                      type: object
                                      additionalProperties:
                                        type: string
                                      description: >-
                                        Optional headers to be sent with the
                                        webhook request.
                                      example:
                                        Content-Type: application/json
                                        Authorization: Bearer token
                                    skipOnFail:
                                      type: boolean
                                      default: false
                                      description: >-
                                        If true, the webhook will not be sent if
                                        the API execution fails.
                                    apisToSend:
                                      type: array
                                      items:
                                        type: string
                                      minItems: 1
                                      description: >-
                                        List of API names to be sent to the
                                        webhook. If not provided, all APIs will
                                        be sent.
                                      example:
                                        - api1
                                        - api2
                                  required:
                                    - type
                                    - url
                                  description: Configuration for the webhook sink.
                                  title: Webhook Sink Configuration
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - s3
                                    bucket:
                                      type: string
                                      description: >-
                                        The name of the S3 bucket where the data
                                        will be stored.
                                      example: my-s3-bucket
                                    accessKeyId:
                                      type: string
                                      description: The access key ID for the S3 bucket.
                                      example: AKIAIOSFODNN7EXSSPLE
                                    secretAccessKey:
                                      type: string
                                      description: The secret access key for the S3 bucket.
                                      example: wJalrXUtnFFFI/K7MDENG/bPxRfiCYEXAMPLEKEY
                                    region:
                                      type: string
                                      description: >-
                                        The region where the S3 bucket is
                                        located.
                                      example: us-west-2
                                    prefix:
                                      type: string
                                      description: >-
                                        Optional prefix for the S3 objects. This
                                        can be used to organize objects within
                                        the bucket.
                                      example: my-prefix/
                                    skipOnFail:
                                      type: boolean
                                      default: false
                                      description: >-
                                        If enabled, failed payload runs will
                                        ***not*** be written to the bucket.
                                    apisToSend:
                                      type: array
                                      items:
                                        type: string
                                      minItems: 1
                                      description: >-
                                        List of API names to be sent to the S3
                                        bucket. If not provided, all APIs will
                                        be sent.
                                      example:
                                        - api1
                                        - api2
                                    endpoint:
                                      type: string
                                      description: >-
                                        Optional custom endpoint for the S3
                                        bucket. This can be used for
                                        S3-compatible services.
                                      example: https://s3.custom-endpoint.com
                                    forcePathStyle:
                                      type: boolean
                                      description: >-
                                        If true, the S3 client will use
                                        path-style URLs instead of
                                        virtual-hosted-style URLs. This is
                                        useful for S3-compatible services that
                                        require path-style access.
                                      example: true
                                  required:
                                    - type
                                    - bucket
                                    - accessKeyId
                                    - secretAccessKey
                                    - region
                                  description: Configuration for the S3 sink.
                                  title: S3 Sink Configuration
                                - type: 'null'
                              description: >-
                                Optional sink configuration for the job. Can be
                                a webhook or S3 Compatible sink.
                            auth_session:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                checkAttempts:
                                  type: integer
                                  default: 3
                                  description: >-
                                    Number of attempts to check the validity of
                                    the AuthSession before recreating it.
                                  example: 3
                                createAttempts:
                                  type: integer
                                  default: 3
                                  description: >-
                                    Number of attempts to create a new
                                    AuthSession if the current one is invalid or
                                    expired.
                                  example: 3
                              required:
                                - id
                              description: Authentication session information for the job
                              example:
                                id: auth-session-123
                            proxy:
                              type:
                                - object
                                - 'null'
                              properties:
                                version:
                                  type: string
                                  enum:
                                    - v1
                                url:
                                  type: string
                                  format: uri
                              required:
                                - version
                                - url
                              description: Proxy configuration for the job, stored as JSONB
                            notifications:
                              type:
                                - array
                                - 'null'
                              items:
                                oneOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - webhook
                                      url:
                                        type: string
                                        description: >-
                                          The URL to which the webhook will send
                                          the data.
                                        example: https://example.com/webhook
                                      headers:
                                        type: object
                                        additionalProperties:
                                          type: string
                                        description: >-
                                          Optional headers to be sent with the
                                          webhook request.
                                        example:
                                          Content-Type: application/json
                                          Authorization: Bearer token
                                    required:
                                      - type
                                      - url
                              description: >-
                                Array of notification configurations for the
                                job. Notifications are sent when jobs reach a
                                terminal state.
                          required:
                            - configuration
                          description: >-
                            Snapshot of job configuration at the time of the job
                            run
                      required:
                        - id
                        - start_time
                        - end_time
                        - workspace_id
                        - project_id
                        - job_id
                        - created_at
                        - updated_at
                        - type
                        - status
                        - payloads
                        - successful_runs
                        - failed_runs
                        - job_configuration_snapshot
                  totalCount:
                    type: integer
                    description: Total number of JobRuns available.
                    example: 150
                required:
                  - jobRuns
                  - totalCount
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad-request
                    description: The request is invalid or malformed
                    externalDocs:
                      description: Find more info here
                      url: >-
                        https://intunedhq.com/docs/main/support/errors#bad-request
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: The request requires user authentication
                    externalDocs:
                      description: Find more info here
                      url: >-
                        https://intunedhq.com/docs/main/support/errors#unauthorized
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not-found
                    description: The requested resource was not found
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#not-found
                  category:
                    type: string
                    enum:
                      - user
                    description: Errors caused by user actions or input
                    externalDocs:
                      description: Find more info here
                      url: https://intunedhq.com/docs/main/support/errors#user
                  message:
                    type: string
                  retirable:
                    type: boolean
                    enum:
                      - false
                  details: {}
                  correlationId:
                    type: string
                required:
                  - code
                  - category
                  - message
                  - retirable
                  - correlationId
      x-codeSamples:
        - lang: typescript
          label: getJobRuns
          source: |
            import { IntunedClient } from "@intuned/client";

            const client = new IntunedClient({
              workspaceId: "123e4567-e89b-12d3-a456-426614174000",
              apiKey: process.env["INTUNED_API_KEY"] ?? "",
            });

            async function run() {
              const result = await client.projects.jobs.runs.all(
                {
                  projectName: "my-project",
                  jobId: "my-sample-job",
                  pageSize: "10",
                  pageNumber: "0",
                  sortBy: "start_time,desc/status,asc",
                },
            );

              console.log(result);
            }

            run();
        - lang: python
          label: Python (SDK)
          source: |-
            from intuned_client import IntunedClient
            import os


            with IntunedClient(
                workspace_id="123e4567-e89b-12d3-a456-426614174000",
                api_key=os.getenv("INTUNED_API_KEY", ""),
            ) as client:

                res = client.projects.jobs.runs.list(
                    project_name="my-project",
                    job_id="my-sample-job",
                    page_size="10",
                    page_number="0",
                    sort_by="start_time,desc/status,asc",
                )

                print(res)
components:
  securitySchemes:
    api_key:
      type: apiKey
      description: >-
        API Key used to authenticate your requests. [How to create
        one](/main/03-how-to/manage/manage-api-keys).
      in: header
      name: x-api-key

````