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

# Add Device

> Call to add or register a device for notifications. This endpoint allows clients to register a device by providing its details such as device ID, FCM ID, app version, and other relevant information. The registered device will be used to send notifications. The request body must contain the device payload information.




## OpenAPI

````yaml post /notification/add-device
openapi: 3.1.0
info:
  title: Notification Connect
  description: |-
    | **Pipeline** | **Release Date** |
    | --- | --- |
    | Registration API | 12th Aug, 2024 |
  version: 1.0.0
servers:
  - url: https://api.eka.care
  - url: https://api.dev.eka.care
security:
  - bearerAuth: []
paths:
  /notification/add-device:
    post:
      tags:
        - Notifications
      summary: Add Device
      description: >
        Call to add or register a device for notifications. This endpoint allows
        clients to register a device by providing its details such as device ID,
        FCM ID, app version, and other relevant information. The registered
        device will be used to send notifications. The request body must contain
        the device payload information.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDeviceRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                success: true
        '400':
          description: Client error response
          content:
            application/json:
              schema:
                type: object
              example:
                message: Unauthorized access.
                error_code: 401
        '500':
          description: Server error response
          content:
            application/json:
              schema:
                type: object
              example:
                message: Internal server error.
                error_code: 500
      security:
        - bearerAuth: []
components:
  schemas:
    AddDeviceRequest:
      type: object
      properties:
        devicePayload:
          type: object
          properties:
            app-id:
              description: >-
                Would be a enum describing the platform in use. Allowed Enums -
                android, ios
              type: string
            app-platform:
              description: >-
                The platform on which the application is running (e.g., Android,
                iOS).
              type: string
            app-version:
              description: >-
                This helps us in Notifications to trigger based on App Version
                compatibility. Should be a string convertible integer for
                android and string convertible float for iOS.
              type: string
            did:
              description: Device ID any unique id where we can identify a device.
              type: string
            fcm-id:
              description: The Firebase Cloud Messaging identifier for the device.
              type: string
            fid:
              description: The Firebase Installation identifier.
              type: string
            lang:
              description: The language setting of the device.
              type: string
            os-version:
              description: The operating system version of the device.
              type: integer
            user-hash:
              description: A hash representing the user, can be empty if not applicable.
              type: string
          required:
            - did
            - fcm-id
            - app-version
      description: >-
        The request body must contain the device payload information. The format
        should be:

        ```json {
          "devicePayload": {
            "app-id": "string",
            "app-platform": "string",
            "app-version": "string",
            "did": "string",
            "fcm-id": "string",
            "fid": "string",
            "lang": "string",
            "os-version": "integer",
            "user-hash": "string"
          }
        } ```
      example:
        devicePayload:
          app-id: '123'
          app-platform: android
          app-version: '1571'
          did: aa8650d03
          fcm-id: fr3Ybq-2QHW_Jp:CivqQlS6tZZZ
          fid: frbq-2Qkh
          lang: en
          os-version: 20
          user-hash: user123
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        The API requires a Bearer token in the Authorization header for
        authentication.

````