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

# Import Details

> This API fetches the status at an import level. It can fetch the status of multiple imports but not the status of the files within the import.

### Rate Limit

You can create 50 requests per minute.

### Postman Collections

We have made it easy for you to test the APIs. Click [here](https://www.postman.com/moengage-dev/api-docs/collection/mzt9mgo/moengage-status-and-run-history-api) to view it in Postman.


## OpenAPI

````yaml /api/data/data.yaml post /fileimports/import/status
openapi: 3.0.3
info:
  title: MoEngage Data APIs
  version: '1.0'
  description: >-
    This is a comprehensive OpenAPI specification for MoEngage's Data APIs,
    including User, Event, and Device management.

    It's designed to power an interactive API playground on your new
    documentation site.
servers:
  - url: https://api-0{dc}.moengage.com/v1
    description: MoEngage Core API Server
    variables:
      dc:
        default: '1'
        description: >-
          The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of ‘dc’ in the URL by referring
          to the DC and API endpoint mapping
          [here](https://help.moengage.com/hc/en-us/articles/360057030512-Data-Centers-in-MoEngage).
          Your MoEngage Data Center (DC) can be 1, 2, 3, 4,5, 6. 
        enum:
          - '1'
          - '2'
          - '3'
          - '4'
          - '5'
          - '6'
security:
  - Authentication: []
tags:
  - name: User
    description: Operations for creating, updating, retrieving, and managing user profiles.
  - name: Event
    description: Operations for tracking user events.
  - name: Device
    description: Operations for managing user devices.
  - name: Tracking
    description: Endpoints for tracking attribution and installs.
  - name: Utilities
    description: Utility endpoints for testing connections.
  - name: File Imports
    description: Operations for managing asynchronous file imports.
  - name: Bulk
    description: Operations for importing users and events in bulk.
  - name: Webhooks
    description: Incoming webhook specifications from MoEngage.
paths:
  /fileimports/import/status:
    post:
      tags:
        - File Import
      summary: Import Details
      description: >-
        This API fetches the status at an import level. It can fetch the status
        of multiple imports but not the status of the files within the import.
      parameters:
        - name: MOE-APPKEY
          in: header
          required: true
          description: >
            This is your MoEngage account's WORKSPACE ID that has to be passed
            along with the request.You can find your MoEngage Workspace ID at
            Settings -> Account -> APIs -> Workspace ID (earlier app id).
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportDetailsRequest'
            examples:
              all_the_filters_passed:
                summary: Sample cURL with all the filters passed in the API body.
                value:
                  import_name: test_import
                  import_type:
                    - USERS
                    - EVENTS
                    - AUX_DATA
                  date:
                    start_date: 14/11/2024
                    end_date: 14/11/2024
                    format: DD/MM/YYYY
                  schedule_type:
                    - PERIODIC
                    - ONETIME
                  file_source:
                    - SFTP
                    - S3
                    - CSV
                  schedule_status:
                    - SUCCESSFUL
                    - FAILED
                    - PARTIAL_SUCCESS
                    - SCHEDULED
                    - PROCESSING
                    - QUEUED
                    - ARCHIVED
                  offset: '1'
              no_filters_passed:
                summary: Sample cURL with no filters passed in the API body.
                value: {}
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportDetailsResponse'
              examples:
                success_response:
                  summary: Successful request
                  value:
                    status: success
                    total_count: 1
                    data:
                      - id: 672561rr0abd2da34cf7f7df
                        file_name: filename.csv
                        scheduled_at: '2024-11-14T12:31:31.713000'
                        completed_at: '2024-11-14T12:32:09.942000'
                        type: AUX_DATA
                        file_size: '1544'
                        file_status: SUCCESSFUL
                        status_msg: ''
                        total_rows: 10
                        skipped_rows: 0
                        updated_rows: 0
                        failed_rows: 0
                        aux_data_added_count: 10
                        aux_data_failed_count: 0
                        added_rows: 10
                    offset: 1
                    more_files: false
        '400':
          description: >-
            This response is returned when the required parameters are missing
            from the request, attributes are not found, and incorrect values are
            passed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                    description: This field denotes the status of the request.
                  error_type:
                    type: string
                    description: This field denotes the type of error occured
                  message:
                    type: string
                    description: 'This field denotes the error message. '
              examples:
                invalid_date_format:
                  summary: Invalid or Mismatched date format passed
                  value:
                    status: FAILURE
                    error_type: Invalid Date format
                    message: >-
                      The provided date format is either incorrect or doesn't
                      match the entered dates. Please ensure both the dates and
                      the format are valid.
                case_sensitivity:
                  summary: >-
                    Invalid bad request - Case sensitivity in parameter values
                    passed in the API body
                  value:
                    success: false
                    status_code: 400 Bad Request
                    data: Unable to process the request
                invalid_offset:
                  summary: Bad request - Incorrect offset value passed
                  value:
                    status: FAILURE
                    error_type: Invalid Offset Value
                    message: >-
                      The offset value you have provided is not valid. Please
                      review and correct the offset.
                date_range_exceeded:
                  summary: Date range exceeds 30 days
                  value:
                    status: FAILURE
                    error_type: Difference exceeds 30 days
                    message: >-
                      Please note that only imports with a date difference of 30
                      can be displayed. Kindly adjust the dates accordingly.
        '401':
          description: >-
            This response is returned when the APP Key is invalid or missing,
            the password is incorrect, or there are other such
            authorization-related errors in the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    example: fail
                    description: This field denotes the error title.
                  description:
                    type: string
                    description: This field denotes error description.
              examples:
                missing_header:
                  summary: MoeAPPkey missing, Invalid username, invalid password
                  value:
                    title: HeaderMissing
                    description: MOE-APPKEY is missing in Header
        '404':
          description: >-
            This response is returned when the APP Key is invalid or missing,
            the password is incorrect, or there are other such
            authorization-related errors in the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                    description: This field denotes the status of the request.
                  data:
                    type: string
                    description: This field denotes the error description.
              examples:
                invalid_endpoint:
                  summary: Resource not found
                  value:
                    status: fail
                    data: Resource not found.
        '415':
          description: >-
            This response is returned when the APP Key is invalid or missing,
            the password is incorrect, or there are other such
            authorization-related errors in the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    example: fail
                    description: This field denotes the error title.
                  description:
                    type: string
                    description: This field denotes the error description.
              examples:
                unsupported_media_type:
                  summary: Unsupported media type
                  value:
                    title: Unsupported media type
                    description: Content type is not supported
        '429':
          description: >-
            This response is returned when the number of requests has exceeded
            the rate limit.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      This field contains the status of the request and
                      specifies whether the request was a failure.
                    example: fail
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        description: >-
                          A descriptive error message explaining why the request
                          failed.
                      type:
                        type: string
                        description: >-
                          The type or category of the error (e.g., Rate Limits
                          Exceeded).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                rate_limit_exceeded:
                  summary: Rate limits exceeded
                  value:
                    status: fail
                    error:
                      message: Rate limits exceeded, please try after some time
                      type: Rate Limits Exceeded
                      request_id: '1234'
      servers:
        - url: https://fileimports-data-api-0{dc}.moengage.com/v1.0/data
          description: MoEngage File Imports API Server
          variables:
            dc:
              default: '1'
              description: >-
                The dc in the API Endpoint URL refers to the MoEngage Data
                Center (DC). MoEngage hosts each customer in a different DC.
              enum:
                - '1'
                - '2'
                - '3'
                - '4'
                - '5'
                - '6'
components:
  schemas:
    ImportDetailsRequest:
      type: object
      properties:
        import_type:
          type: string
          enum:
            - USERS
            - EVENTS
            - AUX_DATA
          description: This field denotes the type of data to be imported.
        date:
          type: object
          description: >
            This field denotes the file processing date. Supported values are:


            * `start_date`

            * `end_date`

            * `format`
              
            If this field is not passed, the API will respond with details of
            all the files corresponding to the import_id / import_name passed
            and in accordance to the offset and limit values.


            Supported date time formats are:

             * `"datetime_format": "YYYY-MM-DD"` (2022-01-22)
             * `"datetime_format": "YYYY/MM/DD"` (2022/01/22)
             * `"datetime_format": "DD/MM/YYYY"` (22/01/2022)
             * `"datetime_format": "DD-MM-YYYY"` (22-01-2022)
             * `"datetime_format": "DD-MM-YYYY hh:mm:ss"` (31-12-2022 12:10:33)
             * `"datetime_format": "DD/MM/YYYY hh:mm:ss"` (31/12/2022 12:10:33)
             * `"datetime_format": "YYYY-MM-DD hh:mm:ss"` (2019-02-22 17:54:14)
             * `"datetime_format": "YYYY/MM/DD hh:mm:ss"` (2019/02/22 17:54:14)
          properties:
            start_date:
              type: string
              format: date-time
              description: The start date of the import.
            end_date:
              type: string
              format: date-time
              description: The end date of the import.
            format:
              type: string
              description: The format of the date.
        schedule_type:
          type: string
          enum:
            - PERIODIC
            - ONETIME
          description: This field denotes the type of import schedule.
        file_source:
          type: string
          enum:
            - SFTP
            - S3
            - CSV
          description: This field denotes the file source of the import.
        schedule_status:
          type: string
          enum:
            - SUCCESSFUL
            - FAILED
            - PARTIAL_SUCCESS
            - SCHEDULED
            - PROCESSING
            - QUEUED
            - ARCHIVED
          description: >
            This field denotes the import schedule status.

            * PARTIAL_SUCCESS is displayed when all rows in the files are not
            processed successfully.

            * QUEUED is displayed when the import is queued to be processed
            next.

            * ARCHIVED is displayed when the import is archived.
        import_name:
          type: string
          description: This field denotes the name of the import.
        offset:
          type: integer
          description: >
            'API responds with a maximum of 50 file details in a single
            response. For example, if there are a total of 150 files that are
            part of the API response, then:

            * Offset = 1 will fetch the details of the first 50 files

            * Offset = 2 will fetch the file details of the next 50 imports

            * Offset = 3 will fetch the import details of the last 50 imports

            * If offset is not passed in the request body, the API response will
            consider offset = 1.


            You can refer to the total_count parameter in the response to
            understand how many total files are part of the response. 


            OR

             If the API responds with more_files = true, it indicates that there are more files that are not part of the current response for which another API request must be made with offset +1.'
          default: 1
    ImportDetailsResponse:
      type: object
      properties:
        status:
          type: string
          description: This field denotes the status of the API response.
          example: success
        total_count:
          type: integer
          description: This field denotes the total count of the imports in the response.
          example: 1
        data:
          type: array
          description: This field contains the import data details.
          items:
            type: object
            properties:
              import_id:
                type: string
                description: This field denotes the unique ID of the import.
              import_name:
                type: string
                description: This field denotes the unique name of the import.
              last_run_status:
                type: string
                description: This field denotes the latest sync status of the import.
                format: date-time
              import_type:
                type: string
                description: This field denotes the import type.
                enum:
                  - USERS
                  - EVENTS
                  - AUX_DATA
              schedule_type:
                type: string
                description: This field denotes the file type.
                enum:
                  - ONETIME
                  - PERIODIC
              import_source:
                type: string
                description: This field denotes the source of import.
                enum:
                  - S3
                  - SFTP
                  - CSV
              custom_segment_config:
                type: array
                description: This field contains details about the custom segment.
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: This field denotes the custom segment ID.
                    name:
                      type: string
                      description: This field denotes the unique name of the custom event.
                    type:
                      type: string
                      description: This field denotes the type of custom segment.
                    user_id_column:
                      type: string
                      description: >-
                        This field denotes the attribute selected as the
                        identifier.
              aux_data_config:
                type: array
                description: This field contains details about the auxiliary data.
                items:
                  type: object
                  properties:
                    primary_key:
                      type: string
                      description: >-
                        This field denotes the attribute used as the auxiliary
                        data import ID.
                    retention_period:
                      type: integer
                      description: >-
                        This field denotes the number of days, weeks, and months
                        (to be read with retention_type).
                    retention_type:
                      type: string
                      description: The field denotes retention type.
                      enum:
                        - DAYS
                        - WEEKS
                        - MONTHS
              total_files:
                type: integer
                description: This field denotes the total number of files in the import.
              processed_files:
                type: integer
                description: >-
                  This field denotes the total number of processed files in the
                  import.
              total_rows:
                type: integer
                description: This field denotes the total number of rows across all files.
              processed_rows:
                type: integer
                description: >-
                  This field denotes the total number of processed rows across
                  all files.
              created_at:
                type: integer
                description: This field denotes the date at which the import is created.
              last_run_at:
                type: string
                description: This field denotes the date on which the import was last run.
                format: date time
              next_scheduled_at:
                type: string
                description: >-
                  This field denotes the date on which the import is next
                  scheduled.
                format: date time
              created_by_email:
                type: string
                description: >-
                  This field denotes the email ID of the team member who created
                  the import.
              status:
                type: string
                description: This field denotes the import status.
              time_zone:
                type: string
                description: This field denotes the timezone of the workspace.
        offset:
          type: integer
          description: >
            This field denotes the pagination value of the imports. For example,
            if there are 100 imports to be fetched in the response:

            * Offset = 1 will return the first 50 imports

            * Offset = 2 will return the next 50 import details
        more_files:
          type: string
          description: >-
            This field indicates if there are more files. For example, if there
            are 100 imports and offset = 1, 50 imports will be returned with
            more_file = true to indicate that offset = 2 must be passed to get
            the next 50 imports.
  securitySchemes:
    Authentication:
      type: http
      scheme: basic
      description: >
        This authentication parameter, used for access control, must be passed
        along with the request. The API request will be authenticated through
        Basic Authentication. Basic Authentication sends a Base64-encoded string
        containing your username and password with every API request. It encodes
        a 'username:password' string in Base64 and appends the encoded string
        with 'Basic '. This string is included in the authorization header as
        shown below:


        `{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}`


        The username and password details can be obtained from the MoEngage
        Dashboard. If you're using the API for the first time, follow these
        steps:

        1. Navigate to Settings -> Account -> APIs.

        2. Copy the following details:
           * **Username:** Under Workspace ID (earlier app id), click the copy icon to copy the username.
           * **Password:** In the **API keys** section, click the copy icon in the **Data** tile to copy the API key.

        Use these details to authenticate the API requests.

````