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

# Create Job

> Creates a new job.

- If neither `run_at` nor `schedule` are provided, the job runs immediately.
- If `run_at` is provided, the job runs once at the specified time.
- If `schedule` is provided, the job runs on the specified cron schedule.
- If both are provided, `schedule` takes precedence.




## OpenAPI

````yaml openapi.json post /jobs
openapi: 3.1.0
info:
  description: QuedUp API Reference
  title: OpenAPI
  version: 0.0.1
servers:
  - description: Production server
    url: https://api.quedup.dev
security: []
tags:
  - name: Job
paths:
  /jobs:
    post:
      tags:
        - Job
      summary: Create Job
      description: >
        Creates a new job.


        - If neither `run_at` nor `schedule` are provided, the job runs
        immediately.

        - If `run_at` is provided, the job runs once at the specified time.

        - If `schedule` is provided, the job runs on the specified cron
        schedule.

        - If both are provided, `schedule` takes precedence.
      operationId: POST_/jobs
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJobRequest'
        description: Request body for job.CreateJobRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Bad Request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
          description: Internal Server Error
        default:
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    CreateJobRequest:
      description: CreateJobRequest schema
      properties:
        body:
          description: Optional request body to include when sending the job.
          nullable: true
          type: string
        headers:
          additionalProperties:
            description: >-
              Optional key/value pairs of HTTP headers to include in the
              request.
          description: Optional key/value pairs of HTTP headers to include in the request.
          type: object
        method:
          description: The HTTP method used when sending the request.
          example: POST
          type: string
        name:
          description: A unique name for the job. Used for identification.
          example: Database Backup
          type: string
        run_at:
          description: >-
            A timestamp for running the job once at a specific time. Must be in
            RFC3339 format, e.g. 2025-09-24T17:00:00Z. Ignored if schedule is
            provided.
          format: date-time
          nullable: true
          type: string
        schedule:
          description: >-
            A cron expression for running the job on a recurring schedule. If
            provided, it takes precedence over run_at.
          nullable: true
          type: string
        url:
          description: The URL the job will send a request to.
          example: https://example.com
          type: string
      required:
        - method
        - name
        - url
      type: object
    Job:
      description: Job schema
      properties:
        body:
          type: string
        headers:
          additionalProperties: {}
          type: object
        id:
          example: job_xxx
          type: string
        method:
          example: POST
          type: string
        name:
          example: Job
          type: string
        next_run_at:
          description: >-
            The next time the Job is scheduled to run. If empty, the Job is
            complete=.
          format: date-time
          nullable: true
          type: string
        schedule:
          description: The CRON schedule for the Job
          example: 0 12 * * *
          nullable: true
          type: string
        status:
          description: A Job can be active, paused, failed or completed
          example: active
          type: string
        url:
          example: https://example.com
          type: string
      type: object
    HTTPError:
      description: HTTPError schema
      properties:
        detail:
          description: Human readable error message
          nullable: true
          type: string
        errors:
          items:
            nullable: true
            properties:
              more:
                additionalProperties:
                  description: Additional information about the error
                  nullable: true
                description: Additional information about the error
                nullable: true
                type: object
              name:
                description: For example, name of the parameter that caused the error
                type: string
              reason:
                description: Human readable error message
                type: string
            type: object
          nullable: true
          type: array
        instance:
          nullable: true
          type: string
        status:
          description: HTTP status code
          example: 403
          nullable: true
          type: integer
        title:
          description: Short title of the error
          nullable: true
          type: string
        type:
          description: >-
            URL of the error type. Can be used to lookup the error in a
            documentation
          nullable: true
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      scheme: bearer
      type: http

````