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

> Creates a new data mirroring job and returns the job details.



## OpenAPI

````yaml post /api/datamirroring
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/datamirroring:
    post:
      tags:
        - Data mirroring
      summary: Create
      description: Creates a new data mirroring job and returns the job details.
      operationId: create_api_datamirroring_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataMirroringRequest'
        required: true
      responses:
        '200':
          description: Data Mirror submitted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateJobResponse'
        '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:
    CreateDataMirroringRequest:
      properties:
        job_type:
          type: string
          title: Job Type
          description: >-
            Defines the category of job. (Valid values: `airflow.dataeng`,
            `airflow.nlp`, `airflow.ingest`, `mirror`).
        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.
        properties_json:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Json
          description: Additional job properties in JSON format.
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
          description: The cron expression that specifies how often the job runs.
        dbtype:
          type: string
          title: Dbtype
          description: >-
            The database type to mirror. Accepted values: `postgres`, `mariadb`,
            `mssql`, `mysql`, `oracle`, or `db2`.
        schemas:
          anyOf:
            - type: string
            - type: 'null'
          title: Schemas
          description: >-
            The database schema name to replicate. Leave empty if dbtype is
            `mysql` or `mariadb`.
        include_list:
          type: string
          title: Include List
          description: >-
            The table name inside the schema. Format: <schema name>.<table name>
            (For example, `public.employees`).
        host_name:
          type: string
          title: Host Name
          description: >-
            The URL to connect to the database. Must be accessible to the rapid
            platform.
        port:
          type: integer
          title: Port
          description: The network port used for the connection.
        user:
          type: string
          title: User
          description: The username for accessing the database.
        password:
          type: string
          title: Password
          description: The password corresponding to the user.
        dbname:
          type: string
          title: Dbname
          description: The name of the source database.
      type: object
      required:
        - job_type
        - job_name
        - dbtype
        - include_list
        - host_name
        - port
        - user
        - password
        - dbname
      title: CreateDataMirroringRequest
    CreateJobResponse:
      properties:
        job_type:
          type: string
          title: Job Type
          description: >-
            Defines the category of job. (Valid values: `airflow.dataeng`,
            `airflow.nlp`, `airflow.ingest`, `mirror`).
        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.
        properties_json:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Json
          description: Additional job properties in JSON format.
        schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule
          description: The cron expression that specifies how often the job runs.
        id:
          type: string
          format: uuid
          title: Id
          description: The unique ID of the created job.
        status:
          type: string
          title: Status
          description: The current status of the job immediately after creation.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Job creation timestamp.
      type: object
      required:
        - job_type
        - job_name
        - id
        - status
        - created_at
      title: CreateJobResponse
    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
    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:
    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

````