> ## 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 schedule is provided, it takes precedence over run_at.



## OpenAPI

````yaml /openapi.json post /jobs
openapi: 3.0.3
info:
  title: QuedUp API
  description: Development documentation
  version: 0.1.0
servers:
  - url: https://api.quedup.dev
    description: Production API
security: []
tags:
  - name: Jobs
    description: Job management endpoints.
paths:
  /jobs:
    post:
      tags:
        - Jobs
      summary: Create Job
      description: >-
        Creates a new job. If schedule is provided, it takes precedence over
        run_at.
      operationId: postJobs
      requestBody:
        description: Payload used to create a new scheduled HTTP job.
        required: true
        content:
          application/json:
            schema:
              example:
                name: Nightly customer sync
                url: https://api.example.com/webhooks/customer-sync
                method: POST
                headers:
                  Authorization: Bearer sk_test_123
                  Content-Type: application/json
                schedule: 0 0 * * *
                body: '{"source":"quedup","action":"sync"}'
              type: object
              required:
                - name
                - url
                - method
              properties:
                name:
                  minLength: 1
                  description: Human-readable name for the job.
                  example: Nightly customer sync
                  type: string
                url:
                  minLength: 1
                  description: Destination URL that QuedUp should call when the job runs.
                  format: uri
                  example: https://api.example.com/webhooks/customer-sync
                  type: string
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - PATCH
                    - DELETE
                  description: HTTP method used when QuedUp executes the job request.
                  example: POST
                headers:
                  description: Optional HTTP headers to include in the outbound request.
                  example:
                    Authorization: Bearer sk_test_123
                    Content-Type: application/json
                  type: object
                  additionalProperties: {}
                schedule:
                  description: >-
                    Cron expression for a recurring job. Takes precedence over
                    run_at when both are provided.
                  example: 0 0 * * *
                  type: string
                run_at:
                  description: ISO 8601 timestamp for a one-time execution.
                  format: date-time
                  example: '2026-03-09T00:00:00.000Z'
                  type: string
                body:
                  description: Optional raw request body to send with the job request.
                  example: '{"source":"quedup","action":"sync"}'
                  type: string
      responses:
        '200':
          description: A scheduled HTTP job managed by QuedUp.
          content:
            application/json:
              schema:
                example:
                  id: 550e8400-e29b-41d4-a716-446655440000
                  name: Nightly customer sync
                  url: https://api.example.com/webhooks/customer-sync
                  method: POST
                  headers:
                    Authorization: Bearer sk_test_123
                    Content-Type: application/json
                  body: '{"source":"quedup","action":"sync"}'
                  schedule: 0 0 * * *
                  next_run_at: '2026-03-09T00:00:00.000Z'
                  status: active
                type: object
                required:
                  - id
                  - name
                  - url
                  - method
                  - headers
                  - body
                  - schedule
                  - next_run_at
                  - status
                properties:
                  id:
                    description: Unique identifier for the job.
                    example: 550e8400-e29b-41d4-a716-446655440000
                    type: string
                  name:
                    description: Human-readable name for the job.
                    example: Nightly customer sync
                    type: string
                  url:
                    description: Destination URL that QuedUp calls when the job runs.
                    format: uri
                    example: https://api.example.com/webhooks/customer-sync
                    type: string
                  method:
                    type: string
                    enum:
                      - GET
                      - POST
                      - PUT
                      - PATCH
                      - DELETE
                    description: HTTP method used when QuedUp executes the job request.
                    example: POST
                  headers:
                    description: HTTP headers that will be sent with the outbound request.
                    example:
                      Authorization: Bearer sk_test_123
                      Content-Type: application/json
                    type: object
                    additionalProperties: {}
                  body:
                    description: Raw request body sent when the job executes.
                    example: '{"source":"quedup","action":"sync"}'
                    type: string
                  schedule:
                    nullable: true
                    description: >-
                      Cron expression for recurring execution. Null for one-time
                      jobs.
                    example: 0 0 * * *
                    type: string
                  next_run_at:
                    nullable: true
                    description: Next scheduled execution time in ISO 8601 format.
                    format: date-time
                    example: '2026-03-09T00:00:00.000Z'
                    type: string
                  status:
                    type: string
                    enum:
                      - active
                      - paused
                      - failed
                      - completed
                      - running
                    description: Current lifecycle state of the job.
                    example: active
        '400':
          description: Standard error payload returned when a request cannot be completed.
          content:
            application/json:
              schema:
                example:
                  error: invalid_request
                  message: url must be a valid http(s) URL
                  field: url
                type: object
                required:
                  - error
                  - message
                properties:
                  error:
                    description: Stable machine-readable error code.
                    example: invalid_request
                    type: string
                  message:
                    description: Human-readable explanation of the error.
                    example: url must be a valid http(s) URL
                    type: string
                  field:
                    description: >-
                      Request field associated with the validation error, when
                      applicable.
                    example: url
                    type: string
        '500':
          description: Standard error payload returned when a request cannot be completed.
          content:
            application/json:
              schema:
                example:
                  error: invalid_request
                  message: url must be a valid http(s) URL
                  field: url
                type: object
                required:
                  - error
                  - message
                properties:
                  error:
                    description: Stable machine-readable error code.
                    example: invalid_request
                    type: string
                  message:
                    description: Human-readable explanation of the error.
                    example: url must be a valid http(s) URL
                    type: string
                  field:
                    description: >-
                      Request field associated with the validation error, when
                      applicable.
                    example: url
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Provide your QuedUp API key in the Authorization header as `Bearer
        <api_key>`.

````