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

# Submit Local Job

> Submit user-run job (user executed on it's own) endpoint.

Handles the storing pre-run job object or job-result object into Haiqu.

Args:
    user (User): User authenticated with api key.

Returns:
    LocalJobModel: The new job object.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json post /jobs
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.4.0
servers: []
security: []
paths:
  /jobs:
    post:
      summary: Submit Local Job
      description: |-
        Submit user-run job (user executed on it's own) endpoint.

        Handles the storing pre-run job object or job-result object into Haiqu.

        Args:
            user (User): User authenticated with api key.

        Returns:
            LocalJobModel: The new job object.
      operationId: submit_local_job_jobs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocalJobSubmitModel'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocalJobModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    LocalJobSubmitModel:
      properties:
        experiment_id:
          type: string
          title: Experiment Id
        hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Hash
          default: ''
        circuit_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Circuit Hash
          default: ''
        results:
          anyOf:
            - type: string
            - type: 'null'
          title: Results
          default: ''
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          default: ''
        shots:
          anyOf:
            - type: string
            - type: 'null'
          title: Shots
          default: ''
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          default: ''
        status:
          type: string
          title: Status
          default: ''
        job_type:
          type: string
          title: Job Type
          default: ''
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
          default: {}
      type: object
      required:
        - experiment_id
      title: LocalJobSubmitModel
      description: |-
        Job submit data model for user-owned, local job/results.

        * User local Qiskit job/results, haiqu.log(job|results)
        * Data loading job
        * Execution job
    LocalJobModel:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        user_id:
          type: integer
          title: User Id
        experiment_id:
          type: string
          title: Experiment Id
        status:
          $ref: '#/components/schemas/JobStatus'
        job_type:
          $ref: '#/components/schemas/JobType'
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          default: Haiqu OS
        creation_date:
          type: string
          format: date-time
          title: Creation Date
        run_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Run Date
        finish_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finish Date
        logs:
          anyOf:
            - type: string
            - type: 'null'
          title: Logs
        quality:
          anyOf:
            - type: number
            - type: 'null'
          title: Quality
        info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Info
        time:
          anyOf:
            - type: number
            - type: 'null'
          title: Time
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Parameters
        hash:
          type: string
          title: Hash
        circuit_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Circuit Id
          default: ''
        backend_name:
          type: string
          title: Backend Name
        results:
          anyOf:
            - type: string
            - type: 'null'
          title: Results
          default: ''
        shot_local:
          anyOf:
            - type: string
            - type: 'null'
          title: Shot Local
          default: ''
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
          default: {}
      type: object
      required:
        - id
        - user_id
        - experiment_id
        - status
        - job_type
        - creation_date
        - hash
        - backend_name
      title: LocalJobModel
      description: |-
        Local user-run Job (regular Qiskit job).
        Flow:
            * user run normal Qiskit job
            * they use `haiqu.log(<job|result>)` to send it to Haiqu cloud for analysis.

        Qiskit and IBM runtime has several types of jobs and types of results.
        We do our best to analyze them all.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobStatus:
      type: string
      enum:
        - Submitted
        - Initializing
        - Queued
        - Validating
        - Running
        - Cancelled
        - Done
        - Error
      title: JobStatus
      description: Class for job status.
    JobType:
      type: string
      enum:
        - User local job
        - Analytics
        - Device specific analytics
        - Data Loading
        - Hybrid
        - Run
        - State Compression
        - Transpilation
        - Variational
        - Pretraining
        - SKQD
      title: JobType
      description: Class for job types.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````