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

# Ingest

> Submit a new data ingestion request to upload the required data into NexusOne. Returns the ingestion flow details.



## OpenAPI

````yaml post /api/dataingest/submit
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/dataingest/submit:
    post:
      tags:
        - Data ingestion
      summary: Ingest
      description: >-
        Submit a new data ingestion request to upload the required data into
        NexusOne. Returns the ingestion flow details.
      operationId: ingest_api_dataingest_submit_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestRequest'
        required: true
      responses:
        '200':
          description: Data Ingest submitted successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    IngestRequest:
      properties:
        name:
          type: string
          title: Name
          description: The name of the ingestion job.
        ingesttype:
          $ref: '#/components/schemas/IngestTypeEnum'
          description: >-
            Defines the type of data ingestion. Valid values: `file`, `jdbc`, or
            `lakehouse`.
        schema_name:
          type: string
          title: Schema Name
          description: The target schema that receives ingested data.
        table:
          type: string
          title: Table
          description: The target table name for the data.
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
          description: >-
            The cron expression that specifies when or how often the ingestion
            runs.
        mode:
          $ref: '#/components/schemas/IngestModeEnum'
          description: >-
            Defines how the job writes query output to a target table. Valid
            values: `append`, `overwrite`, or `merge`.
        merge:
          anyOf:
            - type: string
            - type: 'null'
          title: Merge
          description: Columns used to match and merge data when the `mode` is `merge`.
        column_transformations:
          anyOf:
            - items:
                $ref: '#/components/schemas/ColumnTransformation'
              type: array
            - type: 'null'
          title: Column Transformations
          description: >-
            Optional list of column transformations to apply during ingestion.
            Supports casting to different data types, renaming columns, and
            encrypting column values.
        file_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: File Id
          description: Unique ID of the uploaded file.
        file_path:
          anyOf:
            - type: string
            - type: 'null'
          title: File Path
          description: S3 URL to the file you want to ingest.
        file_format:
          anyOf:
            - type: string
            - type: 'null'
          title: File Format
          description: >-
            The format of the file. Valid values: `csv`, `orc`, `xml`,
            `parquet`, or `xls`.
        file_read_options:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: File Read Options
          description: Options for reading the file.
        jdbc_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Url
          description: Connection URL for the JDBC data source when the format is `jdbc`.
        jdbc_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Username
          description: Username for the JDBC connection.
        jdbc_password:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Password
          description: Password for the JDBC connection.
        jdbc_type:
          anyOf:
            - $ref: '#/components/schemas/JdbcTypeEnum'
            - type: 'null'
          description: 'Type of JDBC ingestion. Valid values: `table` or `query`.'
        jdbc_schema:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Schema
          description: Source schema in the JDBC database.
        jdbc_table:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Table
          description: Source table in the JDBC database.
        jdbc_query:
          anyOf:
            - type: string
            - type: 'null'
          title: Jdbc Query
          description: SQL query used to extract data via JDBC.
        lakehouse_sourceschema:
          anyOf:
            - type: string
            - type: 'null'
          title: Lakehouse Sourceschema
          description: Source schema in the lakehouse when file format is `lakehouse`.
        lakehouse_sourcetable:
          anyOf:
            - type: string
            - type: 'null'
          title: Lakehouse Sourcetable
          description: Source table in the lakehouse.
        lakehouse_conditions:
          anyOf:
            - type: string
            - type: 'null'
          title: Lakehouse Conditions
          description: >-
            Filter conditions for the lakehouse source query. For example,
            `salary > 2000, store_id = 1`.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: The domain to assign to the dataset in DataHub.
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Tags to assign to the dataset in DataHub.
        owner_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner Id
          description: The logged in user's email ID.
      type: object
      required:
        - name
        - ingesttype
        - schema_name
        - table
        - mode
      title: IngestRequest
      description: Request model for data ingestion jobs.
    IngestResponse:
      properties:
        job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Job Id
          description: A unique ID of the created ingestion job.
        flow_url:
          type: string
          title: Flow Url
          description: Airflow URL to access the ingestion flow.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Error message if the ingestion fails due to any issue.
      type: object
      required:
        - flow_url
      title: IngestResponse
    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
    IngestTypeEnum:
      type: string
      enum:
        - file
        - jdbc
        - lakehouse
      title: IngestTypeEnum
      description: Type of data source for ingestion.
    IngestModeEnum:
      type: string
      enum:
        - append
        - overwrite
        - merge
      title: IngestModeEnum
      description: Defines how the job writes data to a target table.
    ColumnTransformation:
      properties:
        stream:
          anyOf:
            - type: string
            - type: 'null'
          title: Stream
          description: >-
            Target stream name. For Airbyte multi-stream ingestion only. The
            field has no effect on single-table ingestion.
        column:
          type: string
          title: Column
          description: The source column name to transform.
        transformation_type:
          $ref: '#/components/schemas/ColumnTransformationType'
          description: >-
            Type of transformation to apply, such as `cast`, `rename`, or
            `encrypt`.
        target_type:
          anyOf:
            - $ref: '#/components/schemas/SparkDataType'
            - type: 'null'
          description: >-
            Target data type for cast transformation. Required when
            `transformation_type` is `cast`.
        new_name:
          anyOf:
            - type: string
            - type: 'null'
          title: New Name
          description: >-
            New column name for rename transformation. Required when
            `transformation_type` is `rename`.
        encryption_key_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Encryption Key Name
          description: >-
            Optional encryption key name when using the `vault_encrypt` User
            Defined Function (UDF). If not provided, uses the default key.
      type: object
      required:
        - column
        - transformation_type
      title: ColumnTransformation
      description: |-
        Defines a transformation to apply to a column during data ingestion.

        Supported transformations:
        - cast: Convert column to a different data type
        - rename: Rename the column
        - encrypt: Encrypt the column value
        - drop: Remove the column from the output
    JdbcTypeEnum:
      type: string
      enum:
        - table
        - query
      title: JdbcTypeEnum
      description: Type of JDBC data extraction.
    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
    ColumnTransformationType:
      type: string
      enum:
        - cast
        - rename
        - encrypt
        - drop
      title: ColumnTransformationType
      description: Type of column transformation to apply during ingestion.
    SparkDataType:
      type: string
      enum:
        - string
        - int
        - integer
        - long
        - bigint
        - short
        - smallint
        - byte
        - tinyint
        - float
        - double
        - decimal
        - boolean
        - date
        - timestamp
        - binary
      title: SparkDataType
      description: Supported Spark SQL data types for casting.
  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

````