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

# Trigger File Imports

> This API can be used to trigger scheduled file imports. Periodic imports can be triggered to run using this API if the import has not expired and is in any of the following states- Scheduled, Successful, Partially Successful, and Failed.

### Rate Limit

This API can be triggered once in every five minutes for a specific schedule\_id. A Bad request response (400) response will be sent if this is exceeded.

### Postman Collections

We have made it easy for you to test the APIs. Click [here](https://www.postman.com/moengage-dev/api-docs/collection/u3yt8gn/moengage-file-imports-trigger-api?action=share\&creator=3182294) to view it in Postman.

### FAQs

* **Does the trigger API change the import schedule?**

No, the schedule still remains the same as originally set up in the MoEngage Dashboard.


## OpenAPI

````yaml /api/data/data.yaml post /fileimports/trigger/{schedule_id}
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/trigger/{schedule_id}:
    post:
      tags:
        - File Import
      summary: Trigger File Imports
      description: >-
        This API can be used to trigger scheduled file imports. Periodic imports
        can be triggered to run using this API if the import has not expired and
        is in any of the following states- Scheduled, Successful, Partially
        Successful, and Failed.
      parameters:
        - name: schedule_id
          in: path
          required: true
          description: >-
            This field specifies the Import ID(the unique identifier for the
            import) of the import that needs to be triggered. You can find the
            Import ID in the MoEngage Dashboard on the Imports History page.
            Click Actions → View import to view the Import Details. You can also
            view the Import ID in the email notification received once the
            import has been set up.
          schema:
            type: string
        - 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
      responses:
        '200':
          description: >-
            This response is returned when the request is processed
            successfully.
          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 successful.
                    example: success, failure
                  message:
                    type: string
                    description: >-
                      This field contains information about whether the request
                      was successful or not.
                    example: Trigger Import Successful
              examples:
                success_response:
                  summary: Successful request
                  value:
                    status: success
                    message: Triggered Import Successfully
        '400':
          description: >-
            This response is returned when the Import ID/Schedule ID is missing
            from the request or when the provided parameters are invalid. Also,
            this response is returned when the rate limit (one request in five
            minutes) is breached.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                    description: >-
                      This field contains the status of the request and
                      specifies whether the request was successful.
                  error_type:
                    type: object
                    description: >-
                      This field is present in the response when the
                      Import/Schedule ID in the request is not found in the
                      system (either because it is invalid or has been deleted).
                  message:
                    type: string
                    description: >-
                      This field contains information about whether the request
                      was successful or not. 
                    example: Trigger Import Successful
              examples:
                invalid_scheduleid:
                  summary: The Import ID (Schedule ID) in the Request is Invalid
                  value:
                    status: fail
                    error_type: NOT_FOUND
                    message: This import is either deleted or expired.
                exceeded_user_limit:
                  summary: The Number of Users Exceeds the Allowed Limit in the Request
                  value:
                    status: fail
                    error_type: ALREADY_EXISTS
                    message: Import has run in the last 5 min.
        '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 is present in the response in the case of
                      errors and contains the type of error.
                  description:
                    type: string
                    description: >-
                      This field is present in the response in the case of
                      errors and contains the error description.
              examples:
                incorrect_password:
                  summary: Incorrect Password in the Header
                  value:
                    title: AuthenticationInvalid
                    description: >-
                      Password (APP_KEY) doesn't match the one available on the
                      dashboard. Kindly ensure the same APP_KEY available on the
                      dashboard is used.
                missing_authorization_key:
                  summary: Missing Authorization Key in the Header
                  value:
                    title: HeaderMissing
                    description: MOE-APPKEY is missing in Header
                header_mismatch:
                  summary: APP Key Mismatch in the Header
                  value:
                    title: HeaderMismatch
                    description: >-
                      MOE_APPKEY doesn't match the Username (APP_KEY) used in
                      Basic Auth authorization
        '403':
          description: >-
            This response is returned when your MoEngage account has been
            blocked or suspended.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        description: >-
                          This field contains information about whether the
                          request was successful or not.
                      type:
                        type: string
                        description: >-
                          This field is present in the response in the case of
                          403 errors and contains the error type.
                      request_id:
                        type: string
                        description: >-
                          This field is present in the response in the case of
                          403 errors and contains the request-id.
              examples:
                account_blocked:
                  summary: Your Account is Blocked
                  value:
                    status: fail
                    error:
                      message: Your account is suspended. Please contact MoEngage team.
                      type: BlockedClient
                      request_id: ofHUEaEQ
        '404':
          description: >-
            This response is returned when the request contains the incorrect
            URL (when you try to access a resource that is not present).
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                    description: >-
                      This field contains the status of the request and
                      specifies whether the request was successful.
                  message:
                    type: string
                    description: >-
                      This field contains information about whether the request
                      was successful or not.
                    example: Trigger Import Successful
              examples:
                missing_resource:
                  summary: Resource Not Found Error
                  value:
                    status: fail
                    message: Resource not found
        '405':
          description: >-
            This response is returned when the request contains an unsupported
            method. For example, if you were to use the GET method instead of
            POST for this request, you would result in a 405 error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: fail
                    description: >-
                      This field contains the status of the request and
                      specifies whether the request was successful.
                  message:
                    type: string
                    description: >-
                      This field contains information about whether the request
                      was successful or not.
                    example: Trigger Import Successful
              examples:
                missing_resource:
                  summary: Method Not Allowed Error
                  value:
                    status: fail
                    message: Method not allowed
        '500':
          description: >-
            This response is returned when the system runs into an unexpected
            error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    example: fail
                    description: >-
                      This field is present in the response in the case of
                      errors and contains the type of error.
                  error_description:
                    type: string
                    description: >-
                      This field is present in the response in the case of
                      errors and contains the error description.
                  code:
                    type: string
                    description: >-
                      This field is present in the response in the case of 5xx
                      errors and contains the error code.
              examples:
                unknown_error:
                  summary: Unknown Errors
                  value:
                    title: Server Error
                    error_description: >-
                      An unexpected error was encountered while processing this
                      request. Please contact MoEngage Team.
                    code: GlQhUzvM
      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:
  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.

````