> ## 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.

# Get Optimization With Jobs

> List optimization jobs and optimization records for the project.

Filter parameters support Supabase filter operators:

- Text fields (name, template_name, cell_name, model_name,
  created_by_email): use ``ilike.%value%`` for partial match.
- Status: use ``eq.completed`` or ``in.(pending,running)`` for
  multiple values.
- Date range: use ``created_at_gt`` and ``created_at_lt`` for
  between queries.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json get /optimize
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /optimize:
    get:
      tags:
        - optimization
      summary: Get Optimization With Jobs
      description: |-
        List optimization jobs and optimization records for the project.

        Filter parameters support Supabase filter operators:

        - Text fields (name, template_name, cell_name, model_name,
          created_by_email): use ``ilike.%value%`` for partial match.
        - Status: use ``eq.completed`` or ``in.(pending,running)`` for
          multiple values.
        - Date range: use ``created_at_gt`` and ``created_at_lt`` for
          between queries.
      operationId: get_optimization_with_jobs_optimize_get
      parameters:
        - name: project_id
          in: query
          required: true
          schema:
            type: string
            title: Project Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 10
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
            title: Offset
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Status
        - name: template_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Template Name
        - name: cell_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cell Name
        - name: model_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Model Name
        - name: created_by_email
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created By Email
        - name: created_at
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created At
        - name: created_at_gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created At Gt
        - name: created_at_lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created At Lt
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizationListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      deprecated: true
components:
  schemas:
    OptimizationListResponse:
      properties:
        jobs:
          items:
            $ref: '#/components/schemas/JobResponse'
          type: array
          title: Jobs
        optimizations:
          items:
            $ref: '#/components/schemas/Optimization'
          type: array
          title: Optimizations
        total:
          type: integer
          title: Total
      type: object
      required:
        - jobs
        - optimizations
        - total
      title: OptimizationListResponse
      description: List of optimization jobs and their optimization records.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    Optimization:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        job_id:
          type: string
          title: Job Id
        project_id:
          type: string
          title: Project Id
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        cell_spec_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Cell Spec Id
        parameterized_model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parameterized Model Id
        optimization_template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Optimization Template Id
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
        parameterized_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Parameterized Model Name
        cell_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Cell Name
        organization_id:
          type: string
          title: Organization Id
          description: Organization this optimization belongs to.
      type: object
      required:
        - id
        - job_id
        - project_id
        - organization_id
      title: Optimization
      description: Pydantic model for the ``optimizations`` table.
    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
    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

````