> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flextell.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Start an import for an import source



## OpenAPI

````yaml post /v1/import/sources/{id}/start
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/import/sources/{id}/start:
    post:
      tags:
        - Import
      summary: Start an import for an import source
      operationId: import.sources.start
      parameters:
        - name: id
          in: path
          required: true
          description: The import source identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportSourceStartImportRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/ImportJobResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: RESOURCE_NOT_FOUND
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '409':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: IMPORT_JOB_ALREADY_RUNNING
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    ImportSourceStartImportRequest:
      type: object
      properties:
        types:
          type: array
          description: >-
            The import types to run, taken from the import source's available
            types.
          items:
            $ref: '#/components/schemas/ImportType'
            description: An import type identifier.
          minItems: 1
        mode:
          type:
            - string
            - 'null'
          description: >-
            The import mode (delta or full). Delta only fetches records changed
            since the last import.
          enum:
            - delta
            - full
            - null
        options:
          type: object
          description: >-
            Extra import options, as described by the import source's options
            schema.
          properties:
            skip_files_without_visit:
              type:
                - boolean
                - 'null'
              description: >-
                Skip file downloads for customers without a recorded visit. Only
                accepted when customer_file is among the selected types.
      required:
        - types
      title: ImportSourceStartImportRequest
    ImportJobResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        parent_id:
          type:
            - integer
            - 'null'
        import_source_id:
          type: integer
        user_id:
          type:
            - integer
            - 'null'
        status:
          type: string
        status_label:
          type: string
          enum:
            - Bekliyor
            - İşleniyor
            - Tamamlandı
            - Başarısız
            - İptal Edildi
        import_type:
          type:
            - string
            - 'null'
        import_type_label:
          type:
            - string
            - 'null'
          enum:
            - Hasta
            - Randevu
            - Ürün
            - Tedavi
            - Kullanıcı
            - Oda
            - Hasta Notu
            - Hasta Dosyaları
            - Satış
            - Banka Hesabı
            - Muhasebe İşlemi
            - Fatura
            - Lead
            - Genel
            - null
        selected_types:
          type: array
          items: {}
        mode:
          type: string
          enum:
            - full
            - delta
        options:
          type: array
          items: {}
        total_records:
          type: integer
        processed_records:
          type: integer
        successful_records:
          type: integer
        failed_records:
          type: integer
        skipped_records:
          type: integer
        progress_percentage:
          type: string
        errors_count:
          type: integer
        skips_count:
          type: integer
        is_stalled:
          type: boolean
        can_be_cancelled:
          type: boolean
        error_message:
          type:
            - string
            - 'null'
        throughput:
          type: string
        eta_seconds:
          type: string
        elapsed_seconds:
          type: string
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        last_activity_at:
          type:
            - string
            - 'null'
          format: date-time
        import_source:
          $ref: '#/components/schemas/RelatedImportSourceResource'
        user:
          $ref: '#/components/schemas/RelatedUserResource'
        children:
          type: array
          items:
            $ref: '#/components/schemas/ImportJobResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - tenant_id
        - parent_id
        - import_source_id
        - user_id
        - status
        - status_label
        - import_type
        - import_type_label
        - selected_types
        - mode
        - options
        - total_records
        - processed_records
        - successful_records
        - failed_records
        - skipped_records
        - progress_percentage
        - errors_count
        - skips_count
        - is_stalled
        - can_be_cancelled
        - error_message
        - throughput
        - eta_seconds
        - elapsed_seconds
        - started_at
        - completed_at
        - last_activity_at
        - created_at
        - updated_at
      title: ImportJobResource
    ImportType:
      type: string
      enum:
        - customer
        - appointment
        - product
        - treatment
        - user
        - room
        - customer_note
        - customer_file
        - sale
        - bank_info
        - accounting_transaction
        - invoice
        - lead
        - general
      title: ImportType
    RelatedImportSourceResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        company_logo:
          type: 'null'
      required:
        - id
        - name
        - company_logo
      title: RelatedImportSourceResource
    RelatedUserResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        avatar_url:
          type:
            - string
            - 'null'
          description: >-
            A signed profile photo URL valid for a few hours, or `null` without
            a photo. Only on responses that opt in.
      required:
        - id
        - name
      title: RelatedUserResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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