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

# Update job status

> Updates the status along with a status message of an existing job based on the user's requirement.



## OpenAPI

````yaml put /api/jobs/{job_id}/status
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/jobs/{job_id}/status:
    put:
      tags:
        - Jobs
      summary: Update job status
      description: >-
        Updates the status along with a status message of an existing job based
        on the user's requirement.
      operationId: update_job_status_api_jobs__job_id__status_put
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique ID of the job that requires a status update.
            title: Job Id
          description: Unique ID of the job that requires a status update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateJobStatusRequest'
      responses:
        '200':
          description: Job status updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UpdateJobStatusRequest:
      properties:
        status:
          $ref: '#/components/schemas/JobStatusEnum'
          description: The new status to update the job to.
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
          description: A message explaining the reason or details behind the status change.
      type: object
      required:
        - status
      title: UpdateJobStatusRequest
    JobModel:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
          description: Unique ID of the job.
        owner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Id
          description: The logged in user's email ID.
        job_type:
          anyOf:
            - $ref: '#/components/schemas/JobTypeEnum'
            - type: 'null'
          description: Defines the category of job.
        job_name:
          type: string
          title: Job Name
          description: Specifies the name of the job.
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
          description: Indicates where the data originates.
        destination:
          anyOf:
            - type: string
            - type: 'null'
          title: Destination
          description: Specifies the data or output destination.
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
          description: The cron expression that specifies how often the job runs.
        properties_json:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Json
          description: Additional job properties in JSON format.
        status:
          $ref: '#/components/schemas/JobStatusEnum'
          description: Current status of the job.
          default: new
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
          description: Detailed status message or error information.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Job creation timestamp.
        last_started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Started At
          description: Timestamp when the job last started.
        last_completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Completed At
          description: Timestamp when the job last completed successfully.
        last_failed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Failed At
          description: Timestamp when the job last failed.
        is_deleted:
          type: boolean
          title: Is Deleted
          description: True if you deleted this job.
          default: false
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Timestamp when you deleted this job.
      type: object
      required:
        - job_name
      title: JobModel
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobStatusEnum:
      type: string
      enum:
        - new
        - running
        - completed
        - failed
      title: JobStatusEnum
    JobTypeEnum:
      type: string
      enum:
        - airflow.dataeng
        - airflow.nlp
        - airflow.ingest
        - airflow.airbyte
        - mirror
      title: JobTypeEnum
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````