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

# Approve a proposal and start materialization

> Apply edits, mark approved, and queue the CTAS materialization.



## OpenAPI

````yaml post /api/automl/feature-engineering/jobs/{job_id}/approve
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/feature-engineering/jobs/{job_id}/approve:
    post:
      tags:
        - AutoML Feature Engineering
      summary: Approve a proposal and start materialization
      description: Apply edits, mark approved, and queue the CTAS materialization.
      operationId: >-
        approve_proposal_api_automl_feature_engineering_jobs__job_id__approve_post
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Feature engineering job ID.
            title: Job Id
          description: Feature engineering job ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          description: Job isn't in a ``pending_approval`` state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    ApprovalRequest:
      properties:
        edits:
          anyOf:
            - $ref: '#/components/schemas/ProposalEdits'
            - type: 'null'
        auto_train:
          type: boolean
          title: Auto Train
          description: If true, kick off AutoML training once materialization completes.
          default: false
        train_request:
          anyOf:
            - $ref: >-
                #/components/schemas/api__models__automl_feature_engineering_models__AutoMLTrainingRequest
            - type: 'null'
          description: Training request to forward when auto_train is true.
      type: object
      title: ApprovalRequest
      description: Request body for approving a proposal and starting materialization.
    ApprovalResponse:
      properties:
        job_id:
          type: string
          format: uuid
          title: Job Id
        status:
          $ref: '#/components/schemas/AutoMLFeatureEngineeringStatusEnum'
        training_table:
          type: string
          title: Training Table
          description: Target table queued for materialization.
        training_job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Training Job Id
          description: AutoML training job ID if auto_train chained successfully.
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      required:
        - job_id
        - status
        - training_table
      title: ApprovalResponse
      description: Response returned by the approval endpoint.
    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
    ProposalEdits:
      properties:
        remove_features:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Remove Features
          description: Feature names to drop from the recipe.
        rename:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Rename
          description: Mapping of old feature name -> new feature name.
        label:
          anyOf:
            - $ref: '#/components/schemas/LabelSpec'
            - type: 'null'
          description: Replacement label spec, if the user wants to tweak the label.
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Optional reviewer notes captured in the audit trail.
      type: object
      title: ProposalEdits
      description: Edits the user wants applied to the recipe before materialization.
    api__models__automl_feature_engineering_models__AutoMLTrainingRequest:
      properties:
        source_table:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Table
          description: >-
            Fully qualified training table name. Defaults to the materialized
            target_table_name.
        label_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Label Column
          description: Label column name. Defaults to the recipe's label.name.
        feature_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Feature Columns
          description: Override feature columns. Defaults to the recipe's features list.
      type: object
      title: AutoMLTrainingRequest
      description: |-
        Forward-declared shape for the AutoML training request.

        The training endpoint does not yet exist in this repo; this stub keeps
        the approval payload future-compatible. When ``auto_train`` is true on
        an approval, the service will populate this from the recipe and POST it
        to ``/api/automl/train`` once that endpoint lands.
    AutoMLFeatureEngineeringStatusEnum:
      type: string
      enum:
        - running
        - pending_approval
        - failed
        - approved
        - materializing
        - complete
      title: AutoMLFeatureEngineeringStatusEnum
      description: Lifecycle of an AutoML feature engineering 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
    LabelSpec:
      properties:
        name:
          type: string
          title: Name
          description: Output column name in the training table.
          default: label
        type:
          type: string
          const: binary
          title: Type
          description: Label type. Version 1 supports binary labels only.
          default: binary
        column:
          anyOf:
            - type: string
            - type: 'null'
          title: Column
          description: >-
            Existing column name or a simple SQL expression that yields the
            label.
        derivation:
          anyOf:
            - type: string
            - type: 'null'
          title: Derivation
          description: >-
            Natural-language description of how to derive the label from source
            data.
        positive_class_value:
          anyOf:
            - {}
            - type: 'null'
          title: Positive Class Value
          description: Value treated as the positive class for binary labels.
      type: object
      title: LabelSpec
      description: |-
        How to derive the label column for the training table.

        Provide exactly one of ``column`` or ``derivation``. ``column``
        refers to an existing column or a simple SQL expression over source
        columns. ``derivation`` is a natural-language description that the crew
        translates into SQL.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````