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

# List Jobs

> Retrieve jobs with optional filtering and pagination. Jobs represent individual executions of your scheduled HTTP requests.



## OpenAPI

````yaml GET /jobs
openapi: 3.1.0
info:
  title: Cronhost API
  description: >-
    Schedule HTTP requests with cron expressions. Cronhost allows you to
    automate HTTP requests on a schedule using familiar cron syntax.
  license:
    name: MIT
  version: 1.0.0
  contact:
    name: Cronhost Support
    email: help@cronho.st
    url: https://cronho.st
servers:
  - url: https://cronho.st/api/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Schedules
    description: Create, manage, and control scheduled HTTP requests
  - name: Jobs
    description: Monitor and retrieve job execution details
paths:
  /jobs:
    get:
      tags:
        - Jobs
      summary: List Jobs
      description: >-
        Retrieve jobs with optional filtering and pagination. Jobs represent
        individual executions of your scheduled HTTP requests.
      operationId: getJobs
      parameters:
        - name: scheduleId
          in: query
          required: false
          description: Filter jobs by specific schedule ID
          schema:
            type: string
            example: schedule_123
        - name: status
          in: query
          required: false
          description: Filter jobs by execution status
          schema:
            type: string
            enum:
              - PENDING
              - RUNNING
              - SUCCESS
              - FAILED
            example: SUCCESS
        - name: page
          in: query
          required: false
          description: Page number for pagination
          schema:
            type: integer
            minimum: 1
            default: 1
            example: 1
        - name: limit
          in: query
          required: false
          description: Number of jobs per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
            example: 20
      responses:
        '200':
          description: Successfully retrieved jobs
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Job'
                  success:
                    type: boolean
                    example: true
                required:
                  - data
                  - success
              examples:
                successResponse:
                  summary: Successful response with jobs
                  value:
                    data:
                      - id: job_456
                        scheduleId: schedule_123
                        status: SUCCESS
                        scheduledRunAtUtc: '2024-01-14T14:00:00.000Z'
                        attemptNumber: 1
                        httpMethod: GET
                        endpoint: https://api.example.com/health
                        body: null
                        headers: '{"User-Agent": "Cronhost-Monitor"}'
                        statusCode: 200
                        response: '{"status": "ok", "uptime": 99.9}'
                        startedAtUtc: '2024-01-14T14:00:01.000Z'
                        completedAtUtc: '2024-01-14T14:00:02.500Z'
                        errorMessage: null
                        createdAt: '2024-01-14T14:00:00.000Z'
                        updatedAt: '2024-01-14T14:00:02.500Z'
                    success: true
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    Job:
      type: object
      required:
        - id
        - scheduleId
        - status
        - scheduledRunAtUtc
        - attemptNumber
        - httpMethod
        - endpoint
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: Unique job identifier
          example: job_456
        scheduleId:
          type: string
          description: ID of the associated schedule
          example: schedule_123
        status:
          type: string
          enum:
            - PENDING
            - RUNNING
            - SUCCESS
            - FAILED
          description: Current job execution status
          example: SUCCESS
        scheduledRunAtUtc:
          type: string
          format: date-time
          description: When the job was scheduled to run
          example: '2024-01-14T14:00:00.000Z'
        attemptNumber:
          type: integer
          minimum: 1
          description: Current retry attempt (1-based)
          example: 1
        httpMethod:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
          description: HTTP method used for the request
          example: GET
        endpoint:
          type: string
          format: uri
          description: Target endpoint URL
          example: https://api.example.com/health
        body:
          type: string
          nullable: true
          description: Request body (null for GET requests)
          example: '{"key": "value"}'
        headers:
          type: string
          nullable: true
          description: HTTP headers as JSON string
          example: '{"User-Agent": "Cronhost-Monitor"}'
        statusCode:
          type: integer
          nullable: true
          description: HTTP response status code (null if request failed)
          example: 200
        response:
          type: string
          nullable: true
          description: HTTP response body (null if request failed)
          example: '{"status": "ok"}'
        startedAtUtc:
          type: string
          format: date-time
          nullable: true
          description: When execution started
          example: '2024-01-14T14:00:01.000Z'
        completedAtUtc:
          type: string
          format: date-time
          nullable: true
          description: When execution completed
          example: '2024-01-14T14:00:02.500Z'
        errorMessage:
          type: string
          nullable: true
          description: Error details (null for successful jobs)
          example: Request timeout after 30 seconds
        createdAt:
          type: string
          format: date-time
          description: Job creation timestamp
          example: '2024-01-14T14:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2024-01-14T14:00:02.500Z'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - code
          properties:
            message:
              type: string
              description: Human-readable error message
            code:
              type: string
              description: Error code for programmatic handling
            details:
              description: Additional error details
  responses:
    ValidationError:
      description: Validation error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            error:
              message: Validation error
              code: VALIDATION_ERROR
              details:
                fieldErrors:
                  cronExpression:
                    - Invalid cron expression
                  endpoint:
                    - Must be a valid URL
    UnauthorizedError:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  message: API key is required
                  code: MISSING_API_KEY
            invalidApiKey:
              summary: Invalid API key
              value:
                error:
                  message: Invalid API key
                  code: INVALID_API_KEY
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            error:
              message: Internal server error
              code: INTERNAL_ERROR
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get your API key from the [Cronhost
        dashboard](https://cronho.st/settings).

````