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

# Submit Job

> Submit a new job for processing.

The job will be added to the queue and processed based on priority.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /jobs
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /jobs:
    post:
      tags:
        - jobs
      summary: Submit Job
      description: |-
        Submit a new job for processing.

        The job will be added to the queue and processed based on priority.
      operationId: submit_job_jobs_post
      parameters:
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitJobRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SubmitJobRequest:
      properties:
        job_type:
          $ref: '#/components/schemas/JobType'
          description: Type of job to run
        params:
          additionalProperties: true
          type: object
          title: Params
          description: Parameters for the job
        priority:
          type: integer
          maximum: 10
          minimum: 0
          title: Priority
          description: Job priority (0-10)
          default: 0
        callback_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Callback Url
          description: Webhook URL for job completion notification
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        parent_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Job Id
          description: Parent job ID for hierarchical job relationships
      type: object
      required:
        - job_type
        - params
      title: SubmitJobRequest
      description: Schema for submitting a new job
    JobResponse:
      properties:
        job_id:
          type: string
          title: Job Id
        job_type:
          $ref: '#/components/schemas/JobType'
        status:
          $ref: '#/components/schemas/JobStatus'
        priority:
          type: integer
          title: Priority
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        compute_time:
          anyOf:
            - type: number
            - type: 'null'
          title: Compute Time
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - $ref: '#/components/schemas/JobErrorCode'
            - type: 'null'
        error_detail:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        result:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result
        callback_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Callback Url
        parent_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Job Id
        user_id:
          type: string
          title: User Id
        organization_id:
          type: string
          title: Organization Id
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
        access_level:
          anyOf:
            - $ref: '#/components/schemas/JobAccessLevelEnum'
            - type: 'null'
          default: organization
        params_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Params Path
        metadata_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Metadata Path
        is_terminal:
          type: boolean
          title: Is Terminal
          description: >-
            Whether the job has reached a terminal state and will not transition
            further.


            Derived from :attr:`JobStatus.TERMINAL_STATUSES`, so adding a new

            terminal status to the enum automatically updates the wire field —

            clients that read ``is_terminal`` never need to know the status

            taxonomy or be re-released when it changes.
          readOnly: true
        is_failed:
          type: boolean
          title: Is Failed
          description: >-
            Whether the job terminated unsuccessfully (failed or canceled, not
            completed).


            Derived from :attr:`is_terminal` minus the success case, so any new

            non-success terminal status added to :class:`JobStatus` is

            automatically classified as a failure without touching this method.
          readOnly: true
      type: object
      required:
        - job_id
        - job_type
        - status
        - priority
        - created_at
        - updated_at
        - user_id
        - organization_id
        - is_terminal
        - is_failed
      title: JobResponse
      description: Schema for job information response
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobType:
      type: string
      enum:
        - dummy
        - datafit
        - validation
        - simulate
        - evaluate_variables
        - optimize
        - ecm_fit
        - simple_pipeline
      title: JobType
      description: Possible types for a job
    JobStatus:
      type: string
      enum:
        - pending
        - processing
        - waiting
        - completed
        - failed
        - canceled
      title: JobStatus
      description: Possible statuses for a job
    JobErrorCode:
      type: string
      enum:
        - CONFIGURATION_ERROR
        - MODEL_ERROR
        - SOLVER_ERROR
        - EXECUTION_TIMEOUT
        - SUBMISSION_FAILED
        - INTERNAL_ERROR
      title: JobErrorCode
      description: Machine-readable error codes for jobs.
    JobAccessLevelEnum:
      type: string
      enum:
        - project
        - organization
      title: JobAccessLevelEnum
      description: Possible access levels for a job
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````