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

# Get User

> This API facilitates the retrieval of information of users by specifying the user IDs.

#### Rate Limit

The rate limit is 20 users per payload and 1000 users per minute.


## OpenAPI

````yaml /api/data/data.yaml post /customers/export
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-{dc}.moengage.com/v1
    description: MoEngage Core API Server
    variables:
      dc:
        default: '01'
        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](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101. 
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:
  /customers/export:
    post:
      tags:
        - User
      summary: Get User
      description: >-
        This API facilitates the retrieval of information of users by specifying
        the user IDs.
      parameters:
        - name: app_id
          in: query
          required: true
          description: >-
            This is the Workspace ID of your MoEngage account that must be
            passed with the request. You can find it in the MoEngage dashboard
            at **Settings** > **Account** > **APIs** > **Workspace ID (earlier
            app id)**.
          schema:
            type: string
            example: VJ0GSMESHMQA3L7WV1EEK3UR
        - name: X-Forwarded-For
          in: header
          required: false
          description: >-
            The 'X-Forwarded-For' header is used to specify the IP address of
            the client that made the request. This header may be added by proxy
            servers or load balancers. The header value must contain the IP
            address of the original client that initiated the request. Multiple
            IP addresses may be specified in the header value, separated by
            commas.
          schema:
            type: string
            example: 203.0.113.195
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetUserRequest'
            examples:
              export_users:
                summary: Export users by identifiers
                value:
                  data:
                    identifiers:
                      - identifier_type: customer_id
                        identifier: 6416d1a318r98264512c0f89
                      - identifier_type: id
                        identifier: 62e79fb15ada55x123g987bu
                    user_fields_to_export:
                      - last_name
                      - customer_id
                      - name
      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. Supported
                      values are : "success", "failure"
                    example: success
                  type:
                    type: string
                    description: >-
                      This field denotes the fetch type. Supported values are:
                      "export_users".
                    example: export_users
                  data:
                    type: object
                    description: >
                      This field contains the list of users who were not found
                      in MoEngage and returns the data specified for the list of
                      users who were found in MoEngage.


                      This is the structure:

                      ```json

                      {
                          "users_not_found": [
                              {
                                  "identifier_type": "customer_id",
                                  "identifier": "<customer_id>"
                              }
                          ],
                          "users": [
                              {
                                  "user_attributes": {
                                      "<list of user attributes>"
                                  } 
                              }
                          ]
                      }

                      ```
                    properties:
                      users_not_found:
                        type: array
                        description: >-
                          An array of JSON Objects that contains the list of
                          users who were not found in MoEngage.
                        items:
                          $ref: '#/components/schemas/IdentifierObject'
                      users:
                        type: array
                        description: >-
                          Contains the user_attributes specified in the request
                          for each user in specified in the request.
                        items:
                          type: object
                          properties:
                            user_attributes:
                              type: object
                              additionalProperties: true
                              example:
                                last_name: Doe
                                customer_id: john_doe
                                id: 62e79fb15ada55x123g987bu
              examples:
                success_response:
                  summary: Success Response
                  value:
                    status: success
                    type: export_users
                    data:
                      users_not_found:
                        - identifier_type: customer_id
                          identifier: john_doe
                      users:
                        - user_attributes:
                            last_name: Doe
                            customer_id: john_doe
                            name: John
                            custom_user_attr: 12345
                            id: 62e79fb15ada55x123g987bu
        '400':
          description: >-
            This response is returned when the required parameters APP KEY,
            user_id, and so on are missing from the request or when the provided
            params are invalid.
          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
                          ("MissingAttributeError, Malformed JSON,
                          LimitBreached").
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
                      attribute:
                        type: string
                        description: The attribute in the payload that caused the error.
              examples:
                missing_identifiers:
                  summary: Identifiers are missing in the request
                  value:
                    status: fail
                    error:
                      attribute: identifiers
                      message: identifiers is not found in the payload
                      type: MissingAttributeError
                      request_id: UkBwaUmU
                data_missing:
                  summary: Data is missing in the request
                  value:
                    status: fail
                    error:
                      attribute: data
                      message: data is not found in the payload
                      type: MissingAttributeError
                      request_id: DataMiss2
                incorrect_json:
                  summary: JSON is incorrect in the request
                  value:
                    status: fail
                    error:
                      message: >-
                        Could not decode the request body. The JSON was
                        incorrect or not encoded as UTF-8.
                      type: Malformed JSON
                      request_id: NphDCzWk
                limit_exceeded:
                  summary: Users exceeds the allowed limit in the request
                  value:
                    status: fail
                    error:
                      attribute: users
                      message: max limit allowed is 20
                      type: LimitBreached
                      request_id: LimitX4
        '401':
          description: Unauthorized.
          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.,
                          Authentication required).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                auth_error:
                  summary: Authorization errors
                  value:
                    status: fail
                    error:
                      message: >-
                        App Secret key mismatch. Please login to the dashboard
                        to verify key
                      type: Authentication required
                      request_id: PVUDFisO
                missing_header:
                  summary: Missing authentication header
                  value:
                    status: fail
                    error:
                      message: Authentication Header Required
                      type: Authentication required
                      request_id: PisPjGQQ
        '403':
          description: >-
            This response is returned when your MoEngage account is suspended or
            blocked.
          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.(e.g., Your account is suspended. Please
                          contact MoEngage team.)
                      type:
                        type: string
                        description: >-
                          The type or category of the error (e.g.,
                          BlockedClient, Account Suspended, Account Temporarily
                          Suspended).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                account_blocked:
                  summary: Sample response for when your account is blocked
                  value:
                    status: fail
                    error:
                      message: Your account is suspended. Please contact MoEngage team.
                      type: BlockedClient
                      request_id: ofHUEaEQ
                account_suspended:
                  summary: Sample response for when your account is suspended
                  value:
                    status: fail
                    error:
                      message: Your account is suspended. Please contact MoEngage team.
                      type: Account Suspended
                      request_id: gqJvCNYu
                temp_suspended:
                  summary: >-
                    Sample response for when your account is temporarily
                    suspended
                  value:
                    status: fail
                    error:
                      message: >-
                        Your account is temporarily suspended. Please contact
                        MoEngage team.
                      type: Account Temporarily Suspended
                      request_id: ssSJjoyD
        '413':
          description: This response is returned when the payload size exceeds 128 KB.
          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., Payload too
                          large).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                payload_exceeded:
                  summary: Payloads exceeding the size limit
                  value:
                    status: fail
                    error:
                      message: Payload size exceeds 128 KB
                      type: PayloadTooLarge
                      request_id: VFzDwhwt
        '415':
          description: This response is returned when the content type is not supported.
          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., Unsupported
                          media type).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                unsupported_media_type:
                  summary: Unsupported media type
                  value:
                    status: fail
                    error:
                      message: Unsupported Media Type
                      type: MediaTypeError
                      request_id: SgBQfKJh
        '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:
                  summary: Rate limit breach
                  value:
                    status: fail
                    error:
                      message: Rate limit exceeded
                      type: RateLimitError
                      request_id: onqucLYL
        '500':
          description: >-
            This response is returned when the system runs into an unexpected
            error.
          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., Server
                          Error).
                      request_id:
                        type: string
                        description: >-
                          A unique identifier for the request, useful for
                          debugging.
              examples:
                unknown_error:
                  summary: Unknown errors
                  value:
                    status: fail
                    error:
                      message: Internal Server Error
                      type: ServerError
                      request_id: KovrwJiF
components:
  schemas:
    GetUserRequest:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          description: >
            Wrapper object that contains the user identifiers to look up. The
            API expects `identifiers` inside this object, not at the root of the
            JSON body.
          required:
            - identifiers
          properties:
            identifiers:
              type: array
              description: >
                This field is used to specify the identifiers for the users for
                whom the data needs to be fetched.

                Structure:

                   ```json
                 "data": {
                   "identifiers": [
                     {
                       "identifier_type": "customer_id",
                       "identifier": "<customer_id>"
                     },
                     {
                       "identifier_type": "id",
                       "identifier": "<MoEngageID>"
                     },
                     ...{}
                   ]
                 }
                 ```
              items:
                $ref: '#/components/schemas/IdentifierObject'
            user_fields_to_export:
              type: array
              items:
                type: string
              description: >-
                This field is used to specify the fields that need to be fetched
                for the user specified in Identifiers. Tracked standard user
                attributes and custom attributes can be fetched using this API.
                For the list of tracked standard attributes in MoEngage, refer
                to [User Attributes](#user-attributes).
              example:
                - last_name
                - customer_id
                - name
    IdentifierObject:
      type: object
      properties:
        identifier_type:
          type: string
          enum:
            - customer_id
            - moengage_id
          description: >-
            This field specifies the identifier type. Identifier types can
            either be customer_id (ID field in the User Profile) or moengage_id
            (the MoEngageID of the user in the User Profile). Allowed values are
            "moengage_id", "customer_id".
          example: customer_id
        identifier:
          type: string
          description: This field specifies the unique identifier that identifies the user.
          example: 6416d1a318r98264512c0f89
  securitySchemes:
    Authentication:
      type: http
      scheme: basic
      description: >
        Authentication is done via Basic Auth. This requires a base64-encoded
        string of your credentials in the format 'username:password'.


        - **Username**: Use your MoEngage workspace ID (also known as the App
        ID). You can find it in the MoEngage dashboard at **Settings** >
        **Account** > **APIs** > **Workspace ID (earlier app id)**.

        - **Password**: Use your API Key, which you can find within the **Data**
        tile.


        **Note**: After you generate and save the Data API Key, DO NOT generate
        a new key unless there is a security breach. After you generate a
        different Data API key and save it, the authentication will start
        failing. You must update your existing data tracking. 


        For more information on authentication and getting your credentials,
        refer
        [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials).

````