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

# Create an ingest pipeline

> Validates, creates the pipeline, schedules its DAG and links the job.

Without a schedule it runs at once, and the first run is listed as queued.



## OpenAPI

````yaml post /api/ingest/pipelines
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/ingest/pipelines:
    post:
      tags:
        - Ingest pipelines
      summary: Create an ingest pipeline
      description: >-
        Validates, creates the pipeline, schedules its DAG and links the job.


        Without a schedule it runs at once, and the first run is listed as
        queued.
      operationId: create_pipeline_api_ingest_pipelines_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePipelineRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PipelineDetail'
        '400':
          description: Invalid request.
        '403':
          description: Not allowed.
        '404':
          description: No such pipeline (or file).
        '409':
          description: Conflicts with the pipeline's state.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Airflow or the source couldn't be reached.
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    CreatePipelineRequest:
      properties:
        name:
          type: string
          title: Name
        source:
          oneOf:
            - $ref: '#/components/schemas/FileSource'
            - $ref: '#/components/schemas/DatabaseSource'
            - $ref: '#/components/schemas/LakehouseSource'
            - $ref: '#/components/schemas/SaasSource'
          title: Source
          discriminator:
            propertyName: kind
            mapping:
              database: '#/components/schemas/DatabaseSource'
              file: '#/components/schemas/FileSource'
              lakehouse: '#/components/schemas/LakehouseSource'
              saas: '#/components/schemas/SaasSource'
        destination:
          $ref: '#/components/schemas/Destination'
        columns:
          items:
            $ref: '#/components/schemas/ColumnSpec'
          type: array
          maxItems: 500
          title: Columns
        governance:
          $ref: '#/components/schemas/Governance'
      type: object
      required:
        - name
        - source
        - destination
      title: CreatePipelineRequest
    PipelineDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        source_kind:
          $ref: '#/components/schemas/api__models__ingest_pipeline_models__SourceKind'
        source_summary:
          type: string
          title: Source Summary
        target_table:
          type: string
          title: Target Table
        mode:
          $ref: '#/components/schemas/WriteMode'
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
        schedule_label:
          type: string
          title: Schedule Label
        status:
          $ref: '#/components/schemas/PipelineStatus'
        last_run:
          anyOf:
            - $ref: '#/components/schemas/RunSummary'
            - type: 'null'
        rows_7d:
          type: integer
          title: Rows 7D
          default: 0
        owner:
          type: string
          title: Owner
        can_edit:
          type: boolean
          title: Can Edit
        merge_keys:
          items:
            type: string
          type: array
          title: Merge Keys
        governance:
          $ref: '#/components/schemas/Governance'
        job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Job Id
        airflow_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Airflow Url
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        spec:
          additionalProperties: true
          type: object
          title: Spec
        latest_error:
          anyOf:
            - $ref: '#/components/schemas/LatestError'
            - type: 'null'
      type: object
      required:
        - id
        - name
        - source_kind
        - source_summary
        - target_table
        - mode
        - schedule_label
        - status
        - owner
        - can_edit
        - governance
        - created_at
        - updated_at
      title: PipelineDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FileSource:
      properties:
        kind:
          type: string
          const: file
          title: Kind
          default: file
        file_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: File Id
          description: An uploaded file of yours.
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: An http(s) address.
        s3:
          anyOf:
            - type: string
            - type: 'null'
          title: S3
          description: >-
            An object in storage you can read, s3://bucket/key (s3a:// accepted;
            kept as s3://).
        format:
          $ref: '#/components/schemas/FileFormat'
        options:
          additionalProperties:
            type: string
          type: object
          title: Options
      type: object
      required:
        - format
      title: FileSource
    DatabaseSource:
      properties:
        kind:
          type: string
          const: database
          title: Kind
          default: database
        jdbc:
          $ref: '#/components/schemas/JdbcConnection'
        table:
          anyOf:
            - type: string
            - type: 'null'
          title: Table
          description: schema.table in the source.
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: A SELECT run on the source.
        filters:
          items:
            $ref: '#/components/schemas/Filter'
          type: array
          maxItems: 50
          title: Filters
      type: object
      required:
        - jdbc
      title: DatabaseSource
    LakehouseSource:
      properties:
        kind:
          type: string
          const: lakehouse
          title: Kind
          default: lakehouse
        table:
          type: string
          title: Table
          description: catalog.schema.table (or schema.table).
        filters:
          items:
            $ref: '#/components/schemas/Filter'
          type: array
          maxItems: 50
          title: Filters
      type: object
      required:
        - table
      title: LakehouseSource
    SaasSource:
      properties:
        kind:
          type: string
          const: saas
          title: Kind
          default: saas
        connector:
          type: string
          title: Connector
          description: e.g. `salesforce` or `source-salesforce`.
        config:
          additionalProperties:
            type: string
          type: object
          title: Config
        streams:
          items:
            type: string
          type: array
          maxItems: 1
          minItems: 1
          title: Streams
      type: object
      required:
        - connector
        - streams
      title: SaasSource
    Destination:
      properties:
        schema:
          type: string
          title: Schema
          description: Target schema.
        table:
          type: string
          title: Table
          description: Target table (a SaaS load uses its stream).
        mode:
          $ref: '#/components/schemas/WriteMode'
          default: append
        merge_keys:
          items:
            type: string
          type: array
          maxItems: 20
          title: Merge Keys
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
          description: Cron, five fields, UTC; null runs once.
      type: object
      required:
        - schema
        - table
      title: Destination
    ColumnSpec:
      properties:
        name:
          type: string
          title: Name
          description: Source column name.
        load_as:
          anyOf:
            - type: string
            - type: 'null'
          title: Load As
          description: Type to load it as, e.g. `decimal(18,2)`; null keeps it.
        rename:
          anyOf:
            - type: string
            - type: 'null'
          title: Rename
          description: New name in the table.
        drop:
          type: boolean
          title: Drop
          description: Leave the column out.
          default: false
        encrypt:
          type: boolean
          title: Encrypt
          description: Encrypt it with vault_encrypt.
          default: false
      type: object
      required:
        - name
      title: ColumnSpec
      description: How one source column lands in the table (from the schema step).
    Governance:
      properties:
        owner:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner
          description: Business owner, as text.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: DataHub domain urn.
        tags:
          items:
            type: string
          type: array
          maxItems: 20
          title: Tags
        classify:
          type: boolean
          title: Classify
          description: Classify the table after its first load.
          default: false
        suggest_checks:
          type: boolean
          title: Suggest Checks
          description: Suggest quality checks after its first load.
          default: false
      type: object
      title: Governance
    api__models__ingest_pipeline_models__SourceKind:
      type: string
      enum:
        - file
        - database
        - lakehouse
        - saas
      title: SourceKind
    WriteMode:
      type: string
      enum:
        - append
        - overwrite
        - merge
      title: WriteMode
    PipelineStatus:
      type: string
      enum:
        - healthy
        - failed
        - running
        - stale
        - paused
        - new
      title: PipelineStatus
    RunSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        trigger:
          $ref: '#/components/schemas/RunTrigger'
        status:
          $ref: '#/components/schemas/RunStatus'
        phase:
          anyOf:
            - $ref: '#/components/schemas/RunPhase'
            - type: 'null'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        duration_s:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration S
        rows_read:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Read
        rows_written:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Written
        checks_passed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Checks Passed
        checks_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Checks Total
        error_kind:
          anyOf:
            - $ref: '#/components/schemas/ErrorKind'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        schema_change:
          anyOf:
            - $ref: '#/components/schemas/SchemaChange'
            - type: 'null'
        governance:
          additionalProperties:
            type: string
          type: object
          title: Governance
      type: object
      required:
        - id
        - trigger
        - status
      title: RunSummary
    LatestError:
      properties:
        kind:
          $ref: '#/components/schemas/ErrorKind'
        message:
          type: string
          title: Message
        schema_change:
          anyOf:
            - $ref: '#/components/schemas/SchemaChange'
            - type: 'null'
      type: object
      required:
        - kind
        - message
      title: LatestError
    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
    FileFormat:
      type: string
      enum:
        - csv
        - json
        - parquet
        - orc
        - xml
        - xlsx
      title: FileFormat
    JdbcConnection:
      properties:
        engine:
          $ref: '#/components/schemas/DbEngine'
        host:
          type: string
          title: Host
        port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Port
        database:
          type: string
          title: Database
        username:
          type: string
          maxLength: 128
          minLength: 1
          title: Username
        password:
          type: string
          format: password
          title: Password
          description: Stored only as an Airflow Variable.
          writeOnly: true
      type: object
      required:
        - engine
        - host
        - port
        - database
        - username
        - password
      title: JdbcConnection
    Filter:
      properties:
        column:
          type: string
          title: Column
          description: Source column the condition is on.
        op:
          $ref: '#/components/schemas/api__models__ingest_pipeline_models__FilterOp'
        value:
          anyOf:
            - type: boolean
            - type: integer
            - type: number
            - type: string
            - items:
                anyOf:
                  - type: boolean
                  - type: integer
                  - type: number
                  - type: string
              type: array
            - type: 'null'
          title: Value
          description: A value; a list for `in`; nothing for `is_null`/`not_null`.
      type: object
      required:
        - column
        - op
      title: Filter
      description: One structured condition; compiled server side with sqlglot.
    RunTrigger:
      type: string
      enum:
        - schedule
        - manual
        - create
      title: RunTrigger
    RunStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
      title: RunStatus
    RunPhase:
      type: string
      enum:
        - reading
        - writing
        - checking
        - registering
        - done
      title: RunPhase
    ErrorKind:
      type: string
      enum:
        - schema_drift
        - source_unreachable
        - cast_failed
        - dq_failed
        - permission_denied
        - other
      title: ErrorKind
    SchemaChange:
      properties:
        added:
          items:
            type: string
          type: array
          maxItems: 500
          title: Added
        changed:
          items:
            type: string
          type: array
          maxItems: 500
          title: Changed
      type: object
      title: SchemaChange
    DbEngine:
      type: string
      enum:
        - postgres
        - mysql
        - sqlserver
        - oracle
        - db2
        - mongodb
      title: DbEngine
    api__models__ingest_pipeline_models__FilterOp:
      type: string
      enum:
        - eq
        - ne
        - in
        - gt
        - gte
        - lt
        - lte
        - is_null
        - not_null
      title: FilterOp
  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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.