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

# DAG status writeback

> Called by the rendered DAG at task start, success, or failure.

PSK-authenticated to match the existing /api/jobs/{id}/status endpoint
used by data-engineering DAGs.



## OpenAPI

````yaml put /api/automl/train/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/automl/train/jobs/{job_id}/status:
    put:
      tags:
        - AutoML Training
      summary: DAG status writeback
      description: |-
        Called by the rendered DAG at task start, success, or failure.

        PSK-authenticated to match the existing /api/jobs/{id}/status endpoint
        used by data-engineering DAGs.
      operationId: update_training_status_api_automl_train_jobs__job_id__status_put
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Training job ID.
            title: Job Id
          description: Training job ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutoMLTrainingStatusUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutoMLTrainingJobResponse'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AutoMLTrainingStatusUpdate:
      properties:
        status:
          $ref: '#/components/schemas/AutoMLTrainingJobStatus'
        mlflow_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Mlflow Run Id
        registered_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Registered Model Name
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
      type: object
      required:
        - status
      title: AutoMLTrainingStatusUpdate
      description: Status writeback payload sent by the Airflow DAG.
    AutoMLTrainingJobResponse:
      properties:
        job_id:
          type: string
          format: uuid
          title: Job Id
        name:
          type: string
          title: Name
        domain:
          type: string
          title: Domain
        owner:
          type: string
          title: Owner
        source_table:
          type: string
          title: Source Table
        problem_type:
          $ref: '#/components/schemas/ProblemType'
        algorithm:
          $ref: '#/components/schemas/AutoMLAlgorithm'
        preset:
          $ref: '#/components/schemas/Preset'
        status:
          $ref: '#/components/schemas/AutoMLTrainingJobStatus'
        rendered_dag:
          anyOf:
            - type: string
            - type: 'null'
          title: Rendered Dag
          description: The rendered DAG source. Populated on creation.
        mlflow_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Mlflow Run Id
        mlflow_experiment_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Mlflow Experiment Name
        registered_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Registered Model Name
        airflow_dag_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Airflow Dag Id
        airflow_dag_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Airflow Dag Url
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        feature_engineering_job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Feature Engineering Job Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - job_id
        - name
        - domain
        - owner
        - source_table
        - problem_type
        - algorithm
        - preset
        - status
        - created_at
        - updated_at
      title: AutoMLTrainingJobResponse
      description: A persisted training job.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AutoMLTrainingJobStatus:
      type: string
      enum:
        - ready
        - queued
        - running
        - complete
        - failed
      title: AutoMLTrainingJobStatus
      description: |-
        Lifecycle of an AutoML training job.

        - `READY`: DAG uploaded but not yet triggered. The user opted out of
          auto-trigger at create time. Manual trigger flips it to `QUEUED`.
        - `QUEUED`: DAG triggered, waiting for Airflow to pick it up.
        - `RUNNING`: Airflow has the run going.
        - `COMPLETE`/`FAILED`: terminal.
    ProblemType:
      type: string
      enum:
        - binary_classification
        - multiclass_classification
        - regression
        - ranking
        - anomaly_detection
        - contextual_bandit
      title: ProblemType
      description: Supervised / unsupervised problem categories.
    AutoMLAlgorithm:
      type: string
      enum:
        - lightgbm_classifier
        - lightgbm_regressor
        - lightgbm_ranker
        - xgboost_classifier
        - xgboost_regressor
        - xgboost_ranker
        - isolation_forest
        - vw_classifier
        - vw_regressor
        - vw_contextual_bandit
      title: AutoMLAlgorithm
      description: Supported AutoML algorithms.
    Preset:
      type: string
      enum:
        - fast
        - balanced
        - best_quality
      title: Preset
      description: Tuning presets shared across algorithms.
    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

````