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

# Test Connection API

> The Test Connection API allows you to validate if the entered endpoint details are valid. The API verifies if the provided endpoint URL, workspace ID an data key is accessible and responds without any errors.




## OpenAPI

````yaml /api/data/data.yaml post /integrations/authentication
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:
  /integrations/authentication:
    post:
      tags:
        - Utilities
      summary: Test Connection API
      description: >
        The Test Connection API allows you to validate if the entered endpoint
        details are valid. The API verifies if the provided endpoint URL,
        workspace ID an data key is accessible and responds without any errors.
      parameters:
        - name: MOE-APPKEY
          in: header
          required: true
          description: >-
            This is your MoEngage account's data API keythat has to be passed
            along with the request. You can find it at **Settings** ->
            **Account** -> **APIs** -> **API Keys** -> **Data**.
          schema:
            type: string
            example: '{MoEngage data API key}'
        - name: Authorization
          in: header
          required: true
          description: >-
            This authentication parameter, used for access control, must be
            passed along with the request. To generate the authentication
            header, refer to Authentication.
          schema:
            type: string
            example: Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U==
      requestBody:
        required: true
        description: Set the Content-Type header to application/json.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestConnectionRequest'
            examples:
              cURL_Body:
                value:
                  app_id: '********'
                  app_secret: '**********'
                  source: test
                  region: '01'
      responses:
        '200':
          description: >
            Success. 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 denotes
                      whether it was successful or not.

                      **Example**: "status": "success", "status": "error"
                    example: success
                  app_name:
                    type: string
                    description: >-
                      This field contains the workspace name of your MoEngage
                      workspace
                    example: PI-Prod-DC01
              example:
                status: success
                app_name: PI-Prod-DC01
        '401':
          description: >
            Authorization Failure. This response is returned when the
            authorization parameters are missing in the HTTP Auth Header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      This field denotes the overall outcome of the API request
                      (e.g., "success" or "fail"), allowing the client to
                      quickly determine if the operation was completed as
                      expected.
                    example: fail
                  error:
                    type: object
                    description: >-
                      This field denotes a container object that holds specific
                      technical details and context regarding the failure when
                      the status is returned as "fail".
                    properties:
                      message:
                        type: string
                        description: >-
                          This field denotes a human-readable description
                          explaining the specific cause of the error, intended
                          to help the developer or end-user understand what went
                          wrong (e.g., "Missing required parameter").
                        example: >-
                          App Secret key mismatch. Please login to the dashboard
                          to verify key
                      type:
                        type: string
                        description: >-
                          This field denotes a machine-readable classification
                          or category of the error (e.g., validation_error,
                          authentication_error), which allows the client
                          application to programmatically handle specific error
                          scenarios.
                        example: Authentication required
                      request_id:
                        type: string
                        description: >-
                          This field denotes a unique identifier assigned to
                          this specific API transaction.
                        example: kKcQUqvo
              example:
                status: fail
                error:
                  message: >-
                    App Secret key mismatch. Please login to the dashboard to
                    verify key
                  type: Authentication required
                  request_id: kKcQUqvo
components:
  schemas:
    TestConnectionRequest:
      type: object
      required:
        - app_id
        - app_secret
        - source
        - region
      properties:
        app_id:
          type: string
          description: Your MoEngage Workspace ID.
        app_secret:
          type: string
          description: Your MoEngage Data API Key.
        source:
          type: string
          description: The tool from where you are sending the request.
          example: test
        region:
          type: string
          description: Your MoEngage region (e.g., "01" for DC-01).
          example: '01'
  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.

````